UNPKG

3.37 kBTypeScriptView Raw
1import { INestApplication, INestApplicationContext, INestMicroservice } from '@nestjs/common';
2import { MicroserviceOptions } from '@nestjs/common/interfaces/microservices/microservice-configuration.interface';
3import { NestMicroserviceOptions } from '@nestjs/common/interfaces/microservices/nest-microservice-options.interface';
4import { NestApplicationContextOptions } from '@nestjs/common/interfaces/nest-application-context-options.interface';
5import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-application-options.interface';
6import { AbstractHttpAdapter } from './adapters/http-adapter';
7/**
8 * @publicApi
9 */
10export declare class NestFactoryStatic {
11 private readonly logger;
12 /**
13 * Creates an instance of NestApplication.
14 *
15 * @param module Entry (root) application module class
16 * @param options List of options to initialize NestApplication
17 *
18 * @returns A promise that, when resolved,
19 * contains a reference to the NestApplication instance.
20 */
21 create<T extends INestApplication = INestApplication>(module: any, options?: NestApplicationOptions): Promise<T>;
22 /**
23 * Creates an instance of NestApplication with the specified `httpAdapter`.
24 *
25 * @param module Entry (root) application module class
26 * @param httpAdapter Adapter to proxy the request/response cycle to
27 * the underlying HTTP server
28 * @param options List of options to initialize NestApplication
29 *
30 * @returns A promise that, when resolved,
31 * contains a reference to the NestApplication instance.
32 */
33 create<T extends INestApplication = INestApplication>(module: any, httpAdapter: AbstractHttpAdapter, options?: NestApplicationOptions): Promise<T>;
34 /**
35 * Creates an instance of NestMicroservice.
36 *
37 * @param module Entry (root) application module class
38 * @param options Optional microservice configuration
39 *
40 * @returns A promise that, when resolved,
41 * contains a reference to the NestMicroservice instance.
42 */
43 createMicroservice(module: any, options?: NestMicroserviceOptions & MicroserviceOptions): Promise<INestMicroservice>;
44 /**
45 * Creates an instance of NestApplicationContext.
46 *
47 * @param module Entry (root) application module class
48 * @param options Optional Nest application configuration
49 *
50 * @returns A promise that, when resolved,
51 * contains a reference to the NestApplicationContext instance.
52 */
53 createApplicationContext(module: any, options?: NestApplicationContextOptions): Promise<INestApplicationContext>;
54 private createNestInstance;
55 private initialize;
56 private createProxy;
57 private createExceptionProxy;
58 private createExceptionZone;
59 private applyLogger;
60 private createHttpAdapter;
61 private isHttpServer;
62 private createAdapterProxy;
63}
64/**
65 * Use NestFactory to create an application instance.
66 *
67 * ### Specifying an entry module
68 *
69 * Pass the required *root module* for the application via the module parameter.
70 * By convention, it is usually called `ApplicationModule`. Starting with this
71 * module, Nest assembles the dependency graph and begins the process of
72 * Dependency Injection and instantiates the classes needed to launch your
73 * application.
74 *
75 * @publicApi
76 */
77export declare const NestFactory: NestFactoryStatic;