import { type StyleProp, type ViewStyle } from "../../style/index.js"; import { type IconName } from "../../atoms/icon/icon.js"; import { type CommandSkin } from "./command.styles.js"; export interface CommandItem { /** The row's primary text. */ label: string; /** Optional leading Canvas glyph, named from the kit icon set (e.g. `"file"`, * `"folder"`, `"save"`). Rendered through the `Icon` atom. */ icon?: IconName; /** Optional trailing keyboard shortcut, rendered in a Kbd cap. */ shortcut?: string; } export interface CommandGroup { /** Optional uppercase section heading above the group's rows. */ heading?: string; /** The rows in this group. */ items: CommandItem[]; } export interface CommandProps { /** Prompt shown in the empty search input. */ placeholder?: string; /** * The text typed into the search input (CONTROLLED). Filters the rows to the * labels matching it (case-insensitive). Omit and use `defaultQuery` for * uncontrolled use: a bare Command is searchable out of the box. */ query?: string; /** Initial query for uncontrolled use. */ defaultQuery?: string; /** Fired with the new query on each keystroke (both modes). */ onQueryChange?: (query: string) => void; /** Grouped result rows. */ groups?: CommandGroup[]; /** Flat index of the highlighted row (CONTROLLED), counted across the visible (query-matching) rows. Omit for uncontrolled use. */ active?: number; /** Initial highlighted row for uncontrolled use (hovering a row moves it, typing resets it to the first match). */ defaultActive?: number; /** Controlled open state. Omit for uncontrolled (the search trigger toggles it). */ open?: boolean; /** Render the palette open initially for uncontrolled use (selecting a row closes it). */ defaultOpen?: boolean; /** Fired when the open state changes. */ onOpenChange?: (open: boolean) => void; /** * Render a collapsed full-width search trigger above the palette (a search * glyph + "Search..." + a trailing kbd cap). The palette card still renders * inline below the trigger (gated by `open`), mirroring how Dropdown shows * its trigger plus the open menu in the docs. */ trigger?: boolean; /** * Append a footer hint bar below the list (↑ ↓ to navigate, ↵ to select, * esc to close). */ footer?: boolean; /** Called with the chosen item and its flat index (within the visible, query-matching rows) when a row is pressed. */ onSelect?: (item: CommandItem, index: number) => void; /** E2E hook forwarded to the root element. */ testID?: string; /** Outer layout composition only (width/flex within a parent), never a restyle hook. */ style?: StyleProp; } /** Build a Command component from a platform skin. */ export declare function createCommand(skin: CommandSkin): (props: CommandProps) => import("react").JSX.Element | null; //# sourceMappingURL=command.shared.d.ts.map