export type JsonValue = string | number | boolean | null | JsonValue[] | { [key: string]: JsonValue }; export interface GameContentItem { id: string; title: string; content: string; category: string | null; difficulty: "EASY" | "NORMAL" | "HARD"; metadata: Record; } export interface GameData { profile?: { engine: "sherlock-v1"; bridgeVersion: 1 }; gameId: string; versionId: string; collections: Record; categories: { id: string; key: string; name: string }[]; settings: Record; } export interface HostMessage { source: "sbnova-host"; version: 1; type: | "host:pause" | "host:resume" | "host:restart" | "host:theme" | "host:volume" | "host:config" | "host:data" | "host:profile-reset"; value?: unknown; } export interface SBNovaSDK { /** All HTTP/auth stays in the host. Payload never supplies user/session identity. */ profile: { get(): Promise>; history(view: "runs" | "cases" | "run", page?: number, runId?: string): Promise>; command(command: Record): Promise>; onReset(callback: () => void): () => void; }; getGameData(): Promise; getSettings(): Promise; ready(): void; gameReady(): void; start(): void; end(score?: number): void; restart(): void; setScore(score: number): void; error(message: string): void; fullscreen(): void; on( event: HostMessage["type"] | "pause" | "resume" | "restart" | "theme" | "volume" | "config" | "data", callback: (value: unknown) => void, ): () => void; onHost(callback: (message: HostMessage) => void): () => void; } declare global { const SBNova: SBNovaSDK; interface Window { SBNova: SBNovaSDK; } }