import * as plugins from './smartuniverse.plugins'; import * as interfaces from './interfaces'; import { ClientUniverse } from './'; export class ClientUniverseChannel implements interfaces.IUniverseChannel { // ====== // STATIC // ====== public static async createClientUniverseChannel( clientUniverseArg: ClientUniverse, channelName: string, passphraseArg: string ): Promise { const clientChannel = new ClientUniverseChannel(clientUniverseArg, passphraseArg); await clientChannel.subscribe(); return clientChannel; } // ======== // INSTANCE // ======== public clientUniverse: ClientUniverse; public passphrase: string; constructor(clientUniverseArg: ClientUniverse, passphraseArg: string) { this.clientUniverse = clientUniverseArg; this.passphrase = passphraseArg; } /** * subscribes to a channel * tells the universe about this instances interest into a channel */ public async subscribe() { this.clientUniverse.socketClient; } }