forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
promptly.d.ts
37 lines (28 loc) · 1.19 KB
/
promptly.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
// Type definitions for node-promptly 1.1.1
// Project: https://github.com/IndigoUnited/node-promptly
// Definitions by: Dan Spencer <https://github.com/danrspencer>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///<reference path="../node/node.d.ts"/>
declare module "promptly" {
import stream = require('stream');
interface Callback {
(err: Error, value: string): void;
}
export interface Options {
default?: string;
trim?: boolean;
validator?: any;
retry?: boolean;
silent?: boolean;
input?: NodeJS.ReadableStream;
output?: NodeJS.WritableStream;
}
export function prompt(message: string, fn?: Callback):any;
export function prompt(message: string, opts: Options, fn?: Callback):any;
export function password(message: string, fn?: Callback):any;
export function password(message: string, opts: Options, fn?: Callback):any;
export function confirm(message: string, fn?: Callback):any;
export function confirm(message: string, opts: Options, fn?: Callback):any;
export function choose(message: string, choices: string[], fn?: Callback):any;
export function choose(message: string, choices: string[], opts: Options, fn?: Callback):any;
}