DiscoveryService
class DiscoveryService {
static createDecorator<T>(): DiscoverableDecorator<T>
getProviders(options: DiscoveryOptions = {}, modules: Module[] = this.getModules(options)): InstanceWrapper[]
getControllers(options: DiscoveryOptions = {}, modules: Module[] = this.getModules(options)): InstanceWrapper[]
getMetadataByDecorator<T extends DiscoverableDecorator<any>>(decorator: T, instanceWrapper: InstanceWrapper<any>, methodKey?: string): T extends DiscoverableDecorator<infer R> ? R | undefined : T | undefined
protected getModules(options: DiscoveryOptions = {}): Module[]
}
Static methods
createDecorator() |
---|
Creates a decorator that can be used to decorate classes and methods with metadata.
The decorator will also add the class to the collection of discoverable classes (by metadata key).
Decorated classes can be discovered using the |
ParametersThere are no parameters. Returns
|
Methods
getProviders() | |||||||||
---|---|---|---|---|---|---|---|---|---|
Returns an array of instance wrappers (providers). Depending on the options, the array will contain either all providers or only providers with the specified metadata key. |
|||||||||
Parameters
Returns
|
getControllers() | |||||||||
---|---|---|---|---|---|---|---|---|---|
Returns an array of instance wrappers (controllers). Depending on the options, the array will contain either all controllers or only controllers with the specified metadata key. |
|||||||||
Parameters
Returns
|
getMetadataByDecorator() |
---|
Retrieves metadata from the specified instance wrapper. |
ParametersReturns
|
getModules() | ||||||
---|---|---|---|---|---|---|
Returns a list of modules to be used for discovery. |
||||||
Parameters
Returns
|