import { Context } from '../context'; import { Processor, Middleware } from 'rowan'; export type InterceptOptions = { id: string; handlers: Processor[]; }; /** * used to intercept messages with matching message ids and terminate further processing **/ export default class Interceptor implements Middleware { private _interceptors; meta: { type: "Interceptor"; }; /** * intercept any message with a matching id * @param id: message id to intercept * @param handlers: handlers or middleware * @returns method to remove (dispose) the interception entry.` */ intercept(opt: InterceptOptions): () => void; /** * re-route processing to an interceptor's middleware */ process(ctx: Context, next: any): Promise; dispose(): void; private _checkTimeout; }