import { CodeGenContext } from "./context.js"; //#region src/core/codegen/emit-issue.d.ts /** Common slim slice of SlowGen + FastGen needed for issue emission. */ interface IssueGen { readonly issues: string; readonly input: string; readonly path: string; readonly ctx: CodeGenContext; readonly typeMsg?: string | undefined; } /** * `origin` as source: a bare string is a literal (`"string"`), `{ expr }` is an * expression evaluated at runtime — what a `when`-gated length/size check needs, * since zod derives its origin from the INPUT (`getLengthableOrigin`). */ type Origin = string | { expr: string; }; declare function tooSmall(g: IssueGen, minimum: string | number, origin: Origin, inclusive: boolean, options?: { exact?: boolean; input?: string; path?: string; message?: string | undefined; /** * `"tuple"` selects $ZodTuple's under-length key order — `code, minimum, * inclusive, origin` — where a check-created size issue leads with `origin`. * Same shape as its over-length sibling in {@link tooBig}. */ layout?: "tuple"; /** Emit the union-abort marker; see {@link abortsProp}. */ aborts?: boolean; }): string; declare function tooBig(g: IssueGen, maximum: string | number, origin: Origin, inclusive: boolean, options?: { exact?: boolean; input?: string; path?: string; message?: string | undefined; /** * `"tuple"` selects $ZodTuple's over-length key order — `code, maximum, * inclusive, origin` — where a check-created size issue leads with `origin`. * zod builds the tuple issue by spreading `{code, maximum, inclusive}` and * appending `origin` after `input`/`inst`, and that ordering is visible in * `ZodError.message`. */ layout?: "tuple"; /** Emit the union-abort marker; see {@link abortsProp}. */ aborts?: boolean; }): string; declare function invalidType(g: IssueGen, expected: string, options?: { input?: string; path?: string; extra?: string; message?: string | undefined; /** * Put `extra` BEFORE `code` rather than after it. $ZodCheckNumberFormat's * non-integer issue is `{expected, format, code}` while the `received` a * number/date schema adds trails `code` — two orders for one issue code, both * printed verbatim in `ZodError.message`. */ extraBeforeCode?: boolean; /** * Lead with `code` instead of `expected`. `$ZodDiscriminatedUnion`'s * non-object guard and `$ZodObject`'s absent-required-key issue * (`expected: "nonoptional"`) write the issue that way; every other schema * in zod puts `expected` first. */ codeFirst?: boolean; /** * Set to false for the one `invalid_type` zod pushes WITHOUT an `inst`: * the object's `nonoptional` issue for an absent required key, which no * schema-level `error` reaches. */ useTypeMsg?: boolean; }): string; declare function invalidFormat(g: IssueGen, format: string | { expr: string; }, options?: { input?: string; path?: string; /** * Leading `origin`, present only where zod's push carries one: * `$ZodCheckStringFormat`'s default pattern check and the regex / includes / * starts_with / ends_with checks lead with `origin: "string"`, while * `z.url()`'s own issues and every `$ZodCustomStringFormat` omit it. */ origin?: string | undefined; /** * Extra issue properties as a source fragment (`'pattern:"…"'`), emitted * right after `format` where zod writes them. Explicitly `| undefined` so a * caller can compute it conditionally: zod's `invalid_format` carries * different fields per format, and the bare-issue formats carry none. */ extra?: string | undefined; message?: string | undefined; }): string; declare function unrecognizedKeys(g: IssueGen, keysExpr: string, options?: { input?: string; path?: string; message?: string | undefined; }): string; declare function invalidValue(g: IssueGen, valuesExpr: string, options?: { input?: string; path?: string; /** * Extra issue properties as a source fragment (`'expected:"stringbool"'`), * modelled on {@link invalidFormat}'s option of the same name. Explicitly * `| undefined` so a caller can compute it conditionally: the `invalid_value` * producers do NOT agree on fields — enum and literal push only `values`, * while z.stringbool()'s codec transform also pushes * `expected: "stringbool"`, which zod's locale reads to phrase the message. */ extra?: string | undefined; message?: string | undefined; }): string; //#endregion export { invalidFormat, invalidType, invalidValue, tooBig, tooSmall, unrecognizedKeys }; //# sourceMappingURL=emit-issue.d.ts.map