UNPKG

dino-core

Version:

A dependency injection framework for NodeJS applications

25 lines (24 loc) 875 B
import { Component } from '../../model/component'; import { type ApplicationContext } from '../../context/ApplicationContext'; interface Deps { applicationContext: ApplicationContext; } /** * Helps create complex objects and aggregates */ export declare abstract class Factory<I, T> extends Component { protected readonly applicationContext: ApplicationContext; constructor({ applicationContext }: Deps); /** * Create an new instance based on the input information and internal logic * @param i the input for the factory */ abstract create(i: I): T; /** * Create an new instance based on the input information and internal logic * @param i the input for the factory * @deprecated use Factory#create instead, **this method was introduced by error and will be removed soon** */ translate(_i: I): T; } export {};