import { IFormFields } from "@leight-core/leight"; import { FormInstance } from "antd"; import CancelablePromise from "cancelable-promise"; import { NamePath } from "rc-field-form/lib/interface"; export declare const FormUtils: { /** * Extract form fields. Promise is used to ensure all fields are in the form (in case of dynamic forms). * * @param form Antd form instance */ fields: (form: FormInstance) => CancelablePromise; /** * Returns array of [names, Field] of required fields. * * @param form Antd form instance */ required: (form: FormInstance) => CancelablePromise; /** * Try to guess if there are some missing required values on the form. * * @param form Antd form instance */ hasMissingValues: (form: FormInstance) => CancelablePromise; /** * Check if the given form has errors; also just selected fields could be checked. * * @param form Antd Form instance * @param fields Array of fields being checked (or null to check all fields) */ hasErrors: (form: FormInstance, fields?: NamePath[]) => boolean; /** * Do a check if this form button is enabled by following Form rules: * - validations of all fields must pass * * @param form Antd Form instance */ canSubmit: (form: FormInstance) => CancelablePromise; };