MCPcopy
hub / github.com/bombshell-dev/clack / PromptOptions

Interface PromptOptions

packages/core/src/prompts/prompt.ts:19–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17import { runValidation } from '../utils/validation.js';
18
19export 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
35export default class Prompt<TValue> {
36 protected input: Readable;

Callers

nothing calls this directly

Implementers 1

Promptpackages/core/src/prompts/prompt.ts

Calls

no outgoing calls

Tested by

no test coverage detected