Injector

Injector. Injector

The injector class. This class can't be instantiated.

Constructor

(abstract) new Injector()

Source:

Methods

(static) get(name) → {T|null}

This function is used to get an injected object/variable. If you have a class, you can use the @Retrieve decorator

Parameters:
Name Type Description
name string

The name of the object/variable.

Source:
Example

Example usage of Injector.get.

Injector.get<string>('name');
Injector.get<Configuration>('Configuration');

(static) inject(name, value, type) → {void}

This function is used to inject an object/variable.

Parameters:
Name Type Description
name string

The name of the object/variable.

value any

The object/variable.

type InjectType

The type of the object

Source:

(static) ready()

This function will trigger the onLoad as a promise and after will trigger the onReady

Source:

(static) setup(config)

This function is used to setup the configuration of the server

Parameters:
Name Type Description
config Configuration

The configuration of the server

Source: