aria.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829
  1. //#region ../../packages/utils/dom/aria.d.ts
  2. declare const isShadowRoot: (e: unknown) => e is ShadowRoot;
  3. /**
  4. * Determine if the testing element is visible on screen no matter if its on the viewport or not
  5. */
  6. declare const isVisible: (element: HTMLElement) => boolean;
  7. declare const obtainAllFocusableElements: (element: HTMLElement) => HTMLElement[];
  8. /**
  9. * @desc Determine if target element is focusable
  10. * @param element {HTMLElement}
  11. * @returns {Boolean} true if it is focusable
  12. */
  13. declare const isFocusable: (element: HTMLElement) => boolean;
  14. /**
  15. * Trigger an event
  16. * mouseenter, mouseleave, mouseover, keyup, change, click, etc.
  17. * @param {HTMLElement} elm
  18. * @param {String} name
  19. * @param {*} opts
  20. */
  21. declare const triggerEvent: (elm: HTMLElement, name: string, ...opts: Array<boolean>) => HTMLElement;
  22. declare const isLeaf: (el: HTMLElement) => boolean;
  23. declare const getSibling: (el: HTMLElement, distance: number, elClass: string) => Element | null;
  24. declare const focusElement: (el?: HTMLElement | {
  25. focus: () => void;
  26. } | null, options?: FocusOptions) => void;
  27. declare const focusNode: (el: HTMLElement) => void;
  28. //#endregion
  29. export { focusElement, focusNode, getSibling, isFocusable, isLeaf, isShadowRoot, isVisible, obtainAllFocusableElements, triggerEvent };