@nestjs/core
Version:
Nest - modern, fast, powerful node.js web framework (@core)
53 lines (52 loc) • 3.73 kB
TypeScript
import { HttpServer, ParamData, PipeTransform, RequestMethod } from '@nestjs/common';
import { RouteParamsMetadata } from '@nestjs/common/decorators';
import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum';
import { Controller } from '@nestjs/common/interfaces';
import { GuardsConsumer } from '../guards/guards-consumer';
import { GuardsContextCreator } from '../guards/guards-context-creator';
import { HandlerMetadata } from '../helpers/handler-metadata-storage';
import { InterceptorsConsumer } from '../interceptors/interceptors-consumer';
import { InterceptorsContextCreator } from '../interceptors/interceptors-context-creator';
import { PipesConsumer } from '../pipes/pipes-consumer';
import { PipesContextCreator } from '../pipes/pipes-context-creator';
import { IRouteParamsFactory } from './interfaces/route-params-factory.interface';
import { CustomHeader, RedirectResponse } from './router-response-controller';
export interface ParamProperties {
index: number;
type: RouteParamtypes | string;
data: ParamData;
pipes: PipeTransform[];
extractValue: <TRequest, TResponse>(req: TRequest, res: TResponse, next: Function) => any;
}
export declare class RouterExecutionContext {
private readonly paramsFactory;
private readonly pipesContextCreator;
private readonly pipesConsumer;
private readonly guardsContextCreator;
private readonly guardsConsumer;
private readonly interceptorsContextCreator;
private readonly interceptorsConsumer;
readonly applicationRef: HttpServer;
private readonly handlerMetadataStorage;
private readonly contextUtils;
private readonly responseController;
constructor(paramsFactory: IRouteParamsFactory, pipesContextCreator: PipesContextCreator, pipesConsumer: PipesConsumer, guardsContextCreator: GuardsContextCreator, guardsConsumer: GuardsConsumer, interceptorsContextCreator: InterceptorsContextCreator, interceptorsConsumer: InterceptorsConsumer, applicationRef: HttpServer);
create(instance: Controller, callback: (...args: any[]) => any, methodName: string, module: string, requestMethod: RequestMethod, contextId?: import("..").ContextId, inquirerId?: string): <TRequest, TResponse>(req: TRequest, res: TResponse, next: Function) => Promise<void>;
getMetadata(instance: Controller, callback: (...args: any[]) => any, methodName: string, module: string, requestMethod: RequestMethod): HandlerMetadata;
reflectRedirect(callback: (...args: any[]) => any): RedirectResponse;
reflectHttpStatusCode(callback: (...args: any[]) => any): number;
reflectRenderTemplate(callback: (...args: any[]) => any): string;
reflectResponseHeaders(callback: (...args: any[]) => any): CustomHeader[];
exchangeKeysForValues(keys: string[], metadata: RouteParamsMetadata, moduleContext: string, contextId?: import("..").ContextId, inquirerId?: string): ParamProperties[];
getCustomFactory(factory: (...args: any[]) => void, data: any): (...args: any[]) => any;
getParamValue<T>(value: T, { metatype, type, data, }: {
metatype: any;
type: RouteParamtypes;
data: any;
}, pipes: PipeTransform[]): Promise<any>;
createGuardsFn(guards: any[], instance: Controller, callback: (...args: any[]) => any): Function | null;
createPipesFn(pipes: PipeTransform[], paramsOptions: (ParamProperties & {
metatype?: any;
})[]): <TRequest, TResponse>(args: any[], req: TRequest, res: TResponse, next: Function) => Promise<void>;
createHandleResponseFn(callback: (...args: any[]) => any, isResponseHandled: boolean, redirectResponse?: RedirectResponse, httpStatusCode?: number): <TResult, TResponse>(result: TResult, res: TResponse) => Promise<void>;
}