import { EventEmitter } from 'events'; import { Connection } from '../../skychat/Connection.js'; import { Session } from '../../skychat/Session.js'; import { PlayerChannel, SanitizedPlayerChannel } from './PlayerChannel.js'; import { PlayerPlugin } from './PlayerPlugin.js'; export declare class PlayerChannelManager extends EventEmitter { readonly channels: PlayerChannel[]; readonly plugin: PlayerPlugin; /** * Mapping from session to channel ids */ readonly sessionChannels: Map; constructor(plugin: PlayerPlugin); /** * Get the next available channel id * @returns */ getNextChannelId(): number; /** * Create a new channel with the given name * @param id * @param name */ createChannel(id: number, name: string): PlayerChannel; /** * Rename a given channel * @param id * @param name */ renameChannel(id: number, name: string): void; /** * Delete a given channel id * @param id */ deleteChannel(id: number): void; /** * Get the channel where the session is, if any * @param session * @returns */ getSessionChannel(session: Session): PlayerChannel | null; /** * * @param session * @param id */ joinChannel(session: Session, id: number): void; /** * * @param session */ leaveChannel(session: Session): void; /** * To be called when the list of channel or channel metadata changes */ sync(sessionsOrConnections?: (Session | Connection)[]): void; /** * Find an existing channel by its id * @param id */ getChannelById(id: number): PlayerChannel | null; /** * What will be sent to the client */ sanitized(): SanitizedPlayerChannel[]; toString(): string; }