import type { ColumnNamingStrategy, MetaData } from "@metaobjectsdev/metadata"; import type { SelectSpec, Row } from "./persistence-driver.js"; export interface N2mDescriptor { /** Entity that declares the relationship (source of the lookup; its PK feeds sourceField). */ sourceEntityName: string; targetEntityName: string; joinEntityName: string; /** Junction FK field holding the source-side key (derived from the junction's references). */ sourceJoinField: string; /** Junction FK field holding the target-side key (derived from the junction's references). */ targetJoinField: string; /** Undirected self-join: union both junction FK columns at read time. */ symmetric: boolean; } export interface N2mLazyOutput { joinSpec: SelectSpec; /** Caller runs joinSpec, then passes the rows here to build the target spec. */ makeTargetSpec: (joinRows: Row[]) => SelectSpec | null; } export type N2mBatchOutput = N2mLazyOutput; /** Returns null if the named relationship is not M:N — caller should try resolveRelationDescriptor. */ export declare function resolveN2mDescriptor(sourceEntity: MetaData, relationName: string, root: MetaData): N2mDescriptor | null; export declare function buildN2mLazySpecs(desc: N2mDescriptor, sourceRecord: Row, root: MetaData, strategy?: ColumnNamingStrategy): N2mLazyOutput; export declare function buildN2mBatchSpecs(desc: N2mDescriptor, sourceRecords: Row[], root: MetaData, strategy?: ColumnNamingStrategy): N2mBatchOutput; export declare function resolveJoinColumnName(joinEntity: MetaData, fieldName: string, strategy?: ColumnNamingStrategy): string; //# sourceMappingURL=n2m-resolver.d.ts.map