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