//#region ../react-form/src/standard-schema/types.d.ts /** * Standard Schema V1 spec types. * * Vendored from https://standardschema.dev so the form engine can consume any * Standard-Schema-compliant validator (`@warlock.js/seal`, `zod`, `valibot`, * `arktype`, …) **without** taking a runtime dependency on any of them. We only * duck-type on the `~standard` property at runtime. */ /** The Standard Schema interface. */ interface StandardSchemaV1 { readonly "~standard": StandardSchemaV1.Props; } declare namespace StandardSchemaV1 { /** The Standard Schema properties interface. */ interface Props { /** The version number of the standard. */ readonly version: 1; /** The vendor name of the schema library. */ readonly vendor: string; /** Inferred types associated with the schema. */ readonly types?: Types | undefined; /** Validates unknown input values. */ readonly validate: (value: unknown) => Result | Promise>; } /** The result interface of the validate function. */ type Result = SuccessResult | FailureResult; /** The result interface if validation succeeds. */ interface SuccessResult { /** The typed output value. */ readonly value: Output; /** The non-existent issues. */ readonly issues?: undefined; } /** The result interface if validation fails. */ interface FailureResult { /** The issues of failed validation. */ readonly issues: ReadonlyArray; } /** The issue interface of the failure output. */ interface Issue { /** The error message of the issue. */ readonly message: string; /** The path of the issue, if any. */ readonly path?: ReadonlyArray | undefined; } /** The path segment interface of the issue. */ interface PathSegment { /** The key representing a path segment. */ readonly key: PropertyKey; } /** The Standard Schema types interface. */ interface Types { /** The input type of the schema. */ readonly input: Input; /** The output type of the schema. */ readonly output: Output; } /** Infers the input type of a Standard Schema. */ type InferInput = NonNullable["input"]; /** Infers the output type of a Standard Schema. */ type InferOutput = NonNullable["output"]; } /** * Convenience alias: infer the *output* (post-validation) shape of the values * a `
` will hand to `onSubmit`. */ type InferFormValues = StandardSchemaV1.InferOutput; /** * Convenience alias: infer the *input* (pre-validation) shape of the values a * `` collects from its controls. */ type InferFormInput = StandardSchemaV1.InferInput; //#endregion export { InferFormInput, InferFormValues, StandardSchemaV1 }; //# sourceMappingURL=types.d.mts.map