import { ArgSchema } from "../schema/arg.mjs"; import { FlagSchema } from "../schema/flag.mjs"; import { ArgDiagnosticSource, FlagDiagnosticSource } from "./contracts.mjs"; import { ValidationError } from "../errors/index.mjs"; import "../schema/index.mjs"; //#region src/core/resolve/coerce.d.ts type CoerceSource = FlagDiagnosticSource; /** Discriminated result of a value coercion attempt — success with the coerced value, or failure with a structured validation error. */ type CoerceResult = { readonly ok: true; readonly value: unknown; } | { readonly ok: false; readonly error: ValidationError; }; /** Coerce a raw value from env/config/prompt into the type declared by a flag schema. */ declare function coerceValue(flagName: string, source: CoerceSource, raw: unknown, schema: FlagSchema): CoerceResult; type ArgStringSource = ArgDiagnosticSource; /** Coerce a string value from stdin/env into the type declared by an arg schema, redacting raw values in error diagnostics. */ declare function coerceArgStringValue(argName: string, source: ArgStringSource, raw: string, schema: ArgSchema): CoerceResult; //#endregion export { type CoerceResult, coerceArgStringValue, coerceValue };