@types/yargs
Advanced tools
Comparing version 12.0.12 to 12.0.13
@@ -10,2 +10,3 @@ // Type definitions for yargs 12.0 | ||
// Emily Marigold Klassen <https://github.com/forivall> | ||
// ExE Boss <https://github.com/ExE-Boss> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -29,8 +30,12 @@ // TypeScript Version: 3.0 | ||
declare namespace yargs { | ||
// The type parameter T is the expected shape of the parsed options. | ||
// Arguments<T> is those options plus _ and $0, and an indexer falling | ||
// back to unknown for unknown options. | ||
// | ||
// For the return type / argv property, we create a mapped type over | ||
// Arguments<T> to simplify the inferred type signature in client code. | ||
type BuilderCallback<T, R> = ((args: Argv<T>) => Argv<R>) | ((args: Argv<T>) => void); | ||
/** | ||
* The type parameter `T` is the expected shape of the parsed options. | ||
* `Arguments<T>` is those options plus `_` and `$0`, and an indexer falling | ||
* back to `unknown` for unknown options. | ||
* | ||
* For the return type / `argv` property, we create a mapped type over | ||
* `Arguments<T>` to simplify the inferred type signature in client code. | ||
*/ | ||
interface Argv<T = {}> { | ||
@@ -64,6 +69,17 @@ (): { [key in keyof Arguments<T>]: Arguments<T>[key] }; | ||
command<U>(command: string | ReadonlyArray<string>, description: string, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>; | ||
/** | ||
* Define the commands exposed by your application. | ||
* @param command Should be a string representing the command or an array of strings representing the command and its aliases. | ||
* @param description Use to provide a description for each command your application accepts (the values stored in `argv._`). | ||
* Set `description` to false to create a hidden command. Hidden commands don't show up in the help output and aren't available for completion. | ||
* @param [builder] Object to give hints about the options that your command accepts. | ||
* Can also be a function. This function is executed with a yargs instance, and can be used to provide advanced command specific help. | ||
* | ||
* Note that when `void` is returned, the handler `argv` object type will not include command-specific arguments. | ||
* @param [handler] Function, which will be executed with the parsed `argv` object. | ||
*/ | ||
command<U = T>(command: string | ReadonlyArray<string>, description: string, builder?: BuilderCallback<T, U>, handler?: (args: Arguments<U>) => void): Argv<T>; | ||
command<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, description: string, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>; | ||
command<U>(command: string | ReadonlyArray<string>, description: string, module: CommandModule<T, U>): Argv<U>; | ||
command<U>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>; | ||
command<U = T>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: BuilderCallback<T, U>, handler?: (args: Arguments<U>) => void): Argv<T>; | ||
command<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>; | ||
@@ -70,0 +86,0 @@ command<U>(command: string | ReadonlyArray<string>, showInHelp: false, module: CommandModule<T, U>): Argv<U>; |
{ | ||
"name": "@types/yargs", | ||
"version": "12.0.12", | ||
"version": "12.0.13", | ||
"description": "TypeScript definitions for yargs", | ||
@@ -41,2 +41,7 @@ "license": "MIT", | ||
"githubUsername": "forivall" | ||
}, | ||
{ | ||
"name": "ExE Boss", | ||
"url": "https://github.com/ExE-Boss", | ||
"githubUsername": "ExE-Boss" | ||
} | ||
@@ -53,4 +58,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "797da61a576678d4a7247c12796a39175a72c67c12a6b2e34a47306ad6c42cdf", | ||
"typesPublisherContentHash": "ea9855e5c1ba05db1ffd4d41938348cfcfe0c40fa527d651521a4ca7ff4b0946", | ||
"typeScriptVersion": "3.0" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for yargs ( https://github.com/chevex/yargs ). | ||
This package contains type definitions for yargs (https://github.com/chevex/yargs). | ||
@@ -12,3 +12,3 @@ # Details | ||
Additional Details | ||
* Last updated: Mon, 08 Apr 2019 01:51:31 GMT | ||
* Last updated: Wed, 25 Sep 2019 16:10:32 GMT | ||
* Dependencies: none | ||
@@ -18,2 +18,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Martin Poelstra <https://github.com/poelstra>, Mizunashi Mana <https://github.com/mizunashi-mana>, Jeffery Grajkowski <https://github.com/pushplay>, Jeff Kenney <https://github.com/jeffkenney>, Jimi (Dimitris) Charalampidis <https://github.com/JimiC>, Steffen Viken Valvåg <https://github.com/steffenvv>, Emily Marigold Klassen <https://github.com/forivall>. | ||
These definitions were written by Martin Poelstra <https://github.com/poelstra>, Mizunashi Mana <https://github.com/mizunashi-mana>, Jeffery Grajkowski <https://github.com/pushplay>, Jeff Kenney <https://github.com/jeffkenney>, Jimi (Dimitris) Charalampidis <https://github.com/JimiC>, Steffen Viken Valvåg <https://github.com/steffenvv>, Emily Marigold Klassen <https://github.com/forivall>, and ExE Boss <https://github.com/ExE-Boss>. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
26786
365
0