UNPKG

@nestjs/microservices

Version:

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

18 lines (17 loc) 1.38 kB
import { Transport } from '../enums/index.js'; export type EventDataMethodDecorator<TEventTypes extends Record<string, any>, TKey extends keyof TEventTypes> = (target: object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<(data: TEventTypes[TKey], ...args: unknown[]) => any>) => void; /** * Subscribes to incoming events which fulfils chosen pattern. * * @publicApi */ export declare const EventPattern: { <TEventTypes extends Record<string, any>>(topic: keyof TEventTypes): EventDataMethodDecorator<TEventTypes, typeof topic>; <TEventTypes extends Record<string, any>>(topic: keyof TEventTypes, transport: Transport | symbol): EventDataMethodDecorator<TEventTypes, typeof topic>; <TEventTypes extends Record<string, any>>(topic: keyof TEventTypes, extras: Record<string, any>): EventDataMethodDecorator<TEventTypes, typeof topic>; <TEventTypes extends Record<string, any>>(topic: keyof TEventTypes, transport: Transport | symbol, extras: Record<string, any>): EventDataMethodDecorator<TEventTypes, typeof topic>; <T = string>(metadata?: T): MethodDecorator; <T = string>(metadata?: T, transport?: Transport | symbol): MethodDecorator; <T = string>(metadata?: T, extras?: Record<string, any>): MethodDecorator; <T = string>(metadata?: T, transport?: Transport | symbol, extras?: Record<string, any>): MethodDecorator; };