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)