$ cnpm install @types/yargs-parser
npm install --save @types/yargs-parser
This package contains type definitions for yargs-parser (https://github.com/yargs/yargs-parser#readme).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs-parser/v11.
// Type definitions for yargs-parser 11.0
// Project: https://github.com/yargs/yargs-parser#readme
// Definitions by: Miles Johnson <https://github.com/milesj>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare namespace yargsParser {
interface Arguments {
/** Non-option arguments */
_: string[];
/** The script name or node command */
$0: string;
/** All remaining options */
[argName: string]: any;
}
interface DetailedArguments {
argv: Arguments;
error: Error | null;
aliases: { [alias: string]: string[] };
newAliases: { [alias: string]: boolean };
configuration: Configuration;
}
interface Configuration {
'boolean-negation': boolean;
'camel-case-expansion': boolean;
'combine-arrays': boolean;
'dot-notation': boolean;
'duplicate-arguments-array': boolean;
'flatten-duplicate-arrays': boolean;
'negation-prefix': string;
'parse-numbers': boolean;
'populate--': boolean;
'set-placeholder-key': boolean;
'short-option-groups': boolean;
}
interface Options {
alias?: { [key: string]: string | string[] } | undefined;
array?: string[] | undefined;
boolean?: string[] | undefined;
config?: string | string[] | { [key: string]: boolean } | undefined;
configuration?: Partial<Configuration> | undefined;
coerce?: { [key: string]: (arg: any) => any } | undefined;
count?: string[] | undefined;
default?: { [key: string]: any } | undefined;
envPrefix?: string | undefined;
narg?: { [key: string]: number } | undefined;
normalize?: string[] | undefined;
string?: string[] | undefined;
number?: string[] | undefined;
'--'?: boolean | undefined;
}
interface Parser {
(argv: string | string[], opts?: Options): Arguments;
detailed(argv: string | string[], opts?: Options): DetailedArguments;
}
}
declare var yargsParser: yargsParser.Parser;
export = yargsParser;
These definitions were written by Miles Johnson.
Copyright 2013 - present © cnpmjs.org