@types/argv
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

Installation

npm install --save @types/argv

Summary

This package contains type definitions for argv (https://www.npmjs.com/package/argv).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/argv.

index.d.ts

// argv module
type args = {
    targets: string[];
    options: { [key: string]: any };
};

type helpOption = {
    name: string;
    type: string;
    short?: string | undefined;
    description?: string | undefined;
    example?: string | undefined;
};

type module = {
    mod: string;
    description: string;
    options: { [key: string]: helpOption };
};

type typeFunction = (value: any, ...arglist: any[]) => any;

type argv = {
    // Runs the arguments parser
    run: (argv?: string[]) => args;

    // Adding options to definitions list
    option: (mod: helpOption | helpOption[]) => argv;

    // Creating module
    mod: (object: module | module[]) => argv;

    // Creates custom type function
    type: (name: string | { [key: string]: typeFunction }, callback?: typeFunction) => any;

    // Setting version number, and auto setting version option
    version: (v: string) => argv;

    // Description setup
    info: (mod: string, description?: module) => argv;

    // Cleans out current options
    clear: () => argv;

    // Prints out the help doc
    help: (mod?: string) => argv;
};

declare const argv: argv;

export = argv;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:04 GMT
  • Dependencies: none

Credits

These definitions were written by Hookclaw.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/argv

Weekly Downloads

1,919

Version

0.0.8

License

MIT

Unpacked Size

4.79 kB

Total Files

5

Last publish

Collaborators

  • types