@dimah-form/core
v0.6.0
Published
Typed questionnaire protocol and fetch client shared by @dimah-form/server and @dimah-form/react
Maintainers
Readme
@dimah-form/core
Protocol, error catalog, typed fetch client, and headless fill session for dimah-form.
Install
pnpm add @dimah-form/coreMost apps should install @dimah-form/server and/or @dimah-form/react instead. This package is for protocol and plugin authors, and for shared isomorphic modules such as defineFieldType catalogs used on both the server and the browser.
createFormClient<typeof form>({ fieldTypes }) copies server $Infer onto the client. $Infer is type-only — pass fieldTypes or defineClientPlugin({ fieldTypes }) for local session validation. $Infer.answers matches stored payloads: required keys present, optional keys omitted (including required fields with showWhen). createFormClient({ plugins }) merges defineClientPlugin endpoints, field types, and validateAnswers. createDefineForm({ fieldTypes, plugins }) is type-only authoring (plugin $Meta + field types). Pass forms / fieldTypes only when you do not have the server instance type.
License
MIT
