UNPKG

@mitcsutt/kiln-forms

Version:

Kiln forms: typed React forms on TanStack Form, in component or JSON schema mode, rendered through kiln-ui

22 lines (21 loc) • 944 B
import { type ComponentType } from 'react'; import type { FieldRegistry } from './types.js'; /** `text` → `TextField` (`form.TextField`). */ export declare function fieldComponentName(kind: string): string; interface BoundProps extends Record<string, unknown> { name: string; validators?: unknown; listeners?: unknown; defaultValue?: unknown; asyncDebounceMs?: number; } /** * The typed-shorthand components for `api` (a form, a `withForm` form, a field group): each * renders `<api.AppField name={prefix + name}>` around the registered field (in view mode, a * read-only `ViewField` instead — no TanStack field). Each is `memo`'d, and the set is cached per * (api, registry, prefix) so identities are stable across renders and `useFields` calls. */ export declare function bindFields(api: { AppField: unknown; }, registry: FieldRegistry, prefix?: string): Record<string, ComponentType<BoundProps>>; export {};