mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-23 01:02:54 +00:00
* feat(mz): Update to v2.7
* fix(mz): Keep support for TypeScript 2.0
* fix(mz): Add myself to the contributors list
* test(mz): Refactor tests to remove override in `.editorconfig`
* chore(mz): Remove `.editorconfig` 😡️
* fix(mz): Fix name of `dest` parameter in `fs.copyFile(…)`
* refactor(mz): Remove need for setting `"unified‑signatures": false`
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
// Modified from the node.js definitions.
|
|
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/readline.d.ts
|
|
|
|
import * as readline from "readline";
|
|
export * from "readline";
|
|
export { Completer as SyncCompleter } from "readline";
|
|
|
|
export class Interface extends readline.Interface {
|
|
question(query: string, callback: (answer: string) => void): void;
|
|
question(query: string): Promise<string>;
|
|
}
|
|
|
|
// type forwarded for backwards compatibility
|
|
export type ReadLine = Interface;
|
|
|
|
export type AsyncCompleter =
|
|
((line: string, callback: (err?: null | Error, result?: readline.CompleterResult) => void) => void) |
|
|
((line: string) => Promise<readline.CompleterResult>);
|
|
export type Completer = AsyncCompleter | readline.Completer;
|
|
|
|
export interface ReadLineOptions extends readline.ReadLineOptions {
|
|
completer?: Completer;
|
|
}
|
|
|
|
export function createInterface(
|
|
input: NodeJS.ReadableStream,
|
|
output?: NodeJS.WritableStream,
|
|
completer?: Completer,
|
|
terminal?: boolean
|
|
): Interface;
|
|
export function createInterface(options: ReadLineOptions): Interface;
|