import { INestApplicationContext, LoggerService, ShutdownSignal } from '@nestjs/common'; import { Abstract } from '@nestjs/common/interfaces'; import { Type } from '@nestjs/common/interfaces/type.interface'; import { ContextId } from './injector'; import { NestContainer } from './injector/container'; import { Injector } from './injector/injector'; import { Module } from './injector/module'; /** * @publicApi */ export declare class NestApplicationContext implements INestApplicationContext { protected readonly container: NestContainer; private readonly scope; private contextModule; protected isInitialized: boolean; protected readonly injector: Injector; private readonly activeShutdownSignals; private readonly containerScanner; constructor(container: NestContainer, scope?: Type[], contextModule?: Module); selectContextModule(): void; select(module: Type): INestApplicationContext; get(typeOrToken: Type | Abstract | string | symbol, options?: { strict: boolean; }): TResult; resolve(typeOrToken: Type | string | symbol, contextId?: ContextId, options?: { strict: boolean; }): Promise; /** * Initalizes the Nest application. * Calls the Nest lifecycle events. * * @returns {Promise} The NestApplicationContext instance as Promise */ init(): Promise; close(): Promise; useLogger(logger: LoggerService): void; /** * Enables the usage of shutdown hooks. Will call the * `onApplicationShutdown` function of a provider if the * process receives a shutdown signal. * * @param {ShutdownSignal[]} [signals=[]] The system signals it should listen to * * @returns {this} The Nest application context instance */ enableShutdownHooks(signals?: (ShutdownSignal | string)[]): this; protected dispose(): Promise; /** * Listens to shutdown signals by listening to * process events * * @param {string[]} signals The system signals it should listen to */ protected listenToShutdownSignals(signals: string[]): void; /** * Calls the `onModuleInit` function on the registered * modules and its children. */ protected callInitHook(): Promise; /** * Calls the `onModuleDestroy` function on the registered * modules and its children. */ protected callDestroyHook(): Promise; /** * Calls the `onApplicationBootstrap` function on the registered * modules and its children. */ protected callBootstrapHook(): Promise; /** * Calls the `onApplicationShutdown` function on the registered * modules and children. */ protected callShutdownHook(signal?: string): Promise; /** * Calls the `beforeApplicationShutdown` function on the registered * modules and children. */ protected callBeforeShutdownHook(signal?: string): Promise; protected find(typeOrToken: Type | Abstract | string | symbol): TResult; protected findInstanceByToken(metatypeOrToken: Type | Abstract | string | symbol, contextModule: Partial): TResult; protected resolvePerContext(typeOrToken: Type | string | symbol, contextModule: Module, contextId: ContextId, options?: { strict: boolean; }): Promise; }