import type { RetryStrategyConfig } from '@omnitron-dev/titan/utils'; export interface MessagingTransport { readonly id: string; readonly type: string; publish(channel: string, message: NotificationMessage, options?: TransportPublishOptions): Promise; subscribe(pattern: string, handler: NotificationHandler, options?: TransportSubscribeOptions): Promise; use(middleware: TransportMiddleware): void; healthCheck(): Promise; shutdown(): Promise; waitUntilReady?(): Promise; destroy?(): Promise; subscribeToDLQ?(handler: NotificationHandler): Promise; requeueFromDLQ?(count?: number): Promise; getDLQStats?(): Promise; getDLQMessages?(options?: DLQQueryOptions): Promise; cleanupDLQ?(): Promise; clearDLQ?(): Promise; updateDLQConfig?(config: Partial): void; } export interface TransportPublishOptions { delayMs?: number; deliverAt?: number | Date; exactlyOnce?: boolean; deduplicationTTL?: number; dedupKey?: string; priority?: 'low' | 'normal' | 'high' | 'urgent'; maxRetries?: number; metadata?: Record; } export interface TransportPublishResult { success: boolean; messageIds: string[]; status: 'published' | 'scheduled' | 'duplicate' | 'no_subscribers' | 'failed'; patternCount: number; error?: string; timestamp: number; } export interface TransportSubscribeOptions { groupName?: string; consumerName?: string; startFrom?: '$' | '0' | string; maxRetries?: number; retryDelay?: number | ((attempt: number) => number); retryStrategy?: RetryStrategyConfig; autoAck?: boolean; prefetchCount?: number; } export type NotificationHandler = (message: IncomingNotification) => Promise; export interface IncomingNotification { id: string; channel: string; payload: NotificationMessage; timestamp: number; attempt: number; metadata?: Record; ack(): Promise; nack?(requeue?: boolean): Promise; } export interface NotificationSubscription { id: string; pattern: string; group: string; isPaused: boolean; unsubscribe(removePattern?: boolean): Promise; pause(): void; resume(): void; stats(): SubscriptionStats; } export interface SubscriptionStats { messages: number; retries: number; failures?: number; lastMessageAt?: number; inflightCount?: number; } export interface TransportHealth { status: 'healthy' | 'degraded' | 'unhealthy'; connected: boolean; latency?: number; error?: string; details?: Record; timestamp: number; } export interface NotificationMessage { type: string; data: unknown; id?: string; metadata?: Record; } export interface DLQStats { totalMessages: number; messagesByChannel: Record; oldestMessage?: number; newestMessage?: number; messagesCleanedUp: number; messagesArchived: number; } export interface DLQQueryOptions { channel?: string; limit?: number; offset?: number; maxAge?: number; } export interface DLQMessageInfo { id: string; channel: string; payload: unknown; error?: string; timestamp: number; attempt: number; age: number; } export interface DLQCleanupConfig { enabled?: boolean; maxAge?: number; maxSize?: number; cleanupInterval?: number; batchSize?: number; archiveBeforeDelete?: boolean; archivePrefix?: string; } export interface TransportMiddleware { beforePublish?(channel: string, message: NotificationMessage, options?: TransportPublishOptions): void | Promise; afterPublish?(channel: string, message: NotificationMessage, result: TransportPublishResult, options?: TransportPublishOptions): void | Promise; beforeProcess?(notification: IncomingNotification): void | Promise; afterProcess?(notification: IncomingNotification): void | Promise; onError?(notification: IncomingNotification, error: Error): void | Promise; } export declare function generateUuid(): string; //# sourceMappingURL=transport.interface.d.ts.map