From acfcb772e5276854c02da1e8a94a2d60c523bb80 Mon Sep 17 00:00:00 2001 From: Gobb Date: Fri, 29 Dec 2017 18:49:20 +0100 Subject: [PATCH] Fixing wrong typing for ClusterWS.subscribe(...) method. --- dist/index.d.ts | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.d.ts b/dist/index.d.ts index 6578427..7c09167 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -10,7 +10,7 @@ export class ClusterWS { send(event: string, data: any, type?: string): void; disconnect(code?: number, msg?: any): void; getState(): number; - subscribe(channel: string): void; + subscribe(channel: string): Channel; getChannelByName(channelName: string): Channel; } diff --git a/src/index.ts b/src/index.ts index 60fa052..51d1dce 100644 --- a/src/index.ts +++ b/src/index.ts @@ -122,7 +122,7 @@ export class ClusterWS { return this.websocket.readyState } - public subscribe(channel: string): void { + public subscribe(channel: string): Channel { return this.channels[channel] ? this.channels[channel] : this.channels[channel] = new Channel(this, channel)