export type View = { screen: "lobby" | "history" | "slots" | "roulette" | "blackjack" | "crash"; [key: string]: any; }; export type Hello = { type: "hello"; version: string; grace_seconds: number; /** Signed-in user restored after a refresh, if any. */ user?: string | null; /** Estimated game-server Unix time in milliseconds. */ time: number; }; export type Send = (command: unknown) => void; export type Handlers = { onHello: (hello: Hello) => void; onView: (view: View) => void; onNotice: (text: string) => void; onError: (text: string) => void; onReplaced: () => void; onPong: () => void; onOpen: () => void; onClosed: (willRetry: boolean) => void; };