Files
NapCatQQ/.pnpm-store/v3/files/d4/e68c3da53dce6cda8406e18e78338707296e649a574ceb2b0edebd3ee7d16d6c2a4595e2dea02f84477fdef446ea199101a348363d51e2d862e871003ae1ca
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

60 lines
2.6 KiB
Plaintext

import { FocusStrategy, Key } from "@react-types/shared";
import { MenuTriggerProps } from "@react-types/menu";
import { OverlayTriggerState } from "@react-stately/overlays";
export interface MenuTriggerState extends OverlayTriggerState {
/** Controls which item will be auto focused when the menu opens. */
readonly focusStrategy: FocusStrategy | null;
/** Opens the menu. */
open(focusStrategy?: FocusStrategy | null): void;
/** Toggles the menu. */
toggle(focusStrategy?: FocusStrategy | null): void;
}
export interface RootMenuTriggerState extends MenuTriggerState {
/** Opens a specific submenu tied to a specific menu item at a specific level. */
openSubmenu: (triggerKey: Key, level: number) => void;
/** Closes a specific submenu tied to a specific menu item at a specific level. */
closeSubmenu: (triggerKey: Key, level: number) => void;
/** An array of open submenu trigger keys within the menu tree.
* The index of key within array matches the submenu level in the tree.
*/
expandedKeysStack: Key[];
/** Closes the menu and all submenus in the menu tree. */
close: () => void;
}
/**
* Manages state for a menu trigger. Tracks whether the menu is currently open,
* and controls which item will receive focus when it opens. Also tracks the open submenus within
* the menu tree via their trigger keys.
*/
export function useMenuTriggerState(props: MenuTriggerProps): RootMenuTriggerState;
export interface SubmenuTriggerProps {
/** Key of the trigger item. */
triggerKey: Key;
}
export interface SubmenuTriggerState extends OverlayTriggerState {
/** Whether the submenu is currently open. */
isOpen: boolean;
/** Controls which item will be auto focused when the submenu opens. */
focusStrategy: FocusStrategy | null;
/** Opens the submenu. */
open: (focusStrategy?: FocusStrategy | null) => void;
/** Closes the submenu. */
close: () => void;
/** Closes all menus and submenus in the menu tree. */
closeAll: () => void;
/** The level of the submenu. */
submenuLevel: number;
/** Toggles the submenu. */
toggle: (focusStrategy?: FocusStrategy | null) => void;
/** @private */
setOpen: () => void;
}
/**
* Manages state for a submenu trigger. Tracks whether the submenu is currently open, the level of the submenu, and
* controls which item will receive focus when it opens.
*/
export function useSubmenuTriggerState(props: SubmenuTriggerProps, state: RootMenuTriggerState): SubmenuTriggerState;
export type { MenuTriggerProps } from '@react-types/menu';
//# sourceMappingURL=types.d.ts.map