mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Fix type definition for REPL module of Node.js (#18021)
* Fix signature for repl.start() function * Complete type definition for REPLServer.context property
This commit is contained in:
3
types/node/index.d.ts
vendored
3
types/node/index.d.ts
vendored
@@ -1593,6 +1593,7 @@ declare module "repl" {
|
||||
}
|
||||
|
||||
export interface REPLServer extends readline.ReadLine {
|
||||
context: any;
|
||||
defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void;
|
||||
displayPrompt(preserveCursor?: boolean): void;
|
||||
|
||||
@@ -1627,7 +1628,7 @@ declare module "repl" {
|
||||
prependOnceListener(event: "reset", listener: (...args: any[]) => void): this;
|
||||
}
|
||||
|
||||
export function start(options: ReplOptions): REPLServer;
|
||||
export function start(options?: string | ReplOptions): REPLServer;
|
||||
}
|
||||
|
||||
declare module "readline" {
|
||||
|
||||
2
types/node/v0/index.d.ts
vendored
2
types/node/v0/index.d.ts
vendored
@@ -810,7 +810,7 @@ declare module "repl" {
|
||||
ignoreUndefined?: boolean;
|
||||
writer?: Function;
|
||||
}
|
||||
export function start(options: ReplOptions): events.EventEmitter;
|
||||
export function start(options?: string | ReplOptions): events.EventEmitter;
|
||||
}
|
||||
|
||||
declare module "readline" {
|
||||
|
||||
2
types/node/v4/index.d.ts
vendored
2
types/node/v4/index.d.ts
vendored
@@ -972,7 +972,7 @@ declare module "repl" {
|
||||
ignoreUndefined?: boolean;
|
||||
writer?: Function;
|
||||
}
|
||||
export function start(options: ReplOptions): events.EventEmitter;
|
||||
export function start(options?: string | ReplOptions): events.EventEmitter;
|
||||
}
|
||||
|
||||
declare module "readline" {
|
||||
|
||||
2
types/node/v6/index.d.ts
vendored
2
types/node/v6/index.d.ts
vendored
@@ -1420,7 +1420,7 @@ declare module "repl" {
|
||||
prependOnceListener(event: "reset", listener: Function): this;
|
||||
}
|
||||
|
||||
export function start(options: ReplOptions): REPLServer;
|
||||
export function start(options?: string | ReplOptions): REPLServer;
|
||||
}
|
||||
|
||||
declare module "readline" {
|
||||
|
||||
3
types/node/v7/index.d.ts
vendored
3
types/node/v7/index.d.ts
vendored
@@ -1448,6 +1448,7 @@ declare module "repl" {
|
||||
}
|
||||
|
||||
export interface REPLServer extends readline.ReadLine {
|
||||
context: any;
|
||||
defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void;
|
||||
displayPrompt(preserveCursor?: boolean): void;
|
||||
|
||||
@@ -1482,7 +1483,7 @@ declare module "repl" {
|
||||
prependOnceListener(event: "reset", listener: Function): this;
|
||||
}
|
||||
|
||||
export function start(options: ReplOptions): REPLServer;
|
||||
export function start(options?: string | ReplOptions): REPLServer;
|
||||
}
|
||||
|
||||
declare module "readline" {
|
||||
|
||||
Reference in New Issue
Block a user