mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
fix(yargs-interactive): Extend Interactive interface with yargs.Argv interface (#45831)
This commit is contained in:
parent
a7e3800d07
commit
d3facd7b56
4
types/yargs-interactive/index.d.ts
vendored
4
types/yargs-interactive/index.d.ts
vendored
@ -4,6 +4,8 @@
|
||||
// Nano Vazquez <https://github.com/nanovazquez>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Argv } from 'yargs';
|
||||
|
||||
declare function yargsInteractive(): yargsInteractive.Interactive;
|
||||
|
||||
declare namespace yargsInteractive {
|
||||
@ -17,7 +19,7 @@ declare namespace yargsInteractive {
|
||||
interface Option {
|
||||
[key: string]: OptionData | { default: boolean };
|
||||
}
|
||||
interface Interactive {
|
||||
interface Interactive extends Argv {
|
||||
usage(usage: string): Interactive;
|
||||
interactive(options: Option): Interactive;
|
||||
then(callback: (result: any) => any): Interactive;
|
||||
|
||||
@ -23,4 +23,7 @@ yargsInteractive()
|
||||
.interactive(options)
|
||||
.then((result: any) => {
|
||||
console.log(result);
|
||||
});
|
||||
})
|
||||
.demandCommand(1, 1, 'You need to specify a command before moving on')
|
||||
.help()
|
||||
.wrap(null).version;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user