/** * Consumer-neutral, data-relatable field descriptors — the canonical, * validator-agnostic authoring channel. Merged by `collection.describe()`. * * Descriptive, never prescriptive: label/semanticType/unit/sensitivity/ * aggregate/aliases/displayFor only. Layout, styling, and active-locale * selection stay app-side. * * @module */ /** Known semantic types; the union is open — unknown strings pass through. */ export type SemanticType = 'date' | 'datetime' | 'email' | 'url' | 'currency' | 'percent' | 'country' | 'vat' | 'iban' | 'entity' | (string & {}); export interface FieldMeta { /** Human label for any displayable field. Required. */ label: string; description?: string; semanticType?: SemanticType; /** Display unit, e.g. '€', '%', 'kg'. */ unit?: string; /** Data classification driving redaction/inspector masking. */ sensitivity?: 'public' | 'pii' | 'secret'; /** Default aggregation for this field. */ aggregate?: 'sum' | 'count' | 'distinct' | 'none'; /** Canonical search synonyms (data vocabulary, not UI). */ aliases?: readonly string[]; /** Entity pairing: the field holding the human label for this id (buyerId → buyerName). */ displayFor?: string; /** * Override the widget hint derived from semanticType/type. * e.g. 'textarea', 'date', 'money', 'select', 'checkbox', 'number', 'text'. * When absent, the widget is derived automatically by buildDescription. */ widget?: string; /** * Card/section grouping hint for detail & form layouts (e.g. 'Identity', * 'Amounts'). Purely descriptive metadata — consumers group; describe() * keeps emitting fields alphabetically. */ group?: string; /** Relative ordering hint within (and across) groups. Lower renders first. */ order?: number; } export declare class FieldMetaUnknownFieldError extends Error { readonly collection: string; readonly key: string; constructor(collection: string, key: string); } /** Reject fieldMeta keys that are not known fields (typo guard), fail-loud. */ export declare function validateFieldMetaKeys(collection: string, fieldMeta: Record, knownFields: ReadonlySet): void; export interface MergeInputs { channel?: FieldMeta; zodMeta?: Partial; inferred?: Partial; } export interface ResolvedMeta extends Partial { label: string; } /** camelCase / snake_case → Title Case words. */ export declare function humanizeFieldKey(key: string): string; /** Merge one field's metadata: channel > zodMeta > inferred; label always present. */ export declare function resolveFieldMeta(key: string, inputs: MergeInputs): ResolvedMeta;