@nestjs/microservices
Version:
Nest - modern, fast, powerful node.js web framework (@microservices)
10 lines (9 loc) • 391 B
TypeScript
import { OutgoingEvent, OutgoingRequest, OutgoingResponse } from './packet.interface';
/**
* @publicApi
*/
export interface Serializer<TInput = any, TOutput = any> {
serialize(value: TInput, options?: Record<string, any>): TOutput;
}
export type ProducerSerializer = Serializer<OutgoingEvent | OutgoingRequest, any>;
export type ConsumerSerializer = Serializer<OutgoingResponse, any>;