UNPKG

422 BTypeScriptView Raw
1import { IncomingEvent, IncomingRequest, IncomingResponse } from './packet.interface';
2/**
3 * @publicApi
4 */
5export interface Deserializer<TInput = any, TOutput = any> {
6 deserialize(value: TInput, options?: Record<string, any>): TOutput | Promise<TOutput>;
7}
8export type ProducerDeserializer = Deserializer<any, IncomingResponse>;
9export type ConsumerDeserializer = Deserializer<any, IncomingRequest | IncomingEvent>;