UNPKG

3.43 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 } from '@nestjs/core/interceptors/interceptors-consumer';
8import { InterceptorsContextCreator } from '@nestjs/core/interceptors/interceptors-context-creator';
9import { PipesConsumer } from '@nestjs/core/pipes/pipes-consumer';
10import { PipesContextCreator } from '@nestjs/core/pipes/pipes-context-creator';
11import { Observable } from 'rxjs';
12import { RpcParamsFactory } from '../factories/rpc-params-factory';
13import { ExceptionFiltersContext } from './exception-filters-context';
14import { RpcProxy } from './rpc-proxy';
15type RpcParamProperties = ParamProperties & {
16 metatype?: any;
17};
18export interface RpcHandlerMetadata {
19 argsLength: number;
20 paramtypes: any[];
21 getParamsMetadata: (moduleKey: string) => RpcParamProperties[];
22}
23export declare class RpcContextCreator {
24 private readonly rpcProxy;
25 private readonly exceptionFiltersContext;
26 private readonly pipesContextCreator;
27 private readonly pipesConsumer;
28 private readonly guardsContextCreator;
29 private readonly guardsConsumer;
30 private readonly interceptorsContextCreator;
31 private readonly interceptorsConsumer;
32 private readonly contextUtils;
33 private readonly rpcParamsFactory;
34 private readonly handlerMetadataStorage;
35 constructor(rpcProxy: RpcProxy, exceptionFiltersContext: ExceptionFiltersContext, pipesContextCreator: PipesContextCreator, pipesConsumer: PipesConsumer, guardsContextCreator: GuardsContextCreator, guardsConsumer: GuardsConsumer, interceptorsContextCreator: InterceptorsContextCreator, interceptorsConsumer: InterceptorsConsumer);
36 create<T extends ParamsMetadata = ParamsMetadata>(instance: Controller, callback: (...args: unknown[]) => Observable<any>, moduleKey: string, methodName: string, contextId?: import("@nestjs/core").ContextId, inquirerId?: string, defaultCallMetadata?: Record<string, any>): (...args: any[]) => Promise<Observable<any>>;
37 reflectCallbackParamtypes(instance: Controller, callback: (...args: unknown[]) => unknown): unknown[];
38 createGuardsFn<TContext extends string = ContextType>(guards: any[], instance: Controller, callback: (...args: unknown[]) => unknown, contextType?: TContext): Function | null;
39 getMetadata<TMetadata, TContext extends ContextType = ContextType>(instance: Controller, methodName: string, defaultCallMetadata: Record<string, any>, contextType: TContext): RpcHandlerMetadata;
40 exchangeKeysForValues<TMetadata = any>(keys: string[], metadata: TMetadata, moduleContext: string, paramsFactory: RpcParamsFactory, contextFactory: (args: unknown[]) => ExecutionContextHost): ParamProperties[];
41 createPipesFn(pipes: PipeTransform[], paramsOptions: (ParamProperties & {
42 metatype?: unknown;
43 })[]): (args: unknown[], ...params: unknown[]) => Promise<void>;
44 getParamValue<T>(value: T, { metatype, type, data }: {
45 metatype: any;
46 type: any;
47 data: any;
48 }, pipes: PipeTransform[]): Promise<any>;
49}
50export {};