UNPKG

@conform-to/yup

Version:

Conform helpers for integrating with yup

12 lines (11 loc) 640 B
import { type Intent, type Submission } from '@conform-to/dom'; import * as yup from 'yup'; export { getYupConstraint } from './constraint'; export declare function parseWithYup<Schema extends yup.AnyObjectSchema>(payload: FormData | URLSearchParams, config: { schema: Schema | ((intent: Intent | null) => Schema); async?: false; }): Submission<yup.InferType<Schema>, string[]>; export declare function parseWithYup<Schema extends yup.AnyObjectSchema>(payload: FormData | URLSearchParams, config: { schema: Schema | ((intent: Intent | null) => Schema); async: true; }): Promise<Submission<yup.InferType<Schema>, string[]>>;