ProtectedconstructorCreate a container.
Initializes the container with empty alias and binding maps.
Set a binding as alias.
Adds one or more aliases for a given binding key.
The binding value.
One or more strings representing the aliases.
The container instance.
AutoBind value to the service container.
A key to make the binding. Can be anything.
Optionalitem: V
The item to bind.
Bind as singleton when true.
Key binding aliases.
The container instance.
Bind a resolver function into the container under the provided key, returning a new instance each time.
The key to associate with the value.
The resolver function to provide the value.
The container instance.
Bind a resolver function into the container under the provided key, returning a new instance each time if not already bound.
The key to associate with the value.
The resolver function to provide the value.
The container instance.
Check if a value is already bound in the container by its key.
The key to check.
True if the key is bound, false otherwise.
Reset the container so that all bindings are removed.
The container instance.
Resolve a value from the container by its key and return it in a factory function.
The key to resolve.
A factory function that returns the resolved value.
Retrieve the value of the aliases property.
A map of all aliases registered in the container.
Get a binding key by its alias.
The alias name.
The binding key associated with the alias, or undefined if not found.
Retrieve the value of the bindings property.
A map of all bindings registered in the container.
Check if a value is already bound in the container by its key.
The key to check.
True if the key is bound, false otherwise.
Bind a single instance or value into the container under the provided key.
The key to associate with the value.
The value to be bound.
The container instance.
Bind a single instance or value into the container under the provided key if not already bound.
The key to associate with the value.
The value to be bound.
The container instance.
Check if an alias exists in the container.
The alias to check.
True if the alias exists, false otherwise.
Resolve a registered value from the container by its key.
The key to resolve.
The resolved value.
Resolve a value from the container by its key, binding it if necessary.
The key to resolve.
Whether to bind as a singleton if not already bound.
The resolved value.
Bind a resolver function into the container under the provided key as a singleton.
The resolver function will be called once, and the resulting value will be cached for future use.
The key to associate with the singleton value.
The resolver function to provide the value.
The container instance.
Bind a resolver function into the container under the provided key as a singleton if not already bound.
The key to associate with the singleton value.
The resolver function to provide the value.
The container instance.
Staticcreate
Class representing a Container.
The Container class acts as a dependency injection container, managing bindings and resolving instances. It supports different types of bindings, such as singletons, factories, and instances, and allows the use of aliases for bindings. This makes it easier to manage and resolve complex dependency trees in an application.
Author
Mr. Stone evensstone@gmail.com