import { t as Result } from "./result-Dg2-rfn6.js"; import { ZodTypeAny, output } from "zod"; //#region src/validate.d.ts /** * A single formatted Zod validation issue with a dot-joined path. */ interface ZodIssue { readonly path: string; readonly message: string; } /** * Factory that converts formatted validation details into an application-specific Error. * * Receives the pre-formatted human-readable message and structured issues array * so callers can customize the Error without needing to format issues themselves. */ type ValidationErrorFactory = (details: { readonly issues: readonly ZodIssue[]; readonly message: string; }) => Error; /** * Result type for validation operations. */ type ValidationResult = Result; /** * Validate unknown input against a Zod schema. * * When validation fails, issues are automatically formatted into a human-readable * message. If a `createError` factory is provided, it receives the formatted * issues and message. Otherwise, a plain `Error` with the formatted message is * returned. * * @param options - The validation options. * @param options.schema - The Zod schema to validate against. * @param options.params - The unknown value to validate. * @param options.createError - Optional factory invoked when validation fails. * @returns A Result tuple - either [Error, null] on failure or [null, T] on success. */ declare function validate({ schema, params, createError }: { readonly schema: TSchema; readonly params: unknown; readonly createError?: ValidationErrorFactory; }): ValidationResult>; //#endregion export { ValidationErrorFactory, ValidationResult, ZodIssue, validate }; //# sourceMappingURL=validate.d.ts.map