11/// <reference types="node" />
22import * as http from 'http' ;
3- import { CanActivate , ExceptionFilter , NestInterceptor , PipeTransform , WebSocketAdapter } from '@nestjs/common' ;
3+ import {
4+ CanActivate ,
5+ ExceptionFilter ,
6+ NestInterceptor ,
7+ PipeTransform ,
8+ WebSocketAdapter ,
9+ } from '@nestjs/common' ;
410import { INestApplication , INestMicroservice } from '@nestjs/common' ;
511import { MicroserviceOptions } from '@nestjs/common/interfaces/microservices/microservice-configuration.interface' ;
612import { ApplicationConfig } from './application-config' ;
@@ -12,61 +18,69 @@ import { HttpServer } from '@nestjs/common/interfaces';
1218import { INestExpressApplication } from '@nestjs/common/interfaces/nest-express-application.interface' ;
1319import { INestFastifyApplication } from '@nestjs/common/interfaces/nest-fastify-application.interface' ;
1420import { ServeStaticOptions } from '@nestjs/common/interfaces/external/serve-static-options.interface' ;
15- export declare class NestApplication extends NestApplicationContext implements INestApplication , INestExpressApplication , INestFastifyApplication {
16- private readonly httpAdapter ;
17- private readonly config ;
18- private readonly appOptions ;
19- private readonly logger ;
20- private readonly middlewaresModule ;
21- private readonly middlewaresContainer ;
22- private readonly microservicesModule ;
23- private readonly socketModule ;
24- private readonly routesResolver ;
25- private readonly microservices ;
26- private httpServer ;
27- private isInitialized ;
28- constructor ( container : NestContainer , httpAdapter : HttpServer , config : ApplicationConfig , appOptions ?: NestApplicationOptions ) ;
29- registerHttpServer ( ) : void ;
30- applyOptions ( ) : this;
31- createServer ( ) : any ;
32- getUnderlyingHttpServer ( ) : any ;
33- registerModules ( ) : Promise < void > ;
34- init ( ) : Promise < this> ;
35- registerParserMiddlewares ( ) : any ;
36- isMiddlewareApplied ( httpAdapter : HttpServer , name : string ) : boolean ;
37- registerRouter ( ) : Promise < void > ;
38- connectMicroservice ( options : MicroserviceOptions ) : INestMicroservice ;
39- getMicroservices ( ) : INestMicroservice [ ] ;
40- getHttpServer ( ) : http . Server ;
41- startAllMicroservices ( callback ?: ( ) => void ) : this;
42- startAllMicroservicesAsync ( ) : Promise < void > ;
43- use ( ...args : any [ ] ) : this;
44- engine ( ...args : any [ ] ) : this;
45- set ( ...args : any [ ] ) : this;
46- disable ( ...args : any [ ] ) : this;
47- enable ( ...args : any [ ] ) : this;
48- register ( ...args : any [ ] ) : this;
49- inject ( ...args : any [ ] ) : any ;
50- enableCors ( options ?: CorsOptions ) : this;
51- listen ( port : number | string , callback ?: ( ) => void ) : any ;
52- listen ( port : number | string , hostname : string , callback ?: ( ) => void ) : any ;
53- listenAsync ( port : number | string , hostname ?: string ) : Promise < any > ;
54- close ( ) : void ;
55- setGlobalPrefix ( prefix : string ) : this;
56- useWebSocketAdapter ( adapter : WebSocketAdapter ) : this;
57- useGlobalFilters ( ...filters : ExceptionFilter [ ] ) : this;
58- useGlobalPipes ( ...pipes : PipeTransform < any > [ ] ) : this;
59- useGlobalInterceptors ( ...interceptors : NestInterceptor [ ] ) : this;
60- useGlobalGuards ( ...guards : CanActivate [ ] ) : this;
61- useStaticAssets ( options : any ) : this;
62- useStaticAssets ( path : string , options ?: ServeStaticOptions ) : any ;
63- setBaseViewsDir ( path : string ) : this;
64- setViewEngine ( engineOrOptions : any ) : this;
65- private loadPackage ( name , ctx ) ;
66- private registerMiddlewares ( instance ) ;
67- private isExpress ( ) ;
68- private listenToPromise ( microservice ) ;
69- private callDestroyHook ( ) ;
70- private callModuleDestroyHook ( module ) ;
71- private hasOnModuleDestroyHook ( instance ) ;
21+ export declare class NestApplication extends NestApplicationContext
22+ implements INestApplication ,
23+ INestExpressApplication ,
24+ INestFastifyApplication {
25+ private readonly httpAdapter ;
26+ private readonly config ;
27+ private readonly appOptions ;
28+ private readonly logger ;
29+ private readonly middlewaresModule ;
30+ private readonly middlewaresContainer ;
31+ private readonly microservicesModule ;
32+ private readonly socketModule ;
33+ private readonly routesResolver ;
34+ private readonly microservices ;
35+ private httpServer ;
36+ private isInitialized ;
37+ constructor (
38+ container : NestContainer ,
39+ httpAdapter : HttpServer ,
40+ config : ApplicationConfig ,
41+ appOptions ?: NestApplicationOptions ,
42+ ) ;
43+ registerHttpServer ( ) : void ;
44+ applyOptions ( ) : this;
45+ createServer ( ) : any ;
46+ getUnderlyingHttpServer ( ) : any ;
47+ registerModules ( ) : Promise < void > ;
48+ init ( ) : Promise < this> ;
49+ registerParserMiddlewares ( ) : any ;
50+ isMiddlewareApplied ( httpAdapter : HttpServer , name : string ) : boolean ;
51+ registerRouter ( ) : Promise < void > ;
52+ connectMicroservice ( options : MicroserviceOptions ) : INestMicroservice ;
53+ getMicroservices ( ) : INestMicroservice [ ] ;
54+ getHttpServer ( ) : http . Server ;
55+ startAllMicroservices ( callback ?: ( ) => void ) : this;
56+ startAllMicroservicesAsync ( ) : Promise < void > ;
57+ use ( ...args : any [ ] ) : this;
58+ engine ( ...args : any [ ] ) : this;
59+ set ( ...args : any [ ] ) : this;
60+ disable ( ...args : any [ ] ) : this;
61+ enable ( ...args : any [ ] ) : this;
62+ register ( ...args : any [ ] ) : this;
63+ inject ( ...args : any [ ] ) : any ;
64+ enableCors ( options ?: CorsOptions ) : this;
65+ listen ( port : number | string , callback ?: ( ) => void ) : any ;
66+ listen ( port : number | string , hostname : string , callback ?: ( ) => void ) : any ;
67+ listenAsync ( port : number | string , hostname ?: string ) : Promise < any > ;
68+ close ( ) : void ;
69+ setGlobalPrefix ( prefix : string ) : this;
70+ useWebSocketAdapter ( adapter : WebSocketAdapter ) : this;
71+ useGlobalFilters ( ...filters : ExceptionFilter [ ] ) : this;
72+ useGlobalPipes ( ...pipes : PipeTransform < any > [ ] ) : this;
73+ useGlobalInterceptors ( ...interceptors : NestInterceptor [ ] ) : this;
74+ useGlobalGuards ( ...guards : CanActivate [ ] ) : this;
75+ useStaticAssets ( options : any ) : this;
76+ useStaticAssets ( path : string , options ?: ServeStaticOptions ) : any ;
77+ setBaseViewsDir ( path : string ) : this;
78+ setViewEngine ( engineOrOptions : any ) : this;
79+ private loadPackage ( name , ctx ) ;
80+ private registerMiddlewares ( instance ) ;
81+ private isExpress ( ) ;
82+ private listenToPromise ( microservice ) ;
83+ private callDestroyHook ( ) ;
84+ private callModuleDestroyHook ( module ) ;
85+ private hasOnModuleDestroyHook ( instance ) ;
7286}
0 commit comments