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.

39 lines (38 loc) 1.56 kB
import { BindSyntax } from './bindSyntax'; import { ToSyntax } from './toSyntax'; import { ContainerizedKernel } from '../containerizedKernel'; import { WithAndAsAndInAndWhenSyntax } from './withAndAsAndInAndWhenSyntax'; /** * Represents an syntax extention that allow relate aliases to targets and specify containers. */ export declare class RelationSyntax implements BindSyntax, ToSyntax { /** * Represents the arguments name provider that identify the arguments in a argumentable reference. */ private _argumentsNamesProvider; /** * Represents the bind alias. */ private _alias; /** * Represents the containerized syntax where the bind will be performed. */ private _containerizedKernel; /** * Creates a new relation syntax that allow relates aliases to targets with the given kernel. * @param kernel Reprersents the kernel where the binding is happening. */ constructor(containerizedKernel: ContainerizedKernel); /** * Creates a bind for the alias and allow fluently configure it. * @param alias Represents the alias to bind. * @return A syntax extension to associate the target or setup a container. */ bind(alias: string): ToSyntax; /** * Associate the given target to the current bind. * @param reference Represets the target that will be associated to the current bind. * @return A syntax extension to setup the dependencies, servicing, delivery and conditions. */ to(reference: any): WithAndAsAndInAndWhenSyntax; }