# Container Class

Module
import { Container } from "@tsed/di"
Source/packages/di/src/class/Container.ts

# Overview

class Container extends LocalsContainer<Provider<any>> {
    /**
     *
     * @param token
     * @param settings
     */
    add(token: TokenProvider, settings?: Partial<IProvider<any>>): this;
    /**
     * Add a provider to the
     * @param token
     * @param settings
     */
    addProvider(token: TokenProvider, settings?: Partial<IProvider<any>>): this;
    /**
     *
     * @param token
     */
    hasProvider(token: TokenProvider): boolean;
    /**
     * Add a provider to the
     * @param token
     * @param provider
     */
    setProvider(token: TokenProvider, provider: Provider<any>): this;
    /**
     * The getProvider() method returns a specified element from a Map object.
     * @returns {T} Returns the element associated with the specified key or undefined if the key can't be found in the Map object.
     * @param token
     */
    getProvider(token: TokenProvider): Provider<any> | undefined;
    /**
     * Get all providers registered in the injector container.
     *
     * @param {ProviderType} type Filter the list by the given ProviderType.
     * @returns {[RegistryKey , Provider<any>][]}
     */
    getProviders(type?: ProviderType | string): Provider<any>[];
    addProviders(container: Map<TokenProvider, Provider<any>>): void;
}