Class YFile

Shareable text file.

Hierarchy

Implements

Constructors

Properties

_changed: Signal<YFile, FileChange> = ...
version: string = '1.0.0'

Document version

ysource: YText = ...

YJS file text.

Accessors

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

    Returns ISignal<this, T>

  • get disposed(): ISignal<this, void>
  • A signal emitted when the document is disposed.

    Returns ISignal<this, void>

  • get isDisposed(): boolean
  • Whether the document is disposed or not.

    Returns boolean

  • get undoManager(): UndoManager
  • YJS document undo manager

    Returns UndoManager

  • get ydoc(): Doc
  • YJS document.

    Returns Doc

  • get ystate(): YMap<any>
  • Shared state

    Returns YMap<any>

Methods

  • Handle a change to the ymodel.

    Parameters

    • event: YTextEvent

    Returns void

  • Set the file 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)
        • (): void
        • Returns void

    • undoable: boolean = true

    Returns void

  • Replace content from start' to endwithvalue`.

    Parameters

    • start: number
    • end: number
    • value: string = ''

    Returns void

Generated using TypeDoc