import type { ObjectId } from 'mongodb'; import type { DocumentClass } from '../interfaces/document'; /** * A stored foreign key. On disk it is an `ObjectId` (or string id); after * `populate` it becomes the hydrated target instance `T`. */ export type Ref = string | ObjectId | T; /** Turns declared `Ref<...>` fields `K` of `T` into their populated target type. */ export type Populated = Omit & { [P in K]: T[P] extends Ref ? U : T[P] extends Array> ? V[] : T[P]; }; /** Single reference to another document, stored as its `ObjectId`. */ export declare const Ref: (target: () => DocumentClass) => PropertyDecorator; /** Array of references to another document, stored as `ObjectId[]`. */ export declare const RefArray: (target: () => DocumentClass) => PropertyDecorator; /** Embedded subdocument, hydrated into the target class on read. */ export declare const Embedded: (target: () => DocumentClass) => PropertyDecorator; //# sourceMappingURL=relations.d.ts.map