import type { MetaRoot } from "@metaobjectsdev/metadata"; export interface RelationEntry { /** Name of the relationship (e.g., "author") */ name: string; /** Cardinality: 'one' | 'many' */ cardinality: "one" | "many"; /** The other entity's name (e.g., "User") */ targetEntity: string; /** For cardinality 'one': the field on THIS entity that holds the FK (e.g., "authorId") */ fkField?: string; /** For cardinality 'one': the target entity's PK field (e.g., "id") */ targetPkField?: string; /** * FR-018 M:N navigation fields. Present only for a many-to-many navigation (a * `@cardinality: "many"` relationship that declares `@through`). The Drizzle * relations() block emits `many()` for these; the routes file emits * a `mountM2mRoute(...)` traversal. The junction FK fields are DERIVED from the * junction entity's two `identity.reference` children (the SSOT), never * restated on the relationship. */ /** The junction/through entity name (e.g., "PostTag"). M:N entries only. */ junctionEntity?: string; /** Junction FK field holding the source-side key (logical field name, e.g. "postId"). M:N only. */ sourceJoinField?: string; /** Junction FK field holding the target-side key (logical field name, e.g. "tagId"). M:N only. */ targetJoinField?: string; /** Undirected self-join: union both junction FK columns at read time. M:N only. */ symmetric?: boolean; } /** Map from entity name → list of relations for that entity's relations() block */ export type RelationMap = Map; /** * Walk all entities, collect relationship children, and also register inverse * many() sides on the target entity. */ export declare function buildRelationMap(root: MetaRoot): RelationMap; //# sourceMappingURL=relation-resolver.d.ts.map