Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICellModel

The definition of a model object for a cell.

Hierarchy

Implemented by

Index

Properties

Readonly contentChanged

contentChanged: ISignal<ICellModel, void>

A signal emitted when the content of the model changes.

Readonly id

id: string

A unique identifier for the cell.

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 cell.

mimeType

mimeType: string

A mime type of the model.

Notes

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

mimeTypeChanged

mimeTypeChanged: ISignal<IModel, IChangedArgs<string, string, string>>

A signal emitted when a property changes.

Readonly modelDB

modelDB: IModelDB

The underlying IModelDB instance in which model data is stored.

Readonly selections

selections: IObservableMap<ITextSelection[]>

The currently selected code.

Readonly sharedModel

sharedModel: (ISharedCodeCell & ISharedText) | (ISharedRawCell & ISharedText) | (ISharedMarkdownCell & ISharedText) | (ISharedUnrecognizedCell & ISharedText)

sharedModelSwitched

sharedModelSwitched: ISignal<IModel, boolean>

A signal emitted when the shared model was switched.

Readonly stateChanged

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

A signal emitted when a model state changes.

trusted

trusted: boolean

Whether the cell is trusted.

Readonly type

type: CellType

The type of the cell.

Readonly value

The text stored in the model.

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

switchSharedModel

  • switchSharedModel(sharedModel: ISharedText, reinitialize: boolean): void
  • When we initialize a cell model, we create a standalone cell model that cannot be shared in a YNotebook. Call this function to re-initialize the local representation based on a fresh shared model (e.g. models.YFile or models.YCodeCell).

    Parameters

    • sharedModel: ISharedText
    • reinitialize: boolean

    Returns void

toJSON

  • Serialize the model to JSON.

    Returns ICell

Generated using TypeDoc