UNPKG

@message-in-the-middle/core

Version:

Framework-agnostic middleware pattern for message queue processing. Core package with all middlewares.

12 lines (11 loc) 730 B
import { InboundMiddleware, OutboundMiddleware, MessageContext } from '../types'; export declare class TransformInboundMiddleware<TInput = any, TOutput = any> implements InboundMiddleware<TInput> { private readonly transformer; constructor(transformer: (message: TInput) => Promise<TOutput> | TOutput); process(context: MessageContext<TInput>, next: () => Promise<void>): Promise<void>; } export declare class TransformOutboundMiddleware<TInput = any, TOutput = any> implements OutboundMiddleware<TInput> { private readonly transformer; constructor(transformer: (message: TInput) => Promise<TOutput> | TOutput); processOutbound(context: MessageContext<TInput>, next: () => Promise<void>): Promise<void>; }