UNPKG

shoehive

Version:

WebSocket-based multiplayer game framework for real-time, event-driven gameplay

33 lines (32 loc) 1.06 kB
import { Lobby } from '../core/Lobby'; /** * Lobby events. * * You can use these events to listen for changes in the lobby state, or to trigger actions based on lobby events. * Most events are emitted by the Shoehive lobby, but some are emitted from bubbling up from the table, player, or game. */ export declare const LOBBY_EVENTS: { readonly UPDATED: "lobby:updated"; readonly ATTRIBUTE_CHANGED: "lobby:attribute:changed"; readonly ATTRIBUTES_CHANGED: "lobby:attributes:changed"; }; /** * These are the payload structures for native Lobby events. * * You can use these payloads to listen for changes in the lobby state, or to trigger actions based on lobby events. */ export interface DefaultLobbyEventPayloadMap { [LOBBY_EVENTS.UPDATED]: { lobby: Lobby; }; [LOBBY_EVENTS.ATTRIBUTE_CHANGED]: { lobby: Lobby; key: string; value: unknown; }; [LOBBY_EVENTS.ATTRIBUTES_CHANGED]: { lobby: Lobby; changedKeys: string[]; attributes: Record<string, unknown>; }; }