Skip to content

@half0wl/container / IContainer

Interface: IContainer

Defined in: base.ts:14

Minimal interface representing a DI container.

Services receive this as this.registry to resolve other services without coupling to the full Container implementation.

Methods

get()

ts
get<T>(serviceClass): T;

Defined in: base.ts:22

Resolve a service by its class constructor.

Type Parameters

Type ParameterDescription
TThe service type

Parameters

ParameterTypeDescription
serviceClassConstructor<T>The class constructor to resolve

Returns

T

The singleton instance of the service