Skip to content

Commit

Permalink
Expose line/cursor properties
Browse files Browse the repository at this point in the history
The current "line" and "cursor" states are often necessary when developing applications that use readline for prompts.

See nodejs/node#30347
  • Loading branch information
Js-Brecht authored Nov 19, 2019
1 parent 0c600dc commit 32ca106
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions types/node/readline.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ declare module "readline" {

class Interface extends events.EventEmitter {
readonly terminal: boolean;

// Need direct access to line/cursor data, for use in external processes
// see: https://github.com/nodejs/node/issues/30347
/** The current input data */
readonly line: string;
/** The current cursor position in the input line */
readonly cursor: number;

/**
* NOTE: According to the documentation:
Expand Down

0 comments on commit 32ca106

Please sign in to comment.