import type { Conditional, FormSpec, Group, MetadataPolicyInput, Predicate } from "@formspec/core"; import { type FieldBuilderElement, type FieldBuilderNamespace } from "./field.js"; import type { FormSpecOptions } from "./structure.js"; import { is } from "./predicate.js"; /** * A configured DSL surface with policy-aware field builders and structure helpers. * * @public */ export interface FormSpecFactory { /** Field builders scoped to the factory metadata policy. */ readonly field: FieldBuilderNamespace; /** Creates a `FormSpec` carrying the factory metadata policy. */ readonly formspec: []>(...elements: Elements) => FormSpec; /** Creates a validating `FormSpec` carrying the factory metadata policy. */ readonly formspecWithValidation: []>(options: FormSpecOptions, ...elements: Elements) => FormSpec; /** Policy-scoped re-export of `group()`. */ readonly group: []>(label: string, ...elements: Elements) => FieldBuilderElement>; /** Policy-scoped re-export of `when()`. */ readonly when: []>(predicate: Predicate, ...elements: Elements) => FieldBuilderElement>; /** Re-export of `is()`. */ readonly is: typeof is; } /** * Creates a DSL factory whose field builders and generated forms share a metadata policy. * * @public */ export declare function createFormSpecFactory(options?: { readonly metadata?: Policy; }): FormSpecFactory; //# sourceMappingURL=factory.d.ts.map