/** * Terminal keyboard shortcuts hook. * * Binds configurable keyboard shortcuts for terminal operations: * clear, font zoom, pane splitting, reconnect, etc. Prevents * propagation to the terminal when a shortcut is matched. * * @module @mks2508/mks-ui/react/blocks/Terminal/hooks/useTerminalKeyboardShortcuts * * @example * ```tsx * useTerminalKeyboardShortcuts({ * onClear: () => resttyRef.current?.clear(), * onFontIncrease: () => font.increase(), * onFontDecrease: () => font.decrease(), * onSplitVertical: () => panes.splitActive('vertical'), * }); * ``` */ /** * Keyboard shortcut configuration for terminal. */ export interface ITerminalShortcutConfig { /** Enable keyboard shortcuts (default: true). */ enabled?: boolean; /** Container element for scoped shortcuts. Defaults to `document` if not provided. */ containerRef?: React.RefObject; /** Clear terminal (default: Ctrl+Shift+K). */ onClear?: () => void; /** Increase font size (default: Ctrl+=). */ onFontIncrease?: () => void; /** Decrease font size (default: Ctrl+-). */ onFontDecrease?: () => void; /** Reset font size (default: Ctrl+0). */ onFontReset?: () => void; /** Split pane horizontally (default: Ctrl+Shift+E). */ onSplitHorizontal?: () => void; /** Split pane vertically (default: Ctrl+Shift+D). */ onSplitVertical?: () => void; /** Close active pane (default: Ctrl+Shift+W). */ onClosePane?: () => void; /** Reconnect terminal (default: Ctrl+Shift+R). */ onReconnect?: () => void; } /** * Terminal keyboard shortcuts. * * Registers keyboard event listeners for common terminal operations. * Shortcuts use Ctrl+Shift+ combinations to avoid conflicting with * terminal input. All shortcuts are optional — only handlers that are * provided get bound. * * Default shortcut map: * - `Ctrl+Shift+K` → clear * - `Ctrl+=` / `Ctrl+-` → font increase/decrease * - `Ctrl+0` → font reset * - `Ctrl+Shift+D` → split vertical * - `Ctrl+Shift+E` → split horizontal * - `Ctrl+Shift+W` → close pane * - `Ctrl+Shift+R` → reconnect * * @param config - Shortcut configuration and handlers * * @example * ```tsx * const terminal = useTerminal({ wsUrl: 'ws://...' }); * * useTerminalKeyboardShortcuts({ * onClear: terminal.clear, * onFontIncrease: terminal.fontIncrease, * onFontDecrease: terminal.fontDecrease, * onSplitVertical: () => terminal.splitActive('vertical'), * onSplitHorizontal: () => terminal.splitActive('horizontal'), * }); * ``` */ export declare function useTerminalKeyboardShortcuts(config: ITerminalShortcutConfig): void; //# sourceMappingURL=useTerminalKeyboardShortcuts.d.ts.map