UNPKG

@jems/di

Version:

An implementation of IoC pattern based on dependency injection that allows you to granulate and decouple your libraries or applications. Wrote using SOLID principles and a variety OOP patterns implementations.

24 lines (23 loc) 958 B
import { ResolutionContext } from '../resolutionContext'; import { DependencyMetadata } from '../dependencyMetadata'; import { DeliveryStrategy } from './deliveryStrategy'; /** * Represenst an strategy to deliver the same instance targets with an specific strategy. */ export declare class SingletonDeliveryStrategy implements DeliveryStrategy { /** * Represents a boolean value specifying if the target has been served. */ private _isServed; /** * Represets an instance of the target. */ private _instance; /** * Deliver the transformed reference in the provided dependency metadata. * @param resolutionContext Represents the context in which the request was made. * @param dependencyMetadata Represents the dependency metadata that will be delivered. * @return The transformed reference. */ deliver(resolutionContext: ResolutionContext, dependencyMetadata: DependencyMetadata): any; }