UNPKG

edix

Version:

An experimental, type-safe, framework agnostic and small (5kB+) contenteditable state manager.

15 lines (14 loc) 368 B
/** * Functions to handle keyboard events. * * Return `true` if you want to stop propagation. */ export type KeyboardHook = (keyboard: KeyboardEvent) => boolean | void; /** * TODO */ export declare const hotkey: (key: string, cb: (e: KeyboardEvent) => void, { mod, shift, alt, }?: { mod?: boolean; shift?: boolean; alt?: boolean; }) => KeyboardHook;