import { DeprecationWarning, ResolveOptions, ResolveResult } from "./contracts.mjs"; import { CommandSchema } from "../schema/command.mjs"; import "../schema/index.mjs"; import { ParseResult } from "../parse/index.mjs"; //#region src/core/resolve/index.d.ts /** * Resolve parsed values against a command schema. * * Low-level API: most applications should rely on `cli().run()`, `.execute()`, * or `runCommand()`, which already call {@linkcode resolve} at the right time. * Reach for this function when testing precedence rules directly or building * custom execution flows around {@linkcode CommandSchema}. * * Resolution order: * 1. CLI parsed value (from {@linkcode ParseResult}) * 2. Env variable (from {@linkcode ResolveOptions.env}, if flag declares `envVar`) * 3. Config value (from {@linkcode ResolveOptions.config}, if flag declares `configPath`) * 4. Prompt (from {@linkcode ResolveOptions.prompter}, if flag declares `prompt`) * 5. Default value (from schema) * * After resolution, validates that all required flags and args have * a value. Collects **all** validation errors before throwing, so the * user sees every missing field at once. * * @param schema - The command schema defining flags and args * @param parsed - Raw parsed values from the parser * @param options - External state for the resolution chain * @returns Fully resolved flag and arg values * @throws {@linkcode ValidationError} if any required flag or arg is missing, * or if an env/config value fails coercion * * @example * ```ts * const parsed = parse(deploy.schema, ['production']); * const resolved = await resolve(deploy.schema, parsed, { * env: { DEPLOY_REGION: 'eu' }, * }); * ``` */ declare function resolve(schema: CommandSchema, parsed: ParseResult, options?: ResolveOptions): Promise; //#endregion export { type DeprecationWarning, type ResolveOptions, type ResolveResult, resolve };