diff --git a/src/subs.ts b/src/subs.ts index eebfac1..f9d6606 100644 --- a/src/subs.ts +++ b/src/subs.ts @@ -9,7 +9,7 @@ import type { EventData } from '@/types.ts'; * Subscriptions can be added, removed, and matched against events. */ class SubscriptionStore { - #store = new Map>(); + #store = new Map>(); /** * Add a subscription to the store, and then iterate over it. @@ -20,7 +20,7 @@ class SubscriptionStore { * } * ``` */ - sub(socket: WebSocket, id: string, filters: DittoFilter[]): Subscription { + sub(socket: unknown, id: string, filters: DittoFilter[]): Subscription { let subs = this.#store.get(socket); if (!subs) { @@ -37,13 +37,13 @@ class SubscriptionStore { } /** Remove a subscription from the store. */ - unsub(socket: WebSocket, id: string): void { + unsub(socket: unknown, id: string): void { this.#store.get(socket)?.get(id)?.close(); this.#store.get(socket)?.delete(id); } /** Remove an entire socket. */ - close(socket: WebSocket): void { + close(socket: unknown): void { const subs = this.#store.get(socket); if (subs) {