import { on, type CSSMixinDescriptor, type Dispatched, type ElementProps, type Handle, type MixinFactory, type Props, type RemixNode } from '@remix-run/ui'; import { type AnchorOptions } from '../anchor/anchor.ts'; import { type SearchValue } from '../../interactions/typeahead/typeahead-mixin.ts'; declare const MENU_SELECT_EVENT: "rmx:menu-select"; type MenuSelectHandler = (event: Dispatched, signal: AbortSignal) => void | Promise; export declare const buttonStyle: CSSMixinDescriptor; export declare const popoverStyle: CSSMixinDescriptor; export declare const listStyle: CSSMixinDescriptor; export declare const itemStyle: CSSMixinDescriptor; export declare const itemSlotStyle: CSSMixinDescriptor; export declare const itemLabelStyle: CSSMixinDescriptor; export declare const itemGlyphStyle: CSSMixinDescriptor; export declare const triggerGlyphStyle: CSSMixinDescriptor; declare global { interface HTMLElementEventMap { [MENU_SELECT_EVENT]: MenuSelectEvent; } } type MenuItemType = 'item' | 'checkbox' | 'radio'; type CloseAnimation = 'fade' | 'none'; type OpenStrategy = 'first' | 'last' | 'list' | 'none'; type NavigationStrategy = 'next' | 'previous' | 'first' | 'last'; type State = 'idle' | 'dismissing' | 'selecting'; export interface MenuSelectItem { checked?: boolean; id: string; label: string; name: string; type: MenuItemType; value: string | null; } export declare class MenuSelectEvent extends Event { readonly item: MenuSelectItem; constructor(item: MenuSelectItem); } export interface MenuProviderProps { children?: RemixNode; label?: string; } export interface MenuTriggerOptions extends AnchorOptions { } export interface MenuContextTriggerOptions extends AnchorOptions { } export interface MenuItemOptions { checked?: boolean; disabled?: boolean; label?: string; name: string; searchValue?: SearchValue; type?: Exclude; value?: string; } export interface SubmenuTriggerOptions { disabled?: boolean; label?: string; searchValue?: SearchValue; value?: string; } type OpenMenuOptions = { focus?: boolean; strategy?: OpenStrategy; }; type CloseBranchOptions = { focusTrigger?: boolean; }; type CloseAllOptions = { focusRoot?: boolean; }; type CloseSyncOptions = { animation?: CloseAnimation; }; type HighlightOptions = { focus?: boolean; }; interface RegisteredMenuItem { checked?: boolean; disabled?: boolean; id: string; searchValue?: SearchValue; submenu?: MenuContextValue; type: MenuItemType; value?: string; name?: string; readonly hidden: boolean; readonly label: string; readonly node: HTMLElement; } interface MenuContextValue { readonly activeId: string | undefined; readonly closeAnimation: CloseAnimation; readonly flashingChecked: boolean | undefined; readonly flashingId: string | undefined; readonly isOpen: boolean; readonly isRoot: boolean; readonly label: string | undefined; readonly listId: string; readonly parent: MenuContextValue | undefined; readonly root: MenuContextValue; readonly state: State; readonly surfaceNode: HTMLElement | undefined; readonly triggerId: string | undefined; activateActive: () => Promise; activateItem: (id: string) => Promise; allowsPointer: (event: PointerEvent) => boolean; closeAll: (options?: CloseAllOptions) => Promise; closeBranch: (options?: CloseBranchOptions) => Promise; closeSync: (updates: Promise[], options?: CloseSyncOptions) => void; consumePointerLeaveClearSuppression: () => boolean; finishDismissalSync: (updates: Promise[]) => void; getOpenChild: () => MenuContextValue | undefined; hasOpenChild: () => boolean; highlight: (id: string | null, options?: HighlightOptions) => void; highlightSearchMatch: (text: string) => void; navigate: (strategy: NavigationStrategy) => void; openActiveSubmenu: () => Promise; open: (options?: OpenMenuOptions) => Promise; registerChild: (menu: MenuContextValue) => void; registerItem: (item: RegisteredMenuItem) => void; registerList: (node: HTMLElement) => void; registerSurface: (node: HTMLElement) => void; registerTrigger: (node: HTMLElement, id: string) => void; suppressNextPointerLeaveClear: () => void; startHoverAim: (source: HTMLElement | null, target: HTMLElement | null, event: PointerEvent) => boolean; unregisterList: (node: HTMLElement) => void; unregisterSurface: (node: HTMLElement) => void; unregisterTrigger: (node: HTMLElement) => void; } declare function MenuProvider(handle: Handle): () => RemixNode; declare const popoverMixin: MixinFactory; export interface MenuListProps extends Props<'div'> { } type MenuListChildProps = Omit, 'children'>; export declare const Context: typeof MenuProvider; export declare const contextTrigger: MixinFactory; export declare const item: MixinFactory; export declare const list: MixinFactory; export { popoverMixin as popover }; export declare const submenuTrigger: MixinFactory; export declare const trigger: MixinFactory; export declare function onMenuSelect(handler: MenuSelectHandler, captureBoolean?: boolean): ReturnType>; export interface MenuProps extends Omit, 'children'> { children?: RemixNode; label: RemixNode; menuLabel?: string; } export interface MenuItemProps extends Omit, 'children' | 'name' | 'type' | 'value'>, MenuItemOptions { children?: RemixNode; } export interface SubmenuProps extends Omit, 'children' | 'name' | 'type' | 'value'>, Omit { children?: RemixNode; label: RemixNode; listProps?: MenuListChildProps; menuLabel?: string; } export declare function Menu(handle: Handle): () => RemixNode; export declare function MenuList(handle: Handle): () => RemixNode; export declare function MenuItem(handle: Handle): () => RemixNode; export declare function Submenu(handle: Handle): () => RemixNode;