/** * Generic presence tracker — ref-counted online status per stream per identity. * * Supports multi-tab: each subscribe increments the ref count, each * unsubscribe decrements it. An identity is considered online when * ref count > 0. * * ## Usage * * ```typescript * const presence = new PresenceTracker(); * * // On SSE connect: * presence.add(game_id, player_id); * * // On SSE disconnect: * presence.remove(game_id, player_id); * * // Query: * presence.online(game_id); // Set * ``` */ export declare class PresenceTracker { private streams; /** Increment ref count for an identity on a stream. */ add(streamId: string, identity_id: string): void; /** Decrement ref count. Removes the identity when count reaches 0. */ remove(streamId: string, identity_id: string): void; /** Get the set of online identity IDs for a stream. */ online(streamId: string): Set; /** Check if a specific identity is online for a stream. */ isOnline(streamId: string, identity_id: string): boolean; /** @deprecated use `online` — removal in the next major */ get_online(streamId: string): Set; /** @deprecated use `isOnline` — removal in the next major */ is_online(streamId: string, identity_id: string): boolean; } //# sourceMappingURL=presence.d.ts.map