import Channel from '../Channel'; import Socket from '../../Socket'; import { DeepReadonly } from '../../../main/utils/typeUtils'; import { ComplexTypesOption } from 'ziron-worker'; export default class ChannelContainer { private readonly _channels; private readonly _count; constructor(channels: Channel[]); get channels(): Channel[]; /** * **Not override this method.** * Publish into a member of this channel. * @param member * @param event * @param data * @param options * The publisher sid indicates the socket sid that publishes the data. * If you provide one the published data will not send to the publisher socket. */ publish(member: M, event: string, data: any, options?: ComplexTypesOption & { publisherSid?: string; }): void; /** * The close function will close a Channel member for every client on every server. * You optionally can provide a code or any other information for the client. * Usually, the close function is used when the data is completely deleted from the system. * For example, a chat that doesn't exist anymore. * @param member The member you want to close. * @param code * @param metadata * @param forEveryServer * @return The returned promise is resolved when * the close is fully processed on the current server. */ close(member: M, code?: number | string, metadata?: any, forEveryServer?: boolean): Promise; /** * **Not override this method.** * Kicks out a socket from a member of this channel. * @param member * @param socket * @param code * @param metadata */ kickOut(member: M, socket: Socket, code?: number | string, metadata?: any): void; /** * With this function, you can do a recheck of all sockets on a specific member. * It can be useful when the access rights to member have changed, * and you want to kick out all sockets that not have access anymore. * Notice that the promise is resolved when the access was checked * on the current server and request sent to other servers. * @param member * @param forEveryServer */ recheckMemberAccess(member: M, forEveryServer?: boolean): Promise; /** * This method returns an array * with all members that the socket has subscribed. * @param socket */ getSocketSubMembers(socket: Socket): DeepReadonly[]; }