interface Options { undo: () => void | Promise; /** Omit to bind undo only; the redo strokes then fall through untouched. */ redo?: () => void | Promise; /** Set false to unbind, e.g. while a modal owns the keyboard. */ enabled?: boolean; } /** * Binds the undo and redo shortcuts for as long as the component is mounted. * * | Stroke | Action | * |--------|--------| * | `Ctrl+Z` / `Cmd+Z` | undo | * | `Ctrl+Y` / `Cmd+Y` | redo | * | `Ctrl+Shift+Z` / `Cmd+Shift+Z` | redo | * * Both redo strokes are bound because both are conventional: `Ctrl+Y` on * Windows, `Shift+Cmd+Z` on macOS, and plenty of users of either reach for the * other. * * Pair it with a `createUndoHistory` stack — `useUndoRedoShortcuts({ undo: () => * history.undo(), redo: () => history.redo() })` — or with anything else that * moves between states. Mount it high enough that it outlives the panel the * change was made from, or the shortcut disappears the moment the user looks at * a different tab. * * Keystrokes aimed at a text field are left alone: inside a search box `Ctrl+Z` * should edit the text. That is also why `preventDefault` only happens on the * strokes actually handled here. */ export declare function useUndoRedoShortcuts({ undo, redo, enabled }: Options): void; export {}; //# sourceMappingURL=useUndoRedoShortcuts.d.ts.map