mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* promptly: Add `replace` property inside `options` Was missing `replace`, see https://github.com/moxystudio/node-promptly * Updated promptly version
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
// Type definitions for node-promptly 3.0.3
|
|
// Project: https://github.com/IndigoUnited/node-promptly
|
|
// Definitions by: Dan Spencer <https://github.com/danrspencer>
|
|
// Alex Ilyaev <https://github.com/alexilyaev>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
///<reference types="node"/>
|
|
|
|
import stream = require('stream');
|
|
|
|
interface Callback {
|
|
(err: Error, value: string): void;
|
|
}
|
|
|
|
export interface Options {
|
|
default?: string;
|
|
trim?: boolean;
|
|
validator?: any;
|
|
retry?: boolean;
|
|
silent?: boolean;
|
|
replace?: string;
|
|
input?: NodeJS.ReadableStream;
|
|
output?: NodeJS.WritableStream;
|
|
}
|
|
|
|
export declare function prompt(message: string, fn?: Callback): any;
|
|
export declare function prompt(message: string, opts: Options, fn?: Callback): any;
|
|
|
|
export declare function password(message: string, fn?: Callback): any;
|
|
export declare function password(message: string, opts: Options, fn?: Callback): any;
|
|
|
|
export declare function confirm(message: string, fn?: Callback): any;
|
|
export declare function confirm(message: string, opts: Options, fn?: Callback): any;
|
|
|
|
export declare function choose(message: string, choices: string[], fn?: Callback): any;
|
|
export declare function choose(message: string, choices: string[], opts: Options, fn?: Callback): any;
|