/** * Keyboard Accessibility Types * * Types for accessibility-focused keyboard modes. * * @since v1.58.5 */ import type { Tier } from '../../core/types/auth.js'; /** * Accessibility mode settings */ export interface AccessibilityConfig { /** Whether accessibility features are enabled */ enabled: boolean; /** User's tier for feature gating */ userTier: Tier; /** Sticky keys mode */ stickyKeys: StickyKeysConfig; /** Slow keys mode */ slowKeys: SlowKeysConfig; /** Key repeat settings */ keyRepeat: KeyRepeatConfig; /** Visual feedback settings */ visualFeedback: VisualFeedbackConfig; /** Announcements settings */ announcements: AnnouncementsConfig; /** Single-hand mode */ singleHand: SingleHandConfig; } /** * Sticky keys configuration * Modifiers stay pressed until next key */ export interface StickyKeysConfig { /** Enable sticky keys */ enabled: boolean; /** Lock modifier after pressing twice */ lockOnDouble: boolean; /** Clear all sticky keys after action */ clearAfterAction: boolean; /** Timeout for sticky modifier (ms, 0 = no timeout) */ timeout: number; /** Sound feedback on modifier toggle */ soundFeedback: boolean; } /** * Slow keys configuration * Ignore accidental/brief key presses */ export interface SlowKeysConfig { /** Enable slow keys */ enabled: boolean; /** Minimum key press duration (ms) */ acceptanceDelay: number; /** Play sound when key is accepted */ soundOnAccept: boolean; /** Visual indicator for pending key */ showPending: boolean; } /** * Key repeat configuration */ export interface KeyRepeatConfig { /** Enable key repeat */ enabled: boolean; /** Initial delay before repeat starts (ms) */ initialDelay: number; /** Delay between repeats (ms) */ repeatDelay: number; /** Maximum repeats per second */ maxRepeatRate: number; } /** * Visual feedback configuration */ export interface VisualFeedbackConfig { /** Show visual key press indicator */ showKeyPress: boolean; /** Duration to show key press (ms) */ keyPressDuration: number; /** Position of key indicator */ keyIndicatorPosition: 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left'; /** Show modifier key status */ showModifierStatus: boolean; /** Flash screen on important actions */ flashOnAction: boolean; } /** * Announcements configuration */ export interface AnnouncementsConfig { /** Enable action announcements */ enabled: boolean; /** Announce navigation changes */ announceNavigation: boolean; /** Announce action results */ announceActions: boolean; /** Announce errors */ announceErrors: boolean; /** Verbosity level */ verbosity: 'minimal' | 'normal' | 'verbose'; } /** * Single-hand mode configuration */ export interface SingleHandConfig { /** Enable single-hand mode */ enabled: boolean; /** Which hand (affects key mapping) */ hand: 'left' | 'right'; /** Mirror keys to other side */ mirrorKeys: boolean; /** Use space as modifier */ spaceAsModifier: boolean; } /** * Sticky key state */ export interface StickyKeyState { /** Active sticky modifiers */ activeModifiers: Set; /** Locked modifiers (double-pressed) */ lockedModifiers: Set; /** Timeout ID for auto-clear */ timeoutId: ReturnType | null; } /** * Slow key state */ export interface SlowKeyState { /** Currently pending key */ pendingKey: string | null; /** When the key was pressed */ pressedAt: number | null; /** Timeout ID */ timeoutId: ReturnType | null; } /** * Key repeat state */ export interface KeyRepeatState { /** Currently repeating key */ activeKey: string | null; /** Repeat count */ repeatCount: number; /** Last repeat time */ lastRepeatTime: number | null; /** Interval ID */ intervalId: ReturnType | null; } /** * Visual feedback state */ export interface VisualFeedbackState { /** Current visible key(s) */ visibleKeys: string[]; /** Whether flash is active */ isFlashing: boolean; } /** * Announcement queue item */ export interface Announcement { /** Unique ID */ id: string; /** Message to announce */ message: string; /** Priority (higher = more important) */ priority: number; /** Whether to interrupt current announcement */ interrupt: boolean; /** When created */ timestamp: number; } /** * Default accessibility configuration */ export declare const DEFAULT_ACCESSIBILITY_CONFIG: AccessibilityConfig; /** * Create initial sticky key state */ export declare function createInitialStickyKeyState(): StickyKeyState; /** * Create initial slow key state */ export declare function createInitialSlowKeyState(): SlowKeyState; /** * Create initial key repeat state */ export declare function createInitialKeyRepeatState(): KeyRepeatState; /** * Create initial visual feedback state */ export declare function createInitialVisualFeedbackState(): VisualFeedbackState; /** * Check if a key is a modifier */ export declare function isModifierKey(key: string): boolean; /** * Get modifier display name */ export declare function getModifierDisplayName(key: string): string; /** * Create announcement */ export declare function createAnnouncement(message: string, priority?: number, interrupt?: boolean): Announcement; /** * Format key for display */ export declare function formatAccessibleKeyLabel(key: string, modifiers?: string[]): string; //# sourceMappingURL=accessibility-types.d.ts.map