import { type UpdateMap } from "react-elmish"; import { type Model } from "../Form/shared"; import { type ValidationError, type ValidationKey } from "../Validation"; import { type FormMapOptions, type Message, type Msg as MsgObject } from "./shared"; interface FormMap { /** * Initializes the Form model. */ init: (props: TProps) => Model; /** * Update map for the Form. */ updateMap: UpdateMap & TModel, Message>; /** * Object to call Form messages. */ Msg: MsgObject; /** * Gets a validation error for a key. * @param key The key of the error to get. * @param errors The list of errors. * @returns The error for the given key, or null if there is no error. */ getError: (key: TValidationKeys, errors: ValidationError[]) => string | null; } /** * Creates a Form object. * @param options Options to pass to the Form. * @returns The created Form object. */ declare function createFormMap(options: FormMapOptions): FormMap; export type { FormMapOptions, Message } from "./shared"; export type { FormMap }; export { createFormMap };