import { InjectionToken } from '@nestjs/common'; import { Controller, Injectable, Type } from '@nestjs/common/interfaces'; import { ContextId, InstancePerContext, InstanceWrapper, PropertyMetadata } from './instance-wrapper'; import { Module } from './module'; import { SettlementSignal } from './settlement-signal'; /** * The type of an injectable dependency */ export type InjectorDependency = InjectionToken; /** * The property-based dependency */ export interface PropertyDependency { key: symbol | string; name: InjectorDependency; isOptional?: boolean; instance?: any; } /** * Context of a dependency which gets injected by * the injector */ export interface InjectorDependencyContext { /** * The name of the property key (property-based injection) */ key?: string | symbol; /** * The function itself, the name of the function, or injection token. */ name?: Function | string | symbol; /** * The index of the dependency which gets injected * from the dependencies array */ index?: number; /** * The dependency array which gets injected */ dependencies?: InjectorDependency[]; } export declare class Injector { private readonly options?; private logger; constructor(options?: { preview: boolean; }); loadPrototype({ token }: InstanceWrapper, collection: Map>, contextId?: ContextId): void; loadInstance(wrapper: InstanceWrapper, collection: Map, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise; loadMiddleware(wrapper: InstanceWrapper, collection: Map, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise; loadController(wrapper: InstanceWrapper, moduleRef: Module, contextId?: ContextId): Promise; loadInjectable(wrapper: InstanceWrapper, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise; loadProvider(wrapper: InstanceWrapper, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise; applySettlementSignal(instancePerContext: InstancePerContext, host: InstanceWrapper): SettlementSignal; resolveConstructorParams(wrapper: InstanceWrapper, moduleRef: Module, inject: InjectorDependency[], callback: (args: unknown[]) => void | Promise, contextId?: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise; getClassDependencies(wrapper: InstanceWrapper): [InjectorDependency[], number[]]; getFactoryProviderDependencies(wrapper: InstanceWrapper): [InjectorDependency[], number[]]; reflectConstructorParams(type: Type): any[]; reflectOptionalParams(type: Type): any[]; reflectSelfParams(type: Type): any[]; resolveSingleParam(wrapper: InstanceWrapper, param: Type | string | symbol | any, dependencyContext: InjectorDependencyContext, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise>; resolveParamToken(wrapper: InstanceWrapper, param: Type | string | symbol | any): any; resolveComponentInstance(moduleRef: Module, token: InjectionToken, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise; resolveComponentHost(moduleRef: Module, instanceWrapper: InstanceWrapper>, contextId?: ContextId, inquirer?: InstanceWrapper): Promise; lookupComponent(providers: Map, moduleRef: Module, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise>; lookupComponentInParentModules(dependencyContext: InjectorDependencyContext, moduleRef: Module, wrapper: InstanceWrapper, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise; lookupComponentInImports(moduleRef: Module, name: InjectionToken, wrapper: InstanceWrapper, moduleRegistry?: any[], contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number, isTraversing?: boolean): Promise; resolveProperties(wrapper: InstanceWrapper, moduleRef: Module, inject?: InjectorDependency[], contextId?: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise; reflectProperties(type: Type): PropertyDependency[]; applyProperties(instance: T, properties: PropertyDependency[]): void; instantiateClass(instances: any[], wrapper: InstanceWrapper, targetMetatype: InstanceWrapper, contextId?: ContextId, inquirer?: InstanceWrapper): Promise; loadPerContext(instance: T, moduleRef: Module, collection: Map, ctx: ContextId, wrapper?: InstanceWrapper): Promise; loadEnhancersPerContext(wrapper: InstanceWrapper, ctx: ContextId, inquirer?: InstanceWrapper): Promise; loadCtorMetadata(metadata: InstanceWrapper[], contextId: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise; loadPropertiesMetadata(metadata: PropertyMetadata[], contextId: ContextId, inquirer?: InstanceWrapper): Promise; private getInquirerId; private resolveScopedComponentHost; private isInquirerRequest; private isInquirer; protected addDependencyMetadata(keyOrIndex: symbol | string | number, hostWrapper: InstanceWrapper, instanceWrapper: InstanceWrapper): void; private getTokenName; private printResolvingDependenciesLog; private printLookingForProviderLog; private printFoundInModuleLog; private isDebugMode; private getContextId; private getNowTimestamp; }