import * as React from "react"; import {Mode} from '@smart-link/shared/react-hook-form' import {Size} from '../../interfaces' import SmartLinkFormItem from './SmartLinkFormItem'; import { GridColProps, Validator } from "./interface"; export interface SmartLinkFormMethods { handleSubmit: () => void; reset: () => void; setValues: (values: Values) => void; getData: () => Values; setValue: (name: string, value: unknown) => void; register: (name: string, rules?: Validator) => void; validate: () => Promise; } export interface SmartLinkFormProps { className?: string; criteriaMode?: 'firstError' | 'all'; children?: React.ReactNode | React.ReactNodeArray; defaultValues: Values; disabled?: boolean; layout?: 'horizontal' | 'vertical' | 'inline'; labelCol?: GridColProps & {style?: React.CSSProperties}; labelWidth?: number; requireMarker?: 'before' | 'after'; mode?: Mode; onSubmit?: (values: Values) => void reValidateMode?: Exclude; rules?: { [key in keyof Values]?: Validator }; ref?: React.Ref>; size?: Size; spacing?: number; shouldFocusError?: boolean; shouldUnregister?: boolean; wrapCol?: GridColProps & {style?: React.CSSProperties}; } export interface ISmartLinkForm { (props: SmartLinkFormProps): React.ReactElement; Item: typeof SmartLinkFormItem } declare const SmartLinkForm: ISmartLinkForm; export default SmartLinkForm