Viktorani API - v0.0.8
    Preparing search index...

    Type Alias PlayerEvent

    PlayerEvent:
        | {
            playerId: string;
            playerName: string;
            timestamp: number;
            type: "BUZZ";
        }
        | {
            deviceId: string;
            playerId: string;
            playerName: string;
            teamId: string
            | null;
            type: "JOIN";
        }
        | { playerId: string; type: "LEAVE" }
        | { away: boolean; playerId: string; type: "FOCUS_CHANGE" }

    Events sent by players to the GameMaster.

    Type Declaration

    • { playerId: string; playerName: string; timestamp: number; type: "BUZZ" }

      Player pressed the buzzer. timestamp is a performance.now() value for ordering.

    • {
          deviceId: string;
          playerId: string;
          playerName: string;
          teamId: string | null;
          type: "JOIN";
      }

      Player joined the lobby. deviceId is a stable browser-local UUID.

    • { playerId: string; type: "LEAVE" }

      Player disconnected or left the game.

    • { away: boolean; playerId: string; type: "FOCUS_CHANGE" }

      Player's tab visibility changed — used to flag distracted players.

    The host listens for these via transportManager.onEvent() and dispatches them to the appropriate hook (e.g. useBuzzer.handleIncomingBuzz).