UNPKG

2.26 kBTypeScriptView Raw
1import { RequestMethod } from '@nestjs/common';
2import { VersioningOptions, VersionValue } from '@nestjs/common/interfaces';
3import { CorsOptions, CorsOptionsDelegate } from '@nestjs/common/interfaces/external/cors-options.interface';
4import { NestApplicationOptions } from '@nestjs/common/interfaces/nest-application-options.interface';
5import { AbstractHttpAdapter } from '@nestjs/core/adapters/http-adapter';
6import { ServeStaticOptions } from '../interfaces/serve-static-options.interface';
7export declare class ExpressAdapter extends AbstractHttpAdapter {
8 private readonly routerMethodFactory;
9 constructor(instance?: any);
10 reply(response: any, body: any, statusCode?: number): any;
11 status(response: any, statusCode: number): any;
12 render(response: any, view: string, options: any): any;
13 redirect(response: any, statusCode: number, url: string): any;
14 setErrorHandler(handler: Function, prefix?: string): any;
15 setNotFoundHandler(handler: Function, prefix?: string): any;
16 setHeader(response: any, name: string, value: string): any;
17 listen(port: string | number, callback?: () => void): any;
18 listen(port: string | number, hostname: string, callback?: () => void): any;
19 close(): Promise<unknown>;
20 set(...args: any[]): any;
21 enable(...args: any[]): any;
22 disable(...args: any[]): any;
23 engine(...args: any[]): any;
24 useStaticAssets(path: string, options: ServeStaticOptions): any;
25 setBaseViewsDir(path: string | string[]): any;
26 setViewEngine(engine: string): any;
27 getRequestHostname(request: any): string;
28 getRequestMethod(request: any): string;
29 getRequestUrl(request: any): string;
30 enableCors(options: CorsOptions | CorsOptionsDelegate<any>): any;
31 createMiddlewareFactory(requestMethod: RequestMethod): (path: string, callback: Function) => any;
32 initHttpServer(options: NestApplicationOptions): void;
33 registerParserMiddleware(): void;
34 setLocal(key: string, value: any): this;
35 getType(): string;
36 applyVersionFilter(handler: Function, version: VersionValue, versioningOptions: VersioningOptions): <TRequest extends Record<string, any> = any, TResponse = any>(req: TRequest, res: TResponse, next: () => void) => any;
37 private isMiddlewareApplied;
38}