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

3.0.32 • Public • Published

Installation

npm install --save @types/nopt

Summary

This package contains type definitions for nopt (https://github.com/npm/nopt).

Details

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

index.d.ts

interface CommandData {
    [key: string]: string;
}

interface TypeDefs {
    [key: string]: TypeInfo;
}

interface TypeInfo {
    type: Object;
    validate: (data: CommandData, k: string, val: string) => boolean;
}

declare namespace nopt {
    export function clean(data: CommandData, types: FlagTypeMap, typeDefs?: TypeDefs): string;
    export var typeDefs: TypeDefs;
}

interface FlagTypeMap {
    [k: string]: Object;
}

interface ShortFlags {
    [k: string]: string[] | string;
}

declare function nopt(types: FlagTypeMap, shorthands?: ShortFlags, args?: string[], slice?: number): OptionsParsed;

interface OptionsParsed {
    [k: string]: any;
    argv: {
        remain: string[];
        cooked: string[];
        original: string[];
    };
}

export = nopt;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by jbondc.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/nopt

Weekly Downloads

19,686

Version

3.0.32

License

MIT

Unpacked Size

4.01 kB

Total Files

5

Last publish

Collaborators

  • types