/** * Accessibility Utilities * Provides helpers for ARIA attributes, keyboard navigation, and accessibility features */ /** * Generate a unique ID for ARIA relationships * @param prefix - Optional prefix for the ID * @param suffix - Optional suffix for the ID */ export declare function generateAriaId(prefix?: string, suffix?: string): string; /** * Set ARIA attributes on an element * @param element - The element to set attributes on * @param attributes - Object with attribute names and values */ export declare function setAriaAttributes(element: HTMLElement, attributes: Record): void; /** * Add accessible label to an element * @param element - The element to label * @param label - The label text or element ID * @param useAriaLabel - If true, uses aria-label; if false, uses aria-labelledby */ export declare function addAriaLabel(element: HTMLElement, label: string, useAriaLabel?: boolean): void; /** * Add accessible description to an element * @param element - The element to describe * @param description - The description text or element ID * @param useAriaDescription - If true, uses aria-description; if false, uses aria-describedby */ export declare function addAriaDescription(element: HTMLElement, description: string, useAriaDescription?: boolean): void; /** * Set ARIA live region announcement * @param element - The element to make a live region * @param message - The message to announce * @param politeness - 'polite' (default), 'assertive', or 'off' * @param atomic - Whether to announce the entire region */ export declare function announceAriaLive(element: HTMLElement, message: string, politeness?: 'polite' | 'assertive' | 'off', atomic?: boolean): void; /** * Mark an element as disabled with ARIA attributes * @param element - The element to mark as disabled * @param disabled - Whether the element is disabled */ export declare function setAriaDisabled(element: HTMLElement, disabled: boolean): void; /** * Mark an element as expanded/collapsed (for collapsible sections) * @param element - The element to mark * @param expanded - Whether the element is expanded * @param targetId - ID of the element being controlled (optional) */ export declare function setAriaExpanded(element: HTMLElement, expanded: boolean, targetId?: string): void; /** * Mark an element as selected * @param element - The element to mark * @param selected - Whether the element is selected */ export declare function setAriaSelected(element: HTMLElement, selected: boolean): void; /** * Mark an element as checked (for checkboxes and radio buttons) * @param element - The element to mark * @param checked - The checked state ('true', 'false', or 'mixed') */ export declare function setAriaChecked(element: HTMLElement, checked: 'true' | 'false' | 'mixed'): void; /** * Set the current value of an element (for sliders, spinbuttons, etc.) * @param element - The element * @param current - Current value * @param min - Minimum value * @param max - Maximum value * @param text - Optional text description of the value */ export declare function setAriaValueNow(element: HTMLElement, current: number, min?: number, max?: number, text?: string): void; /** * Mark an element as having a popup (for menus, popovers, etc.) * @param element - The element with the popup trigger * @param type - Type of popup: 'menu', 'listbox', 'tree', 'grid', 'dialog' * @param popupId - ID of the popup element */ export declare function setAriaPopup(element: HTMLElement, type?: 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog', popupId?: string): void; /** * Set role for an element * @param element - The element * @param role - The role (button, menu, menuitem, etc.) */ export declare function setRole(element: HTMLElement, role: string): void; /** * Get the accessible name of an element * Follows ARIA naming convention: aria-labelledby > aria-label > title > textContent */ export declare function getAccessibleName(element: HTMLElement): string; /** * Create a skip link for keyboard navigation * @param text - Link text * @param targetId - ID of element to skip to */ export declare function createSkipLink(text: string, targetId: string): HTMLElement; /** * Check if element should be hidden from screen readers */ export declare function isAriaHidden(element: HTMLElement): boolean; /** * Hide element from screen readers but keep visually visible */ export declare function setAriaHidden(element: HTMLElement, hidden: boolean): void; /** * Announce a message to screen readers immediately (without ARIA live regions) * @param message - The message to announce * @param politeness - 'polite' (default) or 'assertive' */ export declare function announceToScreenReader(message: string, politeness?: 'polite' | 'assertive'): void; /** * Set proper heading hierarchy * @param element - The heading element * @param level - Heading level (1-6) */ export declare function setHeadingLevel(element: HTMLElement, level: 1 | 2 | 3 | 4 | 5 | 6): void; /** * Enable keyboard navigation for a custom component * @param element - The element that should handle keyboard * @param keys - Map of key to handler function */ export declare function enableKeyboardNavigation(element: HTMLElement, keys: Record void>): (() => void); /** * Check if element has accessible focus styling */ export declare function hasAccessibleFocus(element: HTMLElement): boolean; /** * Ensure focus visible styling (for focus-visible pseudo-class) */ export declare function ensureFocusVisible(element: HTMLElement): void;