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