PromoCursed/node_modules/rc-menu/lib/hooks/useAccessibility.d.ts
2024-08-20 23:25:37 +04:00

13 lines
918 B
TypeScript

import * as React from 'react';
import type { MenuMode } from '../interface';
/**
* Get focusable elements from the element set under provided container
*/
export declare function getFocusableElements(container: HTMLElement, elements: Set<HTMLElement>): HTMLElement[];
export declare const refreshElements: (keys: string[], id: string) => {
elements: Set<HTMLElement>;
key2element: Map<string, HTMLElement>;
element2key: Map<HTMLElement, string>;
};
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>;