Type aliases
Arguments
Arguments<T>: T & { $0: string; _: string[] }
Type parameters
AsyncCompletionFunction
Async
CompletionFunction: (current: string, argv: any, done: (completion: ReadonlyArray<string>) => void) => void
Type declaration
-
- (current: string, argv: any, done: (completion: ReadonlyArray<string>) => void): void
-
Parameters
-
current: string
-
argv: any
-
done: (completion: ReadonlyArray<string>) => void
Returns void
BuilderCallback
Builder
Callback<T, R>: ((args: Argv<T>) => Argv<R>) | ((args: Argv<T>) => void)
Type parameters
Choices
CommandBuilder
Command
Builder<T, U>: {} | ((args: Argv<T>) => Argv<U>)
Type parameters
Defined
Defined<T, K>
: Omit<T, K> & {}
Type parameters
InferredOptionType
InferredOptionType<O>: O extends { default: infer D } ? D : O extends { type: "count" } ? number : O extends { count: true } ? number : O extends { required: string | true } ? RequiredOptionType<O> : O extends { require: string | true } ? RequiredOptionType<O> : O extends { demand: string | true } ? RequiredOptionType<O> : O extends { demandOption: string | true } ? RequiredOptionType<O> : RequiredOptionType<O> | undefined
Type parameters
InferredOptionTypes
InferredOptionTypes<O>: {}
Type parameters
MiddlewareFunction
Middleware
Function<T>: (args: Arguments<T>) => void
Type parameters
Omit
Omit<T, K>: {}
Type parameters
ParseCallback
Parse
Callback<T>: (err: Error | undefined, argv: Arguments<T>, output: string) => void
Type parameters
Type declaration
-
-
Parameters
-
err: Error | undefined
-
-
output: string
Returns void
ParserConfigurationOptions
Parser
ConfigurationOptions: Configuration & { sort-commands: boolean }
PositionalOptionsType
PositionalOptionsType: "boolean" | "number" | "string"
PromiseCompletionFunction
Promise
CompletionFunction: (current: string, argv: any) => Promise<string[]>
Type declaration
-
- (current: string, argv: any): Promise<string[]>
-
Parameters
-
current: string
-
argv: any
Returns Promise<string[]>
RequiredOptionType
Required
OptionType<O>: O extends { string: true; type: "array" } ? string[] : O extends { number: true; type: "array" } ? number[] : O extends { normalize: true; type: "array" } ? string[] : O extends { array: true; type: "string" } ? string[] : O extends { array: true; type: "number" } ? number[] : O extends { array: true; string: true } ? string[] : O extends { array: true; number: true } ? number[] : O extends { array: true; normalize: true } ? string[] : O extends { type: "array" } ? Array<string | number> : O extends { type: "boolean" } ? boolean : O extends { type: "number" } ? number : O extends { type: "string" } ? string : O extends { array: true } ? Array<string | number> : O extends { boolean: true } ? boolean : O extends { number: true } ? number : O extends { string: true } ? string : O extends { normalize: true } ? string : O extends { choices: ReadonlyArray<infer C> } ? C : O extends { coerce: (arg: any) => infer T } ? T : unknown
Type parameters
SyncCompletionFunction
SyncCompletionFunction: (current: string, argv: any) => string[]
Type declaration
-
- (current: string, argv: any): string[]
-
Parameters
-
current: string
-
argv: any
Returns string[]
ToArray
Type parameters
ToNumber
Type parameters
ToString
Type parameters
Remove undefined as a possible value for keys K in T