You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.2KB

  1. export interface IsInaccessibleOptions {
  2. getComputedStyle?: typeof window.getComputedStyle;
  3. /**
  4. * Can be used to return cached results from previous isSubtreeInaccessible calls.
  5. */
  6. isSubtreeInaccessible?: (element: Element) => boolean;
  7. }
  8. /**
  9. * Partial implementation https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion
  10. * which should only be used for elements with a non-presentational role i.e.
  11. * `role="none"` and `role="presentation"` will not be excluded.
  12. *
  13. * Implements aria-hidden semantics (i.e. parent overrides child)
  14. * Ignores "Child Presentational: True" characteristics
  15. *
  16. * @param element
  17. * @param options
  18. * @returns {boolean} true if excluded, otherwise false
  19. */
  20. export declare function isInaccessible(element: Element, options?: IsInaccessibleOptions): boolean;
  21. export interface IsSubtreeInaccessibleOptions {
  22. getComputedStyle?: typeof window.getComputedStyle;
  23. }
  24. /**
  25. *
  26. * @param element
  27. * @param options
  28. * @returns {boolean} - `true` if every child of the element is inaccessible
  29. */
  30. export declare function isSubtreeInaccessible(element: Element, options?: IsSubtreeInaccessibleOptions): boolean;
  31. //# sourceMappingURL=is-inaccessible.d.ts.map