@arkadiuminc/sdk 0.0.37 → 0.0.38
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.
- package/dist/pkg/api/core/rpc.d.ts +5 -2
- package/dist/pkg/api/features/ads/index.d.ts +10 -11
- package/dist/pkg/api/features/analytics/analytics.api.d.ts +5 -1
- package/dist/pkg/api/features/environment/environment.api.d.ts +7 -4
- package/dist/pkg/api/features/game-lifecycle/game-lifecycle.api.d.ts +5 -1
- package/dist/pkg/api/features/game-state/game-state.api.d.ts +5 -2
- package/dist/pkg/api/features/user-state/user-state.api.d.ts +3 -2
- package/dist/pkg/arkadium-arena-sdk.d.ts +3 -1
- package/dist/pkg/arkadium-game-sdk.d.ts +3 -1
- package/dist/pkg/ping.module.d.ts +4 -1
- package/package.json +1 -1
|
@@ -28,6 +28,9 @@ declare class RpcSubscriber {
|
|
|
28
28
|
private sendError;
|
|
29
29
|
}
|
|
30
30
|
export declare function shouldSubscribe(name: string, value: any): boolean;
|
|
31
|
-
export declare
|
|
32
|
-
|
|
31
|
+
export declare class RpcProvider {
|
|
32
|
+
rpcPublisher: RpcPublisher;
|
|
33
|
+
rpcSubscriber: RpcSubscriber;
|
|
34
|
+
constructor();
|
|
35
|
+
}
|
|
33
36
|
export {};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { RpcProvider } from '../../core/rpc';
|
|
2
|
+
declare type InterstitialAdContract = {
|
|
3
3
|
show(): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
declare
|
|
6
|
-
constructor();
|
|
4
|
+
};
|
|
5
|
+
declare type RewardAdContract = {
|
|
7
6
|
show(): Promise<{
|
|
8
7
|
value: number;
|
|
9
8
|
}>;
|
|
10
|
-
}
|
|
9
|
+
};
|
|
11
10
|
export declare class AdsApi {
|
|
12
|
-
interstitial:
|
|
13
|
-
rewarded:
|
|
14
|
-
constructor(interstitial:
|
|
15
|
-
static getArenaApi(): AdsApi;
|
|
16
|
-
static getGameApi(): AdsApi;
|
|
11
|
+
interstitial: InterstitialAdContract;
|
|
12
|
+
rewarded: RewardAdContract;
|
|
13
|
+
constructor(interstitial: InterstitialAdContract, rewarded: RewardAdContract);
|
|
14
|
+
static getArenaApi(rpcProvider: RpcProvider): AdsApi;
|
|
15
|
+
static getGameApi(rpcProvider: RpcProvider): AdsApi;
|
|
17
16
|
}
|
|
18
17
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RpcProvider } from '../../core/rpc';
|
|
1
2
|
import { GameIdReaderContract } from '../environment/environment.api';
|
|
2
3
|
interface EnvironmentVersion {
|
|
3
4
|
GameKey: string;
|
|
@@ -12,13 +13,16 @@ export interface AnalyticsApiContract {
|
|
|
12
13
|
}
|
|
13
14
|
export declare class AnalyticsApi implements AnalyticsApiContract {
|
|
14
15
|
private gameReader;
|
|
15
|
-
|
|
16
|
+
private rpcProvider;
|
|
17
|
+
constructor(gameReader: GameIdReaderContract, rpcProvider: RpcProvider);
|
|
16
18
|
getEnvVersion(): Promise<EnvironmentVersion>;
|
|
17
19
|
private info;
|
|
18
20
|
setGameVersion(v: string): Promise<void>;
|
|
19
21
|
setNestVersion(v: string): Promise<void>;
|
|
20
22
|
}
|
|
21
23
|
export declare class AnalyticsApiProxy implements AnalyticsApiContract {
|
|
24
|
+
private rpcProvider;
|
|
25
|
+
constructor(rpcProvider: RpcProvider);
|
|
22
26
|
setGameVersion(v: string): Promise<void>;
|
|
23
27
|
setNestVersion(v: string): Promise<void>;
|
|
24
28
|
getEnvVersion(): Promise<EnvironmentVersion>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RpcProvider } from '../../core/rpc';
|
|
1
2
|
export interface LocalStorageContract {
|
|
2
3
|
getItem(key: string): Promise<string | null>;
|
|
3
4
|
setItem(key: string, value: string): Promise<void>;
|
|
@@ -5,7 +6,7 @@ export interface LocalStorageContract {
|
|
|
5
6
|
}
|
|
6
7
|
export declare class DefaultLocalStorage implements LocalStorageContract {
|
|
7
8
|
private ls;
|
|
8
|
-
constructor();
|
|
9
|
+
constructor(rpcProvider: RpcProvider);
|
|
9
10
|
getItem(key: string): Promise<string | null>;
|
|
10
11
|
setItem(key: string, value: string): Promise<void>;
|
|
11
12
|
removeItem(key: string): Promise<void>;
|
|
@@ -22,11 +23,13 @@ export interface GameIdReaderContract {
|
|
|
22
23
|
}
|
|
23
24
|
export declare class GameIdReader implements GameIdReaderContract {
|
|
24
25
|
private gameIdOverride;
|
|
25
|
-
constructor();
|
|
26
|
+
constructor(rpcProvider: RpcProvider);
|
|
26
27
|
readGameId(): Promise<string>;
|
|
27
28
|
setGameId(id: string): void;
|
|
28
29
|
}
|
|
29
30
|
export declare class GameIdReaderProxy implements GameIdReaderContract {
|
|
31
|
+
private rpcProvider;
|
|
32
|
+
constructor(rpcProvider: RpcProvider);
|
|
30
33
|
readGameId(): Promise<string>;
|
|
31
34
|
setGameId(id: string): Promise<any>;
|
|
32
35
|
}
|
|
@@ -36,7 +39,7 @@ export declare class EnvironmentApi {
|
|
|
36
39
|
urlParamsReader: UrlParamsReaderContract;
|
|
37
40
|
gameIdReader: GameIdReaderContract;
|
|
38
41
|
constructor(localStorage: LocalStorageContract, cookieStorage: CookieStorageContract, urlParamsReader: UrlParamsReaderContract, gameIdReader: GameIdReaderContract);
|
|
39
|
-
static getArenaApi(): EnvironmentApi;
|
|
40
|
-
static getGameApi(): EnvironmentApi;
|
|
42
|
+
static getArenaApi(rpcProvider: RpcProvider): EnvironmentApi;
|
|
43
|
+
static getGameApi(rpcProvider: RpcProvider): EnvironmentApi;
|
|
41
44
|
}
|
|
42
45
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RpcProvider } from '../../core/rpc';
|
|
1
2
|
declare enum LifecycleEvent {
|
|
2
3
|
TEST_READY = 1,
|
|
3
4
|
GAME_START = 2,
|
|
@@ -15,8 +16,9 @@ export interface GameLifecycleContract {
|
|
|
15
16
|
subscribe(fn: LifecycleFn): void;
|
|
16
17
|
}
|
|
17
18
|
export declare class GameLifecycle implements GameLifecycleContract {
|
|
19
|
+
private rpcProvider;
|
|
18
20
|
private cb;
|
|
19
|
-
constructor();
|
|
21
|
+
constructor(rpcProvider: RpcProvider);
|
|
20
22
|
OnTestReady(): Promise<void>;
|
|
21
23
|
OnGameStart(): Promise<void>;
|
|
22
24
|
OnInteract(): Promise<void>;
|
|
@@ -25,6 +27,8 @@ export declare class GameLifecycle implements GameLifecycleContract {
|
|
|
25
27
|
subscribe(cb: LifecycleFn): void;
|
|
26
28
|
}
|
|
27
29
|
export declare class GameLifecycleProxy implements GameLifecycleContract {
|
|
30
|
+
private rpcProvider;
|
|
31
|
+
constructor(rpcProvider: RpcProvider);
|
|
28
32
|
OnTestReady(): Promise<void>;
|
|
29
33
|
OnGameStart(): Promise<void>;
|
|
30
34
|
OnInteract(): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RpcProvider } from '../../core/rpc';
|
|
1
2
|
import { GameIdReaderContract } from '../environment/environment.api';
|
|
2
3
|
import { BackendApi } from '../backend/backend.api';
|
|
3
4
|
declare class SaveDataContract<T> {
|
|
@@ -18,13 +19,14 @@ export interface Serializer {
|
|
|
18
19
|
unpack(data: string): Promise<Record<any, any> | null>;
|
|
19
20
|
}
|
|
20
21
|
export declare class GameStateApi {
|
|
22
|
+
private rpcProvider;
|
|
21
23
|
private ls;
|
|
22
24
|
private backendApi;
|
|
23
25
|
private gameIdReader;
|
|
24
26
|
private knownStates;
|
|
25
27
|
private serializer;
|
|
26
28
|
private useGameSerializer;
|
|
27
|
-
constructor(backendApi: BackendApi, gameIdReader: GameIdReaderContract);
|
|
29
|
+
constructor(backendApi: BackendApi, gameIdReader: GameIdReaderContract, rpcProvider: RpcProvider);
|
|
28
30
|
private getGameId;
|
|
29
31
|
private packData;
|
|
30
32
|
private unpackData;
|
|
@@ -42,7 +44,8 @@ export declare class GameStateApi {
|
|
|
42
44
|
private saveDataToStorage;
|
|
43
45
|
}
|
|
44
46
|
export declare class GameStateApiProxy {
|
|
45
|
-
|
|
47
|
+
private rpcProvider;
|
|
48
|
+
constructor(rpcProvider: RpcProvider);
|
|
46
49
|
private serializer;
|
|
47
50
|
setSerializer(serializer: Serializer | null): void;
|
|
48
51
|
customPack(data: Record<any, any>): Promise<string | undefined>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BackendApi } from '../backend/backend.api';
|
|
2
2
|
import { createStore } from '../../utils/observable';
|
|
3
|
+
import { RpcProvider } from '../../core/rpc';
|
|
3
4
|
interface Image {
|
|
4
5
|
png: string;
|
|
5
6
|
webp: string;
|
|
@@ -24,7 +25,7 @@ export declare class UserStateApi {
|
|
|
24
25
|
userProfileReader: UserProfileReaderContract;
|
|
25
26
|
authUIManager: AuthUIManagerContract;
|
|
26
27
|
constructor(userProfileReader: UserProfileReaderContract, authUIManager: AuthUIManagerContract);
|
|
27
|
-
static getArenaApi(backendApi: BackendApi): UserStateApi;
|
|
28
|
-
static getGameApi(backendApi: BackendApi): UserStateApi;
|
|
28
|
+
static getArenaApi(backendApi: BackendApi, rpcProvider: RpcProvider): UserStateApi;
|
|
29
|
+
static getGameApi(backendApi: BackendApi, rpcProvider: RpcProvider): UserStateApi;
|
|
29
30
|
}
|
|
30
31
|
export {};
|
|
@@ -2,11 +2,13 @@ import { ApiEnv, BackendApi, SessionStorageType } from './api/features/backend/b
|
|
|
2
2
|
import { GameStateContract } from './api/features/game-state/game-state.api';
|
|
3
3
|
import { GameLifecycleContract } from './api/features/game-lifecycle/game-lifecycle.api';
|
|
4
4
|
import { EnvironmentApi } from './api/features/environment/environment.api';
|
|
5
|
+
import { RpcProvider } from './api/core/rpc';
|
|
5
6
|
import { AdsApi } from './api/features/ads/';
|
|
6
7
|
import { UserStateApi } from './api/features/user-state/user-state.api';
|
|
7
8
|
import { AnalyticsApiContract } from './api/features/analytics/analytics.api';
|
|
8
9
|
import { Observable } from './api/utils/observable';
|
|
9
10
|
export declare class ArkadiumGameSdk {
|
|
11
|
+
private rpcProvider;
|
|
10
12
|
backendApi: BackendApi;
|
|
11
13
|
environment: EnvironmentApi;
|
|
12
14
|
gameState: GameStateContract;
|
|
@@ -17,7 +19,7 @@ export declare class ArkadiumGameSdk {
|
|
|
17
19
|
private gamePingSender;
|
|
18
20
|
private gamePingListener;
|
|
19
21
|
$pingNotification: Observable<number>;
|
|
20
|
-
constructor(backendApi: BackendApi, environment: EnvironmentApi, gameState: GameStateContract, lifecycle: GameLifecycleContract, ads: AdsApi, userStateApi: UserStateApi, analytics: AnalyticsApiContract);
|
|
22
|
+
constructor(rpcProvider: RpcProvider, backendApi: BackendApi, environment: EnvironmentApi, gameState: GameStateContract, lifecycle: GameLifecycleContract, ads: AdsApi, userStateApi: UserStateApi, analytics: AnalyticsApiContract);
|
|
21
23
|
initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
|
|
22
24
|
updateWinReference(target: any): void;
|
|
23
25
|
debugMode(enabled: boolean): void;
|
|
@@ -5,7 +5,9 @@ import { EnvironmentApi } from './api/features/environment/environment.api';
|
|
|
5
5
|
import { AdsApi } from './api/features/ads/';
|
|
6
6
|
import { UserStateApi } from './api/features/user-state/user-state.api';
|
|
7
7
|
import { AnalyticsApiContract } from './api/features/analytics/analytics.api';
|
|
8
|
+
import { RpcProvider } from './api/core/rpc';
|
|
8
9
|
export declare class ArkadiumGameSdk {
|
|
10
|
+
private rpcProvider;
|
|
9
11
|
backendApi: BackendApi;
|
|
10
12
|
environment: EnvironmentApi;
|
|
11
13
|
gameState: GameStateContract;
|
|
@@ -15,7 +17,7 @@ export declare class ArkadiumGameSdk {
|
|
|
15
17
|
analytics: AnalyticsApiContract;
|
|
16
18
|
private arenaPingSender;
|
|
17
19
|
private arenaPingListener;
|
|
18
|
-
constructor(backendApi: BackendApi, environment: EnvironmentApi, gameState: GameStateContract, lifecycle: GameLifecycleContract, ads: AdsApi, userStateApi: UserStateApi, analytics: AnalyticsApiContract);
|
|
20
|
+
constructor(rpcProvider: RpcProvider, backendApi: BackendApi, environment: EnvironmentApi, gameState: GameStateContract, lifecycle: GameLifecycleContract, ads: AdsApi, userStateApi: UserStateApi, analytics: AnalyticsApiContract);
|
|
19
21
|
initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
|
|
20
22
|
updateWinReference(target: any): void;
|
|
21
23
|
debugMode(enabled: boolean): void;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { RpcProvider } from './api/core/rpc';
|
|
1
2
|
export declare class PingModule {
|
|
2
|
-
constructor();
|
|
3
|
+
constructor(rpcProvider: RpcProvider);
|
|
3
4
|
$ping: import("./api/utils/observable").Observable<number>;
|
|
4
5
|
ping(): boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare class PingModuleProxy {
|
|
8
|
+
private rpcProvider;
|
|
9
|
+
constructor(rpcProvider: RpcProvider);
|
|
7
10
|
ping(): Promise<any>;
|
|
8
11
|
}
|