Interface INotebookModel

The definition of a model object for a notebook widget.

Hierarchy

Implemented by

Properties

cells: CellList

The list of cells in the notebook.

collaborative?: boolean

Whether this document model supports collaboration when the collaborative flag is enabled globally. Defaults to false.

contentChanged: ISignal<INotebookModel, void>

A signal emitted when the document content changes.

defaultKernelLanguage: string

The default kernel language of the document.

defaultKernelName: string

The default kernel name of the document.

deletedCells: string[]

The array of deleted cells since the notebook was last run.

dirty: boolean

The dirty state of the model.

Notes

This should be cleared when the document is loaded from or saved to disk.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

The metadata associated with the notebook.

Notes

This is a copy of the metadata. Changing a part of it won't affect the model. As this returns a copy of all metadata, it is advised to use getMetadata to speed up the process of getting a single key.

metadataChanged: ISignal<INotebookModel, IMapChange<any>>

Signal emitted when notebook metadata changes.

nbformat: number

The major version number of the nbformat.

nbformatMinor: number

The minor version number of the nbformat.

readOnly: boolean

The read-only state of the model.

sharedModel: ISharedNotebook

Shared model

stateChanged: ISignal<INotebookModel, IChangedArgs<any, any, string>>

A signal emitted when the model state changes.

Methods

  • Delete a metadata

    Parameters

    • key: string

      Metadata key

    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

  • Deserialize the model from JSON.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: ReadonlyPartialJSONValue

    Returns void

  • Deserialize the model from a string.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: string

    Returns void

  • Get a metadata

    Notes

    This returns a copy of the key value.

    Parameters

    • key: string

      Metadata key

    Returns any

  • Set a metadata

    Parameters

    • key: string

      Metadata key

    • value: any

      Metadata value

    Returns void

  • Serialize the model to a string.

    Returns string

Generated using TypeDoc