Skip to content

DI Bag API / index / GraphSnapshot

Interface: GraphSnapshot ​

Defined in: inspection.ts:69

A frozen description of every binding a container can resolve, plus the edges observed so far. Named dependencies read from a factory's object parameter are not knowable until the factory runs; observedEdges records them after acquisition. Use the static graph tool for declared edges.

See ​

https://dany-fedorov.github.io/di-bag/guides/tutorial.html#attach-metadata-and-inspect-without-resolving

Properties ​

bindings ​

ts
readonly bindings: readonly BindingSnapshot<object, readonly unknown[]>[];

Defined in: inspection.ts:72

Public bindings in service key order, then contributions in group order, then remaining private bindings.


containerId ​

ts
readonly containerId: symbol;

Defined in: inspection.ts:70


contributions ​

ts
readonly contributions: readonly {
    readonly collectionTokenSymbol: symbol;
    readonly bindingIds: readonly symbol[];
}[];

Defined in: inspection.ts:73


observedEdges ​

ts
readonly observedEdges: readonly {
    readonly consumerBindingId: symbol;
    readonly dependencyBindingId: symbol;
}[];

Defined in: inspection.ts:75

Consumer-to-dependency edges recorded by acquisitions in this container's ownership family.

Ordinary services. Checked composition. Explicit ownership.