import { Issue } from "@ebec/core"; import { ValidatorContext, ValidatorDescriptor } from "validup"; import { StandardSchemaV1 } from "@standard-schema/spec"; //#region src/error.d.ts /** * Translate Standard Schema issues into validup `IssueItem`s. Standard Schema * intentionally only exposes `message` + `path`; vendor-specific fields like * `expected`/`received`/`code` are not part of the spec, so the resulting * issues carry only the portable subset (`code` defaults to * `IssueCode.VALUE_INVALID`). */ declare function buildIssuesForStandardSchemaIssues(issues: ReadonlyArray): Issue[]; //#endregion //#region src/module.d.ts type StandardSchemaCreateFn = (ctx: ValidatorContext) => S; /** * Options accepted by {@link createValidator}. */ type StandardSchemaCreateValidatorOptions = { /** * Mark the resulting validator as having side effects (network * calls, sibling-field reads, observable state) so the framework * never caches its outcome. Default `false` — most Standard * Schema validators (regex / length / enum / type checks) are * deterministic and safe to cache by `(ctx.value, ctx.context, * ctx.group)`. Set to `true` for schemas that resolve against * external state. */ sideEffect?: boolean; }; /** * Wrap any Standard Schema validator (zod 3.24+, valibot, arktype, * effect-schema, …) as a validup `ValidatorDescriptor`. The schema's * `~standard.validate` method is invoked with the mounted value; on * failure, its issues are translated into validup `IssueItem`s. * * Pass a function instead of a schema to build per-context schemas * (e.g. depending on the active group, sibling values, or * `ctx.context`). * * The returned descriptor infers its `Out` type from the schema's * `StandardSchemaV1.InferOutput`, so the builder API * (`defineSchema`) picks up real per-field types from any * Standard-Schema-compatible library. Returned as a * {@link ValidatorDescriptor} so it carries the `sideEffect` flag the * validup runtime consults for its result cache. */ declare function createValidator(input: S | StandardSchemaCreateFn, options?: StandardSchemaCreateValidatorOptions): ValidatorDescriptor>; //#endregion export { StandardSchemaCreateValidatorOptions, buildIssuesForStandardSchemaIssues, createValidator }; //# sourceMappingURL=index.d.mts.map