Skip to content

DI Bag API / index / BindingSnapshot

Interface: BindingSnapshot<M = Readonly<{ }>, A extends readonly unknown[] = readonly []> ​

Defined in: inspection.ts:52

One binding of a container's graph, described without acquiring it.

See ​

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

Extends ​

Type Parameters ​

Type ParameterDescription
M-
A-

Properties ​

acquisitions ​

ts
readonly acquisitions: readonly AcquisitionSnapshot<A>[];

Defined in: inspection.ts:45

Point-in-time attempts; inspection does not retain failed-attempt history.

Inherited from ​

RegistrationSnapshot.acquisitions


aliasTarget? ​

ts
readonly aliasTarget?: {
    readonly bindingId: symbol;
    readonly bindingLabel: string;
};

Defined in: inspection.ts:41

Direct lexical target; acquisition snapshots follow the canonical target.

bindingId ​

ts
readonly bindingId: symbol;

bindingLabel ​

ts
readonly bindingLabel: string;

Inherited from ​

RegistrationSnapshot.aliasTarget


bindingId ​

ts
readonly bindingId: symbol;

Defined in: inspection.ts:37

Stable identity for the canonical graph binding.

Inherited from ​

RegistrationSnapshot.bindingId


bindingLabel ​

ts
readonly bindingLabel: string;

Defined in: inspection.ts:39

Human-readable binding label.

Inherited from ​

RegistrationSnapshot.bindingLabel


factoryReturnKind ​

ts
readonly factoryReturnKind: FactoryReturnKind;

Defined in: inspection.ts:56


isOwnedByContainer ​

ts
readonly isOwnedByContainer: boolean;

Defined in: inspection.ts:58

True when some stage of the provider accepts ownership through a disposer.


lifetime ​

ts
readonly lifetime: Lifetime;

Defined in: inspection.ts:55


registrationMetadata ​

ts
readonly registrationMetadata: Readonly<M>;

Defined in: inspection.ts:43

Static registration metadata; application-owned payload values retain their identity.

Inherited from ​

RegistrationSnapshot.registrationMetadata


serviceKeys ​

ts
readonly serviceKeys: readonly (string | symbol)[];

Defined in: inspection.ts:54

Public names or token symbols that select this binding, in service key order; empty for a private module binding.


tokenDependencies ​

ts
readonly tokenDependencies: readonly {
    readonly tokenSymbol: symbol;
    readonly dependencyKind: 'required' | 'optional' | 'lazy';
}[];

Defined in: inspection.ts:60

Typed-token dependencies declared positionally through service tokens, collection tokens, optional, or lazy references.

Ordinary services. Checked composition. Explicit ownership.