UNPKG

@nestjs/microservices

Version:

Microservices for NestJS: message and event handlers over Kafka, RabbitMQ, NATS, Redis, MQTT, gRPC or TCP.

10 lines (9 loc) • 413 B
import { OutgoingEvent, OutgoingRequest, OutgoingResponse } from './packet.interface.js'; /** * @publicApi */ export interface Serializer<TInput = any, TOutput = any> { serialize(value: TInput, options?: Record<string, any>): TOutput | Promise<TOutput>; } export type ProducerSerializer = Serializer<OutgoingEvent | OutgoingRequest, any>; export type ConsumerSerializer = Serializer<OutgoingResponse, any>;