forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nopt.d.ts
46 lines (36 loc) · 936 Bytes
/
nopt.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Type definitions for nopt 3.0.1
// Project: https://github.com/npm/nopt
// Definitions by: jbondc <https://github.com/jbondc>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "nopt" {
interface CommandData {
[key: string]: string
}
interface TypeDefs {
[key: string]: TypeInfo
}
interface TypeInfo {
type: Object
validate: (data: CommandData, k: string, val: string) => boolean
}
module 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
}
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
}