import { Ref, Stream } from "effect"; import { DanglingReferenceError } from "../../errors/query-errors.js"; import type { CollectionConfig } from "../../types/database-config-types.js"; /** * PopulateValue can be: * - `true` to populate a relationship with all fields * - An object with nested populate config for recursive population */ type PopulateValue = boolean | Record; /** * Apply relationship population as a Stream combinator. * * For each item in the stream, resolves relationships by reading related * entities from collection Refs. Supports nested population recursively * up to a depth of 5. * * - `ref` relationships: look up a single entity in the target collection * using the foreign key field (default: `Id`) * - `inverse` relationships: find all entities in the target collection * whose foreign key points back to this item's `id` * * @param populateConfig - Which relationships to populate (e.g. `{ company: true }`) * @param stateRefs - Map of collection name → Ref> * @param dbConfig - Full database config with relationship definitions * @param collectionName - Name of the source collection being queried */ export declare const applyPopulate: >(populateConfig: Record | undefined, stateRefs: Record>>>, dbConfig: Record, collectionName: string) => (stream: Stream.Stream) => Stream.Stream; export {}; //# sourceMappingURL=populate-stream.d.ts.map