import { type TextInputProps } from "react-native"; 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 supporting text, announced with the result label. */ description?: 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 as mono text. */ 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; /** Accessible purpose for the search input and result list. Defaults to the * search placeholder. Supply this when the placeholder does not explain the task. */ accessibilityLabel?: 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[]; /** Groups are already filtered and ranked by the owner; preserve their order and contents. */ filtered?: boolean; /** Fill the parent and inherit its surface, for composition inside a Dialog or Drawer. Ignored with trigger. */ embedded?: boolean; /** Focus the inline search field after mounting, allowing the containing overlay to capture its opener first. */ autoFocus?: boolean; /** Input keyboard handler, called before built-in navigation. preventDefault cancels built-in handling. */ onKeyPress?: TextInputProps["onKeyPress"]; /** Content shown when there are no result rows, including an empty query. */ emptyMessage?: string; /** 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; the scrolling results list gets `${testID}-results`. */ 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