import { Writable } from 'svelte/store'; import { FormulaError } from './forms'; import { FormulaOptions } from './options'; /** * Internal type for object */ export declare type FormulaValue = Record; export declare type FormulaValueDefault = Record; declare type PartialFormValue = Partial>; /** * The stores available in Formula */ export interface FormulaStores { /** * A store containing the current form values */ formValues: Writable; /** * A store containing the values at the time of `
` submission */ submitValues: Writable; /** * A store containing the initial values */ initialValues: Writable; /** * A store containing the touched status of each named field */ touched: Writable>; /** * A store containing the dirty status of each named field */ dirty: Writable>; /** * A store containing the current validity of all named fields from HTML and custom validations */ validity: Writable>; /** * A store containing the current validity of all custom form validations */ formValidity: Writable>; /** * A store containing a boolean value if the form is overall valid */ isFormValid: Writable; /** * Observable value if the form state is ready to be used */ isFormReady: Writable; /** * A store containing additional field enrichment */ enrichment: Writable>; } /** * The Formula interface with stores and form factory */ export interface Formula extends FormulaStores { /** * The form object for use with the Svelte use directive * @param node */ form: (node: HTMLElement) => { destroy: () => void; }; /** * Update */ updateForm: (updatedOpts?: FormulaOptions) => void; /** * Destroy */ destroyForm: () => void; /** * Resets the form to the initial value */ resetForm: () => void; /** * Stores */ stores: FormulaStores; } export {};