Options
All
  • Public
  • Public/Protected
  • All
Menu

Module shared-models

Index

Type aliases

CellChange

CellChange<MetadataType>: { executionCountChange?: { newValue: number | undefined; oldValue: number | undefined }; metadataChange?: { newValue: Partial<MetadataType> | undefined; oldValue: Partial<MetadataType> | undefined }; outputsChange?: Delta<nbformat.IOutput[]>; sourceChange?: Delta<string> }

Definition of the shared Cell changes.

Type parameters

  • MetadataType

Type declaration

  • Optional executionCountChange?: { newValue: number | undefined; oldValue: number | undefined }
    • newValue: number | undefined
    • oldValue: number | undefined
  • Optional metadataChange?: { newValue: Partial<MetadataType> | undefined; oldValue: Partial<MetadataType> | undefined }
    • newValue: Partial<MetadataType> | undefined
    • oldValue: Partial<MetadataType> | undefined
  • Optional outputsChange?: Delta<nbformat.IOutput[]>
  • Optional sourceChange?: Delta<string>

Delta

Delta<T>: { delete?: number; insert?: T; retain?: number }[]

Changes on Sequence-like data are expressed as Quill-inspired deltas.

source

https://quilljs.com/docs/delta/

Type parameters

  • T

DocumentChange

DocumentChange: { contextChange?: MapChange }

Type declaration

FileChange

FileChange: { contextChange?: MapChange; sourceChange?: Delta<string> }

Type declaration

  • Optional contextChange?: MapChange
  • Optional sourceChange?: Delta<string>

ISharedCell

MapChange

MapChange: Map<string, { action: "add" | "update" | "delete"; newValue: any; oldValue: any }>

Definition of the map changes for yjs.

NotebookChange

NotebookChange: { cellsChange?: Delta<ISharedCell[]>; contextChange?: MapChange; metadataChange?: { newValue: nbformat.INotebookMetadata | undefined; oldValue: nbformat.INotebookMetadata } }

Definition of the shared Notebook changes.

Type declaration

  • Optional cellsChange?: Delta<ISharedCell[]>
  • Optional contextChange?: MapChange
  • Optional metadataChange?: { newValue: nbformat.INotebookMetadata | undefined; oldValue: nbformat.INotebookMetadata }
    • newValue: nbformat.INotebookMetadata | undefined
    • oldValue: nbformat.INotebookMetadata

TextChange

TextChange: { sourceChange?: Delta<string> }

Type declaration

  • Optional sourceChange?: Delta<string>

YCellType

Functions

convertYMapEventToMapChange

  • convertYMapEventToMapChange(event: Y.YMapEvent<any>): MapChange
  • Parameters

    • event: Y.YMapEvent<any>

    Returns MapChange

Const createCellFromType

  • createCellFromType(type: YMap<any>): YCellType
  • Create a new shared cell given the type.

    Parameters

    • type: YMap<any>

    Returns YCellType

Const createMutex

  • createMutex(): (f: () => void) => void
  • Creates a mutual exclude function with the following property:

    const mutex = createMutex()
    mutex(() => {
      // This function is immediately executed
      mutex(() => {
        // This function is not executed, as the mutex is already active.
      })
    })
    

    Returns (f: () => void) => void

      • (f: () => void): void
      • Parameters

        • f: () => void
            • (): void
            • Returns void

        Returns void

Const createStandaloneCell

  • createStandaloneCell(cellType: CellType, id?: string): YCellType
  • Create a new standalone cell given the type.

    Parameters

    • cellType: CellType
    • Optional id: string

    Returns YCellType

Generated using TypeDoc