@@ -22,7 +22,7 @@ type DeepRequired<T> = Required<{
22
22
23
23
type InferHandler < T > = T extends SubscriptionHandler < infer H > ? H : never
24
24
25
- interface SubscriptionInfo < T extends DataSubscriber < any , any , any > > {
25
+ interface SubscriptionInfo {
26
26
// Internal ID for the subscription
27
27
id : number
28
28
// Remote ID assigned by the server used for message routing and unsubscribing
@@ -63,7 +63,7 @@ export interface SubscriptionManagerConfig {
63
63
export class SubscriptionManager < Handlers extends SubscriptionHandler < any > [ ] > {
64
64
private counter = 0
65
65
private socket : WebSocket | null = null
66
- private subscriptions : SubscriptionInfo < DataSubscriber < any , any , any > > [ ] = [ ]
66
+ private subscriptions : SubscriptionInfo [ ] = [ ]
67
67
private config : DeepRequired < SubscriptionManagerConfig >
68
68
private reconnectAttempts = 0
69
69
private handlers : Record < string , SubscriptionHandler < any > >
@@ -203,7 +203,7 @@ export class SubscriptionManager<Handlers extends SubscriptionHandler<any>[]> {
203
203
)
204
204
205
205
// Track the subscription locally
206
- const sub : SubscriptionInfo < DataSubscriber < any , any , any > > = {
206
+ const sub : SubscriptionInfo = {
207
207
id : this . counter ++ ,
208
208
topic : opts . topic ,
209
209
subscriber : subscriber ,
@@ -248,9 +248,7 @@ export class SubscriptionManager<Handlers extends SubscriptionHandler<any>[]> {
248
248
}
249
249
}
250
250
251
- private async sendSubscribe (
252
- sub : SubscriptionInfo < DataSubscriber < any , any , any > >
253
- ) {
251
+ private async sendSubscribe ( sub : SubscriptionInfo ) {
254
252
// Send the subscription message
255
253
const request : SubscribeMessageRequest = {
256
254
action : Action . SUBSCRIBE ,
@@ -270,9 +268,7 @@ export class SubscriptionManager<Handlers extends SubscriptionHandler<any>[]> {
270
268
return response
271
269
}
272
270
273
- private async sendUnsubscribe (
274
- sub : SubscriptionInfo < DataSubscriber < any , any , any > >
275
- ) {
271
+ private async sendUnsubscribe ( sub : SubscriptionInfo ) {
276
272
// Send the unsubscribe message if the subscription has a remote id
277
273
const { remoteId} = sub
278
274
if ( remoteId ) {
0 commit comments