1 |
|
2 | import type { Server } from 'http';
|
3 | import { RequestMethod, VersioningOptions } from '@nestjs/common';
|
4 | import { VersionValue } from '@nestjs/common/interfaces';
|
5 | import { CorsOptions, CorsOptionsDelegate } from '@nestjs/common/interfaces/external/cors-options.interface';
|
6 | import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-application-options.interface';
|
7 | import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
|
8 | import * as bodyparser from 'body-parser';
|
9 | import { NestExpressBodyParserOptions } from '../interfaces/nest-express-body-parser-options.interface';
|
10 | import { ServeStaticOptions } from '../interfaces/serve-static-options.interface';
|
11 | type VersionedRoute = <TRequest extends Record<string, any> = any, TResponse = any>(req: TRequest, res: TResponse, next: () => void) => any;
|
12 |
|
13 |
|
14 |
|
15 | export declare class ExpressAdapter extends AbstractHttpAdapter {
|
16 | private readonly routerMethodFactory;
|
17 | private readonly logger;
|
18 | private readonly openConnections;
|
19 | constructor(instance?: any);
|
20 | reply(response: any, body: any, statusCode?: number): any;
|
21 | status(response: any, statusCode: number): any;
|
22 | end(response: any, message?: string): any;
|
23 | render(response: any, view: string, options: any): any;
|
24 | redirect(response: any, statusCode: number, url: string): any;
|
25 | setErrorHandler(handler: Function, prefix?: string): any;
|
26 | setNotFoundHandler(handler: Function, prefix?: string): any;
|
27 | isHeadersSent(response: any): boolean;
|
28 | setHeader(response: any, name: string, value: string): any;
|
29 | listen(port: string | number, callback?: () => void): Server;
|
30 | listen(port: string | number, hostname: string, callback?: () => void): Server;
|
31 | close(): Promise<unknown>;
|
32 | set(...args: any[]): any;
|
33 | enable(...args: any[]): any;
|
34 | disable(...args: any[]): any;
|
35 | engine(...args: any[]): any;
|
36 | useStaticAssets(path: string, options: ServeStaticOptions): any;
|
37 | setBaseViewsDir(path: string | string[]): any;
|
38 | setViewEngine(engine: string): any;
|
39 | getRequestHostname(request: any): string;
|
40 | getRequestMethod(request: any): string;
|
41 | getRequestUrl(request: any): string;
|
42 | enableCors(options: CorsOptions | CorsOptionsDelegate<any>): any;
|
43 | createMiddlewareFactory(requestMethod: RequestMethod): (path: string, callback: Function) => any;
|
44 | initHttpServer(options: NestApplicationOptions): void;
|
45 | registerParserMiddleware(prefix?: string, rawBody?: boolean): void;
|
46 | useBodyParser<Options extends bodyparser.Options = bodyparser.Options>(type: keyof bodyparser.BodyParser, rawBody: boolean, options?: NestExpressBodyParserOptions<Options>): this;
|
47 | setLocal(key: string, value: any): this;
|
48 | getType(): string;
|
49 | applyVersionFilter(handler: Function, version: VersionValue, versioningOptions: VersioningOptions): VersionedRoute;
|
50 | private trackOpenConnections;
|
51 | private closeOpenConnections;
|
52 | private isMiddlewareApplied;
|
53 | }
|
54 | export {};
|