import { Event } from '@dxos/async'; import { type Context, Resource } from '@dxos/context'; import { type EdgeConnection } from '@dxos/edge-client'; import { PublicKey } from '@dxos/keys'; import { type SwarmResponse } from '@dxos/protocols/proto/dxos/edge/messenger'; import { type Message, type PeerInfo, type SubscribeMessagesParams, type SwarmEvent, type UnsubscribeCallback } from '../signal-methods'; import { type SignalManager } from './signal-manager'; export declare class EdgeSignalManager extends Resource implements SignalManager { /** * @deprecated */ swarmEvent: Event; swarmState: Event; /** * Active message subscriptions. Routing is encapsulated here (DX-1125): each incoming message is * dispatched to every subscription it matches, and each subscription owns its own teardown. */ private readonly _subscriptions; /** * Swarm key -> { peer: , joinedPeers: }. */ private readonly _swarmPeers; /** * OR-subscription tag refcounts for broadcast messages (DX-1125). One count per distinct tag across * all subscribers, so one consumer's unsubscribe releases only its own registration rather than * clobbering another consumer's identical subscription. The effective tag set (the keys) is shared * across all joined swarms; the edge fans out any broadcast whose tags intersect it. Re-sent on * reconnect and whenever a swarm is (re-)joined. */ private readonly _subscribedTags; private readonly _edgeConnection; constructor({ edgeConnection }: { edgeConnection: EdgeConnection; }); protected _open(): Promise; /** * Warning: PeerInfo is inferred from edgeConnection. */ join(ctx: Context, { topic, peer }: { topic: PublicKey; peer: PeerInfo; }): Promise; leave(ctx: Context, { topic, peer }: { topic: PublicKey; peer: PeerInfo; }): Promise; query(ctx: Context, { topic }: { topic: PublicKey; }): Promise; sendMessage(ctx: Context, message: Message): Promise; subscribeMessages({ peer, tags, onMessage }: SubscribeMessagesParams): Promise; private _sendSubscription; private _onMessage; private _processSwarmResponse; private _processMessage; /** * Route an incoming message to matching subscriptions (DX-1125): point-to-point by recipient * `peerKey`, broadcasts by tag intersection. */ private _deliver; private _matchSelfPeerInfo; private _rejoinAllSwarms; } //# sourceMappingURL=edge-signal-manager.d.ts.map