/** * ARIA hidden detection utilities. * Determines if elements are hidden from the accessibility tree. * * Based on W3C WAI-ARIA spec and Playwright's implementation patterns. * https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion */ /** * Options for hidden element checks. */ export interface HiddenCheckOptions { /** Check aria-hidden attribute (default: true) */ includeAria?: boolean; /** Check CSS visibility/display (default: true) */ includeCSS?: boolean; /** Check slot assignment for shadow DOM (default: true) */ includeSlot?: boolean; } /** * Check if an element is one of the always-ignored tags. */ export declare function isIgnoredForAria(element: Element): boolean; /** * Check if element or any ancestor has aria-hidden="true". * Once aria-hidden is set, all descendants are hidden from the accessibility tree. */ export declare function hasAriaHidden(element: Element): boolean; /** * Check if element is in an inert subtree. * Elements inside an inert element or its descendants are not focusable * and are hidden from the accessibility tree. */ export declare function isInertSubtree(element: Element): boolean; /** * Check if element is hidden via CSS. * Considers display, visibility, and opacity. */ export declare function isHiddenByCSS(element: Element): boolean; /** * Check if element is hidden due to display:contents. * Elements with display:contents don't generate a box but their children do. * For ARIA, we need to check if any children are visible. */ export declare function isDisplayContentsWithNoVisibleChildren(element: Element): boolean; /** * Check if element is hidden due to not being slotted in shadow DOM. * When a parent has a shadow root, children must be slotted to be rendered. */ export declare function isNotSlotted(element: Element): boolean; /** * Check if element is hidden for ARIA/accessibility purposes. * This is the main entry point for hidden detection. * * An element is hidden for ARIA if: * - It's an ignored tag (script, style, etc.) * - It or an ancestor has aria-hidden="true" * - It's hidden via CSS (display:none, visibility:hidden) * - It's in an inert subtree * - It's not slotted when parent has shadow DOM * - It has display:contents with no visible children * * @param element The element to check * @param options Optional configuration for which checks to perform */ export declare function isElementHiddenForAria(element: Element, options?: HiddenCheckOptions): boolean; /** * Check if element is visually visible (has perceivable rendering). * This is different from isElementHiddenForAria - an element can be * ARIA-visible but not visually visible (e.g., for screen reader only content). */ export declare function isElementVisuallyVisible(element: Element): boolean; /** * Determine element visibility based on mode. * * @param element The element to check * @param mode The visibility mode: * - 'aria': Only check ARIA visibility (aria-hidden, etc.) * - 'ariaOrVisible': Include if ARIA-visible OR visually visible * - 'ariaAndVisible': Must be both ARIA-visible AND visually visible */ export declare function checkElementVisibility(element: Element, mode?: 'aria' | 'ariaOrVisible' | 'ariaAndVisible'): boolean; //# sourceMappingURL=hidden.d.ts.map