/** * useCommandHistory - Command history for ↑ arrow recall * * Manages a list of previously entered commands for easy recall. */ /** * Return value from useCommandHistory hook */ export interface UseCommandHistoryReturn { /** Add a command to history */ addToHistory: (command: string) => void; /** Navigate to previous command (↑ arrow) */ navigateUp: () => string | null; /** Navigate to next command (↓ arrow) */ navigateDown: () => string | null; /** Get current history item */ getCurrentItem: () => string | null; /** Reset navigation index (called when user starts typing) */ resetNavigation: () => void; /** Get all history items */ getHistory: () => string[]; } /** * useCommandHistory - React hook for managing command history * * Provides ↑/↓ arrow navigation through previously entered commands. * * @example * ```tsx * function ChatInput() { * const { addToHistory, navigateUp, navigateDown, resetNavigation } = useCommandHistory(); * const [value, setValue] = useState(''); * * useInput((input, key) => { * if (key.upArrow) { * const prev = navigateUp(); * if (prev) setValue(prev); * } * if (key.downArrow) { * const next = navigateDown(); * setValue(next || ''); * } * }); * * const handleSubmit = (cmd: string) => { * addToHistory(cmd); * // ... submit logic * }; * } * ``` */ export declare function useCommandHistory(): UseCommandHistoryReturn;