import type { EventObject } from "xstate"; export declare type Command = { id: string; title: CommandTitle; description: CommandDescription; exec: ExecutionFn; getMatchString?: GenerateMatchStringFn; requiredArgs?: string[]; }; export declare type ExecutionFn = (command: Command, input: ParserResult) => void; export declare type CommandDescription = string | CommandDescriptionFn; export declare type CommandDescriptionFn = (input: ParserResult) => string; export declare type CommandTitle = string | CommandTitleFn; export declare type CommandTitleFn = (input: ParserResult) => string; export declare type GenerateMatchStringFn = (input: ParserResult) => string; export interface RankCommand extends Command { rank: number; } export declare type Resolvers = { [key: string]: () => void; }; export declare type ExecPayload = { detail: ExecDetail; }; export declare type ExecDetail = { id: string; input: ParserResult; }; export declare type Theme = { "--background-color"?: string; "--color"?: string; "--result-description-color"?: string; "--active-result-background-color"?: string; "--active-result-title-color"?: string; "--active-result-description-color"?: string; "--scale"?: string; }; export declare type SortFunction = (commands: Command[], input: string) => Command[] | null; export declare type ParserResult = [string] | [string, ParserParams] | null; declare type ParserParams = { [key: string]: string; }; export declare type MachineContextState = { resultIds: string[]; selectedId: string; toggleKey: string; commands: Command[]; input: string; parsedInput: ParserResult; sortFn: SortFunction; }; export interface ExecDoneEvent extends EventObject { type: "EXEC_DONE"; id: string; input: ParserResult; } export interface InputEvent extends EventObject { type: "INPUT"; input: string; } export interface SelectEvent extends EventObject { type: "SELECT"; id: string; } export interface ExecEvent extends EventObject { type: "EXEC"; id?: string; } export interface SetCommandsEvent extends EventObject { type: "NEW_COMMANDS"; commands: Command[]; } export interface StepEvent extends EventObject { type: "STEP"; direction: "UP" | "DOWN"; } export interface CloseEvent extends EventObject { type: "CLOSE"; } export interface OpenEvent extends EventObject { type: "OPEN"; } export declare type MachineEvents = OpenEvent | CloseEvent | ExecEvent | ExecDoneEvent | SelectEvent | ExecDoneEvent | StepEvent | SetCommandsEvent | InputEvent; export {};