| 17 | import { runValidation } from '../utils/validation.js'; |
| 18 | |
| 19 | export interface PromptOptions<TValue, Self extends Prompt<TValue>> { |
| 20 | render(this: Omit<Self, 'prompt'>): string | undefined; |
| 21 | initialValue?: any; |
| 22 | initialUserInput?: string; |
| 23 | |
| 24 | /** |
| 25 | * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema) |
| 26 | * that validates user input. If a custom function is given, you should return a `string` or `Error` |
| 27 | * to show as a validation error, or `undefined` to accept the result. |
| 28 | */ |
| 29 | validate?: Validate<TValue> | undefined; |
| 30 | input?: Readable; |
| 31 | output?: Writable; |
| 32 | signal?: AbortSignal; |
| 33 | } |
| 34 | |
| 35 | export default class Prompt<TValue> { |
| 36 | protected input: Readable; |
nothing calls this directly
no outgoing calls
no test coverage detected