import type { BaseBlockModel } from '@revesuite/store'; import type { VRange } from '@revesuite/virgo'; import type { AffineVEditor } from './virgo/types.js'; export interface BindingContext { collapsed: boolean; empty: boolean; offset: number; prefix: string; suffix: string; format: Record; event: KeyboardEvent; } export type KeyboardBinding = { /** * See https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values */ key: number | string | string[]; collapsed?: boolean; handler: KeyboardBindingHandler; prefix?: RegExp; suffix?: RegExp; shortKey?: boolean | null; shiftKey?: boolean | null; altKey?: boolean | null; metaKey?: boolean | null; ctrlKey?: boolean | null; }; type KeyboardBindingHandler = (this: KeyboardEventThis, range: VRange, context: BindingContext) => boolean; export type KeyboardBindings = Record; interface KeyboardEventThis { vEditor: AffineVEditor; options: { bindings: KeyboardBindings; }; } export declare function createKeyboardBindings(model: BaseBlockModel, vEditor: AffineVEditor): KeyboardBindings; export declare function createKeyDownHandler(vEditor: AffineVEditor, bindings: KeyboardBindings, model: BaseBlockModel): (evt: KeyboardEvent) => void; export {}; //# sourceMappingURL=keyboard.d.ts.map