import type { OperatorPlaylistSong } from './operator-playlist';
import type { QueueItem, ReactionType, Room, ShoutOut, Song, SongReactionSummary, User } from './types';
/**
 * Socket.IO event contract — server is source of truth.
 * Client → Server payloads use `*Payload`; Server → Client use `*Event`.
 */
export interface RoomCreatePayload {
    /** TV host optional display name */
    hostNickname?: string;
    /** Stable TV device id — room code is derived from this + calendar day */
    deviceId?: string;
    /** @deprecated No longer used — admin approves rooms instead of PIN. */
    operatorPin?: string;
    /** Replace today's daily room (e.g. after TV host logout) */
    forceNewRoom?: boolean;
}
export interface RoomCreateResponse {
    room: Room;
    user: User;
    joinUrl: string;
    /** @deprecated PIN flow removed — check `room.approvalStatus` instead. */
    needsOperatorPin?: boolean;
}
export interface RoomSetOperatorPinPayload {
    roomId: string;
    pin: string;
}
export interface RoomHostLogoutPayload {
    roomId: string;
    /** @deprecated PIN no longer required for host logout */
    pin?: string;
}
export interface RoomJoinPayload {
    code: string;
    nickname: string;
}
/** Venue operator joins from phone (room must be admin-allowed). */
export interface RoomOperatorJoinPayload {
    code: string;
    nickname: string;
    /** @deprecated PIN no longer used */
    pin?: string;
}
export interface RoomOperatorRejoinPayload {
    code: string;
    userId: string;
    nickname: string;
    /** @deprecated PIN no longer used */
    pin?: string;
}
/** TV host reconnects after network drop — same room code, new socket */
export interface RoomRehostPayload {
    code: string;
    /** When room was lost (e.g. server restart), recreate today's code for this device */
    deviceId?: string;
}
/** Guest reconnects with prior user id from localStorage */
export interface RoomRejoinPayload {
    code: string;
    userId: string;
    nickname: string;
}
export interface RoomJoinResponse {
    room: Room;
    user: User;
}
export interface QueueAddPayload {
    roomId: string;
    song: Omit<Song, 'id' | 'createdAt' | 'requestedBy' | 'requestedByUserId'>;
}
export interface QueueRemovePayload {
    roomId: string;
    queueItemId: string;
    /** Requesting user id (guest self-remove or operator) */
    userId: string;
}
export interface QueueRemoveResponse {
    queue: QueueItem[];
    /** Credits returned when a guest removes their own song */
    creditsRefunded?: number;
}
export interface QueueReorderPayload {
    roomId: string;
    /** Full queue order by queue item ids */
    queueItemIds: string[];
}
export interface PlaybackStartPayload {
    roomId: string;
    queueItemId: string;
}
export interface PlaybackEndPayload {
    roomId: string;
    queueItemId: string;
}
export interface PlaybackNextPayload {
    roomId: string;
}
export interface ShoutOutAddPayload {
    roomId: string;
    message: string;
}
/** TV host reports one completed ticker cycle for the listed shout outs */
export interface ShoutOutDisplayedPayload {
    roomId: string;
    shoutOutIds: string[];
}
export interface CreditsAdjustPayload {
    roomId: string;
    userId: string;
    /** Credits to add (positive) or remove (negative) */
    delta: number;
}
/** Operator sets per-room credit economy (sparse — matches env defaults are not stored). */
export interface RoomCreditSettingsPayload {
    roomId: string;
    settings: {
        startingCredits?: number;
        songCost?: number;
        shoutOutCost?: number;
        queueSongLimit?: number;
    };
}
export interface ReactionTogglePayload {
    roomId: string;
    queueItemId: string;
    reaction: ReactionType;
}
export interface OperatorPlaylistsListPayload {
    roomId: string;
    roomCode: string;
}
export interface OperatorPlaylistSavePayload {
    roomId: string;
    roomCode: string;
    /** Omit to create a new saved playlist */
    playlistId?: string;
    name: string;
    songs: OperatorPlaylistSong[];
}
export interface OperatorPlaylistDeletePayload {
    roomId: string;
    roomCode: string;
    playlistId: string;
}
export interface QueueUpdateEvent {
    roomId: string;
    queue: QueueItem[];
}
export interface UserConnectedEvent {
    roomId: string;
    user: User;
    users: User[];
}
export interface UserDisconnectedEvent {
    roomId: string;
    userId: string;
    users: User[];
}
export interface RoomStateEvent {
    room: Room;
}
/** TV host ended the session — guests/operators should leave. */
export interface RoomClosedEvent {
    roomId: string;
    code: string;
    reason: 'host-logout' | 'host-disconnected';
}
export interface ShoutOutUpdateEvent {
    roomId: string;
    shoutOuts: ShoutOut[];
}
export interface ReactionUpdateEvent {
    roomId: string;
    queueItemId: string;
    summary: SongReactionSummary;
}
/** Canonical event names — use these strings in socket.on / socket.emit */
export declare const SocketEvents: {
    readonly ROOM_CREATE: "room:create";
    readonly ROOM_JOIN: "room:join";
    readonly ROOM_OPERATOR_JOIN: "room:operator-join";
    readonly ROOM_OPERATOR_REJOIN: "room:operator-rejoin";
    readonly ROOM_REHOST: "room:rehost";
    readonly ROOM_REJOIN: "room:rejoin";
    readonly ROOM_SET_OPERATOR_PIN: "room:set-operator-pin";
    readonly ROOM_HOST_LOGOUT: "room:host-logout";
    readonly QUEUE_ADD: "queue:add";
    readonly QUEUE_REMOVE: "queue:remove";
    readonly QUEUE_REORDER: "queue:reorder";
    readonly SHOUTOUT_ADD: "shoutout:add";
    readonly SHOUTOUT_DISPLAYED: "shoutout:displayed";
    readonly CREDITS_ADJUST: "credits:adjust";
    readonly ROOM_CREDIT_SETTINGS: "room:credit-settings";
    readonly OPERATOR_PLAYLISTS_LIST: "operator:playlists-list";
    readonly OPERATOR_PLAYLIST_SAVE: "operator:playlist-save";
    readonly OPERATOR_PLAYLIST_DELETE: "operator:playlist-delete";
    readonly REACTION_TOGGLE: "reaction:toggle";
    readonly PLAYBACK_START: "playback:start";
    readonly PLAYBACK_END: "playback:end";
    readonly PLAYBACK_NEXT: "playback:next";
    readonly QUEUE_UPDATE: "queue:update";
    readonly PLAYBACK_UPDATE: "playback:update";
    readonly USER_CONNECTED: "user:connected";
    readonly USER_DISCONNECTED: "user:disconnected";
    readonly ROOM_STATE: "room:state";
    readonly ROOM_CLOSED: "room:closed";
    readonly SHOUTOUT_UPDATE: "shoutout:update";
    readonly REACTION_UPDATE: "reaction:update";
    readonly ERROR: "error";
};
export type SocketEventName = (typeof SocketEvents)[keyof typeof SocketEvents];
//# sourceMappingURL=socket-events.d.ts.map