Description
I am coming from superforms V1 and have done most changes with no problems, but I used to reference a ZodValidation type that seems to be hidden now.
V1 Code was:
import type { Message } from '$lib/superform';
import type { z, AnyZodObject } from 'zod';
import type { ZodValidation, FormPathLeaves } from 'sveltekit-superforms';
import { formFieldProxy, type SuperForm } from 'sveltekit-superforms/client';
type T = $$Generic<AnyZodObject>;
export let form: SuperForm<ZodValidation<T>, Message>;
export let field: FormPathLeaves<z.infer<T>>;
export let title = field.toString();
const { value, errors, constraints } = formFieldProxy(form, field);
I looked for ZodValidation in 'sveltekit-superforms/adapters' and the zod.js does have the exportable type, but adapters is only exposing zod and zodClient.
In v2, you don't use the Zod schema type, but instead the underlying data for the schema as the type parameter. Search the migration guide for Infer and it should hopefully be clear.
Description I am coming from superforms V1 and have done most changes with no problems, but I used to reference a ZodValidation type that seems to be hidden now.
V1 Code was:
I looked for ZodValidation in 'sveltekit-superforms/adapters' and the zod.js does have the exportable type, but adapters is only exposing zod and zodClient.
How should I change my reference?