@arkadiuminc/sdk 2.6.0 → 2.7.0
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Client as NakamaApiClient, Session as NakamaSession } from '@heroiclabs/nakama-js';
|
|
2
2
|
import { ApiEnv, Backend } from '../backend/backend.api';
|
|
3
3
|
import { IHost } from '../host';
|
|
4
|
-
|
|
4
|
+
interface NakamaProviderContract {
|
|
5
5
|
isUserAuthorized(): Promise<boolean>;
|
|
6
6
|
getNakamaSession(): Promise<NakamaSession>;
|
|
7
7
|
getNakamaClient(): NakamaApiClient;
|
|
8
8
|
}
|
|
9
|
-
export declare class NakamaProvider implements
|
|
9
|
+
export declare class NakamaProvider implements NakamaProviderContract {
|
|
10
10
|
private backendApi;
|
|
11
11
|
private host;
|
|
12
12
|
private nakamaApiClient;
|
|
@@ -20,3 +20,4 @@ export declare class NakamaProvider implements UserNakamaReaderContract {
|
|
|
20
20
|
private refreshNakamaSessionIfNeeded;
|
|
21
21
|
private initNakamaSessionViaEagle;
|
|
22
22
|
}
|
|
23
|
+
export {};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { RpcProvider } from '../../core/rpc';
|
|
2
|
+
import { NakamaProvider } from '../nakama/nakama-provider';
|
|
3
|
+
import { IHost } from '../host';
|
|
4
|
+
declare type RemoteStorageValueType = string | object;
|
|
2
5
|
export interface IPersistence {
|
|
3
6
|
getLocalStorageItem(key: string): Promise<string | null>;
|
|
4
7
|
setLocalStorageItem(key: string, value: string): Promise<void>;
|
|
5
8
|
removeLocalStorageItem(key: string): Promise<void>;
|
|
6
9
|
getCookie(cookieName: string): Promise<string>;
|
|
10
|
+
getRemoteStorageItem?(key: string): Promise<RemoteStorageValueType | null>;
|
|
11
|
+
setRemoteStorageItem?(key: string, value: RemoteStorageValueType): Promise<void>;
|
|
12
|
+
removeRemoteStorageItem?(key: string): Promise<boolean>;
|
|
7
13
|
}
|
|
8
14
|
export declare class PersistenceArena implements IPersistence {
|
|
9
15
|
private ls;
|
|
@@ -18,12 +24,19 @@ export declare class PersistenceArena implements IPersistence {
|
|
|
18
24
|
}
|
|
19
25
|
export declare class PersistenceGame implements IPersistence {
|
|
20
26
|
private rpcProvider;
|
|
27
|
+
private nakamaProvider;
|
|
28
|
+
private host;
|
|
21
29
|
/**
|
|
22
30
|
* @internal
|
|
23
31
|
*/
|
|
24
|
-
constructor(rpcProvider: RpcProvider);
|
|
32
|
+
constructor(rpcProvider: RpcProvider, nakamaProvider: NakamaProvider, host: IHost);
|
|
25
33
|
getLocalStorageItem(key: string): Promise<string | null>;
|
|
26
34
|
setLocalStorageItem(key: string, value: string): Promise<void>;
|
|
27
35
|
removeLocalStorageItem(key: string): Promise<void>;
|
|
28
36
|
getCookie(cookieName: string): Promise<string>;
|
|
37
|
+
private getRemoteStorageCollection;
|
|
38
|
+
getRemoteStorageItem(key: string): Promise<RemoteStorageValueType | null>;
|
|
39
|
+
setRemoteStorageItem(key: string, value: RemoteStorageValueType): Promise<void>;
|
|
40
|
+
removeRemoteStorageItem(key: string): Promise<boolean>;
|
|
29
41
|
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|