@conform-to/zod
Version:
Conform helpers for integrating with Zod
33 lines • 1.67 kB
TypeScript
import { type Intent, type Submission } from '@conform-to/dom';
import type { $ZodType, $ZodIssue, $ZodErrorMap, output, input } from 'zod/v4/core';
export declare function parseWithZod<Schema extends $ZodType>(payload: FormData | URLSearchParams, options: {
schema: Schema | ((intent: Intent | null) => Schema);
async?: false;
error?: $ZodErrorMap;
disableAutoCoercion?: boolean;
}): Submission<input<Schema>, string[], output<Schema>>;
export declare function parseWithZod<Schema extends $ZodType, FormError>(payload: FormData | URLSearchParams, options: {
schema: Schema | ((intent: Intent | null) => Schema);
async?: false;
error?: $ZodErrorMap;
formatError: (issues: Array<$ZodIssue>) => FormError;
disableAutoCoercion?: boolean;
}): Submission<input<Schema>, FormError, output<Schema>>;
export declare function parseWithZod<Schema extends $ZodType>(payload: FormData | URLSearchParams, options: {
schema: Schema | ((intent: Intent | null) => Schema);
async: true;
error?: $ZodErrorMap;
disableAutoCoercion?: boolean;
}): Promise<Submission<input<Schema>, string[], output<Schema>>>;
export declare function parseWithZod<Schema extends $ZodType, FormError>(payload: FormData | URLSearchParams, options: {
schema: Schema | ((intent: Intent | null) => Schema);
async: true;
error?: $ZodErrorMap;
formatError: (issues: Array<$ZodIssue>) => FormError;
disableAutoCoercion?: boolean;
}): Promise<Submission<input<Schema>, FormError, output<Schema>>>;
export declare const conformZodMessage: {
VALIDATION_SKIPPED: string;
VALIDATION_UNDEFINED: string;
};
//# sourceMappingURL=parse.d.ts.map