Options
All
  • Public
  • Public/Protected
  • All
Menu

Shared implementation of the Shared Document types.

Shared cells can be inserted into a SharedNotebook. Shared cells only start emitting events when they are connected to a SharedNotebook.

"Standalone" cells must not be inserted into a (Shared)Notebook. Standalone cells emit events immediately after they have been created, but they must not be included into a (Shared)Notebook.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected _changed

_changed: Signal<YNotebook, NotebookChange>

Private _disableDocumentWideUndoRedo

_disableDocumentWideUndoRedo: any

Private _onMetadataChanged

_onMetadataChanged: any

Handle a change to the ystate.

Private _onStateChanged

_onStateChanged: any

Handle a change to the ystate.

Private _onYCellsChanged

_onYCellsChanged: any

Handle a change to the list of cells.

Private _ycellMapping

_ycellMapping: any

awareness

awareness: Awareness

cells

cells: YCellType[]

The list of shared cells in the notebook.

isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

source

source: YText

undoManager

undoManager: UndoManager

ycells

ycells: YArray<YMap<any>>

ydoc

ydoc: Doc

ymeta

ymeta: YMap<any>

ymodel

ymodel: YMap<any>

ystate

ystate: YMap<any>

Accessors

changed

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

    Returns ISignal<this, T>

dirty

  • get dirty(): boolean
  • set dirty(value: boolean): void
  • Whether the document is saved to disk or not.

    Returns boolean

  • Whether the document is saved to disk or not.

    Parameters

    • value: boolean

    Returns void

disableDocumentWideUndoRedo

  • get disableDocumentWideUndoRedo(): boolean
  • Wether the the undo/redo logic should be considered on the full document across all cells.

    Returns boolean

    The disableDocumentWideUndoRedo setting.

nbformat

  • get nbformat(): number
  • set nbformat(value: number): void
  • The major version number of the nbformat.

    Returns number

  • The major version number of the nbformat.

    Parameters

    • value: number

    Returns void

nbformat_minor

  • get nbformat_minor(): number
  • set nbformat_minor(value: number): void
  • The minor version number of the nbformat.

    Returns number

  • The minor version number of the nbformat.

    Parameters

    • value: number

    Returns void

Methods

canRedo

  • canRedo(): boolean

canUndo

  • canUndo(): boolean

clearUndoHistory

  • clearUndoHistory(): void

deleteCell

  • deleteCell(index: number): void
  • Remove a cell.

    Parameters

    • index: number

    Returns void

deleteCellRange

  • deleteCellRange(from: number, to: number): void
  • Remove a range of cells.

    Parameters

    • from: number
    • to: number

    Returns void

dispose

  • dispose(): void

getCell

  • Get a shared cell by index.

    Parameters

    • index: number

    Returns YCellType

    The requested shared cell.

getMetadata

insertCell

  • insertCell(index: number, cell: YCellType): void
  • Insert a shared cell into a specific position.

    Parameters

    Returns void

insertCells

  • insertCells(index: number, cells: YCellType[]): void
  • Insert a list of shared cells into a specific position.

    Parameters

    Returns void

moveCell

  • moveCell(fromIndex: number, toIndex: number): void
  • Move a cell.

    Parameters

    • fromIndex: number
    • toIndex: number

    Returns void

redo

  • redo(): void

setMetadata

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

updateMetadata

Static create

  • Create a new YNotebook.

    Parameters

    • disableDocumentWideUndoRedo: boolean

    Returns ISharedNotebook

Generated using TypeDoc