/** * Keyboard Accessibility Service * * Manages accessibility features like sticky keys, slow keys, and announcements. * * @since v1.58.5 */ import type { AccessibilityConfig, Announcement } from './accessibility-types.js'; /** * Key event from keyboard */ export interface KeyEvent { key: string; type: 'keydown' | 'keyup'; modifiers: string[]; timestamp: number; } /** * Processed key result */ export interface ProcessedKeyResult { /** The key(s) to process */ key: string; /** Active modifiers */ modifiers: string[]; /** Whether to process the key */ shouldProcess: boolean; /** Reason if not processing */ reason?: 'slow-key-pending' | 'repeat-blocked'; /** Visual feedback to show */ visualFeedback?: string[]; /** Announcement to make */ announcement?: Announcement; } /** * Accessibility Service */ export declare class AccessibilityService { private config; private stickyState; private slowState; private repeatState; private visualState; private announcements; private onVisualFeedback?; private onAnnounce?; private onKeyAccepted?; constructor(config?: Partial, callbacks?: { onVisualFeedback?: (keys: string[], isFlash: boolean) => void; onAnnounce?: (message: string) => void; onKeyAccepted?: (key: string, modifiers: string[]) => void; }); /** * Process a key event */ processKey(event: KeyEvent): ProcessedKeyResult; /** * Handle sticky keys */ private handleStickyKeys; /** * Get current active modifiers */ private getCurrentModifiers; /** * Clear non-locked sticky modifiers */ private clearStickyModifiers; /** * Reset sticky timeout */ private resetStickyTimeout; /** * Get modifier visual feedback */ private getModifierVisualFeedback; /** * Handle slow keys */ private handleSlowKeys; /** * Clear slow key state */ private clearSlowKeyState; /** * Handle key repeat */ private handleKeyRepeat; /** * Handle key up (for repeat state) */ handleKeyUp(key: string): void; /** * Show key press visual */ private showKeyPress; /** * Flash screen */ flash(): void; /** * Announce a message */ announce(message: string, priority?: number, interrupt?: boolean): void; /** * Announce navigation */ announceNavigation(view: string, item?: string): void; /** * Announce action result */ announceAction(action: string, result: 'success' | 'failure' | 'cancelled', details?: string): void; /** * Announce error */ announceError(error: string): void; /** * Remap key for single-hand mode */ private remapForSingleHand; /** * Update configuration */ updateConfig(config: Partial): void; /** * Get configuration */ getConfig(): AccessibilityConfig; /** * Enable/disable specific feature */ setFeatureEnabled(feature: keyof AccessibilityConfig, enabled: boolean): void; /** * Check tier access */ private isTierAllowed; /** * Reset all states */ reset(): void; } /** * Create an accessibility service instance */ export declare function createAccessibilityService(config?: Partial, callbacks?: { onVisualFeedback?: (keys: string[], isFlash: boolean) => void; onAnnounce?: (message: string) => void; onKeyAccepted?: (key: string, modifiers: string[]) => void; }): AccessibilityService; //# sourceMappingURL=accessibility-service.d.ts.map