Skip to content

Commit

Permalink
Refactor prompt methods for better encapsulation and readability
Browse files Browse the repository at this point in the history
- Update prompt and start methods to be public for better access
- Improve method signatures for clarity and consistency

Generated by gpt-3.5-turbo
  • Loading branch information
joone committed Mar 16, 2024
1 parent 2e6913a commit 731a37d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/prompt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class CommandLinePrompt implements PromptInterface {
private callback: (input: string) => Promise<void>;
private timer: any;

prompt() {
public prompt(): void {
this.rl.prompt();
}

Expand All @@ -22,7 +22,7 @@ export class CommandLinePrompt implements PromptInterface {
});
}

async start(blinking?: boolean) {
public async start(blinking?: boolean): Promise<void> {
// Set the prompt to display before each input
this.rl.setPrompt("> ");

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 731a37d

Please sign in to comment.