import { CloudEvent } from "../types"; import { PublishOptions, SubscribeOptions } from "./io-options"; export interface EventBusOptions { connection: { url: string; exchange?: string; exchangeType?: 'topic' | 'direct' | 'fanout'; deadLetterExchange?: string; retryExchange?: string; }; consumer?: { prefetch?: number; autoAck?: boolean; }; producer?: { persistent?: boolean; mandatory?: boolean; }; } export interface EventBus { publish(event: CloudEvent, options?: PublishOptions): Promise; subscribe(type: E | E[], handler: (event: CloudEvent) => Promise, options?: SubscribeOptions): Promise; unsubscribe(consumerTag: string): Promise; close(): Promise; } export interface EventBus { publish(event: CloudEvent, options?: PublishOptions): Promise; subscribe(type: E | E[], handler: (event: CloudEvent) => Promise, options?: SubscribeOptions): Promise; unsubscribe(consumerTag: string): Promise; close(): Promise; }