UNPKG

json-joy

Version:

Collection of libraries for building collaborative editing apps.

11 lines (10 loc) 477 B
export type GetCursorPosition = (x: number, y: number) => null | [node: Node, offset: number]; export declare const getCursorPosition: GetCursorPosition; export declare const unit: (event: KeyboardEvent) => "" | "word" | "vline"; /** * Save the current browser selection, so that it can be restored later. Returns * a callback to restore the selection. * * @returns Callback to restore the selection. */ export declare const saveSelection: () => (() => void) | undefined;