From 32ca106996a0bff57a46b57ad317ad8f29506951 Mon Sep 17 00:00:00 2001 From: Jeremy Albright <1935258+Js-Brecht@users.noreply.github.com> Date: Tue, 19 Nov 2019 13:11:58 -1000 Subject: [PATCH] Expose line/cursor properties The current "line" and "cursor" states are often necessary when developing applications that use readline for prompts. See https://github.com/nodejs/node/issues/30347 --- types/node/readline.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/node/readline.d.ts b/types/node/readline.d.ts index 6cb572e3136dd85..670040c7c0c4b5f 100644 --- a/types/node/readline.d.ts +++ b/types/node/readline.d.ts @@ -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: