UNPKG

@robotlegsjs/core

Version:

An architecture-based IoC framework for JavaScript/TypeScript

48 lines (47 loc) 1.32 kB
import { IContext } from "../api/IContext"; import { IMatcher } from "../api/IMatcher"; /** * The config manager handles configuration files and * allows the installation of custom configuration handlers. * * <p>It is pre-configured to handle plain objects and classes</p> * * @private */ export declare class ConfigManager { private _objectProcessor; private _configs; private _queue; private _injector; private _logger; private _initialized; private _context; /** * @private */ constructor(context: IContext); /** * Process a given configuration object by running it through registered handlers. * <p>If the manager is not initialized the configuration will be queued.</p> * * @param config The configuration object or class */ addConfig(config: any): void; /** * Adds a custom configuration handlers * * @param matcher Pattern to match configuration objects * @param handler Handler to process matching configurations */ addConfigHandler(matcher: IMatcher, handler: Function): void; /** * Destroy */ destroy(): void; private _initialize; private _handleClass; private _handleObject; private _processQueue; private _processClass; private _processObject; }