UNPKG

shoehive

Version:

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

120 lines (119 loc) 3.48 kB
import { Table } from '../core/Table'; import { Player } from '../core/Player'; /** * Table events * * This is a comprehensive list of all events that can be emitted by the Table class. * * You can use these events to listen for changes in the table state, or to trigger actions based on table events. */ export declare const TABLE_EVENTS: { readonly CREATED: "table:created"; readonly EMPTY: "table:empty"; readonly STATE_UPDATED: "table:state:updated"; readonly ATTRIBUTE_CHANGED: "table:attribute:changed"; readonly ATTRIBUTES_CHANGED: "table:attributes:changed"; readonly PLAYER_JOINED: "table:player:joined"; readonly PLAYER_LEFT: "table:player:left"; readonly PLAYER_SAT: "table:player:sat"; readonly PLAYER_STOOD: "table:player:stood"; readonly PLAYER_SIT_REQUEST: "table:player:sit:request"; readonly PLAYER_STAND_REQUEST: "table:player:stand:request"; readonly DECK_CREATED: "table:deck:created"; readonly DECK_SHUFFLED: "table:deck:shuffled"; readonly DECK_CARD_DRAWN: "table:deck:card:drawn"; readonly CARD_DEALT: "table:card:dealt"; readonly SEAT_HAND_ADDED: "table:seat:hand:added"; readonly SEAT_HAND_REMOVED: "table:seat:hand:removed"; readonly SEAT_HAND_CLEARED: "table:seat:hand:cleared"; readonly SEATS_HANDS_CLEARED: "table:seats:hands:cleared"; }; /** * These are the payload structures for native Table events. * * You can use these payloads to listen for changes in the table state, or to trigger actions based on table events. */ export interface DefaultTableEventPayloadMap { [TABLE_EVENTS.CREATED]: { table: Table; }; [TABLE_EVENTS.EMPTY]: { table: Table; }; [TABLE_EVENTS.STATE_UPDATED]: { table: Table; state: unknown; }; [TABLE_EVENTS.ATTRIBUTE_CHANGED]: { table: Table; key: string; value: unknown; }; [TABLE_EVENTS.ATTRIBUTES_CHANGED]: { table: Table; changedKeys: string[]; attributes: Record<string, unknown>; }; [TABLE_EVENTS.PLAYER_JOINED]: { table: Table; player: Player; }; [TABLE_EVENTS.PLAYER_LEFT]: { table: Table; player: Player; }; [TABLE_EVENTS.PLAYER_SAT]: { table: Table; player: Player; seatIndex: number; }; [TABLE_EVENTS.PLAYER_STOOD]: { table: Table; player: Player; seatIndex: number; }; [TABLE_EVENTS.PLAYER_SIT_REQUEST]: { player: Player; table: Table; seatIndex: number; }; [TABLE_EVENTS.PLAYER_STAND_REQUEST]: { player: Player; table: Table; }; [TABLE_EVENTS.DECK_CREATED]: { table: Table; deckId: string; }; [TABLE_EVENTS.DECK_SHUFFLED]: { table: Table; deckId: string; }; [TABLE_EVENTS.DECK_CARD_DRAWN]: { table: Table; deckId: string; card: unknown; }; [TABLE_EVENTS.CARD_DEALT]: { table: Table; player: Player; card: unknown; }; [TABLE_EVENTS.SEAT_HAND_ADDED]: { table: Table; seatIndex: number; handId: string; }; [TABLE_EVENTS.SEAT_HAND_REMOVED]: { table: Table; seatIndex: number; handId: string; }; [TABLE_EVENTS.SEAT_HAND_CLEARED]: { table: Table; seatIndex: number; }; [TABLE_EVENTS.SEATS_HANDS_CLEARED]: { table: Table; }; }