useAccessibility.d.ts 918 B

123456789101112
  1. import * as React from 'react';
  2. import type { MenuMode } from '../interface';
  3. /**
  4. * Get focusable elements from the element set under provided container
  5. */
  6. export declare function getFocusableElements(container: HTMLElement, elements: Set<HTMLElement>): HTMLElement[];
  7. export declare const refreshElements: (keys: string[], id: string) => {
  8. elements: Set<HTMLElement>;
  9. key2element: Map<string, HTMLElement>;
  10. element2key: Map<HTMLElement, string>;
  11. };
  12. export declare function useAccessibility<T extends HTMLElement>(mode: MenuMode, activeKey: string, isRtl: boolean, id: string, containerRef: React.RefObject<HTMLUListElement>, getKeys: () => string[], getKeyPath: (key: string, includeOverflow?: boolean) => string[], triggerActiveKey: (key: string) => void, triggerAccessibilityOpen: (key: string, open?: boolean) => void, originOnKeyDown?: React.KeyboardEventHandler<T>): React.KeyboardEventHandler<T>;