import { ExtensionPriority, KeyBindingCommandFunction, KeyBindingNames, LiteralUnion } from '@remirror/core'; /** * Add custom keyboard bindings to the editor instance. * * @remarks * * ```tsx * import { useCallback } from 'react'; * import { BoldExtension } from 'remirror/extensions'; * import { Remirror, useHelpers, useKeymap, useRemirror, useRemirrorContext } from '@remirror/react'; * * const hooks = [ * () => { * const active = useActive(); * const { insertText } = useCommands(); * const boldActive = active.bold(); * const handler = useCallback(() => { * if (!boldActive) { * return false; * } * * // Prevent the keypress from using the default action. * return insertText.original('\n\nWoah there!')(props); * }, [boldActive, insertText]); * * useKeymap('Shift-Enter', handler); // Add the handler to the keypress pattern. * }, * ]; * * const Editor = () => { * const { manager } = useRemirror({ extensions: () => [new BoldExtension()] }); * * return ; * }; * ``` */ export declare function useKeymap(name: LiteralUnion, handler: KeyBindingCommandFunction, priority?: ExtensionPriority): void;