Installation
npm install --save @types/promptly
Summary
This package contains type definitions for promptly (https://github.com/IndigoUnited/node-promptly).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promptly.
index.d.ts
/// <reference types="node"/>
import stream = require("stream");
interface Callback {
(err: Error, value: string): void;
}
export interface Options {
default?: string | undefined;
trim?: boolean | undefined;
validator?: any;
retry?: boolean | undefined;
silent?: boolean | undefined;
replace?: string | undefined;
input?: NodeJS.ReadableStream | undefined;
output?: NodeJS.WritableStream | undefined;
}
export declare function prompt(message: string, fn?: Callback): Promise<string>;
export declare function prompt(message: string, opts: Options, fn?: Callback): Promise<string>;
export declare function password(message: string, fn?: Callback): Promise<string>;
export declare function password(message: string, opts: Options, fn?: Callback): Promise<string>;
export declare function confirm(message: string, fn?: Callback): Promise<boolean>;
export declare function confirm(message: string, opts: Options, fn?: Callback): Promise<boolean>;
export declare function choose(message: string, choices: string[], fn?: Callback): Promise<string>;
export declare function choose(message: string, choices: string[], opts: Options, fn?: Callback): Promise<string>;
Additional Details
- Last updated: Tue, 07 Nov 2023 09:09:39 GMT
- Dependencies: @types/node
Credits
These definitions were written by Dan Spencer, and Alex Ilyaev.