<?php

declare(strict_types=1);

namespace Blax\WebRtc\Contracts;

/**
 * Receives call-lifecycle events so the host can LOG the call (even when nothing
 * is recorded): peer connected/disconnected, room joined/left, and — when
 * recording is on — the finalized recording locator. Bind your own to persist to
 * a DB / audit log.
 *
 * Event shapes (all carry `type` + a monotonic `seq`):
 *   { type: 'peer-connected',      peer }
 *   { type: 'room-joined',         peer, room, roomType }
 *   { type: 'room-left',           peer, room }
 *   { type: 'recording-finalized', peer, room, recording }   // recording = locator
 *   { type: 'peer-disconnected',   peer }
 */
interface CallEventListener
{
    /** @param array<string,mixed> $event */
    public function handle(array $event): void;
}
