@jupyter/ydoc
    Preparing search index...

    Interface ISharedBaseCell<Metadata>

    Implements an API for nbformat.IBaseCell.

    interface ISharedBaseCell<
        Metadata extends nbformat.IBaseCellMetadata = nbformat.IBaseCellMetadata,
    > {
        cell_type: string;
        changed: ISignal<ISharedBaseCell<Metadata>, CellChange>;
        dirty: boolean;
        disposed: ISignal<ISharedBaseCell<Metadata>, void>;
        id: string;
        isDisposed: boolean;
        isStandalone: boolean;
        metadata: Partial<Metadata>;
        metadataChanged: ISignal<ISharedBaseCell<Metadata>, IMapChange<any>>;
        notebook: ISharedNotebook | null;
        source: string;
        canRedo(): boolean;
        canUndo(): boolean;
        clearUndoHistory(): void;
        deleteMetadata(key: string): void;
        dispose(): void;
        getId(): string;
        getMetadata(): Partial<Metadata>;
        getMetadata(key: string): PartialJSONValue | undefined;
        getSource(): string;
        redo(): boolean;
        setMetadata(metadata: Partial<Metadata>): void;
        setMetadata(metadata: string, value: PartialJSONValue): void;
        setSource(value: string): void;
        toJSON(): IBaseCell;
        transact(f: () => void, undoable?: boolean, origin?: any): void;
        undo(): boolean;
        updateSource(start: number, end: number, value?: string): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index
    cell_type: string

    The type of the cell.

    The changed signal.

    dirty: boolean

    The dirty state of the notebook that the cell belongs to, if any.

    disposed: ISignal<ISharedBaseCell<Metadata>, void>

    A signal emitted when the object is disposed.

    id: string

    Cell id.

    isDisposed: boolean

    Test whether the object has been disposed.

    This property is always safe to access.

    isStandalone: boolean

    Whether the cell is standalone or not.

    If the cell is standalone. It cannot be inserted into a YNotebook because the Yjs model is already attached to an anonymous Y.Doc instance.

    metadata: Partial<Metadata>

    Cell metadata.

    You should prefer to access and modify the specific key of interest.

    metadataChanged: ISignal<ISharedBaseCell<Metadata>, IMapChange<any>>

    Signal triggered when the cell metadata changes.

    notebook: ISharedNotebook | null

    The notebook that this cell belongs to.

    source: string

    Text

    • Delete a metadata cell.

      Parameters

      • key: string

        The key to delete

      Returns void

    • Dispose of the resources held by the object.

      If the object's dispose method is called more than once, all calls made after the first will be a no-op.

      It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

      Returns void

    • Perform a transaction. While the function f is called, all changes to the shared document are bundled into a single event.

      Parameters

      • f: () => void

        Transaction to execute

      • Optionalundoable: boolean

        Whether to track the change in the action history or not (default true)

      • Optionalorigin: any

      Returns void

    • Replace content from start to end with value.

      Parameters

      • start: number

        The start index of the range to replace (inclusive).

      • end: number

        The end index of the range to replace (exclusive).

      • Optionalvalue: string

        New source (optional).

      Returns void