@jupyter/ydoc
    Preparing search index...

    Interface ISharedText

    The ISharedText interface defines models that can be bound to a text editor like CodeMirror.

    interface ISharedText {
        changed: ISignal<ISharedText, SourceChange>;
        disposed: ISignal<ISharedText, void>;
        isDisposed: boolean;
        source: string;
        canRedo(): boolean;
        canUndo(): boolean;
        clearUndoHistory(): void;
        dispose(): void;
        getSource(): string;
        redo(): boolean;
        setSource(value: string): void;
        transact(f: () => void, undoable?: boolean, origin?: any): void;
        undo(): boolean;
        updateSource(start: number, end: number, value?: string): void;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    The changed signal.

    disposed: ISignal<ISharedText, void>

    A signal emitted when the object is disposed.

    isDisposed: boolean

    Test whether the object has been disposed.

    This property is always safe to access.

    source: string

    Text

    • 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

    • Set text.

      Parameters

      • value: string

        New text.

      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