Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/yargs

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/yargs - npm Package Compare versions

Comparing version 15.0.18 to 15.0.19

136

yargs v15.0/index.d.ts

@@ -38,3 +38,3 @@ // The following TSLint rules have been disabled:

(): { [key in keyof Arguments<T>]: Arguments<T>[key] };
(args: ReadonlyArray<string>, cwd?: string): Argv<T>;
(args: readonly string[], cwd?: string): Argv<T>;

@@ -50,10 +50,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>;

@@ -80,5 +80,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 }>;

@@ -93,4 +93,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 }>;

@@ -114,11 +114,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,

@@ -144,7 +144,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,

@@ -168,3 +168,3 @@ ): Argv<T & { [key in K]: V | undefined }>;

command<U = T>(
command: string | ReadonlyArray<string>,
command: string | readonly string[],
description: string,

@@ -177,3 +177,3 @@ builder?: BuilderCallback<T, U>,

command<O extends { [key: string]: Options }>(
command: string | ReadonlyArray<string>,
command: string | readonly string[],
description: string,

@@ -185,5 +185,5 @@ builder?: O,

): Argv<T>;
command<U>(command: string | ReadonlyArray<string>, description: string, module: CommandModule<T, U>): Argv<U>;
command<U>(command: string | readonly string[], description: string, module: CommandModule<T, U>): Argv<U>;
command<U = T>(
command: string | ReadonlyArray<string>,
command: string | readonly string[],
showInHelp: false,

@@ -196,3 +196,3 @@ builder?: BuilderCallback<T, U>,

command<O extends { [key: string]: Options }>(
command: string | ReadonlyArray<string>,
command: string | readonly string[],
showInHelp: false,

@@ -202,3 +202,3 @@ builder?: O,

): Argv<T>;
command<U>(command: string | ReadonlyArray<string>, showInHelp: false, module: CommandModule<T, U>): Argv<U>;
command<U>(command: string | readonly string[], showInHelp: false, module: CommandModule<T, U>): Argv<U>;
command<U>(module: CommandModule<T, U>): Argv<U>;

@@ -240,7 +240,7 @@

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>;

@@ -253,4 +253,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>;

@@ -260,4 +260,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 }>;

@@ -281,5 +281,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>;

@@ -295,8 +295,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>;

@@ -321,3 +321,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>;

@@ -380,3 +380,3 @@

*/
getCompletion(args: ReadonlyArray<string>, done: (completions: ReadonlyArray<string>) => void): Argv<T>;
getCompletion(args: readonly string[], done: (completions: readonly string[]) => void): Argv<T>;

@@ -388,6 +388,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>;

@@ -420,4 +420,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>;

@@ -455,4 +455,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 }>;

@@ -470,4 +470,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 }>;

@@ -516,3 +516,3 @@ /**

parse(
arg: string | ReadonlyArray<string>,
arg: string | readonly string[],
context?: object,

@@ -536,3 +536,3 @@ parseCallback?: ParseCallback<T>,

*/
pkgConf(key: string | ReadonlyArray<string>, cwd?: string): Argv<T>;
pkgConf(key: string | readonly string[], cwd?: string): Argv<T>;

@@ -559,7 +559,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>;

@@ -572,11 +572,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>;

@@ -628,3 +628,3 @@ /**

/** 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>;

@@ -654,4 +654,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 }>;

@@ -680,3 +680,3 @@ // Intended to be used with '.wrap()'

usage<U>(
command: string | ReadonlyArray<string>,
command: string | readonly string[],
description: string,

@@ -687,3 +687,3 @@ builder?: (args: Argv<T>) => Argv<U>,

usage<U>(
command: string | ReadonlyArray<string>,
command: string | readonly string[],
showInHelp: boolean,

@@ -694,3 +694,3 @@ builder?: (args: Argv<T>) => Argv<U>,

usage<O extends { [key: string]: Options }>(
command: string | ReadonlyArray<string>,
command: string | readonly string[],
description: string,

@@ -701,3 +701,3 @@ builder?: O,

usage<O extends { [key: string]: Options }>(
command: string | ReadonlyArray<string>,
command: string | readonly string[],
showInHelp: boolean,

@@ -744,3 +744,3 @@ builder?: O,

/** The types of files to look for when requiring command modules. */
extensions?: ReadonlyArray<string> | undefined;
extensions?: readonly string[] | undefined;
/**

@@ -760,3 +760,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()` */

@@ -775,3 +775,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()` */

@@ -807,3 +807,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()` */

@@ -836,3 +836,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()` */

@@ -845,3 +845,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()` */

@@ -858,3 +858,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() */

@@ -917,7 +917,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 */

@@ -940,3 +940,3 @@ deprecated?: boolean | string | undefined;

argv: any,
done: (completion: ReadonlyArray<string>) => void,
done: (completion: readonly string[]) => void,
) => void;

@@ -943,0 +943,0 @@ type PromiseCompletionFunction = (current: string, argv: any) => Promise<string[]>;

{
"name": "@types/yargs",
"version": "15.0.18",
"version": "15.0.19",
"description": "TypeScript definitions for yargs",

@@ -60,4 +60,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs",

},
"typesPublisherContentHash": "649d51b17ba5af7e414f5962957530354f7377e0cfe8e1af4d1ff458ae147fb5",
"typesPublisherContentHash": "2320f14d0576aeec97e6b7bdfcc018edfc2a73a7d5202feab66105deee3e59f4",
"typeScriptVersion": "4.5"
}

@@ -11,3 +11,3 @@ # Installation

### Additional Details
* Last updated: Tue, 07 Nov 2023 21:36:25 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>,
processArgs?: readonly string[],
cwd?: string,
parentRequire?: NodeRequire,
): Argv;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc