Class CodeCellModel

An implementation of a code cell Model.

Hierarchy

Implements

Constructors

Properties

_executedCode: any
_isDirty: any
_onSharedModelChanged: any

Handle a change to the code cell value.

_outputs: any
_setDirty: any

Set whether the cell is dirty or not.

contentChanged: Signal<CodeCellModel, void>

A signal emitted when the state of the model changes.

sharedModel: ISharedCodeCell

The code cell shared model

standaloneModel: boolean

Whether the model should disposed the shared model on disposal or not.

stateChanged: Signal<CodeCellModel, IChangedArgs<any, any, "trusted" | "isDirty" | "executionCount">>

A signal emitted when a model state changes.

Accessors

  • get executionCount(): number
  • The execution count of the cell.

    Returns number

  • set executionCount(newValue): void
  • The code cell's prompt number. Will be null if the cell has not been run.

    Parameters

    • newValue: number

    Returns void

  • get id(): string
  • The id for the cell.

    Returns string

  • get isDirty(): boolean
  • Whether the cell is dirty or not.

    A cell is dirty if it is output is not empty and does not result of the input code execution.

    Returns boolean

  • get isDisposed(): boolean
  • Whether the model is disposed.

    Returns boolean

  • get mimeType(): string
  • A mime type of the model.

    Returns string

  • set mimeType(newValue): void
  • A mime type of the model.

    Notes

    It is never null, the default mime type is text/plain.

    Parameters

    • newValue: string

    Returns void

  • get trusted(): boolean
  • The trusted state of the model.

    Returns boolean

  • set trusted(newValue): void
  • Whether the cell is trusted.

    Parameters

    • newValue: boolean

    Returns void

  • get type(): "code"
  • The type of the cell.

    Returns "code"

Methods

  • Clear execution, outputs, and related metadata

    Returns void

  • Dispose of the resources held by the model.

    Returns void

  • Get a metadata

    Notes

    This returns a copy of the key value.

    Parameters

    • key: string

      Metadata key

    Returns any

  • Handle a change to the observable value.

    Returns void

  • Handle a change to the cell outputs modelDB and reflect it in the shared model.

    Parameters

    Returns void

  • Set a metadata

    Parameters

    • key: string

      Metadata key

    • value: any

      Metadata value

    Returns void

Generated using TypeDoc