UNPKG

2.11 kBTypeScriptView Raw
1import { InjectionToken } from '@nestjs/common';
2import { Edge } from './interfaces/edge.interface';
3import { Entrypoint } from './interfaces/entrypoint.interface';
4import { OrphanedEnhancerDefinition } from './interfaces/extras.interface';
5import { Node } from './interfaces/node.interface';
6import { SerializedGraphJson } from './interfaces/serialized-graph-json.interface';
7import { SerializedGraphMetadata } from './interfaces/serialized-graph-metadata.interface';
8export type SerializedGraphStatus = 'partial' | 'complete';
9type WithOptionalId<T extends Record<'id', string>> = Omit<T, 'id'> & Partial<Pick<T, 'id'>>;
10export declare class SerializedGraph {
11 private readonly nodes;
12 private readonly edges;
13 private readonly entrypoints;
14 private readonly extras;
15 private _status;
16 private _metadata?;
17 private static readonly INTERNAL_PROVIDERS;
18 set status(status: SerializedGraphStatus);
19 set metadata(metadata: SerializedGraphMetadata);
20 insertNode(nodeDefinition: Node): Node;
21 insertEdge(edgeDefinition: WithOptionalId<Edge>): {
22 id: string;
23 metadata: ({
24 type: "module-to-module";
25 } & {
26 sourceModuleName: string;
27 targetModuleName: string;
28 }) | ({
29 type: "class-to-class";
30 sourceClassName: string;
31 targetClassName: string;
32 sourceClassToken: InjectionToken;
33 targetClassToken: InjectionToken;
34 injectionType: "constructor" | "property" | "decorator";
35 keyOrIndex?: string | number | symbol;
36 internal?: boolean;
37 } & {
38 sourceModuleName: string;
39 targetModuleName: string;
40 });
41 source: string;
42 target: string;
43 };
44 insertEntrypoint<T>(definition: Entrypoint<T>, parentId: string): void;
45 insertOrphanedEnhancer(entry: OrphanedEnhancerDefinition): void;
46 insertAttachedEnhancer(nodeId: string): void;
47 getNodeById(id: string): Node;
48 toJSON(): SerializedGraphJson;
49 toString(): string;
50 private generateUuidByEdgeDefinition;
51}
52export {};