/** * Relationship Population * * Populates relationship fields by replacing document IDs with actual * related documents, up to a configurable depth level. * Respects collection-level and field-level access control. */ import type { CollectionConfig, DatabaseAdapter, Field, RequestContext } from '@momentumcms/core'; export interface PopulateOptions { /** Maximum depth of population (0 = no population, 1 = populate immediate, etc.) */ depth: number; /** All collection configs (needed to resolve relationship targets) */ collections: CollectionConfig[]; /** Database adapter for fetching related documents */ adapter: DatabaseAdapter; /** Request context for access control checks */ req?: RequestContext; } /** * Populate relationship fields in a document up to the specified depth. * Returns a new document with relationship IDs replaced by full documents. * * @param doc The document to populate * @param fields The collection's field definitions * @param options Population options including depth, collections, and adapter */ export declare function populateRelationships(doc: Record, fields: Field[], options: PopulateOptions): Promise>;