formik-validator-zod 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.d.ts +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ZodType } from 'zod';
|
|
2
|
+
type ParseParams = Parameters<ZodType['safeParse']>[1];
|
|
3
|
+
/**
|
|
4
|
+
* Allows you to easily use Zod schemas with the <Formik /> component `validate`
|
|
5
|
+
* prop.
|
|
6
|
+
*
|
|
7
|
+
* ```js
|
|
8
|
+
* <Formik {...} validate={withZodSchema(yourSchema)}>
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare const withZodSchema: <T>(schema: ZodType<T>, params?: ParseParams) => (values: T) => Partial<T>;
|
|
12
|
+
export {};
|