shoehive
Version:
WebSocket-based multiplayer game framework for real-time, event-driven gameplay
120 lines (119 loc) • 3.48 kB
TypeScript
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: Table;
};
[]: {
table: Table;
};
[]: {
table: Table;
state: unknown;
};
[]: {
table: Table;
key: string;
value: unknown;
};
[]: {
table: Table;
changedKeys: string[];
attributes: Record<string, unknown>;
};
[]: {
table: Table;
player: Player;
};
[]: {
table: Table;
player: Player;
};
[]: {
table: Table;
player: Player;
seatIndex: number;
};
[]: {
table: Table;
player: Player;
seatIndex: number;
};
[]: {
player: Player;
table: Table;
seatIndex: number;
};
[]: {
player: Player;
table: Table;
};
[]: {
table: Table;
deckId: string;
};
[]: {
table: Table;
deckId: string;
};
[]: {
table: Table;
deckId: string;
card: unknown;
};
[]: {
table: Table;
player: Player;
card: unknown;
};
[]: {
table: Table;
seatIndex: number;
handId: string;
};
[]: {
table: Table;
seatIndex: number;
handId: string;
};
[]: {
table: Table;
seatIndex: number;
};
[]: {
table: Table;
};
}