1 | import { INestApplicationContext, LoggerService, LogLevel, ShutdownSignal } from '@nestjs/common';
|
2 | import { DynamicModule, Type } from '@nestjs/common/interfaces';
|
3 | import { AbstractInstanceResolver } from './injector/abstract-instance-resolver';
|
4 | import { NestContainer } from './injector/container';
|
5 | import { Injector } from './injector/injector';
|
6 | import { InstanceLinksHost } from './injector/instance-links-host';
|
7 | import { ContextId } from './injector/instance-wrapper';
|
8 | import { Module } from './injector/module';
|
9 |
|
10 |
|
11 |
|
12 | export declare class NestApplicationContext extends AbstractInstanceResolver implements INestApplicationContext {
|
13 | protected readonly container: NestContainer;
|
14 | private readonly scope;
|
15 | private contextModule;
|
16 | protected isInitialized: boolean;
|
17 | protected readonly injector: Injector;
|
18 | private shouldFlushLogsOnOverride;
|
19 | private readonly activeShutdownSignals;
|
20 | private readonly moduleCompiler;
|
21 | private shutdownCleanupRef?;
|
22 | private _instanceLinksHost;
|
23 | private _moduleRefsByDistance?;
|
24 | protected get instanceLinksHost(): InstanceLinksHost;
|
25 | constructor(container: NestContainer, scope?: Type<any>[], contextModule?: Module);
|
26 | selectContextModule(): void;
|
27 | /**
|
28 | * Allows navigating through the modules tree, for example, to pull out a specific instance from the selected module.
|
29 | * @returns {INestApplicationContext}
|
30 | */
|
31 | select<T>(moduleType: Type<T> | DynamicModule): INestApplicationContext;
|
32 | |
33 |
|
34 |
|
35 |
|
36 | get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol): TResult;
|
37 | |
38 |
|
39 |
|
40 |
|
41 | get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, options: {
|
42 | strict?: boolean;
|
43 | each?: undefined | false;
|
44 | }): TResult;
|
45 | |
46 |
|
47 |
|
48 |
|
49 | get<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, options: {
|
50 | strict?: boolean;
|
51 | each: true;
|
52 | }): Array<TResult>;
|
53 | |
54 |
|
55 |
|
56 |
|
57 | resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol): Promise<TResult>;
|
58 | |
59 |
|
60 |
|
61 |
|
62 | resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, contextId?: {
|
63 | id: number;
|
64 | }): Promise<TResult>;
|
65 | |
66 |
|
67 |
|
68 |
|
69 | resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, contextId?: {
|
70 | id: number;
|
71 | }, options?: {
|
72 | strict?: boolean;
|
73 | each?: undefined | false;
|
74 | }): Promise<TResult>;
|
75 | |
76 |
|
77 |
|
78 |
|
79 | resolve<TInput = any, TResult = TInput>(typeOrToken: Type<TInput> | Function | string | symbol, contextId?: {
|
80 | id: number;
|
81 | }, options?: {
|
82 | strict?: boolean;
|
83 | each: true;
|
84 | }): Promise<Array<TResult>>;
|
85 | |
86 |
|
87 |
|
88 |
|
89 | registerRequestByContextId<T = any>(request: T, contextId: ContextId): void;
|
90 | |
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 | init(): Promise<this>;
|
97 | |
98 |
|
99 |
|
100 |
|
101 | close(): Promise<void>;
|
102 | |
103 |
|
104 |
|
105 |
|
106 |
|
107 | useLogger(logger: LoggerService | LogLevel[] | false): void;
|
108 | |
109 |
|
110 |
|
111 |
|
112 | flushLogs(): void;
|
113 | |
114 |
|
115 |
|
116 | flushLogsOnOverride(): void;
|
117 | |
118 |
|
119 |
|
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | enableShutdownHooks(signals?: (ShutdownSignal | string)[]): this;
|
127 | protected dispose(): Promise<void>;
|
128 | |
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | protected listenToShutdownSignals(signals: string[]): void;
|
135 | |
136 |
|
137 |
|
138 | protected unsubscribeFromProcessSignals(): void;
|
139 | |
140 |
|
141 |
|
142 |
|
143 | protected callInitHook(): Promise<void>;
|
144 | |
145 |
|
146 |
|
147 |
|
148 | protected callDestroyHook(): Promise<void>;
|
149 | |
150 |
|
151 |
|
152 |
|
153 | protected callBootstrapHook(): Promise<void>;
|
154 | |
155 |
|
156 |
|
157 |
|
158 | protected callShutdownHook(signal?: string): Promise<void>;
|
159 | |
160 |
|
161 |
|
162 |
|
163 | protected callBeforeShutdownHook(signal?: string): Promise<void>;
|
164 | private getModulesSortedByDistance;
|
165 | }
|