From 731a37d15f43fc9912360af72f33d34217ffc07c Mon Sep 17 00:00:00 2001 From: Joone Hur Date: Sat, 16 Mar 2024 02:51:25 -0700 Subject: [PATCH] Refactor prompt methods for better encapsulation and readability - Update prompt and start methods to be public for better access - Improve method signatures for clarity and consistency Generated by gpt-3.5-turbo --- src/prompt/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/prompt/index.ts b/src/prompt/index.ts index e7f320a..12816f4 100644 --- a/src/prompt/index.ts +++ b/src/prompt/index.ts @@ -9,7 +9,7 @@ export class CommandLinePrompt implements PromptInterface { private callback: (input: string) => Promise; private timer: any; - prompt() { + public prompt(): void { this.rl.prompt(); } @@ -22,7 +22,7 @@ export class CommandLinePrompt implements PromptInterface { }); } - async start(blinking?: boolean) { + public async start(blinking?: boolean): Promise { // Set the prompt to display before each input this.rl.setPrompt("> "); @@ -55,7 +55,7 @@ export class CommandLinePrompt implements PromptInterface { }); } - exit(): void { + public exit(): void { clearInterval(this.timer); // Show the cursor process.stdout.write("\x1B[?25h"); // Show the cursor