UNPKG

collaborative-editor

Version:

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

36 lines (35 loc) 1.47 kB
import type { Selection } from './Selection'; import type { EditorFacade, SimpleChange } from './types'; export declare class InputFacade0 implements EditorFacade { protected readonly input: HTMLInputElement | HTMLTextAreaElement; constructor(input: HTMLInputElement | HTMLTextAreaElement); get(): string; set(text: string): void; } export declare class InputFacade1 extends InputFacade0 { protected readonly input: HTMLInputElement | HTMLTextAreaElement; onchange?: (change: SimpleChange[] | void) => void; protected readonly onInput: (e: Event) => void; protected _onInput(): void; protected _onInput(e: Event): void; constructor(input: HTMLInputElement | HTMLTextAreaElement); getLength(): number; dispose(): void; } export declare class InputFacade2 extends InputFacade1 { protected readonly input: HTMLInputElement | HTMLTextAreaElement; onselection?: () => void; constructor(input: HTMLInputElement | HTMLTextAreaElement); getSelection(): [number, number, -1 | 0 | 1] | null; setSelection(start: number, end: number, direction: -1 | 0 | 1): void; private readonly onSelectionChange; dispose(): void; } export declare class InputFacade3 extends InputFacade2 { selection: Selection; protected _onInput(e?: Event): void; } export declare class InputFacade4 extends InputFacade3 { ins(position: number, text: string): void; del(position: number, length: number): void; }