/** * Supported ARIA roles for toggle-like controls. * * Note: `radio` is supported as a role value, but full radio-group behavior * (roving tab index and arrow-key group navigation) is only available when * the component is used inside a parent with `role="radiogroup"`. */ export type ToggleAriaRole = 'button' | 'checkbox' | 'radio'; /** * ARIA state attributes for interactive roles. */ export interface AriaStateAttributes { /** The aria-pressed value, used for button-like toggles. */ ariaPressed?: string; /** The aria-checked value, used for checkbox/radio toggles. */ ariaChecked?: string; } /** * Checks whether a keyboard key should toggle a control. * @param {string} key - KeyboardEvent key value. * @returns {boolean} True when key should trigger toggle behavior. */ export declare function isToggleKey(key: string): boolean; /** * Checks whether a role is a supported toggle ARIA role. * @param {string} role - Role value to validate. * @returns {boolean} True when role is supported. */ export declare function isToggleAriaRole(role: string): role is ToggleAriaRole; /** * Normalizes runtime role values to supported toggle roles. * Falls back to button semantics for invalid values. * @param {string} role - Role value to normalize. * @returns {ToggleAriaRole} Supported role value. */ export declare function normalizeToggleAriaRole(role: string): ToggleAriaRole; /** * Calculates the next selected state for a toggle interaction. * @param {boolean} selected - Current selected state. * @param {boolean} disabled - Disabled state. * @returns {boolean} Updated selected state. */ export declare function getNextSelectedState(selected: boolean, disabled: boolean): boolean; /** * Calculates the next selected state based on role semantics. * Radio-like controls cannot toggle off directly once selected. * Group-level coordination (for example deselecting sibling radios) is handled * by the consuming component in radiogroup context. * @param {ToggleAriaRole} role - Interactive role of the control. * @param {boolean} selected - Current selected state. * @param {boolean} disabled - Disabled state. * @returns {boolean} Updated selected state for the role. */ export declare function getRoleAwareNextSelectedState(role: ToggleAriaRole, selected: boolean, disabled: boolean): boolean; /** * Maps role + state to ARIA attributes. * @param {ToggleAriaRole} role - Interactive role of the control. * @param {boolean} selected - Selected state. * @returns {AriaStateAttributes} ARIA state attributes for the role. */ export declare function getAriaStateAttributes(role: ToggleAriaRole, selected: boolean): AriaStateAttributes;