/** * @license * Copyright 2025 Steven Roussey * SPDX-License-Identifier: Apache-2.0 */ export interface HybridManagerOptions { /** Default polling interval in milliseconds for backup polling */ readonly defaultIntervalMs?: number; /** Backup polling interval in milliseconds (0 to disable, default: 5000) */ readonly backupPollingIntervalMs?: number; /** Enable BroadcastChannel notifications (default: true) */ readonly useBroadcastChannel?: boolean; /** BroadcastChannel name for cross-tab communication */ readonly broadcastChannelName?: string; } import type { ChangeCallback, ChangePayloadFactory, ItemComparator, StateFetcher } from "./PollingSubscriptionManager"; export interface HybridSubscriptionOptions { /** Polling interval in milliseconds (not used if BroadcastChannel is active). */ readonly intervalMs?: number; } /** * Combines three notification mechanisms behind a single subscription API: * local events (same-tab), BroadcastChannel (cross-tab, near-instant), and an * optional backup poll. Falls back to local events only when BroadcastChannel * is unavailable. */ export declare class HybridSubscriptionManager { private readonly subscribers; private lastKnownState; private initialized; private channel; private backupPollingIntervalId; private readonly fetchState; private readonly compareItems; private readonly payloadFactory; private readonly options; private readonly hasBroadcastChannel; constructor(channelName: string, fetchState: StateFetcher, compareItems: ItemComparator, payloadFactory: ChangePayloadFactory, options?: HybridManagerOptions); private initializeBroadcastChannel; private handleBroadcastMessage; /** Must be called after any local mutation. */ notifyLocalChange(): void; subscribe(callback: ChangeCallback, options?: HybridSubscriptionOptions): () => void; private initAndNotify; private notifySubscriberOfCurrentState; private pollAndNotify; private startBackupPolling; private stopBackupPolling; get subscriptionCount(): number; get hasSubscriptions(): boolean; get isBroadcastChannelActive(): boolean; destroy(): void; } //# sourceMappingURL=HybridSubscriptionManager.d.ts.map