UNPKG

dino-core

Version:

A dependency injection framework for NodeJS applications

35 lines (34 loc) 1.31 kB
import type { ComponentDescriptor } from '../model/ComponentDescriptor'; import type { ApplicationContext } from './ApplicationContext'; /** * Build the application context starting from the provided configuration * * @public * @since 0.0.1 */ export declare class ApplicationContextBuilder { private readonly applicationContextHelper; /** * @constructor */ constructor(); /** * Build the application context. * @param {Array<ComponentDescriptor>} componentDescriptors the component descriptors holding the loading information for components * @param {ApplicationContext} context the application context where components will be registered * * @returns {Promise<ApplicationContext>} a promise resolved with the updated application context * @public */ build(componentDescriptors: ComponentDescriptor[], context: ApplicationContext): Promise<ApplicationContext>; /** * Try register a component on this context * * @param {ApplicationContext} context the application context * @param {ComponentDescriptor} componentDescriptor the component descriptor * @param {Array<ComponentDescriptor>} accumulator the accumulator for failed registrations * * @private */ private tryRegisterOrRecordFailure; }