import type { SchemaBase } from './dsl.js'; import type { TableSchema } from './db.js'; /** Member table(s) keyed by role name. Array = 1:N; non-array = 1:1 extension. */ export type AggregateMember = TableSchema | TableSchema[]; /** A cross-member invariant, checked by generated repository code. */ export interface AggregateInvariant { name: string; /** Expression in the aggregate's field vocabulary (e.g. 'total == sum(items.price * items.qty)'). */ check: string; } export interface DomainAggregate extends SchemaBase { type: 'aggregate'; /** The aggregate root table. */ root: TableSchema; /** Member tables keyed by role name (e.g. 'items', 'address'). */ members: Record; /** Cross-member invariants; optional. */ invariants?: AggregateInvariant[]; /** Inter-aggregate references: only by root ID, keyed by referenced role. */ references?: Record; } export declare function defineAggregate(options: { root: TableSchema; members?: Record; invariants?: AggregateInvariant[]; references?: Record; description?: string; }): DomainAggregate;