UNPKG

1.33 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/nopt`
3
4# Summary
5This package contains type definitions for nopt (https://github.com/npm/nopt).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nopt.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nopt/index.d.ts)
10````ts
11interface CommandData {
12 [key: string]: string;
13}
14
15interface TypeDefs {
16 [key: string]: TypeInfo;
17}
18
19interface TypeInfo {
20 type: Object;
21 validate: (data: CommandData, k: string, val: string) => boolean;
22}
23
24declare namespace nopt {
25 export function clean(data: CommandData, types: FlagTypeMap, typeDefs?: TypeDefs): string;
26 export var typeDefs: TypeDefs;
27}
28
29interface FlagTypeMap {
30 [k: string]: Object;
31}
32
33interface ShortFlags {
34 [k: string]: string[] | string;
35}
36
37declare function nopt(types: FlagTypeMap, shorthands?: ShortFlags, args?: string[], slice?: number): OptionsParsed;
38
39interface OptionsParsed {
40 [k: string]: any;
41 argv: {
42 remain: string[];
43 cooked: string[];
44 original: string[];
45 };
46}
47
48export = nopt;
49
50````
51
52### Additional Details
53 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
54 * Dependencies: none
55
56# Credits
57These definitions were written by [jbondc](https://github.com/jbondc).
58
\No newline at end of file