console-app/lib/Sources/Interactive/PathCustomPrompt.ts
2020-06-16 12:52:41 +02:00

26 lines
457 B
TypeScript

import { Prompt } from 'enquirer';
export class PathPrompt extends Prompt {
private _index = 0;
private _value = '';
public constructor (options:Record<string, unknown> = {}) {
super (options);
}
public up (): void {
this._index--;
this.render ();
}
public down (): void {
this._index++;
this.render ();
}
public render (): void {
this.clear ();
this.write (`${this.state.message}: ${this._value}`);
}
}