import { RotifMessage } from './types.js'; export type MiddlewareContext = { message: RotifMessage; next: () => Promise; }; export type Middleware = { beforePublish?: (channel: string, payload: any, options?: any) => void | Promise; afterPublish?: (channel: string, payload: any, id: string[] | string | null, options?: any) => void | Promise; beforeProcess?: (msg: RotifMessage) => void | Promise; afterProcess?: (msg: RotifMessage) => void | Promise; onError?: (msg: RotifMessage, error: Error) => void | Promise; }; export declare class MiddlewareManager { private middleware; use(mw: Middleware): void; runBeforePublish(channel: string, payload: any, options?: any): Promise; runAfterPublish(channel: string, payload: any, id: string[] | string | null, options?: any): Promise; runBeforeProcess(msg: RotifMessage): Promise; runAfterProcess(msg: RotifMessage): Promise; runOnError(msg: RotifMessage, err: Error): Promise; } //# sourceMappingURL=middleware.d.ts.map