import type { GameConfig } from "@/lib/validations/game";
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?,
  ];
  "game:config:update": [
    {
      lobbyId: string;
      config: GameConfig;
    },
  ];
};

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

  "game:config:update": EventArgs["game:config:update"];
};
