/** * @license * Copyright 2023 Nuraly, Laabidi Aymen * SPDX-License-Identifier: MIT */ import { BaseMenuController } from './base.controller.js'; import type { MenuKeyboardController } from '../interfaces/index.js'; import type { StateController } from './state.controller.js'; /** * Keyboard controller manages keyboard navigation for the menu component * Handles arrow keys, Enter/Space, Escape, Home/End, and type-ahead search */ export declare class KeyboardController extends BaseMenuController implements MenuKeyboardController { private stateController; private typeAheadBuffer; private typeAheadTimeout; private currentFocusIndex; constructor(host: any, stateController: StateController); hostConnected(): void; hostDisconnected(): void; /** * Main keydown handler - routes to specific handlers * @param event - The keyboard event */ handleKeydown(event: KeyboardEvent): void; /** * Handle arrow key navigation * @param event - The keyboard event */ handleArrowNavigation(event: KeyboardEvent): void; /** * Navigate down to the next interactive item * @param items - All menu items * @param currentIndex - Current focused item index */ private navigateDown; /** * Navigate up to the previous interactive item * @param items - All menu items * @param currentIndex - Current focused item index */ private navigateUp; /** * Expand submenu or navigate into it (ArrowRight) * @param element - The current element */ private expandOrNavigate; /** * Collapse submenu or navigate out of it (ArrowLeft) * @param element - The current element */ private collapseOrNavigate; /** * Handle Enter or Space key activation * @param event - The keyboard event */ handleActivation(event: KeyboardEvent): void; /** * Handle Escape key - close all submenus * @param event - The keyboard event */ handleEscape(event: KeyboardEvent): void; /** * Handle Home/End keys - jump to first/last item * @param event - The keyboard event */ private handleHomeEnd; /** * Handle type-ahead search - type letters to jump to items * @param event - The keyboard event */ handleTypeAhead(event: KeyboardEvent): void; /** * Check if an element's text matches the type-ahead buffer * @param element - The element to check * @returns True if the element matches */ private matchesTypeAhead; /** * Reset the type-ahead buffer */ resetTypeAhead(): void; } //# sourceMappingURL=keyboard.controller.d.ts.map