/** * Population Core - Pure Types & Utilities * * This module contains types and pure utility functions for relationship * population that have NO imports from the afterRead chain, breaking the * circular dependency: population → populate-helpers → afterRead → population. */ /** Relationship field types supported by population */ export interface PopulateRelationshipField { type: 'relationship' | 'upload' | 'join'; name: string; relationTo?: string | string[]; collection?: string | string[]; hasMany?: boolean; maxDepth?: number; localized?: boolean; } /** Information extracted about a relationship */ export interface RelationInfo { /** The collection slug this relationship points to */ relationName: string | undefined; /** The ID(s) to populate */ id: unknown; /** The related collection config if available */ relatedCollection: unknown; } /** Location information for updating a document with populated values */ export interface UpdateLocation { index?: number; key?: string; } /** * Extract relationship information from field and data * * Handles polymorphic relationships, join tables, and direct FK relationships. */ export declare function extractRelationInfo(field: PopulateRelationshipField, data: unknown, req: { revealui?: { collections?: Record; }; }): RelationInfo; /** * Check if a relationship should be populated based on depth */ export declare function shouldPopulateRelationship(currentDepth: number, depth: number): boolean; /** * Update document with populated relationship value * * Handles various field configurations: arrays, localized fields, join tables, etc. */ export declare function updateDocumentWithPopulatedValue(args: { dataReference: Record; field: PopulateRelationshipField; relationshipValue: unknown; location: UpdateLocation; }): void; //# sourceMappingURL=populate-core.d.ts.map