Interface: Registration\
October 4, 2024 · View on GitHub
DIOD v3.0.0 • Docs
Interface: Registration<T>
Type Parameters
• T
Methods
use()
use(
newable):ConfigurableRegistration&WithScopeChange&WithDependencies
Configure the class implementation that the identifier will provide.
Alias of useClass.
Parameters
• newable: Newable<T>
The implementation that the identifier will provide.
Returns
ConfigurableRegistration & WithScopeChange & WithDependencies
Configuration fluent API for classes
useClass()
useClass(
newable):ConfigurableRegistration&WithScopeChange&WithDependencies
Configure the class implementation that the identifier will provide.
Parameters
• newable: Newable<T>
The implementation that the identifier will provide.
Returns
ConfigurableRegistration & WithScopeChange & WithDependencies
Configuration fluent API for classes
useFactory()
useFactory(
factory):ConfigurableRegistration&WithScopeChange
Configure a factory that returns the instance that the identifier will provide.
Parameters
• factory: Factory<T>
The factory that will be executed when the identifier is requested.
Returns
ConfigurableRegistration & WithScopeChange
Configuration fluent API for factories
useInstance()
useInstance(
instance):ConfigurableRegistration
Configure the instance that the identifier will provide.
Parameters
• instance: Instance<T>
The instance that the identifier will provide.
Returns
Configuration fluent API for instances