export interface PlayerProfile { userId: string; name: string; username: string | null; avatar: string | null; } export interface RoomPlayer extends PlayerProfile { seat: number | null; ready: boolean; connected: boolean; } export interface MatchmakingStatus { state: 'idle' | 'joining' | 'queued' | 'matched' | 'cancelled' | 'error'; queue: string | null; position: number | null; estimatedWaitMs: number | null; roomId: string | null; raw: unknown; } export interface RuntimeTransport { connect(options: { instanceId: string; lastServerSeq: number; }): Promise; disconnect?(): Promise; send(message: unknown): Promise; onMessage?(handler: (message: unknown) => void): () => void; onState?(handler: (state: string) => void): () => void; } export interface ControlTransport { request(method: string, payload?: unknown, options?: { signal?: AbortSignal; }): Promise; stream?(method: string, payload?: unknown, options?: { signal?: AbortSignal; }): AsyncIterable; subscribe?(handler: (event: any) => void): () => void; } export interface BackendTransport { request(path: string, options?: { method?: string; body?: unknown; headers?: Record; signal?: AbortSignal; }): Promise<{ status: number; data: unknown; headers: Headers; }>; connect?(path: string, options?: { protocols?: string[]; signal?: AbortSignal; }): Promise; } export interface BackendSocket { readonly readyState: number; send(data: unknown): void; close(code?: number, reason?: string): void; onMessage(handler: (data: unknown) => void): () => void; onClose(handler: (event: unknown) => void): () => void; } export interface HostAppActions { openProfile(userId: string): Promise; openComments?(options?: { gameId?: string; initialText?: string; images?: string[]; }): Promise; openShare?(options?: { gameId?: string; images?: string[]; }): Promise; captureScreenshot?(options?: { gameId?: string; }): Promise; }