import { z } from 'zod'; import { errors } from '../errors'; import { fmt } from '../fmt'; import { status } from '../status'; export interface ParseOptions { label?: string; context?: Record; } export interface ParseErrorArgs { issues: ReadonlyArray; input: unknown; label: string; context?: Record; cause?: unknown; formatOptions?: fmt.Options; } declare const ParseError_base: errors.TypedClass; /** * An error thrown by `zod.parse` when a value fails to parse. It retains the original * input, a human-readable label, and optional context so that callers and the status * system can render a richer failure message than a raw `ZodError`. * * Extends the typed error system in `@/errors` so callers can match against it with * `ParseError.matches(err)` rather than `instanceof`, which is robust across worker * boundaries and network hops. * * Note that `err.issues.length` and the `(N issues)` count shown in `err.message` can * differ: the message counts "leaves" after union/element flattening and * unrecognized-keys expansion, while `err.issues` exposes the original zod array * unchanged for programmatic consumers. */ export declare class ParseError extends ParseError_base implements status.Custom { readonly issues: ReadonlyArray; readonly input: unknown; readonly label: string; readonly context?: Record; constructor({ issues, input, label, context, cause, formatOptions }: ParseErrorArgs); toStatus(): Partial>; } /** * Parses `value` against `schema`. On failure, throws a `ParseError` that retains the * original input along with a human-readable label and optional context fields. The * error's `message` is a pre-formatted breakdown suitable for logs and status display. */ export declare const parse: (schema: S, value: unknown, options?: ParseOptions) => z.infer; export {}; //# sourceMappingURL=parse.d.ts.map