UNPKG

@nestjs/microservices

Version:

Nest - modern, fast, powerful node.js web framework (@microservices)

42 lines (41 loc) 3.14 kB
import type { ArgumentMetadata, ContextType, PipeTransform } from '@nestjs/common'; import { type Controller } from '@nestjs/common/internal'; import type { ApplicationConfig } from '@nestjs/core'; import { ExecutionContextHost, type GuardsConsumer, type GuardsContextCreator, type InterceptorsConsumer, type InterceptorsContextCreator, type ParamProperties, type ParamsMetadata, type PipesConsumer, type PipesContextCreator } from '@nestjs/core/internal'; import { Observable } from 'rxjs'; import { RpcParamsFactory } from '../factories/rpc-params-factory.js'; import { ExceptionFiltersContext } from './exception-filters-context.js'; import { RpcProxy } from './rpc-proxy.js'; type RpcParamProperties = ParamProperties & { metatype?: any; }; export interface RpcHandlerMetadata { argsLength: number; paramtypes: any[]; getParamsMetadata: (moduleKey: string) => RpcParamProperties[]; } export declare class RpcContextCreator { private readonly rpcProxy; private readonly exceptionFiltersContext; private readonly pipesContextCreator; private readonly pipesConsumer; private readonly guardsContextCreator; private readonly guardsConsumer; private readonly interceptorsContextCreator; private readonly interceptorsConsumer; private readonly applicationConfig?; private readonly contextUtils; private readonly rpcParamsFactory; private readonly handlerMetadataStorage; constructor(rpcProxy: RpcProxy, exceptionFiltersContext: ExceptionFiltersContext, pipesContextCreator: PipesContextCreator, pipesConsumer: PipesConsumer, guardsContextCreator: GuardsContextCreator, guardsConsumer: GuardsConsumer, interceptorsContextCreator: InterceptorsContextCreator, interceptorsConsumer: InterceptorsConsumer, applicationConfig?: ApplicationConfig | undefined); 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>>; reflectCallbackParamtypes(instance: Controller, callback: (...args: unknown[]) => unknown): unknown[]; createGuardsFn<TContext extends string = ContextType>(guards: any[], instance: Controller, callback: (...args: unknown[]) => unknown, contextType?: TContext): Function | null; getMetadata<TMetadata, TContext extends ContextType = ContextType>(instance: Controller, methodName: string, defaultCallMetadata: Record<string, any>, contextType: TContext): RpcHandlerMetadata; exchangeKeysForValues<TMetadata = any>(keys: string[], metadata: TMetadata, moduleContext: string, paramsFactory: RpcParamsFactory, contextFactory: (args: unknown[]) => ExecutionContextHost): ParamProperties[]; createPipesFn(pipes: PipeTransform[], paramsOptions: (ParamProperties & { metatype?: unknown; })[]): ((args: unknown[], ...params: unknown[]) => Promise<void>) | null; getParamValue<T>(value: T, metadata: ArgumentMetadata, pipes: PipeTransform[]): Promise<any>; } export {};