import { GameLLM } from './LLM.js'; import { GameRooms } from './Rooms.js'; import { GameUploads, type GameUploadsOptions } from './Uploads.js'; import { MatchmakingQueue } from './MatchmakingQueue.js'; import { RoomClient } from './RoomClient.js'; import { Leaderboard } from './Leaderboard.js'; import { GameDataStore } from './data.js'; import type { GameDataSchema } from './data.js'; import type { ControlTransport, HostAppActions, RuntimeTransport } from './types.js'; import type { BackendTransport } from './types.js'; import { GameBackendClient } from './BackendClient.js'; import { GameDataClient } from './GameDataClient.js'; import { GameRoomsClient } from './GameRoomsClient.js'; import { GameMediaClient } from './MediaClient.js'; import { type RoomHandleState, type RoomHandleEvent } from './Lifecycle.js'; import { type RealtimeSimulationDescriptor, type RuntimeCapabilities } from './RealtimeCapabilities.js'; export * from './RealtimeCapabilities.js'; export interface GameSdkOptions { bootstrap: () => Promise; exchange: (launch: unknown) => Promise; transportFactory: { createControlTransport(session: unknown): ControlTransport; createRoomTransport(session: unknown, roomId: string): RuntimeTransport; createBackendTransport?(session: unknown, gameId: string): BackendTransport; }; app?: HostAppActions; gameId?: string; } export declare class GameSdk { private readonly options; private session; private readyPromise?; private backendClient?; private gameDataClient?; private gameRoomsClient?; private mediaClient?; private roomClients; private roomHandleLifecycles; private roomManager?; private matchQueue?; private leaderboards; private dataStores; readonly app?: HostAppActions; constructor(options: GameSdkOptions); /** * Resolved game id. Games must create and list rooms under the real game id: * the Runtime picks its authoritative rules adapter from the instance's * `game_id`, so a missing id silently degrades every room to no game logic. */ get gameId(): string | undefined; /** * User id the exchanged session authenticated as, when the host supplied one. * Games read `room.userId` to decide whose turn it is and to stamp optimistic * actions, so it must survive even when the injected context does not. */ get userId(): string | null; ready(): Promise; private requireReady; control(): ControlTransport; /** @deprecated New games implement matchmaking in their game-owned backend. */ matchmaking(): MatchmakingQueue; /** @deprecated New games implement leaderboards in their game-owned backend. */ leaderboard(leaderboardId?: string): Leaderboard; /** @deprecated New games use backend migrations and ctx.sql instead of shared Runtime CRUD. */ db(schema?: GameDataSchema): GameDataStore; llm(): GameLLM; uploads(options?: GameUploadsOptions): GameUploads; backend(): GameBackendClient; /** Declarative CRUD collections provided by a `kind: data` backend. */ data(): GameDataClient; /** Game-owned room primitives for the current backend deployment. */ gameRooms(): GameRoomsClient; /** Game-owned media authorization and WebRTC clients. */ media(): GameMediaClient; /** @deprecated Shared multiplayer Runtime capabilities were removed. */ capabilities(options?: { signal?: AbortSignal; }): Promise; /** @deprecated Put authoritative simulation in the game-owned backend. */ requireRealtimeSimulation(options?: { signal?: AbortSignal; }): Promise; /** @deprecated New games implement room state and admission in their backend. */ rooms(): GameRooms; private makeRoom; /** @deprecated New games connect through sdk.backend(). */ room(roomId: string): RoomClient; /** @internal A successful create starts a new room incarnation for this id. */ replaceCreatedRoom(roomId: string): Promise; /** @internal Bounded lifecycle diagnostics without room state or credentials. */ roomHandleHistory(roomId: string): { from: RoomHandleState; event: RoomHandleEvent; to: RoomHandleState; }[]; }