import { InternalOptionConfig } from "@cli-forge/parser"; //#region src/lib/prompt-types.d.ts /** * Static prompt configuration for an option. * - `true` — always prompt * - `string` — always prompt with this label * - `false` — never prompt */ type PromptConfig = boolean | string; /** * Full prompt configuration, including dynamic resolution. * When a function is provided, it receives accumulated args and returns * a static PromptConfig. Returning null/undefined from the callback * is treated as falsy (don't prompt). */ type PromptOptionConfig = PromptConfig | ((args: Partial) => PromptConfig | null | undefined); /** * An option that needs prompting, passed to prompt providers. */ interface PromptOption { /** The option name (key) */ name: string; /** The full option config from the parser, with resolved prompt value */ config: InternalOptionConfig & { prompt?: PromptConfig; }; } /** * A prompt provider that can fulfill missing option values interactively. */ interface PromptProvider { /** * If provided, this provider only handles options where filter returns true. * Providers without filters act as fallbacks. */ filter?: (name: string, config: InternalOptionConfig) => boolean; /** * Prompt for a single option. Called per-option if promptBatch is not defined. */ prompt?: (option: PromptOption) => Promise; /** * Prompt for multiple options at once. Preferred over prompt when available. */ promptBatch?: (options: PromptOption[]) => Promise>; } //#endregion export { PromptConfig, PromptOption, PromptOptionConfig, PromptProvider }; //# sourceMappingURL=prompt-types.d.mts.map