1 | import { InjectionToken } from '@nestjs/common';
|
2 | import { Controller } from '@nestjs/common/interfaces/controllers/controller.interface';
|
3 | import { Injectable } from '@nestjs/common/interfaces/injectable.interface';
|
4 | import { Type } from '@nestjs/common/interfaces/type.interface';
|
5 | import { ContextId, InstancePerContext, InstanceWrapper, PropertyMetadata } from './instance-wrapper';
|
6 | import { InstanceToken, Module } from './module';
|
7 |
|
8 |
|
9 |
|
10 | export declare type InjectorDependency = InjectionToken;
|
11 |
|
12 |
|
13 |
|
14 | export interface PropertyDependency {
|
15 | key: symbol | string;
|
16 | name: InjectorDependency;
|
17 | isOptional?: boolean;
|
18 | instance?: any;
|
19 | }
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export interface InjectorDependencyContext {
|
25 | |
26 |
|
27 |
|
28 | key?: string | symbol;
|
29 | |
30 |
|
31 |
|
32 | name?: Function | string | symbol;
|
33 | |
34 |
|
35 |
|
36 |
|
37 | index?: number;
|
38 | |
39 |
|
40 |
|
41 | dependencies?: InjectorDependency[];
|
42 | }
|
43 | export declare class Injector {
|
44 | private logger;
|
45 | loadPrototype<T>({ token }: InstanceWrapper<T>, collection: Map<InstanceToken, InstanceWrapper<T>>, contextId?: ContextId): void;
|
46 | loadInstance<T>(wrapper: InstanceWrapper<T>, collection: Map<InstanceToken, InstanceWrapper>, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<void>;
|
47 | loadMiddleware(wrapper: InstanceWrapper, collection: Map<InstanceToken, InstanceWrapper>, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<void>;
|
48 | loadController(wrapper: InstanceWrapper<Controller>, moduleRef: Module, contextId?: ContextId): Promise<void>;
|
49 | loadInjectable<T = any>(wrapper: InstanceWrapper<T>, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<void>;
|
50 | loadProvider(wrapper: InstanceWrapper<Injectable>, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<void>;
|
51 | applyDoneHook<T>(wrapper: InstancePerContext<T>): () => void;
|
52 | resolveConstructorParams<T>(wrapper: InstanceWrapper<T>, moduleRef: Module, inject: InjectorDependency[], callback: (args: unknown[]) => void | Promise<void>, contextId?: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise<void>;
|
53 | getClassDependencies<T>(wrapper: InstanceWrapper<T>): [InjectorDependency[], number[]];
|
54 | getFactoryProviderDependencies<T>(wrapper: InstanceWrapper<T>): [InjectorDependency[], number[]];
|
55 | reflectConstructorParams<T>(type: Type<T>): any[];
|
56 | reflectOptionalParams<T>(type: Type<T>): any[];
|
57 | reflectSelfParams<T>(type: Type<T>): any[];
|
58 | resolveSingleParam<T>(wrapper: InstanceWrapper<T>, param: Type<any> | string | symbol | any, dependencyContext: InjectorDependencyContext, moduleRef: Module, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper<any>>;
|
59 | resolveParamToken<T>(wrapper: InstanceWrapper<T>, param: Type<any> | string | symbol | any): any;
|
60 | resolveComponentInstance<T>(moduleRef: Module, token: InstanceToken, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper>;
|
61 | resolveComponentHost<T>(moduleRef: Module, instanceWrapper: InstanceWrapper<T | Promise<T>>, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<InstanceWrapper>;
|
62 | lookupComponent<T = any>(providers: Map<Function | string | symbol, InstanceWrapper>, moduleRef: Module, dependencyContext: InjectorDependencyContext, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<InstanceWrapper<T>>;
|
63 | lookupComponentInParentModules<T = any>(dependencyContext: InjectorDependencyContext, moduleRef: Module, wrapper: InstanceWrapper<T>, contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number): Promise<any>;
|
64 | lookupComponentInImports(moduleRef: Module, name: InstanceToken, wrapper: InstanceWrapper, moduleRegistry?: any[], contextId?: ContextId, inquirer?: InstanceWrapper, keyOrIndex?: symbol | string | number, isTraversing?: boolean): Promise<any>;
|
65 | resolveProperties<T>(wrapper: InstanceWrapper<T>, moduleRef: Module, inject?: InjectorDependency[], contextId?: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise<PropertyDependency[]>;
|
66 | reflectProperties<T>(type: Type<T>): PropertyDependency[];
|
67 | applyProperties<T = any>(instance: T, properties: PropertyDependency[]): void;
|
68 | instantiateClass<T = any>(instances: any[], wrapper: InstanceWrapper, targetMetatype: InstanceWrapper, contextId?: ContextId, inquirer?: InstanceWrapper): Promise<T>;
|
69 | loadPerContext<T = any>(instance: T, moduleRef: Module, collection: Map<InstanceToken, InstanceWrapper>, ctx: ContextId, wrapper?: InstanceWrapper): Promise<T>;
|
70 | loadEnhancersPerContext(wrapper: InstanceWrapper, ctx: ContextId, inquirer?: InstanceWrapper): Promise<void>;
|
71 | loadCtorMetadata(metadata: InstanceWrapper<any>[], contextId: ContextId, inquirer?: InstanceWrapper, parentInquirer?: InstanceWrapper): Promise<any[]>;
|
72 | loadPropertiesMetadata(metadata: PropertyMetadata[], contextId: ContextId, inquirer?: InstanceWrapper): Promise<PropertyDependency[]>;
|
73 | private getInquirerId;
|
74 | private resolveScopedComponentHost;
|
75 | private isInquirerRequest;
|
76 | private isInquirer;
|
77 | protected addDependencyMetadata(keyOrIndex: symbol | string | number, hostWrapper: InstanceWrapper, instanceWrapper: InstanceWrapper): void;
|
78 | private getTokenName;
|
79 | private printResolvingDependenciesLog;
|
80 | private printLookingForProviderLog;
|
81 | private printFoundInModuleLog;
|
82 | private isDebugMode;
|
83 | }
|
84 |
|
\ | No newline at end of file |