@arkadiuminc/sdk 2.70.4 → 2.70.5
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.
|
@@ -15,15 +15,23 @@ export declare function assignWeightedGroup(weights: number[]): number;
|
|
|
15
15
|
export declare class ABTestService {
|
|
16
16
|
private static _instance;
|
|
17
17
|
private _assignments;
|
|
18
|
+
private _persistence;
|
|
19
|
+
private _groupCache;
|
|
20
|
+
private _hydrated;
|
|
18
21
|
private constructor();
|
|
19
22
|
static get Instance(): ABTestService;
|
|
20
|
-
resolveConfig<T>(config: T): T
|
|
23
|
+
resolveConfig<T>(config: T): Promise<T>;
|
|
21
24
|
getAssignments(): ABTestAssignment[];
|
|
22
25
|
setAssignments(assignments: ABTestAssignment[]): void;
|
|
23
26
|
appendToAbVariations(existing: string | undefined): string | undefined;
|
|
24
27
|
resetAssignments(): void;
|
|
28
|
+
private setPersistence;
|
|
29
|
+
/** @internal */
|
|
30
|
+
resetGroupCache(): void;
|
|
31
|
+
private initPersistence;
|
|
25
32
|
private getOrAssignGroup;
|
|
26
|
-
private
|
|
33
|
+
private legacyCleanup;
|
|
27
34
|
private readStoredGroup;
|
|
28
35
|
private storeGroup;
|
|
36
|
+
private persistCache;
|
|
29
37
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConfigSchema } from './config-service';
|
|
2
|
+
|
|
3
|
+
export declare function mockAbTestPersistenceStorage(storageMap: Map<string, string>): void;
|
|
4
|
+
export declare function initAbTestForTests(): Promise<void>;
|
|
5
|
+
export declare function resolveDefaultConfigForTests(): Promise<ConfigSchema>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as defaultConfigJson } from '../../config.json';
|
|
1
2
|
import { ABTestAssignment } from './ab-test-service';
|
|
2
3
|
import { ArenaType } from '../features/host/arena-type';
|
|
3
4
|
import { IHost } from '../features/host';
|
|
@@ -52,7 +53,7 @@ export interface ConfigSchema {
|
|
|
52
53
|
adBlockerDetection: AdBlockerDetectionEntry[];
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
|
-
export
|
|
56
|
+
export { defaultConfigJson };
|
|
56
57
|
export declare const schema: {
|
|
57
58
|
type: string;
|
|
58
59
|
properties: {
|
|
@@ -240,9 +241,11 @@ export declare class ConfigService {
|
|
|
240
241
|
static get Instance(): ConfigService;
|
|
241
242
|
subscribe(callback: ConfigChangeCallback): () => void;
|
|
242
243
|
private notifyConfigChange;
|
|
244
|
+
private loadBundledConfig;
|
|
243
245
|
init(host?: IHost): Promise<void>;
|
|
244
246
|
loadConfig(): Promise<void>;
|
|
245
247
|
get config(): ConfigSchema;
|
|
248
|
+
getSupportsSubscriptionsHosts(): string[];
|
|
246
249
|
getAbTestAssignments(): ABTestAssignment[];
|
|
247
250
|
appendAbTestToAbVariations(existing: string | undefined): string | undefined;
|
|
248
251
|
isAdBlockerDetectionEnabled(): boolean;
|
|
@@ -261,4 +264,3 @@ export declare class ConfigService {
|
|
|
261
264
|
setGameConfig(gameConfig: any): void;
|
|
262
265
|
getGameConfigProperty(property: GameConfigProperty, defaultValue?: any): any;
|
|
263
266
|
}
|
|
264
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RpcProvider } from '../../core/rpc';
|
|
2
2
|
import { Backend } from '../backend/backend.api';
|
|
3
3
|
import { IHost } from '../host';
|
|
4
|
-
import { DebugProvider } from '../../core/debug-provider';
|
|
4
|
+
import { DebugProvider, DebugProviderArena } from '../../core/debug-provider';
|
|
5
5
|
import { IndexedDBStorage } from '../../utils/indexed-db-storage';
|
|
6
6
|
|
|
7
7
|
declare type RemoteStorageValueType = string | object;
|
|
@@ -16,12 +16,14 @@ export interface IPersistence {
|
|
|
16
16
|
}
|
|
17
17
|
/** @hidden */
|
|
18
18
|
export declare class PersistenceArena implements IPersistence {
|
|
19
|
-
private readonly debugProvider;
|
|
20
19
|
private readonly storage;
|
|
20
|
+
private readonly debugProvider;
|
|
21
|
+
private static _instance;
|
|
21
22
|
/**
|
|
22
23
|
* @internal
|
|
23
24
|
*/
|
|
24
|
-
constructor(rpcProvider
|
|
25
|
+
constructor(rpcProvider?: RpcProvider, debugProvider?: DebugProviderArena, storage?: IndexedDBStorage);
|
|
26
|
+
static get Instance(): PersistenceArena;
|
|
25
27
|
getCookie(cookieName: string): Promise<string>;
|
|
26
28
|
getLocalStorageItem(key: string): Promise<string | null>;
|
|
27
29
|
setLocalStorageItem(key: string, value: string): Promise<void>;
|
|
@@ -52,6 +52,14 @@ export declare class ArkadiumGameSdk {
|
|
|
52
52
|
export { ApiEnv };
|
|
53
53
|
export { Dimension } from './api/features/analytics/dimensions';
|
|
54
54
|
export { Event } from './api/features/analytics/events';
|
|
55
|
+
declare global {
|
|
56
|
+
interface ArkadiumBridge {
|
|
57
|
+
notifyDefold(messageName: string, data: unknown): void;
|
|
58
|
+
}
|
|
59
|
+
interface Window {
|
|
60
|
+
arkadiumBridge?: ArkadiumBridge;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
55
63
|
interface EnvDiscoverer {
|
|
56
64
|
discover(): Promise<ApiEnv>;
|
|
57
65
|
}
|