UNPKG

@nestjs-mod/common

Version:

A collection of utilities for unifying NestJS applications and modules

58 lines (57 loc) 3.17 kB
import { INestApplication, LogLevel, Logger, LoggerService, NestApplicationOptions } from '@nestjs/common'; import { CorsOptions, CorsOptionsDelegate } from '@nestjs/common/interfaces/external/cors-options.interface'; import { HttpsOptions } from '@nestjs/common/interfaces/external/https-options.interface'; import { WrapApplicationOptions } from '../../../nest-module/types'; export declare class DefaultNestApplicationInitializerConfig implements NestApplicationOptions { cors?: boolean | CorsOptions | CorsOptionsDelegate<any>; bodyParser?: boolean; httpsOptions?: HttpsOptions; rawBody?: boolean; defaultLogger?: Logger | null; /** * Specifies the logger to use. Pass `false` to turn off logging. */ logger?: LoggerService | LogLevel[] | false; /** * Whether to abort the process on Error. By default, the process is exited. * Pass `false` to override the default behavior. If `false` is passed, Nest will not exit * the application and instead will rethrow the exception. * @default true */ abortOnError?: boolean; /** * If enabled, logs will be buffered until the "Logger#flush" method is called. * @default false */ bufferLogs?: boolean; /** * If enabled, logs will be automatically flushed and buffer detached when * application initialization process either completes or fails. * @default true */ autoFlushLogs?: boolean; /** * Whether to run application in the preview mode. * In the preview mode, providers/controllers are not instantiated & resolved. * * @default false */ preview?: boolean; /** * Whether to generate a serialized graph snapshot. * * @default false */ snapshot?: boolean; /** * Force close open HTTP connections. Useful if restarting your application hangs due to * keep-alive connections in the HTTP adapter. */ forceCloseConnections?: boolean; preCreateApplication?: (options: WrapApplicationOptions<INestApplication, DefaultNestApplicationInitializerConfig>) => Promise<void>; postCreateApplication?: (options: WrapApplicationOptions<INestApplication, DefaultNestApplicationInitializerConfig>) => Promise<void>; } export declare const DefaultNestApplicationInitializer: Record<"forFeatureAsync", (asyncOptions?: import("../../../nest-module/types").ForFeatureAsyncMethodOptions<never, DefaultNestApplicationInitializerConfig, never, never, never, never> | undefined) => Promise<import("@nestjs/common").DynamicModule>> & Record<"forFeature", (options?: { featureModuleName: string; contextName?: string; } | undefined) => Promise<import("@nestjs/common").DynamicModule>> & Record<"forRoot", (options?: import("../../../nest-module/types").ForRootMethodOptions<DefaultNestApplicationInitializerConfig, never, never, never> | undefined) => Promise<import("@nestjs/common").DynamicModule>> & Record<"forRootAsync", (asyncOptions?: import("../../../nest-module/types").ForRootAsyncMethodOptions<DefaultNestApplicationInitializerConfig, never, never, never> | undefined) => Promise<import("@nestjs/common").DynamicModule>>;