@arkadiuminc/sdk
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -12,5 +12,10 @@ import { GameIdReaderContract } from '../environment/environment.api'; | ||
export interface GameStateContract { | ||
setSerializer(s: Serializer): void; | ||
loadGameState(key: string): Promise<any>; | ||
saveGameState(key: string, state: any): Promise<void>; | ||
} | ||
export interface Serializer { | ||
pack(data: Record<any, any>): Promise<string>; | ||
unpack(data: string): Promise<Record<any, any> | null>; | ||
} | ||
export declare class GameStateApi { | ||
@@ -21,2 +26,4 @@ private ls; | ||
private knownStates; | ||
private serializer; | ||
private useGameSerializer; | ||
constructor(backendApi: BackendApi, gameIdReader: GameIdReaderContract); | ||
@@ -28,2 +35,4 @@ private getGameId; | ||
private getStorageKey; | ||
useSerializer(value: boolean): void; | ||
setSerializer(s: Serializer): void; | ||
loadGameState<T>(key: string): Promise<{ | ||
@@ -39,2 +48,7 @@ cloud: SaveDataContract<T> | null; | ||
export declare class GameStateApiProxy { | ||
constructor(); | ||
private serializer; | ||
setSerializer(serializer: Serializer | null): void; | ||
customPack(data: Record<any, any>): Promise<string | undefined>; | ||
customUnpack(data: string): Promise<Record<any, any> | null | undefined>; | ||
loadGameState<T>(key: string): Promise<{ | ||
@@ -41,0 +55,0 @@ cloud: SaveDataContract<T>; |
{ | ||
"name": "@arkadiuminc/sdk", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
20288
391