import { EventBusTypes, InterceptorSubscriber, InternalModuleDeclaration } from "@medusajs/types"; export declare abstract class AbstractEventBusModuleService implements EventBusTypes.IEventBusModuleService { protected isWorkerMode: boolean; protected eventToSubscribersMap_: Map; protected interceptorSubscribers_: Set; get eventToSubscribersMap(): Map; protected constructor(cradle: Record, moduleOptions: {} | undefined, moduleDeclaration: InternalModuleDeclaration); abstract emit(data: EventBusTypes.Message | EventBusTypes.Message[], options: Record): Promise; abstract releaseGroupedEvents(eventGroupId: string): Promise; abstract clearGroupedEvents(eventGroupId: string, options?: { eventNames?: string[]; }): Promise; protected storeSubscribers({ event, subscriberId, subscriber, }: { event: string | symbol; subscriberId: string; subscriber: EventBusTypes.Subscriber; }): void; subscribe(eventName: string | symbol, subscriber: EventBusTypes.Subscriber, context?: EventBusTypes.SubscriberContext): this; unsubscribe(eventName: string | symbol, subscriber: EventBusTypes.Subscriber, context?: EventBusTypes.SubscriberContext): this; /** * Add an interceptor subscriber that receives all messages before they are emitted * * @param interceptor - Function that receives messages before emission * @returns this for chaining */ addInterceptor(interceptor: InterceptorSubscriber): this; /** * Remove an interceptor subscriber * * @param interceptor - Function to remove from interceptors * @returns this for chaining */ removeInterceptor(interceptor: InterceptorSubscriber): this; /** * Call all interceptor subscribers with the message before emission * This should be called by implementations before emitting events * * @param message - The message to be intercepted * @param context - Optional context about the emission */ protected callInterceptors(message: EventBusTypes.Message, context?: { isGrouped?: boolean; eventGroupId?: string; }): Promise; } export * from "./build-event-messages"; export * from "./common-events"; export * from "./message-aggregator"; export * from "./utils"; //# sourceMappingURL=index.d.ts.map