| 51 | outputText!: string; |
| 52 | |
| 53 | constructor(opts: TextPromptOptions) { |
| 54 | super(opts); |
| 55 | this.transform = { render: (v) => v, scale: 1 }; |
| 56 | this.label = opts.label; |
| 57 | this.scale = this.transform.scale; |
| 58 | this.msg = opts.message; |
| 59 | this.hint = opts.hint; |
| 60 | this.initial = opts.initial || ""; |
| 61 | this.validator = opts.validate || (() => true); |
| 62 | this.value = ""; |
| 63 | this.errorMsg = opts.error || "Please enter a valid value"; |
| 64 | this.cursor = Number(!!this.initial); |
| 65 | this.cursorOffset = 0; |
| 66 | this.clear = clear(``, this.out.columns); |
| 67 | this.render(); |
| 68 | } |
| 69 | |
| 70 | get type() { |
| 71 | return "text" as const; |