trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
34 lines • 1.66 kB
TypeScript
/**
* Form Derivation — entity schema → headless FormDescriptor.
*
* The derivation is a pure function of a {@link SchemaDefinition}: every
* `PropertyValueSpecification` maps to a {@link FormFieldDescriptor} (control,
* options, validation, mode visibility), fields group into sections via the
* schema's `group` hints, and ordering follows `propertyFieldIds` (falling
* back to declaration order, title first).
*
* Nothing here touches the kernel, the graph, or a UI framework — see
* `./resolve.ts` for the graph-override path and `./ontology.ts` for the
* `trellis:Form` override entities.
*
* @module trellis/forms
*/
import type { SchemaDefinition } from '../core/ontology/types.js';
import type { FormDescriptor, FormFieldDescriptor, FormMode } from './types.js';
/** `camelCaseName` → `Camel Case Name`; `snake_case` and `kebab-case` too. */
export declare function humanize(name: string): string;
export interface DeriveFormOptions {
/** Derive for one interaction mode (default: `create`). */
mode?: FormMode;
}
export declare function deriveTypeName(schema: SchemaDefinition): string;
/**
* Derive a headless {@link FormDescriptor} from an entity schema.
*
* Pure — no kernel, no graph, no framework. For the graph-override path see
* {@link resolveFormDescriptor} in `./resolve.ts`.
*/
export declare function deriveFormDescriptor(schema: SchemaDefinition, opts?: DeriveFormOptions): FormDescriptor;
/** Derive the field descriptors for a schema across all modes (no filtering). */
export declare function deriveFormFields(schema: SchemaDefinition): FormFieldDescriptor[];
//# sourceMappingURL=derive.d.ts.map