dimah-formv0.6.1
Reference

Configuration

Options for dimahForm(), createFormClient(), useFormResponse, and ResponseStore.

dimahForm()

database is required. @dimah-form/db is not — memoryAdapter() ships in @dimah-form/server.

import type { DimahFormConfig } from "@dimah-form/server";

Prop

Type

guard

import type { DimahFormGuardContext } from "@dimah-form/server";

Prop

Type

hooks

on* runs after validation and before the write. after* runs after persist — keep side effects there.

import type { DimahFormHooks } from "@dimah-form/server";

Prop

Type

plugins

Plugins are additive: endpoints, hooks, field types, error codes, namespaced metadata, and validation. Persistence remains the database adapter. definePlugin() preserves endpoint names on form.api; a browser companion uses defineClientPlugin() and is never inferred from the server instance.

import type { DimahFormPlugin } from "@dimah-form/server";

Prop

Type

createFormClient()

import type { CreateFormClientOptions } from "@dimah-form/react";

Prop

Type

Pass createFormClient<Form, typeof plugins> when you need literal plugin method names.

useFormResponse()

import type { UseFormResponseOptions } from "@dimah-form/react";

Prop

Type

Returned state and actions: React.

ResponseStore

Anything passed as database implements this. Methods may be sync or async.

import type { ResponseStore } from "@dimah-form/server";

Prop

Type

ListResponsesStoreQuery

Prop

Type

StoreWriteOptions

Prop

Type

memoryAdapter() is an isolated in-memory store. db() from @dimah-form/db is the SQL adapter. A custom store is passed to dimahForm directly — do not wrap it in db().

The HTTP listResponses endpoint maps an omitted include to "summary". Direct ResponseStore.listResponses() calls default to "full"; custom stores must honor the explicit value they receive from the HTTP layer.

Next steps

On this page