/** The widget union the dynamic form/detail renderers understand (superset). */ export type DynamicFieldType = "text" | "password" | "textarea" | "number" | "email" | "phone" | "date" | "select" | "combobox" | "radio" | "checkbox" | "switch" | "currency"; export type DynamicFieldOption = { label: string; value: string; }; export type DynamicFieldValidation = { min?: number; max?: number; minLength?: number; maxLength?: number; pattern?: string; }; export type DynamicFieldSchema = { name: string; label: string; type: DynamicFieldType; required?: boolean; description?: string; placeholder?: string; defaultValue?: unknown; options?: DynamicFieldOption[]; validation?: DynamicFieldValidation; section?: string; }; /** Narrows the legal widget set for a value type V (boolean → toggle, Money → currency). */ type FieldTypeForValue = [NonNullable] extends [string] ? "text" | "password" | "textarea" | "email" | "phone" | "date" | "select" | "combobox" | "radio" : [NonNullable] extends [number] ? "number" : [NonNullable] extends [boolean] ? "checkbox" | "switch" : [NonNullable] extends [{ amount: number; currency: string; }] ? "currency" : DynamicFieldType; /** A form-field schema whose `name`/`type` are checked against the input type T. */ export type TypedDynamicFieldSchema = Omit & { name: keyof T & string; type: FieldTypeForValue; /** * The generated options export this enum field renders (e.g. "projectStatusOptions"). * A non-translating passthrough from the domain definition — carried on the built * schema so the i18n post-process can derive the shared enum namespace key * (strip a trailing "Options"). `undefined` for non-enum fields. */ optionsKey?: string; }; export type TypedDetailFieldSchema = Pick, "name" | "label" | "type" | "section" | "options" | "optionsKey"> & { copyable?: boolean; }; export {}; //# sourceMappingURL=field.d.ts.map