import { Collection, IDKey, IDType, OmitInternalVertexKeys, PrivateIDKey, PrivateIDType, Vertex } from "../vertex.js"; import { AvailableLocation, Coalesced, EdgeBase, EdgeWrapper, GroupWithExclude, Plain, ThreadMessage, Wrapped } from "../edges.js"; import { ExtractNullish, Prettify, SetMultiplicity } from "../util.js"; import { Decrement, MaxDepth, MinDepth, OmitEdges, PickEdges, SupportedDepths } from "../common.js"; //#region src/core/interfaces/vertices/util/deep-vertex-export/index.d.ts type ExportOptions = { mixed?: boolean; optionalId?: boolean; omitPrivateId?: boolean; }; type IDTypes = IDType | PrivateIDType; declare namespace HandleEdge { type Recursion, D extends SupportedDepths, Opts extends ExportOptions> = _DeepVertexExport, Opts> | (Opts['mixed'] extends true ? IDTypes : never); export type Plain, D extends SupportedDepths, Opts extends ExportOptions> = E extends Plain.Edge ? Recursion : never; export type Wrapped, D extends SupportedDepths, Opts extends ExportOptions> = E extends Wrapped.Edge, infer Extra extends object> ? Wrapped.Util.Value, Extra> : never; export type Coalesced, D extends SupportedDepths, Opts extends ExportOptions> = E extends Coalesced.Edge ? V extends Vertex ? Coalesced.Util.Value, Coalesced.Util.ToModel, O, Extra> : never : never; export type GroupWithExclude, D extends SupportedDepths, Opts extends ExportOptions> = E extends GroupWithExclude.Edge, infer P extends Vertex, infer Extra extends object> ? GroupWithExclude.Util.Value, Recursion, Extra> : never; export type AvailableLocation, D extends SupportedDepths, Opts extends ExportOptions> = E extends AvailableLocation.Edge, infer Extra extends object> ? AvailableLocation.Util.Value, Extra> : never; export type ThreadMessage, D extends SupportedDepths, Opts extends ExportOptions> = E extends ThreadMessage.Edge, infer T extends Vertex, infer Extra extends object> ? ThreadMessage.Util.Value, Recursion, Extra> : never; export {}; } type _MinDepthType = any; type TryPrettify = 0 extends (1 & T) ? _MinDepthType : Prettify; type InternalIdKeys = IDKey | PrivateIDKey; type PartialIf = Condition extends true ? Partial : T; type OmitPrivateIdIf = Condition extends true ? Omit : T; type _DeepVertexExport, D extends SupportedDepths, Opts extends ExportOptions> = D extends MinDepth ? _MinDepthType : Prettify]: V[K] }, Opts['optionalId']>, Opts['omitPrivateId']> & { [K in keyof Omit>, InternalIdKeys>]: V[K] } & { [K in keyof PickEdges]: [V[K]] extends [never] ? never : NonNullable extends EdgeWrapper | null | undefined> ? (SetMultiplicity ? (HandleEdge.Plain | HandleEdge.Wrapped | HandleEdge.Coalesced | HandleEdge.GroupWithExclude | HandleEdge.AvailableLocation | HandleEdge.ThreadMessage) : E>, M> | ExtractNullish) : never }>; /** * Recursively transforms a Vertex type into a deeply exported, plain object structure. * - Non-edge properties are preserved as-is. * - Edge properties are expanded according to their edge type (Plain, Coalesced, GroupWithExclude, AvailableLocation, ThreadMessage ). * - Invalid or unsupported edge unions are filtered out as `never`. * - Handles multiplicity (single/array) and optional/null edge cases. * - There is a maximum recursion depth to increase performance. * - Once the maximum depth is reached, all vertices are represented as `any`. */ type DeepVertexExport> = _DeepVertexExport; /** * Similar to {@link DeepVertexExport}, but each edge is represented as both the fully expanded object * and the vertex ID (`string | ObjectId`). */ type MixedVertexExport> = _DeepVertexExport; /** * Similar to {@link MixedVertexExport}, but the ID fields (`_id` and `id`) are optional. */ type MixedWithOptionalIdVertexExport> = _DeepVertexExport; /** * Similar to {@link DeepVertexExport}, but omits the private ID field (`_id`) from the exported type. */ type DeepVertexExportOmitPrivateId> = _DeepVertexExport; //#endregion export { DeepVertexExport, DeepVertexExportOmitPrivateId, MixedVertexExport, MixedWithOptionalIdVertexExport }; //# sourceMappingURL=index.d.ts.map