export declare const NOTIFICATION_PREFERENCE_FLUSH_MS = 300; export type BufferedPreferenceItem = { channel: string; digest: string | null; enabled: boolean; source?: string; topic: string; }; export type PreferenceWriteMutation = { channel: string; digest?: string | null; enabled: boolean; operation: "set"; organizationId?: string | null; topic: string; } | { channel: string; operation: "reset"; organizationId?: string | null; topic: string; }; export type CatalogDefault = { channel: string; defaultEnabled: boolean; topic: string; }; export declare function preferencePairKey(topic: string, channel: string): string; export declare function applyOptimisticSet(items: readonly BufferedPreferenceItem[], input: { channel: string; digest?: string | null; enabled: boolean; source: "organization" | "user"; topic: string; }): BufferedPreferenceItem[]; export declare function catalogDefaultEnabled(channel: string, topic: string, catalog: readonly CatalogDefault[]): boolean; export declare function applyOptimisticReset(items: readonly BufferedPreferenceItem[], catalog: readonly CatalogDefault[]): BufferedPreferenceItem[]; export declare function mergeAuthoritativePreferenceItems(previous: readonly T[], nextItems: readonly T[], currentRevision: (topic: string, channel: string) => number, flushedRevisions: ReadonlyMap): T[]; export declare function rollbackFlushedPreferenceItems(previous: readonly T[], rollbacks: ReadonlyMap, currentRevision: (topic: string, channel: string) => number, flushedRevisions: ReadonlyMap): T[]; export declare class NotificationPreferenceWriteBuffer { private readonly options; private readonly pending; private readonly revisions; private timer; private chain; constructor(options: { delayMs: number; getItems: () => BufferedPreferenceItem[]; onFlushError: (error: unknown) => void; persist: (mutations: PreferenceWriteMutation[]) => Promise<{ items: BufferedPreferenceItem[]; }>; setItems: (items: BufferedPreferenceItem[]) => void; }); revisionOf(topic: string, channel: string): number; bump(topic: string, channel: string): number; discardPending(): void; enqueueSet(input: { channel: string; digest?: string | null; enabled: boolean; organizationId?: string | null; source: "organization" | "user"; topic: string; }): void; flushNow(): Promise; dispose(): void; private schedule; private clearTimer; private flushPending; }