import { type KeyboardEvent } from 'react'; export interface SlashCommandOption { name: string; description?: string | undefined; /** What the command takes after its name, such as `[condition|pause|resume]`: shown beside * the name in the menu, and above the box while its arguments are typed. */ argumentHint?: string | undefined; } export interface SlashMenuConfig { commands: SlashCommandOption[]; /** Names the listbox for assistive tech. */ label: string; /** Called when the input first reads as a command, so a host can load the list lazily. */ onOpen?: (() => void) | undefined; /** The host is still loading the list: the menu opens on the slash and says more are coming, * rather than showing the commands it has so far as all there are. */ loading?: boolean | undefined; } export declare function slashMatches(input: string, commands: SlashCommandOption[]): SlashCommandOption[]; /** The palette's open state and keys; the caller owns the input. * Base UI's Autocomplete drives a single-line input, and its arrow keys would take the caret * from a multi-line composer, so the textarea stays a textbox that points at the list: * spread `inputProps` on it. */ export declare function useSlashMenu(input: string, config: SlashMenuConfig | undefined, setInput: (value: string) => void): { open: boolean; matches: SlashCommandOption[]; loading: boolean; active: number; choose: (name: string) => void; handleKey: (e: KeyboardEvent) => boolean; listId: string; inputProps: { 'aria-autocomplete': 'list'; 'aria-controls': string | undefined; 'aria-activedescendant': string | undefined; 'aria-describedby': string | undefined; }; list: { active: number; setActive: import("react").Dispatch>; handleKey: (event: globalThis.KeyboardEvent | KeyboardEvent) => boolean; listId: string; hostProps: { 'aria-autocomplete': 'list'; 'aria-controls': string | undefined; 'aria-activedescendant': string | undefined; }; listProps: { id: string; role: 'listbox'; }; optionProps: (index: number) => { id: string; role: 'option'; tabIndex: number; 'aria-selected': boolean; 'aria-disabled': true | undefined; 'data-highlighted': true | undefined; 'data-disabled': true | undefined; onMouseDown: (event: { preventDefault: () => void; }) => void; onMouseMove: () => void; onClick: () => void; }; }; /** The command whose arguments are being typed, and the id of its hint. */ argumentHint: { command: SlashCommandOption; id: string; } | undefined; }; export declare function SlashMenu({ label, menu, onChoose, }: { label: string; menu: ReturnType; onChoose: (name: string) => void; }): import("react").JSX.Element; /** What the command being typed takes, where its menu stood; the box keeps every key. */ export declare function SlashArgumentHint({ hint }: { hint: { command: SlashCommandOption; id: string; }; }): import("react").JSX.Element;