import type { DeviceNotificationOperation, DeviceNotificationServerFrame } from './device-notification-protocol'; import type { DeviceNotificationIdentity } from '../api/handlers/DeviceNotificationTicketHandler'; export interface DeviceNotificationHubOptions { origin: string; maxTopicsPerConnection?: number; maxQueueMessages?: number; maxReplayEvents?: number; authorizeTopic?: (input: { identity: DeviceNotificationIdentity; topic: string; }) => boolean | Promise; } export interface OpenDeviceNotificationConnectionInput { identity: DeviceNotificationIdentity; deviceSessionId: string; send: (frame: DeviceNotificationServerFrame) => boolean; close?: (code: number, reason: string) => void; } export interface DeviceNotificationConnectionHandle { connectionId: string; } export interface DeviceNotificationPublishInput { topic: string; object?: string; operation: DeviceNotificationOperation; } type EventFrame = Extract; export declare class DeviceNotificationHub { private readonly origin; private readonly maxTopicsPerConnection; private readonly maxQueueMessages; private readonly maxReplayEvents; private readonly authorizeTopic; private readonly connections; private readonly connectionsByDevice; private readonly topicMembers; private readonly replay; private sequence; constructor(options: DeviceNotificationHubOptions); openConnection(input: OpenDeviceNotificationConnectionInput): DeviceNotificationConnectionHandle; hello(connectionId: string, resumeFrom?: number): DeviceNotificationServerFrame; registerTopics(connectionId: string, requestId: string, topics: string[]): Promise; unregisterTopics(connectionId: string, requestId: string, topics: string[]): Promise; ack(connectionId: string, sequence: number): void; publish(input: DeviceNotificationPublishInput): EventFrame; resume(connectionId: string, resumeFrom: number): EventFrame[] | DeviceNotificationServerFrame; closeConnection(connectionId: string, code?: number, reason?: string): void; getSeenRequestIds(connectionId: string): Set; getTopicMemberCount(topic: string): number; getConnectionSnapshot(connectionId: string): { topicCount: number; topics: string[]; queueLength: number; resyncTopics: string[]; lastAck: number; } | undefined; private deliver; private deliverPendingResume; private enqueue; private coalesceEvent; private markOverflow; private pushReplay; private matchingMemberIds; private connectionMatches; private topicMatches; private assertNewRequestId; private normalizeTopic; private normalizeResource; private requireConnection; private deviceConnectionKey; } export {};