UNPKG

922 BTypeScriptView Raw
1import { ExecutionContext } from '@nestjs/common';
2import { Type } from '@nestjs/common/interfaces';
3import { ContextType, HttpArgumentsHost, RpcArgumentsHost, WsArgumentsHost } from '@nestjs/common/interfaces/features/arguments-host.interface';
4export declare class ExecutionContextHost implements ExecutionContext {
5 private readonly args;
6 private readonly constructorRef;
7 private readonly handler;
8 private contextType;
9 constructor(args: any[], constructorRef?: Type<any>, handler?: Function);
10 setType<TContext extends string = ContextType>(type: TContext): void;
11 getType<TContext extends string = ContextType>(): TContext;
12 getClass<T = any>(): Type<T>;
13 getHandler(): Function;
14 getArgs<T extends Array<any> = any[]>(): T;
15 getArgByIndex<T = any>(index: number): T;
16 switchToRpc(): RpcArgumentsHost;
17 switchToHttp(): HttpArgumentsHost;
18 switchToWs(): WsArgumentsHost;
19}