collaborative-monaco
Version:
Binding for collaborative editing support in Monaco Editor. Connects JSON CRDT str node to Monaco Editor.
21 lines (20 loc) • 859 B
TypeScript
import type { SimpleChange, EditorFacade, Selection, EditorSelection } from 'collaborative-editor';
import * as monaco from 'monaco-editor';
export declare class MonacoEditorFacade implements EditorFacade {
protected readonly editor: monaco.editor.IStandaloneCodeEditor;
selection: Selection;
onchange?: (changes: SimpleChange[] | void) => void;
onselection?: () => void;
private readonly modelChangeDisposable;
private readonly selectionDisposable;
constructor(editor: monaco.editor.IStandaloneCodeEditor);
get(): string;
getLength(): number;
set(text: string): void;
private getRange;
ins(pos: number, text: string): void;
del(pos: number, length: number): void;
getSelection(): EditorSelection | null;
setSelection(start: number, end: number, direction: -1 | 0 | 1): void;
dispose(): void;
}