2.1.6 • Published 1 year ago

@types/yargs-interactive v2.1.6

Weekly downloads
2,598
License
MIT
Repository
github
Last release
1 year ago

Installation

npm install --save @types/yargs-interactive

Summary

This package contains type definitions for yargs-interactive (https://github.com/nanovazquez/yargs-interactive#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs-interactive.

index.d.ts

// Type definitions for yargs-interactive 2.1
// Project: https://github.com/nanovazquez/yargs-interactive#readme
// Definitions by: Nano Vazquez <https://github.com/nanovazquez>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import { Argv } from 'yargs';

declare function yargsInteractive(): yargsInteractive.Interactive;

declare namespace yargsInteractive {
    interface OptionData {
        type: 'input' | 'number' | 'confirm' | 'list' | 'rawlist' | 'expand' | 'checkbox' | 'password' | 'editor';
        describe: string;
        default?: string | number | boolean | any[] | undefined;
        prompt?: 'always' | 'never' | 'if-no-arg' | 'if-empty' | undefined;
        choices?: string[] | undefined;
    }
    interface Option {
        [key: string]: OptionData | { default: boolean };
    }
    interface Interactive extends Argv {
        usage(usage: string): Interactive;
        interactive(options: Option): Interactive;
        then(callback: (result: any) => any): Interactive;
    }
}

export = yargsInteractive;

Additional Details

  • Last updated: Thu, 23 Dec 2021 23:36:06 GMT
  • Dependencies: @types/yargs
  • Global values: none

Credits

These definitions were written by Nano Vazquez.