utils.d.ts 1.4 KB

1234567891011121314151617181920212223242526272829
  1. declare const focusReason: import("vue").Ref<"pointer" | "keyboard" | undefined>;
  2. declare const lastUserFocusTimestamp: import("vue").Ref<number>;
  3. declare const lastAutomatedFocusTimestamp: import("vue").Ref<number>;
  4. export type FocusLayer = {
  5. paused: boolean;
  6. pause: () => void;
  7. resume: () => void;
  8. };
  9. export type FocusStack = FocusLayer[];
  10. export declare const obtainAllFocusableElements: (element: HTMLElement) => HTMLElement[];
  11. export declare const getVisibleElement: (elements: HTMLElement[], container: HTMLElement) => HTMLElement | undefined;
  12. export declare const isHidden: (element: HTMLElement, container: HTMLElement) => boolean;
  13. export declare const getEdges: (container: HTMLElement) => (HTMLElement | undefined)[];
  14. export declare const tryFocus: (element?: HTMLElement | {
  15. focus: () => void;
  16. } | null, shouldSelect?: boolean) => void;
  17. export declare const focusFirstDescendant: (elements: HTMLElement[], shouldSelect?: boolean) => void;
  18. export declare const focusableStack: {
  19. push: (layer: FocusLayer) => void;
  20. remove: (layer: FocusLayer) => void;
  21. };
  22. export declare const isFocusCausedByUserEvent: () => boolean;
  23. export declare const useFocusReason: () => {
  24. focusReason: typeof focusReason;
  25. lastUserFocusTimestamp: typeof lastUserFocusTimestamp;
  26. lastAutomatedFocusTimestamp: typeof lastAutomatedFocusTimestamp;
  27. };
  28. export declare const createFocusOutPreventedEvent: (detail: CustomEventInit["detail"]) => CustomEvent<any>;
  29. export {};