@types/yargs
Advanced tools
Comparing version 17.0.31 to 17.0.32
@@ -37,3 +37,3 @@ // The following TSLint rules have been disabled: | ||
interface Argv<T = {}> { | ||
(args?: ReadonlyArray<string> | string, cwd?: string): Argv<T>; | ||
(args?: readonly string[] | string, cwd?: string): Argv<T>; | ||
@@ -49,10 +49,10 @@ /** | ||
shortName: K1, | ||
longName: K2 | ReadonlyArray<K2>, | ||
longName: K2 | readonly K2[], | ||
): Argv<T & { [key in K2]: T[K1] }>; | ||
alias<K1 extends keyof T, K2 extends string>( | ||
shortName: K2, | ||
longName: K1 | ReadonlyArray<K1>, | ||
longName: K1 | readonly K1[], | ||
): Argv<T & { [key in K2]: T[K1] }>; | ||
alias(shortName: string | ReadonlyArray<string>, longName: string | ReadonlyArray<string>): Argv<T>; | ||
alias(aliases: { [shortName: string]: string | ReadonlyArray<string> }): Argv<T>; | ||
alias(shortName: string | readonly string[], longName: string | readonly string[]): Argv<T>; | ||
alias(aliases: { [shortName: string]: string | readonly string[] }): Argv<T>; | ||
@@ -81,5 +81,5 @@ /** | ||
*/ | ||
array<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToArray<T[key]> }>; | ||
array<K extends keyof T>(key: K | readonly K[]): Argv<Omit<T, K> & { [key in K]: ToArray<T[key]> }>; | ||
array<K extends string>( | ||
key: K | ReadonlyArray<K>, | ||
key: K | readonly K[], | ||
): Argv<T & { [key in K]: Array<string | number> | undefined }>; | ||
@@ -94,4 +94,4 @@ | ||
*/ | ||
boolean<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: boolean | undefined }>; | ||
boolean<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: boolean | undefined }>; | ||
boolean<K extends keyof T>(key: K | readonly K[]): Argv<Omit<T, K> & { [key in K]: boolean | undefined }>; | ||
boolean<K extends string>(key: K | readonly K[]): Argv<T & { [key in K]: boolean | undefined }>; | ||
@@ -115,11 +115,11 @@ /** | ||
*/ | ||
choices<K extends keyof T, C extends ReadonlyArray<any>>( | ||
choices<K extends keyof T, C extends readonly any[]>( | ||
key: K, | ||
values: C, | ||
): Argv<Omit<T, K> & { [key in K]: C[number] | undefined }>; | ||
choices<K extends string, C extends ReadonlyArray<any>>( | ||
choices<K extends string, C extends readonly any[]>( | ||
key: K, | ||
values: C, | ||
): Argv<T & { [key in K]: C[number] | undefined }>; | ||
choices<C extends { [key: string]: ReadonlyArray<any> }>( | ||
choices<C extends { [key: string]: readonly any[] }>( | ||
choices: C, | ||
@@ -145,7 +145,7 @@ ): Argv<Omit<T, keyof C> & { [key in keyof C]: C[key][number] | undefined }>; | ||
coerce<K extends keyof T, V>( | ||
key: K | ReadonlyArray<K>, | ||
key: K | readonly K[], | ||
func: (arg: any) => V, | ||
): Argv<Omit<T, K> & { [key in K]: V | undefined }>; | ||
coerce<K extends string, V>( | ||
key: K | ReadonlyArray<K>, | ||
key: K | readonly K[], | ||
func: (arg: any) => V, | ||
@@ -169,3 +169,3 @@ ): Argv<T & { [key in K]: V | undefined }>; | ||
command<U = T>( | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
description: string, | ||
@@ -178,3 +178,3 @@ builder?: BuilderCallback<T, U>, | ||
command<O extends { [key: string]: Options }>( | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
description: string, | ||
@@ -187,3 +187,3 @@ builder?: O, | ||
command<U = any>( // eslint-disable-line @definitelytyped/no-unnecessary-generics | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
description: string, | ||
@@ -193,3 +193,3 @@ module: CommandModule<T, U>, | ||
command<U = T>( | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
showInHelp: false, | ||
@@ -202,3 +202,3 @@ builder?: BuilderCallback<T, U>, | ||
command<O extends { [key: string]: Options }>( | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
showInHelp: false, | ||
@@ -209,3 +209,3 @@ builder?: O, | ||
command<U = any>( // eslint-disable-line @definitelytyped/no-unnecessary-generics | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
showInHelp: false, | ||
@@ -255,7 +255,7 @@ module: CommandModule<T, U>, | ||
config( | ||
key: string | ReadonlyArray<string>, | ||
key: string | readonly string[], | ||
description?: string, | ||
parseFn?: (configPath: string) => object, | ||
): Argv<T>; | ||
config(key: string | ReadonlyArray<string>, parseFn: (configPath: string) => object): Argv<T>; | ||
config(key: string | readonly string[], parseFn: (configPath: string) => object): Argv<T>; | ||
config(explicitConfigurationObject: object): Argv<T>; | ||
@@ -268,4 +268,4 @@ | ||
*/ | ||
conflicts(key: string, value: string | ReadonlyArray<string>): Argv<T>; | ||
conflicts(conflicts: { [key: string]: string | ReadonlyArray<string> }): Argv<T>; | ||
conflicts(key: string, value: string | readonly string[]): Argv<T>; | ||
conflicts(conflicts: { [key: string]: string | readonly string[] }): Argv<T>; | ||
@@ -275,4 +275,4 @@ /** | ||
*/ | ||
count<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: number }>; | ||
count<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number }>; | ||
count<K extends keyof T>(key: K | readonly K[]): Argv<Omit<T, K> & { [key in K]: number }>; | ||
count<K extends string>(key: K | readonly K[]): Argv<T & { [key in K]: number }>; | ||
@@ -296,5 +296,5 @@ /** | ||
*/ | ||
demand<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>; | ||
demand<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>; | ||
demand(key: string | ReadonlyArray<string>, required?: boolean): Argv<T>; | ||
demand<K extends keyof T>(key: K | readonly K[], msg?: string | true): Argv<Defined<T, K>>; | ||
demand<K extends string>(key: K | readonly K[], msg?: string | true): Argv<T & { [key in K]: unknown }>; | ||
demand(key: string | readonly string[], required?: boolean): Argv<T>; | ||
demand(positionals: number, msg: string): Argv<T>; | ||
@@ -310,8 +310,8 @@ demand(positionals: number, required?: boolean): Argv<T>; | ||
*/ | ||
demandOption<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>; | ||
demandOption<K extends keyof T>(key: K | readonly K[], msg?: string | true): Argv<Defined<T, K>>; | ||
demandOption<K extends string>( | ||
key: K | ReadonlyArray<K>, | ||
key: K | readonly K[], | ||
msg?: string | true, | ||
): Argv<T & { [key in K]: unknown }>; | ||
demandOption(key: string | ReadonlyArray<string>, demand?: boolean): Argv<T>; | ||
demandOption(key: string | readonly string[], demand?: boolean): Argv<T>; | ||
@@ -336,3 +336,3 @@ /** | ||
*/ | ||
describe(key: string | ReadonlyArray<string>, description: string): Argv<T>; | ||
describe(key: string | readonly string[], description: string): Argv<T>; | ||
describe(descriptions: { [key: string]: string }): Argv<T>; | ||
@@ -396,6 +396,6 @@ | ||
getCompletion( | ||
args: ReadonlyArray<string>, | ||
done: (err: Error | null, completions: ReadonlyArray<string>) => void, | ||
args: readonly string[], | ||
done: (err: Error | null, completions: readonly string[]) => void, | ||
): Argv<T>; | ||
getCompletion(args: ReadonlyArray<string>, done?: never): Promise<ReadonlyArray<string>>; | ||
getCompletion(args: readonly string[], done?: never): Promise<readonly string[]>; | ||
@@ -412,6 +412,6 @@ /** | ||
*/ | ||
global(key: string | ReadonlyArray<string>): Argv<T>; | ||
global(key: string | readonly string[]): Argv<T>; | ||
/** Given a key, or an array of keys, places options under an alternative heading when displaying usage instructions */ | ||
group(key: string | ReadonlyArray<string>, groupName: string): Argv<T>; | ||
group(key: string | readonly string[], groupName: string): Argv<T>; | ||
@@ -444,4 +444,4 @@ /** Hides a key from the generated usage information. Unless a `--show-hidden` option is also passed with `--help` (see `showHidden()`). */ | ||
*/ | ||
implies(key: string, value: string | ReadonlyArray<string>): Argv<T>; | ||
implies(implies: { [key: string]: string | ReadonlyArray<string> }): Argv<T>; | ||
implies(key: string, value: string | readonly string[]): Argv<T>; | ||
implies(implies: { [key: string]: string | readonly string[] }): Argv<T>; | ||
@@ -479,4 +479,4 @@ /** | ||
/** The key provided represents a path and should have `path.normalize()` applied. */ | ||
normalize<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>; | ||
normalize<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>; | ||
normalize<K extends keyof T>(key: K | readonly K[]): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>; | ||
normalize<K extends string>(key: K | readonly K[]): Argv<T & { [key in K]: string | undefined }>; | ||
@@ -494,4 +494,4 @@ /** | ||
*/ | ||
number<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToNumber<T[key]> }>; | ||
number<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number | undefined }>; | ||
number<K extends keyof T>(key: K | readonly K[]): Argv<Omit<T, K> & { [key in K]: ToNumber<T[key]> }>; | ||
number<K extends string>(key: K | readonly K[]): Argv<T & { [key in K]: number | undefined }>; | ||
@@ -544,3 +544,3 @@ /** | ||
parse( | ||
arg: string | ReadonlyArray<string>, | ||
arg: string | readonly string[], | ||
context?: object, | ||
@@ -553,3 +553,3 @@ parseCallback?: ParseCallback<T>, | ||
parseSync( | ||
arg: string | ReadonlyArray<string>, | ||
arg: string | readonly string[], | ||
context?: object, | ||
@@ -560,3 +560,3 @@ parseCallback?: ParseCallback<T>, | ||
parseAsync( | ||
arg: string | ReadonlyArray<string>, | ||
arg: string | readonly string[], | ||
context?: object, | ||
@@ -580,3 +580,3 @@ parseCallback?: ParseCallback<T>, | ||
*/ | ||
pkgConf(key: string | ReadonlyArray<string>, cwd?: string): Argv<T>; | ||
pkgConf(key: string | readonly string[], cwd?: string): Argv<T>; | ||
@@ -603,7 +603,7 @@ /** | ||
*/ | ||
require<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>; | ||
require<K extends keyof T>(key: K | readonly K[], msg?: string | true): Argv<Defined<T, K>>; | ||
require(key: string, msg: string): Argv<T>; | ||
require(key: string, required: boolean): Argv<T>; | ||
require(keys: ReadonlyArray<number>, msg: string): Argv<T>; | ||
require(keys: ReadonlyArray<number>, required: boolean): Argv<T>; | ||
require(keys: readonly number[], msg: string): Argv<T>; | ||
require(keys: readonly number[], required: boolean): Argv<T>; | ||
require(positionals: number, required: boolean): Argv<T>; | ||
@@ -616,11 +616,11 @@ require(positionals: number, msg: string): Argv<T>; | ||
*/ | ||
required<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>; | ||
required<K extends keyof T>(key: K | readonly K[], msg?: string | true): Argv<Defined<T, K>>; | ||
required(key: string, msg: string): Argv<T>; | ||
required(key: string, required: boolean): Argv<T>; | ||
required(keys: ReadonlyArray<number>, msg: string): Argv<T>; | ||
required(keys: ReadonlyArray<number>, required: boolean): Argv<T>; | ||
required(keys: readonly number[], msg: string): Argv<T>; | ||
required(keys: readonly number[], required: boolean): Argv<T>; | ||
required(positionals: number, required: boolean): Argv<T>; | ||
required(positionals: number, msg: string): Argv<T>; | ||
requiresArg(key: string | ReadonlyArray<string>): Argv<T>; | ||
requiresArg(key: string | readonly string[]): Argv<T>; | ||
@@ -672,3 +672,3 @@ /** Set the name of your script ($0). Default is the base filename executed by node (`process.argv[1]`) */ | ||
/** Specifies either a single option key (string), or an array of options. If any of the options is present, yargs validation is skipped. */ | ||
skipValidation(key: string | ReadonlyArray<string>): Argv<T>; | ||
skipValidation(key: string | readonly string[]): Argv<T>; | ||
@@ -706,4 +706,4 @@ /** | ||
*/ | ||
string<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>; | ||
string<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>; | ||
string<K extends keyof T>(key: K | readonly K[]): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>; | ||
string<K extends string>(key: K | readonly K[]): Argv<T & { [key in K]: string | undefined }>; | ||
@@ -732,3 +732,3 @@ // Intended to be used with '.wrap()' | ||
usage<U>( | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
description: string, | ||
@@ -739,3 +739,3 @@ builder?: (args: Argv<T>) => Argv<U>, | ||
usage<U>( | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
showInHelp: boolean, | ||
@@ -746,3 +746,3 @@ builder?: (args: Argv<T>) => Argv<U>, | ||
usage<O extends { [key: string]: Options }>( | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
description: string, | ||
@@ -753,3 +753,3 @@ builder?: O, | ||
usage<O extends { [key: string]: Options }>( | ||
command: string | ReadonlyArray<string>, | ||
command: string | readonly string[], | ||
showInHelp: boolean, | ||
@@ -806,3 +806,3 @@ builder?: O, | ||
/** The types of files to look for when requiring command modules. */ | ||
extensions?: ReadonlyArray<string> | undefined; | ||
extensions?: readonly string[] | undefined; | ||
/** | ||
@@ -822,3 +822,3 @@ * A synchronous function called for each command module encountered. | ||
/** string or array of strings, alias(es) for the canonical option key, see `alias()` */ | ||
alias?: string | ReadonlyArray<string> | undefined; | ||
alias?: string | readonly string[] | undefined; | ||
/** boolean, interpret option as an array, see `array()` */ | ||
@@ -837,3 +837,3 @@ array?: boolean | undefined; | ||
/** string or object, require certain keys not to be set, see `conflicts()` */ | ||
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> } | undefined; | ||
conflicts?: string | readonly string[] | { [key: string]: string | readonly string[] } | undefined; | ||
/** boolean, interpret option as a count of boolean flags, see `count()` */ | ||
@@ -869,3 +869,3 @@ count?: boolean | undefined; | ||
/** string or object, require certain keys to be set, see `implies()` */ | ||
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> } | undefined; | ||
implies?: string | readonly string[] | { [key: string]: string | readonly string[] } | undefined; | ||
/** number, specify how many arguments should be consumed for the option, see `nargs()` */ | ||
@@ -898,3 +898,3 @@ nargs?: number | undefined; | ||
/** string or array of strings, see `alias()` */ | ||
alias?: string | ReadonlyArray<string> | undefined; | ||
alias?: string | readonly string[] | undefined; | ||
/** boolean, interpret option as an array, see `array()` */ | ||
@@ -907,3 +907,3 @@ array?: boolean | undefined; | ||
/** string or object, require certain keys not to be set, see `conflicts()` */ | ||
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> } | undefined; | ||
conflicts?: string | readonly string[] | { [key: string]: string | readonly string[] } | undefined; | ||
/** value, set a default value for the option, see `default()` */ | ||
@@ -920,3 +920,3 @@ default?: any; | ||
/** string or object, require certain keys to be set, see `implies()` */ | ||
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> } | undefined; | ||
implies?: string | readonly string[] | { [key: string]: string | readonly string[] } | undefined; | ||
/** boolean, apply path.normalize() to the option, see normalize() */ | ||
@@ -1031,7 +1031,7 @@ normalize?: boolean | undefined; | ||
/** array of strings (or a single string) representing aliases of `exports.command`, positional args defined in an alias are ignored */ | ||
aliases?: ReadonlyArray<string> | string | undefined; | ||
aliases?: readonly string[] | string | undefined; | ||
/** object declaring the options the command accepts, or a function accepting and returning a yargs instance */ | ||
builder?: CommandBuilder<T, U> | undefined; | ||
/** string (or array of strings) that executes this command when given on the command line, first string may contain positional args */ | ||
command?: ReadonlyArray<string> | string | undefined; | ||
command?: readonly string[] | string | undefined; | ||
/** boolean (or string) to show deprecation notice */ | ||
@@ -1058,3 +1058,3 @@ deprecated?: boolean | string | undefined; | ||
argv: any, | ||
done: (completion: ReadonlyArray<string>) => void, | ||
done: (completion: readonly string[]) => void, | ||
) => void; | ||
@@ -1061,0 +1061,0 @@ type PromiseCompletionFunction = (current: string, argv: any) => Promise<string[]>; |
{ | ||
"name": "@types/yargs", | ||
"version": "17.0.31", | ||
"version": "17.0.32", | ||
"description": "TypeScript definitions for yargs", | ||
@@ -85,4 +85,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs", | ||
}, | ||
"typesPublisherContentHash": "8642a52065f5623d73ae3cb486e65a9ab6bc470db4ed0d908060e600e8a56b11", | ||
"typesPublisherContentHash": "490ca9a07cb156b66b475f9dc1666bc4b4d19059bcace8f035888670f6952639", | ||
"typeScriptVersion": "4.5" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT | ||
* Last updated: Mon, 20 Nov 2023 23:36:24 GMT | ||
* Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser) | ||
@@ -14,0 +14,0 @@ |
@@ -6,5 +6,5 @@ import { Argv } from "."; | ||
declare function Yargs( | ||
processArgs?: ReadonlyArray<string> | string, | ||
processArgs?: readonly string[] | string, | ||
cwd?: string, | ||
parentRequire?: NodeRequire, | ||
): Argv; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60158