UNPKG

757 BTypeScriptView Raw
1import * as React from 'react';
2import { FormInstance as RcFormInstance } from 'rc-field-form';
3import { ScrollOptions, NamePath, InternalNamePath } from '../interface';
4export interface FormInstance<Values = any> extends RcFormInstance<Values> {
5 scrollToField: (name: NamePath, options?: ScrollOptions) => void;
6 /** This is an internal usage. Do not use in your prod */
7 __INTERNAL__: {
8 /** No! Do not use this in your code! */
9 name?: string;
10 /** No! Do not use this in your code! */
11 itemRef: (name: InternalNamePath) => (node: React.ReactElement) => void;
12 };
13 getFieldInstance: (name: NamePath) => any;
14}
15export default function useForm<Values = any>(form?: FormInstance<Values>): [FormInstance<Values>];