/** * Terminal font size management hook. * * Manages font size state with ResttyTerminal ref integration. Calls * `ref.current?.setFontSize()` on every change and optionally persists * to localStorage via `useTerminalSettings`. * * Replaces the duplicated `useState(fontSize)` + `handleFontIncrease`/ * `handleFontDecrease` pattern found in both interactive panels. * * @module @mks2508/mks-ui/react/blocks/Terminal/hooks/useTerminalFontSize * * @example * ```tsx * const resttyRef = useRef(null); * const font = useTerminalFontSize({ ref: resttyRef }); * * * * {font.fontSize}px * * ``` */ import type { IResttyTerminalRef } from '../restty/ResttyTerminal.types'; /** * Options for useTerminalFontSize. */ export interface IUseTerminalFontSizeOptions { /** Restty terminal ref for imperative font size updates. */ ref: React.RefObject; /** Initial font size. Defaults to value from useTerminalSettings (usually 14). */ initial?: number; /** Minimum font size (default: 10). */ min?: number; /** Maximum font size (default: 24). */ max?: number; /** Persist font size to localStorage via useTerminalSettings (default: true). */ persist?: boolean; } /** * Return type for useTerminalFontSize. */ export interface IUseTerminalFontSizeReturn { /** Current font size in CSS pixels. */ fontSize: number; /** Increase font size by 1 (clamped to max). */ increase: () => void; /** Decrease font size by 1 (clamped to min). */ decrease: () => void; /** Set exact font size (clamped to min/max). */ set: (size: number) => void; /** Whether the font size is at minimum bound. */ isMin: boolean; /** Whether the font size is at maximum bound. */ isMax: boolean; } /** * Terminal font size management. * * Synchronizes font size state with the ResttyTerminal ref and * optionally persists changes to localStorage. Clamps values to * configurable min/max bounds. * * @param options - Font size configuration * @returns Font size state and mutation functions * * @example * ```tsx * const font = useTerminalFontSize({ ref: resttyRef, persist: true }); * * * ``` */ export declare function useTerminalFontSize(options: IUseTerminalFontSizeOptions): IUseTerminalFontSizeReturn; //# sourceMappingURL=useTerminalFontSize.d.ts.map