Interface ICodeCellModel

The definition of a code cell.

interface ICodeCellModel {
    contentChanged: ISignal<ICellModel, void>;
    executionCount: ExecutionCount;
    id: string;
    isDirty: boolean;
    isDisposed: boolean;
    metadata: Omit<IBaseCellMetadata, "trusted">;
    metadataChanged: ISignal<ICellModel, IMapChange<any>>;
    mimeType: string;
    mimeTypeChanged: ISignal<CodeEditor.IModel, IChangedArgs<string, string, string>>;
    outputs: IOutputAreaModel;
    selections: IObservableMap<ITextSelection[]>;
    sharedModel: ISharedCodeCell;
    stateChanged: ISignal<ICellModel, IChangedArgs<boolean, boolean, any>>;
    trusted: boolean;
    type: "code";
    clearExecution(): void;
    deleteMetadata(key): void;
    dispose(): void;
    getMetadata(key): any;
    setMetadata(key, value): void;
    toJSON(): ICodeCell;
}

Hierarchy (view full)

Implemented by

Properties

contentChanged: ISignal<ICellModel, void>

A signal emitted when the content of the model changes.

executionCount: ExecutionCount

The code cell's prompt number. Will be null if the cell has not been run.

id: string

A unique identifier for the cell.

isDirty: boolean

Whether the code cell has been edited since the last run.

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

metadata: Omit<IBaseCellMetadata, "trusted">

The metadata associated with the cell.

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<ICellModel, IMapChange<any>>

Signal emitted when cell metadata changes.

mimeType: string

A mime type of the model.

Notes

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

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

A signal emitted when a property changes.

The cell outputs.

The currently selected code.

sharedModel: ISharedCodeCell

The code cell shared model

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

A signal emitted when a model state changes.

trusted: boolean

Whether the cell is trusted.

type: "code"

The type of the cell.

Notes

This is a read-only property.

Methods

  • 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