UNPKG

@akala/core

Version:
18 lines (17 loc) 643 B
/** * Decorator factory for creating injectable factories. * @param name - Unique identifier for the factory in the dependency injection container. * @param toInject - Names of dependencies to inject into the factory constructor. */ export declare function factory(name: string, ...toInject: string[]): (target: new (...args: unknown[]) => IFactory<unknown>) => void; /** * Base interface for factory classes. * @template T - Type of the object produced by the factory. */ export interface IFactory<T> { /** * Builds and returns an instance of the target type. * @returns - The created instance. */ build(): T; }