/** * useVimMode Hook * * React hook for integrating vim mode into components. * * @since v1.58.0 */ import type { Tier } from '../../core/types/auth.js'; import type { MarkState, MotionResult, SearchState, VimConfig, VimKeyEvent, VimMode, VimState } from '../vim/vim-types.js'; /** * Hook configuration */ export interface UseVimModeConfig { /** Enable vim mode */ enabled?: boolean; /** User's tier for feature gating */ userTier?: Tier; /** Vim configuration */ config?: Partial; /** Total items in the list */ totalItems: number; /** Number of visible items */ visibleItems: number; /** Item labels for search */ items?: string[]; /** Callback when mode changes */ onModeChange?: (mode: VimMode, prevMode: VimMode) => void; /** Callback when selection changes */ onSelectionChange?: (index: number) => void; /** Callback for command execution */ onCommand?: (command: string) => void; } /** * Hook return type */ export interface UseVimModeReturn { /** Current vim state */ state: VimState; /** Current mode */ mode: VimMode; /** Whether vim mode is enabled */ enabled: boolean; /** Current selection index */ selectedIndex: number; /** Current scroll offset */ scrollOffset: number; /** Search state */ searchState: SearchState; /** Mark state */ markState: MarkState; /** Visual selection if in visual mode */ visualSelection: { start: number; end: number; } | null; /** Process a key event */ processKey: (event: VimKeyEvent) => boolean; /** Toggle vim mode */ toggleVimMode: () => boolean; /** Enable vim mode */ enableVimMode: () => void; /** Disable vim mode */ disableVimMode: () => void; /** Start search */ startSearch: (direction: 'forward' | 'backward') => void; /** Set mark */ setMark: (mark: string) => void; /** Jump to mark */ jumpToMark: (mark: string) => number | null; /** Update items for search */ updateItems: (items: string[]) => void; /** Execute a motion by ID */ executeMotion: (motionId: string, count?: number) => MotionResult | null; /** Get mode indicator */ getModeIndicator: () => { label: string; color: string; }; /** Reset vim state */ reset: () => void; } /** * useVimMode hook */ export declare function useVimMode(config: UseVimModeConfig): UseVimModeReturn; //# sourceMappingURL=useVimMode.d.ts.map