import React from 'react';
import { type Notification, type NotificationOutcome, type NotificationStreamHandle, type NotificationStreamOptions } from '../lib/notifications-client.js';
/**
 * Top-bar notification bell + dropdown panel. Slice 6 of Phase 3
 * surfaces every collaboration event that affects the current user —
 * comment replies, resolves, and mentions — without forcing the
 * editor to round-trip through the comments side panel.
 *
 * Design choices:
 *
 * - **SSE push, with poll fallback (Phase 7).** A persistent
 *   `EventSource` subscribes to `/api/cms/notifications/stream` for
 *   instant delivery; new notifications bump the badge immediately
 *   instead of after the next 30 s poll tick. The poll loop is kept
 *   alive at a back-pressure-friendly cadence (default 60 s — twice
 *   the legacy 30 s value because SSE handles the common case) and
 *   acts as a backstop for:
 *     1. multi-node deployments where the in-process bus only
 *        publishes to subscribers on the same node, and
 *     2. proxies / browsers that silently drop the EventSource
 *        without firing `onerror`.
 * - **Optimistic read state.** When the user clicks a notification we
 *   mark it read locally before the server confirms — so the bell
 *   counter feels instant. Server failures roll the state back via
 *   the `onError` toast.
 * - **API injection.** The dependency-injection seam matches the rest
 *   of the admin (`CommentSidePanel.api`) so unit tests can substitute
 *   in-memory fakes — including the EventSource subscriber, which
 *   isn't available in JSDOM by default.
 */
export interface NotificationsApi {
    list: (opts: {
        includeRead?: boolean;
    }) => Promise<NotificationOutcome<Notification[]>>;
    unread: () => Promise<NotificationOutcome<number>>;
    markRead: (id: string) => Promise<NotificationOutcome<Notification>>;
    markAllRead: () => Promise<NotificationOutcome<number>>;
    /**
     * Open a per-user SSE subscription. Implementations MUST always
     * return a handle — even in environments without `EventSource`
     * (SSR, JSDOM without a polyfill), where a no-op `{ close() {} }`
     * is the right answer. The bell's effect calls `handle.close()`
     * unconditionally on unmount; a `null` return would crash.
     * Omitting the member entirely is the supported way to opt out of
     * SSE (the bell then runs poll-only).
     */
    subscribe?: (opts: NotificationStreamOptions) => NotificationStreamHandle;
}
export interface NotificationBellProps {
    /**
     * Polling cadence in milliseconds for the fallback loop. Default
     * 60,000 (twice the pre-SSE value — push handles the common case).
     * Pass 0 to disable polling entirely (relies on SSE only — only
     * safe on single-node deployments).
     */
    pollIntervalMs?: number;
    /** Optional click hook — called with the notification when a row is clicked. */
    onSelect?: (notification: Notification) => void;
    /** Error sink — bubble server failures to a toast / banner. */
    onError?: (message: string) => void;
    /** Override the API client (tests). */
    api?: NotificationsApi;
    className?: string;
}
export declare function NotificationBell({ pollIntervalMs, onSelect, onError, api, className, }: NotificationBellProps): React.JSX.Element;
//# sourceMappingURL=NotificationBell.d.ts.map