import type { EventHandler, Logger, Unsubscribe } from './types'; /** Configuration for `ws.push(event, config)`. */ export interface PushConfig { /** Custom render function — you decide how to display. */ render?: (data: T) => void; /** Title for browser Notification API. */ title?: string | ((data: T) => string); /** Body for browser Notification API. */ body?: string | ((data: T) => string); /** Icon URL for browser Notification. */ icon?: string; /** Tag for browser Notification deduplication. */ tag?: string | ((data: T) => string); /** * Which tab(s) show the notification: * - `'active'` — only the visible/focused tab (default for render) * - `'leader'` — only the leader tab (default for browser Notification) * - `'all'` — every tab (critical alerts) */ target?: 'active' | 'leader' | 'all'; /** Called when browser Notification is clicked. */ onClick?: (data: T) => void; } /** What PushManager needs from its owner. */ export interface PushManagerDeps { /** Subscribe to an event (SharedWebSocket.on). */ on: (event: string, handler: EventHandler) => Unsubscribe; isLeader: () => boolean; isActive: () => boolean; log: Logger; } /** * Routes incoming events to UI notifications — custom render and/or the browser * Notification API — with `target` deciding which tab(s) display them. Extracted * from SharedWebSocket so the render-vs-native dispatch lives in one unit. */ export declare class PushManager { private readonly deps; constructor(deps: PushManagerDeps); push(event: string, config: PushConfig): Unsubscribe; }