import { type UpdateReturnType } from "react-elmish"; import { type ValidationError, type ValidationKey } from "../Validation"; import { type Message, type Model, type Msg as MsgObject, type Options } from "./shared"; interface Form { /** * Initializes the Form model. */ init: (props: TProps) => Model; /** * Updates the Form model. */ update: (model: Model & TModel, msg: Message, props: TProps) => UpdateReturnType, 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 createForm(options: Options): Form; export type { Message, Model, Options } from "./shared"; export type { Form }; export { createForm };