@arkadiuminc/sdk 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,20 +9,29 @@ declare class SaveDataContract<T> {
|
|
|
9
9
|
}
|
|
10
10
|
export declare const ErrSaveIsOutdated: Error;
|
|
11
11
|
export interface GameStateContract {
|
|
12
|
+
setSerializer(s: Serializer): void;
|
|
12
13
|
loadGameState(key: string): Promise<any>;
|
|
13
14
|
saveGameState(key: string, state: any): Promise<void>;
|
|
14
15
|
}
|
|
16
|
+
export interface Serializer {
|
|
17
|
+
pack(data: Record<any, any>): Promise<string>;
|
|
18
|
+
unpack(data: string): Promise<Record<any, any> | null>;
|
|
19
|
+
}
|
|
15
20
|
export declare class GameStateApi {
|
|
16
21
|
private ls;
|
|
17
22
|
private backendApi;
|
|
18
23
|
private gameIdReader;
|
|
19
24
|
private knownStates;
|
|
25
|
+
private serializer;
|
|
26
|
+
private useGameSerializer;
|
|
20
27
|
constructor(backendApi: BackendApi, gameIdReader: GameIdReaderContract);
|
|
21
28
|
private getGameId;
|
|
22
29
|
private packData;
|
|
23
30
|
private unpackData;
|
|
24
31
|
private isUserAuthorized;
|
|
25
32
|
private getStorageKey;
|
|
33
|
+
useSerializer(value: boolean): void;
|
|
34
|
+
setSerializer(s: Serializer): void;
|
|
26
35
|
loadGameState<T>(key: string): Promise<{
|
|
27
36
|
cloud: SaveDataContract<T> | null;
|
|
28
37
|
local: SaveDataContract<T> | null;
|
|
@@ -33,6 +42,11 @@ export declare class GameStateApi {
|
|
|
33
42
|
private saveDataToStorage;
|
|
34
43
|
}
|
|
35
44
|
export declare class GameStateApiProxy {
|
|
45
|
+
constructor();
|
|
46
|
+
private serializer;
|
|
47
|
+
setSerializer(serializer: Serializer | null): void;
|
|
48
|
+
customPack(data: Record<any, any>): Promise<string | undefined>;
|
|
49
|
+
customUnpack(data: string): Promise<Record<any, any> | null | undefined>;
|
|
36
50
|
loadGameState<T>(key: string): Promise<{
|
|
37
51
|
cloud: SaveDataContract<T>;
|
|
38
52
|
local: SaveDataContract<T>;
|