index.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829
  1. export declare type Undo = () => void;
  2. /**
  3. * Marks everything except given node(or nodes) as aria-hidden
  4. * @param {Element | Element[]} originalTarget - elements to keep on the page
  5. * @param [parentNode] - top element, defaults to document.body
  6. * @param {String} [markerName] - a special attribute to mark every node
  7. * @return {Undo} undo command
  8. */
  9. export declare const hideOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo;
  10. /**
  11. * Marks everything except given node(or nodes) as inert
  12. * @param {Element | Element[]} originalTarget - elements to keep on the page
  13. * @param [parentNode] - top element, defaults to document.body
  14. * @param {String} [markerName] - a special attribute to mark every node
  15. * @return {Undo} undo command
  16. */
  17. export declare const inertOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo;
  18. /**
  19. * @returns if current browser supports inert
  20. */
  21. export declare const supportsInert: () => boolean;
  22. /**
  23. * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way
  24. * @param {Element | Element[]} originalTarget - elements to keep on the page
  25. * @param [parentNode] - top element, defaults to document.body
  26. * @param {String} [markerName] - a special attribute to mark every node
  27. * @return {Undo} undo command
  28. */
  29. export declare const suppressOthers: (originalTarget: Element | Element[], parentNode?: HTMLElement, markerName?: string) => Undo;