1 | interface CommandData {
|
2 | [key: string]: string;
|
3 | }
|
4 |
|
5 | interface TypeDefs {
|
6 | [key: string]: TypeInfo;
|
7 | }
|
8 |
|
9 | interface TypeInfo {
|
10 | type: Object;
|
11 | validate: (data: CommandData, k: string, val: string) => boolean;
|
12 | }
|
13 |
|
14 | declare namespace nopt {
|
15 | export function clean(data: CommandData, types: FlagTypeMap, typeDefs?: TypeDefs): string;
|
16 | export var typeDefs: TypeDefs;
|
17 | }
|
18 |
|
19 | interface FlagTypeMap {
|
20 | [k: string]: Object;
|
21 | }
|
22 |
|
23 | interface ShortFlags {
|
24 | [k: string]: string[] | string;
|
25 | }
|
26 |
|
27 | declare function nopt(types: FlagTypeMap, shorthands?: ShortFlags, args?: string[], slice?: number): OptionsParsed;
|
28 |
|
29 | interface OptionsParsed {
|
30 | [k: string]: any;
|
31 | argv: {
|
32 | remain: string[];
|
33 | cooked: string[];
|
34 | original: string[];
|
35 | };
|
36 | }
|
37 |
|
38 | export = nopt;
|