fix(striker-ui): move types of formik utils to type file

main
Tsu-ba-me 11 months ago
parent aa060a3dd1
commit f485bf860e
  1. 7
      striker-ui/hooks/useFormikUtils.ts
  2. 12
      striker-ui/types/FormikUtils.d.ts

@ -5,13 +5,6 @@ import { useCallback, useMemo } from 'react';
import debounce from '../lib/debounce';
import getFormikErrorMessages from '../lib/getFormikErrorMessages';
type UseFormik<Values extends FormikValues> = typeof useFormik<Values>;
type Formik<Values extends FormikValues> = ReturnType<UseFormik<Values>>;
type FormikChangeHandler<Values extends FormikValues> =
Formik<Values>['handleChange'];
const useFormikUtils = <Values extends FormikValues = FormikValues>(
...formikArgs: Parameters<UseFormik<Values>>
): {

@ -0,0 +1,12 @@
type FormikValues = import('formik').FormikValues;
type UseFormik<Values extends FormikValues> =
typeof import('formik').useFormik<Values>;
type Formik<Values extends FormikValues> = ReturnType<UseFormik<Values>>;
type FormikChangeHandler<Values extends FormikValues> =
Formik<Values>['handleChange'];
type FormikSubmitHandler<Values extends FormikValues> =
import('formik').FormikConfig<Values>['onSubmit'];
Loading…
Cancel
Save