import { Range } from 'slate'; import { Awareness } from 'y-protocols/awareness'; import { RelativeRange } from '../model/types'; import { YjsEditor } from './withYjs'; export declare type CursorStateChangeEvent = { added: number[]; updated: number[]; removed: number[]; }; export declare type RemoteCursorChangeEventListener = (event: CursorStateChangeEvent) => void; export declare type CursorState = Record> = { relativeSelection: RelativeRange | null; data?: TCursorData; clientId: number; }; export declare type CursorEditor = Record> = YjsEditor & { awareness: Awareness; cursorDataField: string; selectionStateField: string; sendCursorPosition: (range: Range | null) => void; sendCursorData: (data: TCursorData) => void; }; export declare const CursorEditor: { isCursorEditor(value: unknown): value is CursorEditor>; sendCursorPosition>(editor: CursorEditor, range?: Range | null): void; sendCursorData>(editor: CursorEditor, data: TCursorData_1): void; on>(editor: CursorEditor, event: 'change', handler: RemoteCursorChangeEventListener): void; off>(editor: CursorEditor, event: 'change', listener: RemoteCursorChangeEventListener): void; cursorState>(editor: CursorEditor, clientId: number): CursorState | null; cursorStates>(editor: CursorEditor): Record>; }; export declare type WithCursorsOptions = Record> = { cursorStateField?: string; cursorDataField?: string; data?: TCursorData; autoSend?: boolean; }; export declare function withCursors, TEditor extends YjsEditor>(editor: TEditor, awareness: Awareness, { cursorStateField: selectionStateField, cursorDataField, autoSend, data, }?: WithCursorsOptions): TEditor & CursorEditor; //# sourceMappingURL=withCursors.d.ts.map