import { IError, IErrorDetails } from "./constants/common-interface"; import { TValue } from "./constants/types"; import MetaFormUpdater from "./core/MetaFormUpdater"; export interface IMetaAPI { metaForm: MetaFormUpdater; /** * Get field value from default form * @param field */ getFieldValue(field: string): TValue | undefined; /** * Get field property from default form * @param field * @param property */ getFieldProperty(field: string, property: string): any; /** * Updates a field in default form * @param field * @param value */ updateField(field: string, value: TValue): void; /** * Sets field error in default form * @param field * @param error */ setFieldError(field: string, error: IError): void; /** * Get field value from specific form and section * @param formName * @param section * @param field */ getFormFieldValue(formName: string, section: string, field: string): TValue | undefined; /** * Get field property from specific form and section * @param formName * @param section * @param field * @param property */ getFormFieldProperty(formName: string, section: string, field: string, property: string): any; /** * Updates a field in specific form and section * @param formName * @param section * @param field * @param value */ updateFormField(formName: string, section: string, field: string, value: TValue): void; /** * Sets field error in specific form and section * @param formName * @param section * @param field * @param error */ setFormFieldError(formName: string, section: string, field: string, error: IError): void; /** * Validates a given form and return the error details * @param formName */ validateForm(formName: string): IErrorDetails; /** * Validates the default form and return the error details */ validateDefaultForm(): IErrorDetails; } /** * API to update form data manually (indirectly from outside of forms) * @category API */ export declare const metaAPI: IMetaAPI;