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