forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
optimist.d.ts
53 lines (35 loc) · 1.21 KB
/
optimist.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
47
48
49
50
51
52
53
// Type definitions for optimist
// Project: https://github.com/substack/node-optimist
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// Imported from: https://github.com/soywiz/typescript-node-definitions/optimist.d.ts
declare module "optimist" {
function optimist(args: string[]): optimist.Optimist;
module optimist {
export interface Optimist {
default(name: string, value: any): Optimist;
default(args: Object): Optimist;
boolean(name: string): Optimist;
boolean(names: string[]): Optimist;
string(name: string): Optimist;
string(names: string[]): Optimist;
wrap(columns: number): Optimist;
help(): void;
showHelp(fn?: Function): void;
usage(message: string): Optimist;
demand(key: string): Optimist;
demand(key: number): Optimist;
demand(key: string[]): Optimist;
alias(key: string, alias: string): Optimist;
describe(key: string, desc: string): Optimist;
options(key: string, opt: Object): Optimist;
check(fn: Function): void;
parse(args: string[]): Optimist;
argv: Argv;
}
export interface Argv extends Object {
_: string[];
}
}
export = optimist;
}