Skip to content

InjectableOptions · Core API

type InjectableOptions<T, TDeps> = object;

Options stored by @Injectable and converted into a factory provider.

Type Parameter Default type

T

‐

TDeps extends Dependency<unknown>[]

Dependency<unknown>[]

readonly token: Token<T>;

Token provided by the decorated class.


readonly optional deps?: TDeps;

Ordered constructor dependencies.

Each item is resolved and passed to the constructor at the same index.


readonly optional scope?: Scope;

Provider lifetime.

Defaults to Scopes.Singleton.


readonly optional onDispose?: DisposeHook<T>;

Cleanup hook for cached singleton and scoped instances.

Not supported for transient providers.