//#region ../../node_modules/.pnpm/citty@0.2.2/node_modules/citty/dist/index.d.mts //#region src/types.d.ts type ArgType = "boolean" | "string" | "enum" | "positional" | undefined; type _ArgDef = { type?: T; description?: string; valueHint?: string; alias?: string | string[]; default?: VT; required?: boolean; options?: string[]; }; type BooleanArgDef = Omit<_ArgDef<"boolean", boolean>, "options"> & { negativeDescription?: string; }; type StringArgDef = Omit<_ArgDef<"string", string>, "options">; type EnumArgDef = _ArgDef<"enum", string>; type PositionalArgDef = Omit<_ArgDef<"positional", string>, "alias" | "options">; type ArgDef = BooleanArgDef | StringArgDef | PositionalArgDef | EnumArgDef; type ArgsDef = Record; type ResolveParsedArgType = T extends { default?: any; required?: boolean; } ? T["default"] extends NonNullable ? VT : T["required"] extends true ? VT : VT | undefined : VT | undefined; type ParsedPositionalArg = T extends { type: "positional"; } ? ResolveParsedArgType : never; type ParsedStringArg = T extends { type: "string"; } ? ResolveParsedArgType : never; type ParsedBooleanArg = T extends { type: "boolean"; } ? ResolveParsedArgType : never; type ParsedEnumArg = T extends { type: "enum"; options: infer U; } ? U extends Array ? ResolveParsedArgType : never : never; type RawArgs = { _: string[]; }; type ParsedArg = T["type"] extends "positional" ? ParsedPositionalArg : T["type"] extends "boolean" ? ParsedBooleanArg : T["type"] extends "string" ? ParsedStringArg : T["type"] extends "enum" ? ParsedEnumArg : never; type ParsedArgs = RawArgs & { [K in keyof T]: ParsedArg; } & { [K in keyof T as T[K] extends { alias: string; } ? T[K]["alias"] : never]: ParsedArg; } & { [K in keyof T as T[K] extends { alias: string[]; } ? T[K]["alias"][number] : never]: ParsedArg; } & Record; interface CommandMeta { name?: string; version?: string; description?: string; hidden?: boolean; alias?: string | string[]; } type SubCommandsDef = Record>>; type CommandDef = { meta?: Resolvable; args?: Resolvable; default?: Resolvable; subCommands?: Resolvable; plugins?: Resolvable[]; setup?: (context: CommandContext) => any | Promise; cleanup?: (context: CommandContext) => any | Promise; run?: (context: CommandContext) => any | Promise; }; type CommandContext = { rawArgs: string[]; args: ParsedArgs; cmd: CommandDef; subCommand?: CommandDef; data?: any; }; type CittyPlugin = { name: string; setup?(context: CommandContext): void | Promise; cleanup?(context: CommandContext): void | Promise; }; type Resolvable = T | Promise | (() => T) | (() => Promise); //#endregion //#region src/main.d.ts declare const main: CommandDef; declare function runMain(): Promise; //#endregion //#region src/run.d.ts declare function runCommand(command: CommandDef, argv?: string[], data?: { overrides?: Record; }): Promise<{ result: unknown; }>; //#endregion export { main, runCommand, runMain };