import type { LobbyMember, Post } from "../db/schema";

export type LobbyMemberLeaveEventData = { playerId: string; kicked?: boolean };

export type EventArgs = {
  "lobby:member:membership": [
    // lobbyId
    string,
    // joined
    boolean,
    // member
    LobbyMember | string,
    // kicked
    boolean?,
  ];
  "lobby:update": [
    //updated Lobby
    Lobby,
    // deleted
    boolean?,
  ];
};

export type SSE_EVENTS = {
  "lobby:update": EventArgs["lobby:update"];
  "lobby:member:update": [LobbyMember];
  "lobby:member:membership": EventArgs["lobby:member:membership"];
};
