UNPKG

2.95 kBTypeScriptView Raw
1import { CanActivate, ExceptionFilter, HttpServer, INestApplication, INestMicroservice, NestHybridApplicationOptions, NestInterceptor, PipeTransform, VersioningOptions, WebSocketAdapter } from '@nestjs/common';
2import { GlobalPrefixOptions, NestApplicationOptions } from '@nestjs/common/interfaces';
3import { CorsOptions, CorsOptionsDelegate } from '@nestjs/common/interfaces/external/cors-options.interface';
4import { AbstractHttpAdapter } from './adapters';
5import { ApplicationConfig } from './application-config';
6import { NestContainer } from './injector/container';
7import { NestApplicationContext } from './nest-application-context';
8/**
9 * @publicApi
10 */
11export declare class NestApplication extends NestApplicationContext implements INestApplication {
12 private readonly httpAdapter;
13 private readonly config;
14 private readonly appOptions;
15 private readonly logger;
16 private readonly middlewareModule;
17 private readonly middlewareContainer;
18 private readonly microservicesModule;
19 private readonly socketModule;
20 private readonly routesResolver;
21 private readonly microservices;
22 private httpServer;
23 private isListening;
24 constructor(container: NestContainer, httpAdapter: HttpServer, config: ApplicationConfig, appOptions?: NestApplicationOptions);
25 protected dispose(): Promise<void>;
26 getHttpAdapter(): AbstractHttpAdapter;
27 registerHttpServer(): void;
28 getUnderlyingHttpServer<T>(): T;
29 applyOptions(): void;
30 createServer<T = any>(): T;
31 registerModules(): Promise<void>;
32 registerWsModule(): void;
33 init(): Promise<this>;
34 registerParserMiddleware(): void;
35 registerRouter(): Promise<void>;
36 registerRouterHooks(): Promise<void>;
37 connectMicroservice<T extends object>(microserviceOptions: T, hybridAppOptions?: NestHybridApplicationOptions): INestMicroservice;
38 getMicroservices(): INestMicroservice[];
39 getHttpServer(): any;
40 startAllMicroservices(): Promise<this>;
41 use(...args: [any, any?]): this;
42 enableCors(options?: CorsOptions | CorsOptionsDelegate<any>): void;
43 enableVersioning(options?: VersioningOptions): this;
44 listen(port: number | string): Promise<any>;
45 listen(port: number | string, hostname: string): Promise<any>;
46 getUrl(): Promise<string>;
47 private formatAddress;
48 setGlobalPrefix(prefix: string, options?: GlobalPrefixOptions): this;
49 useWebSocketAdapter(adapter: WebSocketAdapter): this;
50 useGlobalFilters(...filters: ExceptionFilter[]): this;
51 useGlobalPipes(...pipes: PipeTransform<any>[]): this;
52 useGlobalInterceptors(...interceptors: NestInterceptor[]): this;
53 useGlobalGuards(...guards: CanActivate[]): this;
54 useStaticAssets(options: any): this;
55 useStaticAssets(path: string, options?: any): this;
56 setBaseViewsDir(path: string | string[]): this;
57 setViewEngine(engineOrOptions: any): this;
58 private host;
59 private getProtocol;
60 private registerMiddleware;
61}