From f485bf860eec54e3f8b2dbe8f113132d02aaf28b Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 18 Jan 2024 20:24:21 -0500 Subject: [PATCH] fix(striker-ui): move types of formik utils to type file --- striker-ui/hooks/useFormikUtils.ts | 7 ------- striker-ui/types/FormikUtils.d.ts | 12 ++++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 striker-ui/types/FormikUtils.d.ts diff --git a/striker-ui/hooks/useFormikUtils.ts b/striker-ui/hooks/useFormikUtils.ts index 29a4c69e..344b9c46 100644 --- a/striker-ui/hooks/useFormikUtils.ts +++ b/striker-ui/hooks/useFormikUtils.ts @@ -5,13 +5,6 @@ import { useCallback, useMemo } from 'react'; import debounce from '../lib/debounce'; import getFormikErrorMessages from '../lib/getFormikErrorMessages'; -type UseFormik = typeof useFormik; - -type Formik = ReturnType>; - -type FormikChangeHandler = - Formik['handleChange']; - const useFormikUtils = ( ...formikArgs: Parameters> ): { diff --git a/striker-ui/types/FormikUtils.d.ts b/striker-ui/types/FormikUtils.d.ts new file mode 100644 index 00000000..1a42e51e --- /dev/null +++ b/striker-ui/types/FormikUtils.d.ts @@ -0,0 +1,12 @@ +type FormikValues = import('formik').FormikValues; + +type UseFormik = + typeof import('formik').useFormik; + +type Formik = ReturnType>; + +type FormikChangeHandler = + Formik['handleChange']; + +type FormikSubmitHandler = + import('formik').FormikConfig['onSubmit'];