UNPKG

collaborative-editor

Version:

JSON CRDT str node bindings to any generic plain text editor.

28 lines (27 loc) 966 B
import { Selection } from './Selection'; import type { CollaborativeStr, EditorFacade } from './types'; export declare class StrBinding { protected readonly str: () => CollaborativeStr; protected readonly editor: EditorFacade; static bind: (str: () => CollaborativeStr, editor: EditorFacade, polling?: boolean) => () => void; protected readonly selection: Selection; protected readonly race: (fn: () => void) => void; /** * Latest cached model view. * @readonly */ view: string; constructor(str: () => CollaborativeStr, editor: EditorFacade); protected saveSelection(): void; syncFromModel(): void; protected readonly onModelChange: () => void; syncFromEditor(): void; private readonly onchange; pollingInterval: number; private _p; private readonly pollChanges; stopPolling(): void; private _s; readonly bind: (polling?: boolean) => void; readonly unbind: () => void; }