import { KeyboardHandlerMap } from '../shared/index.js';

interface CommandProps {
    /** Whether the command palette is open (controlled) */
    open?: boolean;
    /** Callback when open state changes */
    onOpenChange?: (open: boolean) => void;
    /** Custom filter function — receives item value and search query, returns true to include */
    filter?: (value: string, search: string) => boolean;
}
interface CommandItemData {
    /** Unique identifier for the item */
    id: string;
    /** Display label */
    label: string;
    /** Searchable value */
    value: string;
    /** Whether the item is disabled */
    disabled?: boolean;
    /** Optional group the item belongs to */
    group?: string;
}
interface CommandState {
    /** Current search query */
    search: string;
    /** Items after filtering */
    filteredItems: CommandItemData[];
    /** Index of the currently highlighted item in filteredItems */
    selectedIndex: number;
    /** Whether the palette is open */
    open: boolean;
}
interface CommandAPI {
    /** Current command state */
    state: CommandState;
    /** Update the search query and re-filter items */
    search(query: string): void;
    /** Select the item at the given index (or the currently highlighted item) */
    select(index?: number): CommandItemData | undefined;
    /** Keyboard handlers for the command palette */
    keyboardHandlers: KeyboardHandlerMap;
    /** ARIA attributes for the command root */
    ariaProps: Record<string, unknown>;
    /** ARIA attributes for the input */
    inputAriaProps: Record<string, unknown>;
    /** ARIA attributes for the list */
    listAriaProps: Record<string, unknown>;
    /** Get ARIA attributes for a specific item */
    getItemAriaProps(item: CommandItemData, index: number): Record<string, unknown>;
    /** Generated IDs */
    ids: {
        root: string;
        input: string;
        list: string;
    };
}
declare function createCommand(props?: CommandProps, items?: CommandItemData[]): CommandAPI;

declare const commandVariants: (props?: ({
    [x: string]: string | undefined;
} & {
    className?: string;
}) | undefined) => string;
declare const commandInputVariants: (props?: ({
    [x: string]: string | undefined;
} & {
    className?: string;
}) | undefined) => string;
declare const commandItemVariants: (props?: ({
    state?: "default" | "selected" | "disabled" | undefined;
} & {
    className?: string;
}) | undefined) => string;
declare const commandGroupVariants: (props?: ({
    [x: string]: string | undefined;
} & {
    className?: string;
}) | undefined) => string;

export { type CommandAPI, type CommandItemData, type CommandProps, type CommandState, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants, createCommand };
