UNPKG

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