Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface INotebookModel

The definition of a model object for a notebook widget.

Hierarchy

Implemented by

Index

Properties

Readonly cells

The list of cells in the notebook.

contentChanged

contentChanged: ISignal<this, void>

A signal emitted when the document content changes.

Readonly contentFactory

contentFactory: IContentFactory

The cell model factory for the notebook.

Readonly defaultKernelLanguage

defaultKernelLanguage: string

The default kernel language of the document.

Readonly defaultKernelName

defaultKernelName: string

The default kernel name of the document.

Readonly deletedCells

deletedCells: string[]

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

dirty

dirty: boolean

The dirty state of the model.

Notes

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

Readonly isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

Readonly metadata

metadata: IObservableJSON

The metadata associated with the notebook.

Readonly modelDB

modelDB: IModelDB

The underlying IModelDB instance in which model data is stored.

Notes

Making direct edits to the values stored in theIModelDB is not recommended, and may produce unpredictable results.

Readonly nbformat

nbformat: number

The major version number of the nbformat.

Readonly nbformatMinor

nbformatMinor: number

The minor version number of the nbformat.

readOnly

readOnly: boolean

The read-only state of the model.

stateChanged

stateChanged: ISignal<this, IChangedArgs<any>>

A signal emitted when the model state changes.

Methods

dispose

  • dispose(): 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

fromJSON

  • fromJSON(value: ReadonlyPartialJSONValue): void
  • Deserialize the model from JSON.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: ReadonlyPartialJSONValue

    Returns void

fromString

  • fromString(value: string): void
  • Deserialize the model from a string.

    Notes

    Should emit a [contentChanged] signal.

    Parameters

    • value: string

    Returns void

initialize

  • initialize(): void
  • Initialize model state after initial data load.

    Notes

    This function must be called after the initial data is loaded to set up initial model state, such as an initial undo stack, etc.

    Returns void

toJSON

  • toJSON(): PartialJSONValue
  • Serialize the model to JSON.

    Returns PartialJSONValue

toString

  • toString(): string
  • Serialize the model to a string.

    Returns string

Generated using TypeDoc