Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

  • new YCodeCell(ymodel: YMap<any>): YCodeCell

Properties

Protected _notebook

_notebook: YNotebook

The notebook that this cell belongs to.

isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

isStandalone

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.

ymodel

ymodel: YMap<any>

Accessors

awareness

  • get awareness(): Awareness
  • Returns Awareness

cell_type

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

    Returns "code"

changed

  • get changed(): ISignal<this, CellChange<Metadata>>
  • The changed signal.

    Returns ISignal<this, CellChange<Metadata>>

execution_count

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

    Returns number

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

    Parameters

    • count: number

    Returns void

notebook

  • The notebook that this cell belongs to.

    Returns YNotebook

undoManager

  • get undoManager(): UndoManager
  • set undoManager(undoManager: UndoManager): void
  • The notebook that this cell belongs to.

    Returns UndoManager

  • Set the undoManager when adding new cells.

    Parameters

    • undoManager: UndoManager

    Returns void

ysource

  • get ysource(): YText
  • Returns YText

Methods

canRedo

  • canRedo(): boolean

canUndo

  • canUndo(): boolean

clearUndoHistory

  • clearUndoHistory(): void

clone

  • Create a new YCodeCell that can be inserted into a YNotebook

    todo

    clone should only be available in the specific implementations i.e. ISharedCodeCell

    Returns YCodeCell

dispose

  • dispose(): void

getAttachments

  • getAttachments(): IAttachments
  • Gets the cell attachments.

    Returns IAttachments

    The cell attachments.

getId

  • getId(): string

getMetadata

getOutputs

  • getOutputs(): IOutput[]
  • Execution, display, or stream outputs.

    Returns IOutput[]

getSource

  • getSource(): string

redo

  • redo(): void

setAttachments

  • setAttachments(attachments: IAttachments): void
  • Sets the cell attachments

    Parameters

    • attachments: IAttachments

    Returns void

setMetadata

setOutputs

  • setOutputs(outputs: IOutput[]): void
  • Replace all outputs.

    Parameters

    • outputs: IOutput[]

    Returns void

setSource

  • setSource(value: string): void

toJSON

  • toJSON(): ICodeCell

transact

  • transact(f: () => void, undoable?: boolean): 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
        • (): void
        • Returns void

    • Optional undoable: boolean

    Returns void

undo

  • undo(): void

updateOutputs

  • updateOutputs(start: number, end: number, outputs?: IOutput[]): void
  • Replace content from start' to endwithoutputs`.

    Parameters

    • start: number
    • end: number
    • Optional outputs: IOutput[]

    Returns void

updateSource

  • updateSource(start: number, end: number, value?: string): void
  • Replace content from start' to endwithvalue`.

    Parameters

    • start: number
    • end: number
    • Optional value: string

    Returns void

Static create

  • Create a new YCodeCell that can be inserted into a YNotebook

    Parameters

    • Optional id: string

    Returns YCodeCell

Static createStandalone

  • Create a new YCodeCell that works standalone. It cannot be inserted into a YNotebook because the Yjs model is already attached to an anonymous Y.Doc instance.

    Parameters

    • Optional id: string

    Returns YCodeCell

Generated using TypeDoc