import type { Argv, Options } from "yargs"; export interface CliExample { command: string; title?: string; description?: string; } export interface CliOptionDefinition extends Options { example?: Omit; type: T extends string ? "string" : T extends number ? "number" : T extends boolean ? "boolean" : T extends Array ? "array" : never; } export type CliCommandOptions = Required<{ [K in keyof OwnArgs]: undefined extends OwnArgs[K] ? CliOptionDefinition : CliOptionDefinition & (Required> | { demandOption: true; }); }>; export interface CliCommand, ParentArgs = Record, R = any> { command: string; describe: string; /** * The folder in docs/pages that the cli.md should be placed in. If not provided no * cli flags page will be generated for the command */ docsFolder?: string; examples?: CliExample[]; options?: CliCommandOptions; subcommands?: CliCommand[]; handler?: (args: OwnArgs & ParentArgs) => Promise; } /** * Register a CliCommand type to yargs. Recursively registers subcommands too. * @param yargs * @param cliCommand */ export declare function registerCommandToYargs(yargs: Argv, cliCommand: CliCommand): void; //# sourceMappingURL=command.d.ts.map