index.d.ts 958 B

12345678910111213141516171819202122232425
  1. import * as React from 'react';
  2. import type { FormRef, FormInstance } from './interface';
  3. import Field from './Field';
  4. import List from './List';
  5. import useForm from './useForm';
  6. import type { FormProps } from './Form';
  7. import { FormProvider } from './FormContext';
  8. import FieldContext from './FieldContext';
  9. import ListContext from './ListContext';
  10. import useWatch from './useWatch';
  11. declare const InternalForm: <Values = any>(props: FormProps<Values> & {
  12. ref?: React.Ref<FormRef<Values>>;
  13. }) => React.ReactElement;
  14. type InternalFormType = typeof InternalForm;
  15. interface RefFormType extends InternalFormType {
  16. FormProvider: typeof FormProvider;
  17. Field: typeof Field;
  18. List: typeof List;
  19. useForm: typeof useForm;
  20. useWatch: typeof useWatch;
  21. }
  22. declare const RefForm: RefFormType;
  23. export { Field, List, useForm, FormProvider, FieldContext, ListContext, useWatch };
  24. export type { FormProps, FormInstance, FormRef };
  25. export default RefForm;