import { AmplitudeConfig } from "./amplitude.js"; import { t as MockEventSubscriber } from "./mock-event-subscriber-CfAyAiQn.js"; import { MixpanelConfig } from "./mixpanel.js"; import { SegmentConfig } from "./segment.js"; import { WebhookConfig } from "./webhook.js"; import { SlackSubscriberConfig } from "./slack.js"; import { EventSubscriber } from "autotel/event-subscriber"; //#region src/factories.d.ts /** Create a Mixpanel events subscriber */ declare function createMixpanelSubscriber(config: { token: string; enabled?: boolean; }): EventSubscriber; /** Create an Amplitude events subscriber */ declare function createAmplitudeSubscriber(config: { apiKey: string; enabled?: boolean; }): EventSubscriber; /** Create a Segment events subscriber */ declare function createSegmentSubscriber(config: { writeKey: string; enabled?: boolean; }): EventSubscriber; /** Create a Webhook events subscriber with retry and timeout support */ declare function createWebhookSubscriber(config: { url: string; method?: 'POST' | 'PUT'; headers?: Record; enabled?: boolean; maxRetries?: number; timeoutMs?: number; retryDelayMs?: number; }): EventSubscriber; /** Create a Slack events subscriber */ declare function createSlackSubscriber(config: { webhookUrl: string; channel?: string; enabled?: boolean; }): EventSubscriber; /** Create a mock events subscriber for testing */ declare function createMockSubscriber(): MockEventSubscriber; /** * Strategy for composing multiple subscribers * * - `parallel`: Send to all subscribers concurrently, fail if any fails * - `failover`: Try subscribers in order until one succeeds * - `round-robin`: Cycle through subscribers sequentially * - `random`: Pick a random subscriber each time * - `race`: Send to all, succeed when any succeeds * - `mirrored`: Send to primary, mirror to others (primary failure fails all) */ type ComposeSubscriberStrategy = 'parallel' | 'failover' | 'round-robin' | 'random' | 'race' | 'mirrored'; /** Configuration options for composing multiple subscribers */ type ComposeSubscribersOptions = { name?: string; strategy?: ComposeSubscriberStrategy; maxAttemptsPerSubscriber?: number; initialRetryDelayMs?: number; maxRetryDelayMs?: number; isRetriable?: (cause: unknown) => boolean; logger?: Pick; }; /** * Compose multiple subscribers into one with a specified strategy * * @example * ```typescript * const multiSubscriber = composeSubscribers( * [ * createWebhookSubscriber({ url: '...' }) * ], * { strategy: 'parallel' } * ) * ``` * * @param subscribers - Array of subscribers to compose * @param options - Configuration for composition strategy and retry behavior * @returns A composite EventSubscriber that applies the strategy */ declare function composeSubscribers(subscribers: EventSubscriber[], options?: ComposeSubscribersOptions): EventSubscriber; //#endregion export { type AmplitudeConfig, ComposeSubscriberStrategy, ComposeSubscribersOptions, type MixpanelConfig, type SegmentConfig, type SlackSubscriberConfig, type WebhookConfig, composeSubscribers, createAmplitudeSubscriber, createMixpanelSubscriber, createMockSubscriber, createSegmentSubscriber, createSlackSubscriber, createWebhookSubscriber };