Interface ISharedNotebook

Implements an API for nbformat.INotebookContent

Hierarchy

Implemented by

Properties

cells: ISharedCell[]

The list of shared cells in the notebook.

changed: ISignal<ISharedNotebook, NotebookChange>

The changed signal.

disableDocumentWideUndoRedo?: boolean

Wether the undo/redo logic should be considered on the full document across all cells.

disposed: ISignal<ISharedNotebook, void>

A signal emitted when the object is disposed.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

metadata: INotebookMetadata

Notebook metadata.

metadataChanged: ISignal<ISharedNotebook, IMapChange<any>>

Signal triggered when a metadata changes.

nbformat: number

The major version number of the nbformat.

nbformat_minor: number

The minor version number of the nbformat.

state: JSONObject

Document state

version: string

Document version

Methods

  • Remove a cell.

    Parameters

    • index: number

    Returns void

  • Remove a range of cells.

    Parameters

    • from: number
    • to: number

    Returns void

  • Delete a metadata notebook.

    Parameters

    • key: string

      The key to delete

    Returns void

  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

  • Override the notebook with a JSON-serialized document.

    Parameters

    • value: INotebookContent

      The notebook

    Returns void

  • Returns all metadata associated with the notebook.

    Returns

    Notebook's metadata.

    Returns INotebookMetadata

  • Returns a metadata associated with the notebook.

    Returns

    Notebook's metadata.

    Parameters

    • key: string

      Key to get from the metadata

    Returns undefined | PartialJSONValue

  • Get the value for a state attribute

    Parameters

    • key: string

      Key to get

    Returns undefined | JSONValue

  • Insert a shared cell into a specific position.

    Returns

    The inserted cell.

    Parameters

    • index: number

      Cell's position.

    • cell: Cell

      Cell to insert.

    Returns ISharedCell

  • Insert a list of shared cells into a specific position.

    Returns

    The inserted cells.

    Parameters

    • index: number

      Position to insert the cells.

    • cells: Cell[]

      Array of shared cells to insert.

    Returns ISharedCell[]

  • Move a cell.

    Parameters

    • fromIndex: number
    • toIndex: number

    Returns void

  • Move cells.

    Parameters

    • fromIndex: number
    • toIndex: number
    • Optional n: number

    Returns void

  • Sets all metadata associated with the notebook.

    Parameters

    • metadata: INotebookMetadata

      All Notebook's metadata.

    Returns void

  • Sets a metadata associated with the notebook.

    Parameters

    • metadata: string

      The key to set.

    • value: PartialJSONValue

      New metadata value

    Returns void

  • Set the value of a state attribute

    Parameters

    • key: string

      Key to set

    • value: JSONValue

      New attribute value

    Returns void

  • Serialize the model to JSON.

    Returns INotebookContent

  • Perform a transaction. While the function f is called, all changes to the shared document are bundled into a single event.

    Parameters

    • f: (() => void)

      Transaction to execute

        • (): void
        • Returns void

    • Optional undoable: boolean

      Whether to track the change in the action history or not (default true)

    Returns void

  • Updates the metadata associated with the notebook.

    Parameters

    • value: Partial<INotebookMetadata>

    Returns void

Generated using TypeDoc