UNPKG

1.01 kBTypeScriptView Raw
1import { HttpServer, RequestMethod } from '@nestjs/common';
2export interface CustomHeader {
3 name: string;
4 value: string;
5}
6export interface RedirectResponse {
7 url: string;
8 statusCode: number;
9}
10export declare class RouterResponseController {
11 private readonly applicationRef;
12 constructor(applicationRef: HttpServer);
13 apply<TInput = any, TResponse = any>(result: TInput, response: TResponse, httpStatusCode?: number): Promise<any>;
14 redirect<TInput = any, TResponse = any>(resultOrDeferred: TInput, response: TResponse, redirectResponse: RedirectResponse): Promise<void>;
15 render<TInput = any, TResponse = any>(resultOrDeferred: TInput, response: TResponse, template: string): Promise<void>;
16 transformToResult(resultOrDeferred: any): Promise<any>;
17 getStatusByMethod(requestMethod: RequestMethod): number;
18 setHeaders<TResponse = any>(response: TResponse, headers: CustomHeader[]): void;
19 setStatus<TResponse = any>(response: TResponse, statusCode: number): void;
20}