diff --git a/dist/index.d.ts b/dist/index.d.ts index 5f3c80b..0a38d3c 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 0120af2..7133ba5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -123,7 +123,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) }