UNPKG

932 BTypeScriptView Raw
1/// <reference types="node" />
2
3import { Duplex } from "stream";
4
5declare namespace MuteStream {
6 interface Options {
7 /**
8 * Set to a string to replace each character with the specified string when muted.
9 * (So you can show **** instead of the password, for example.)
10 */
11 replace?: string | undefined;
12
13 /**
14 * If you are using a replacement char, and also using a prompt with a readline stream
15 * (as for a Password: ***** input), then specify what the prompt is so that backspace
16 * will work properly. Otherwise, pressing backspace will overwrite the prompt with the
17 * replacement character, which is weird.
18 */
19 prompt?: string | undefined;
20 }
21}
22
23declare class MuteStream extends Duplex {
24 constructor(options?: MuteStream.Options);
25 mute: () => void;
26 unmute: () => void;
27 isTTY: boolean;
28}
29
30export = MuteStream;