UNPKG

3.09 kBTypeScriptView Raw
1import { ContextType, Controller, PipeTransform } from '@nestjs/common/interfaces';
2import { GuardsConsumer } from '@nestjs/core/guards/guards-consumer';
3import { GuardsContextCreator } from '@nestjs/core/guards/guards-context-creator';
4import { ParamProperties } from '@nestjs/core/helpers/context-utils';
5import { ExecutionContextHost } from '@nestjs/core/helpers/execution-context-host';
6import { ParamsMetadata } from '@nestjs/core/helpers/interfaces';
7import { InterceptorsConsumer, InterceptorsContextCreator } from '@nestjs/core/interceptors';
8import { PipesConsumer, PipesContextCreator } from '@nestjs/core/pipes';
9import { WsParamsFactory } from '../factories/ws-params-factory';
10import { ExceptionFiltersContext } from './exception-filters-context';
11import { WsProxy } from './ws-proxy';
12type WsParamProperties = ParamProperties & {
13 metatype?: any;
14};
15export interface WsHandlerMetadata {
16 argsLength: number;
17 paramtypes: any[];
18 getParamsMetadata: (moduleKey: string) => WsParamProperties[];
19}
20export declare class WsContextCreator {
21 private readonly wsProxy;
22 private readonly exceptionFiltersContext;
23 private readonly pipesContextCreator;
24 private readonly pipesConsumer;
25 private readonly guardsContextCreator;
26 private readonly guardsConsumer;
27 private readonly interceptorsContextCreator;
28 private readonly interceptorsConsumer;
29 private readonly contextUtils;
30 private readonly wsParamsFactory;
31 private readonly handlerMetadataStorage;
32 constructor(wsProxy: WsProxy, exceptionFiltersContext: ExceptionFiltersContext, pipesContextCreator: PipesContextCreator, pipesConsumer: PipesConsumer, guardsContextCreator: GuardsContextCreator, guardsConsumer: GuardsConsumer, interceptorsContextCreator: InterceptorsContextCreator, interceptorsConsumer: InterceptorsConsumer);
33 create<T extends ParamsMetadata = ParamsMetadata>(instance: Controller, callback: (...args: unknown[]) => void, moduleKey: string, methodName: string): (...args: any[]) => Promise<void>;
34 reflectCallbackParamtypes(instance: Controller, callback: (...args: any[]) => any): any[];
35 reflectCallbackPattern(callback: (...args: any[]) => any): string;
36 createGuardsFn<TContext extends string = ContextType>(guards: any[], instance: Controller, callback: (...args: unknown[]) => any, contextType?: TContext): Function | null;
37 getMetadata<TMetadata, TContext extends ContextType = ContextType>(instance: Controller, methodName: string, contextType: TContext): WsHandlerMetadata;
38 exchangeKeysForValues<TMetadata = any>(keys: string[], metadata: TMetadata, moduleContext: string, paramsFactory: WsParamsFactory, contextFactory: (args: unknown[]) => ExecutionContextHost): ParamProperties[];
39 createPipesFn(pipes: PipeTransform[], paramsOptions: (ParamProperties & {
40 metatype?: unknown;
41 })[]): (args: unknown[], ...params: unknown[]) => Promise<void>;
42 getParamValue<T>(value: T, { metatype, type, data }: {
43 metatype: any;
44 type: any;
45 data: any;
46 }, pipes: PipeTransform[]): Promise<any>;
47}
48export {};