trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
26 lines • 1.11 kB
TypeScript
/**
* Engine schema adapters — `TrellisType` or `FormDescriptor` → `FormSchema`.
*
* @module trellis/forms/core
*/
import type { AnyType } from '../../schema/define.js';
import type { FormDescriptor } from '../types.js';
import type { FormSchema } from './types.js';
/**
* Build an engine `FormSchema` from a `defineType` handle — keeps the zod
* shape, so validation is precise (email/url/enum/length checks run).
*/
export declare function toFormSchema<T extends AnyType>(schema: T): FormSchema;
/**
* Build an engine `FormSchema` from a headless `FormDescriptor` — no zod
* shape; validation runs against lifted field metadata (required, min/max,
* pattern, lengths, select options).
*/
export declare function formSchemaFromDescriptor(descriptor: FormDescriptor): FormSchema;
/**
* Accept either input for the framework adapters — a `TrellisType` handle
* (in-process, zod validation) or a headless `FormDescriptor` (remote-safe,
* metadata validation).
*/
export declare function formSchemaFrom(input: AnyType | FormDescriptor): FormSchema;
//# sourceMappingURL=schema.d.ts.map