@arkadiuminc/sdk 2.18.2 → 2.20.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.
- package/dist/pkg/api/features/ads/__mocks__/display-ad.d.ts +23 -1
- package/dist/pkg/api/features/ads/display-ad.d.ts +23 -1
- package/dist/pkg/api/features/ads/index.d.ts +16 -16
- package/dist/pkg/api/features/analytics/providers/AnalyticsProvider.d.ts +8 -1
- package/dist/pkg/api/features/analytics/providers/AppInsightsProvider.d.ts +4 -3
- package/dist/pkg/api/features/analytics/providers/ConsoleProvider.d.ts +7 -3
- package/dist/pkg/arkadium-arena-sdk.d.ts +3 -3
- package/dist/pkg/arkadium-game-sdk.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
export declare type BannerAdOptions = {
|
|
2
|
+
id: string;
|
|
3
|
+
dimensions: AdTypes[];
|
|
4
|
+
dataId?: string;
|
|
5
|
+
product?: string;
|
|
6
|
+
onAdShow?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare enum AdTypes {
|
|
9
|
+
AD_300x250 = "AD_300x250",
|
|
10
|
+
AD_250x250 = "AD_250x250",
|
|
11
|
+
AD_336x280 = "AD_336x280",
|
|
12
|
+
AD_300x600 = "AD_300x600",
|
|
13
|
+
AD_728x90 = "AD_728x90",
|
|
14
|
+
AD_768x90 = "AD_768x90",
|
|
15
|
+
AD_970x90 = "AD_970x90",
|
|
16
|
+
AD_970x250 = "AD_970x250",
|
|
17
|
+
AD_320x50 = "AD_320x50",
|
|
18
|
+
AD_320x100 = "AD_320x100",
|
|
19
|
+
AD_468x60 = "AD_468x60",
|
|
20
|
+
AD_160x600 = "AD_160x600"
|
|
21
|
+
}
|
|
1
22
|
/** @hidden */
|
|
2
23
|
export declare class DisplayAd {
|
|
3
24
|
static getInstance(): DisplayAd;
|
|
4
25
|
protected _scriptLoaded: Promise<void>;
|
|
5
26
|
private ads;
|
|
6
27
|
constructor();
|
|
28
|
+
private matchAdSize;
|
|
7
29
|
removeAllAds(): void;
|
|
8
|
-
show(
|
|
30
|
+
show(options: BannerAdOptions): void;
|
|
9
31
|
}
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
export declare type BannerAdOptions = {
|
|
2
|
+
id: string;
|
|
3
|
+
dimensions: AdTypes[];
|
|
4
|
+
dataId?: string;
|
|
5
|
+
product?: string;
|
|
6
|
+
onAdShow?: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare enum AdTypes {
|
|
9
|
+
AD_300x250 = "AD_300x250",
|
|
10
|
+
AD_250x250 = "AD_250x250",
|
|
11
|
+
AD_336x280 = "AD_336x280",
|
|
12
|
+
AD_300x600 = "AD_300x600",
|
|
13
|
+
AD_728x90 = "AD_728x90",
|
|
14
|
+
AD_768x90 = "AD_768x90",
|
|
15
|
+
AD_970x90 = "AD_970x90",
|
|
16
|
+
AD_970x250 = "AD_970x250",
|
|
17
|
+
AD_320x50 = "AD_320x50",
|
|
18
|
+
AD_320x100 = "AD_320x100",
|
|
19
|
+
AD_468x60 = "AD_468x60",
|
|
20
|
+
AD_160x600 = "AD_160x600"
|
|
21
|
+
}
|
|
1
22
|
/** @hidden */
|
|
2
23
|
export declare class DisplayAd {
|
|
3
24
|
static domain: string;
|
|
@@ -5,6 +26,7 @@ export declare class DisplayAd {
|
|
|
5
26
|
protected _scriptLoaded: Promise<void>;
|
|
6
27
|
private ads;
|
|
7
28
|
constructor(domain: string);
|
|
29
|
+
private matchAdSize;
|
|
8
30
|
removeAllAds(): void;
|
|
9
|
-
show(
|
|
31
|
+
show(options: BannerAdOptions): void;
|
|
10
32
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { RpcProvider } from '../../core/rpc';
|
|
2
2
|
import { ApiEnv } from '../backend/backend.api';
|
|
3
3
|
import { Auth } from '../auth/';
|
|
4
|
+
import { BannerAdOptions, AdTypes } from './display-ad';
|
|
4
5
|
|
|
5
6
|
/** @hidden */
|
|
6
|
-
export interface
|
|
7
|
+
export interface AdsArena extends Ads, AdsArenaBanner {
|
|
8
|
+
}
|
|
9
|
+
export interface AdsGame extends Ads, AdsGameBanner {
|
|
10
|
+
}
|
|
11
|
+
interface Ads {
|
|
7
12
|
showPrerollAd?(options: {
|
|
8
13
|
duration?: number;
|
|
9
14
|
}): Promise<void>;
|
|
@@ -15,23 +20,16 @@ export interface GameAdsContract {
|
|
|
15
20
|
}): Promise<{
|
|
16
21
|
value: number;
|
|
17
22
|
}>;
|
|
18
|
-
showBannerAd?(adId: string, dimensions: AdTypes[]): any;
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
AD_728x90 = "AD_728x90",
|
|
26
|
-
AD_970x90 = "AD_970x90",
|
|
27
|
-
AD_970x250 = "AD_970x250",
|
|
28
|
-
AD_320x50 = "AD_320x50",
|
|
29
|
-
AD_320x100 = "AD_320x100",
|
|
30
|
-
AD_468x60 = "AD_468x60",
|
|
31
|
-
AD_160x600 = "AD_160x600"
|
|
24
|
+
interface AdsArenaBanner {
|
|
25
|
+
showBannerAd?(options: BannerAdOptions): any;
|
|
26
|
+
}
|
|
27
|
+
interface AdsGameBanner {
|
|
28
|
+
showBannerAd?(adId: string, dimensions: AdTypes[]): any;
|
|
32
29
|
}
|
|
33
30
|
/** @hidden */
|
|
34
|
-
export declare class
|
|
31
|
+
export declare class AdsArenaProvider implements AdsArena {
|
|
32
|
+
bannerSizes: typeof AdTypes;
|
|
35
33
|
private interstitial;
|
|
36
34
|
private rewarded;
|
|
37
35
|
private preroll;
|
|
@@ -50,8 +48,9 @@ export declare class GameAds implements GameAdsContract {
|
|
|
50
48
|
}): Promise<{
|
|
51
49
|
value: number;
|
|
52
50
|
}>;
|
|
51
|
+
showBannerAd(options: BannerAdOptions): any;
|
|
53
52
|
}
|
|
54
|
-
export declare class
|
|
53
|
+
export declare class AdsGameProvider implements AdsGame {
|
|
55
54
|
bannerSizes: typeof AdTypes;
|
|
56
55
|
private interstitial;
|
|
57
56
|
private rewarded;
|
|
@@ -67,3 +66,4 @@ export declare class GameAdsProxy implements GameAdsContract {
|
|
|
67
66
|
}>;
|
|
68
67
|
showBannerAd(adId: string, dimensions: AdTypes[]): any;
|
|
69
68
|
}
|
|
69
|
+
export {};
|
|
@@ -5,7 +5,7 @@ declare type EventArr = [string, string, DimensionsObject];
|
|
|
5
5
|
declare type PageViewArr = [string, DimensionsObject];
|
|
6
6
|
export declare abstract class AnalyticsProvider {
|
|
7
7
|
protected config: IAnalyticConfig;
|
|
8
|
-
|
|
8
|
+
private isReady;
|
|
9
9
|
protected unsentEvents: EventArr[];
|
|
10
10
|
protected unsentPageViews: PageViewArr[];
|
|
11
11
|
protected unsentExceptions: Error[];
|
|
@@ -15,6 +15,13 @@ export declare abstract class AnalyticsProvider {
|
|
|
15
15
|
sendEvent(eventCategory: string, eventAction: string, dimensions: DimensionsObject): void;
|
|
16
16
|
sendPageView(pageName: string, dimensions: DimensionsObject): void;
|
|
17
17
|
trackException(exception: Error): void;
|
|
18
|
+
protected abstract getProviderName(): string;
|
|
19
|
+
protected abstract sendEventImpl(eventCategory: string, eventAction: string, dimensions: DimensionsObject): void;
|
|
20
|
+
protected abstract sendPageViewImpl(pageName: string, dimensions: DimensionsObject): void;
|
|
21
|
+
protected abstract trackExceptionImpl(exception: Error): void;
|
|
22
|
+
protected debugSendEvent(eventCategory: string, eventAction: string, dimensions: DimensionsObject): void;
|
|
23
|
+
protected debugSendPageView(pageName: string, dimensions: DimensionsObject): void;
|
|
24
|
+
protected debugTrackException(exception: Error): void;
|
|
18
25
|
getProviderType(): import('../defs').AnalyticsProviderType;
|
|
19
26
|
}
|
|
20
27
|
export {};
|
|
@@ -34,11 +34,12 @@ export interface ICloudAppInsightConfig {
|
|
|
34
34
|
export declare class AppInsightsProvider extends AnalyticsProvider {
|
|
35
35
|
private _aiTracker;
|
|
36
36
|
private _config;
|
|
37
|
+
getProviderName(): string;
|
|
37
38
|
protected setup(): Promise<void>;
|
|
38
39
|
private fetchRemoteJson;
|
|
39
40
|
private onceLoaded;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
sendEventImpl(eventCategory: string, eventAction: string, dimensions: DimensionsObject): void;
|
|
42
|
+
sendPageViewImpl(pageName: string, dimensions: DimensionsObject): void;
|
|
43
|
+
trackExceptionImpl(exception: Error): void;
|
|
43
44
|
private getDefaultConfig;
|
|
44
45
|
}
|
|
@@ -6,8 +6,12 @@ import { AnalyticsProvider } from './AnalyticsProvider';
|
|
|
6
6
|
*/
|
|
7
7
|
/** @hidden */
|
|
8
8
|
export declare class ConsoleProvider extends AnalyticsProvider {
|
|
9
|
+
getProviderName(): string;
|
|
9
10
|
protected setup(): Promise<void>;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
sendEventImpl(eventCategory: string, eventAction: string, dimensions: DimensionsObject): void;
|
|
12
|
+
sendPageViewImpl(pageName: string, dimensions: DimensionsObject): void;
|
|
13
|
+
trackExceptionImpl(exception: Error): void;
|
|
14
|
+
protected debugSendEvent(eventCategory: string, eventAction: string, dimensions: DimensionsObject): void;
|
|
15
|
+
protected debugSendPageView(pageName: string, dimensions: DimensionsObject): void;
|
|
16
|
+
protected debugTrackException(exception: Error): void;
|
|
13
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiEnv, Backend, SessionStorageType } from './api/features/backend/backend.api';
|
|
2
2
|
import { GameLifecycleContract } from './api/features/game-lifecycle/game-lifecycle.api';
|
|
3
3
|
import { RpcProvider } from './api/core/rpc';
|
|
4
|
-
import {
|
|
4
|
+
import { AdsArena } from './api/features/ads/';
|
|
5
5
|
import { Auth } from './api/features/auth/';
|
|
6
6
|
import { AnalyticsApiContract } from './api/features/analytics/analytics.api';
|
|
7
7
|
import { Observable } from './api/utils/observable';
|
|
@@ -15,7 +15,7 @@ export declare class ArkadiumArenaSdk {
|
|
|
15
15
|
backendApi: Backend;
|
|
16
16
|
host: HostArena;
|
|
17
17
|
lifecycle: GameLifecycleContract;
|
|
18
|
-
ads:
|
|
18
|
+
ads: AdsArena;
|
|
19
19
|
auth: Auth;
|
|
20
20
|
analytics: AnalyticsApiContract;
|
|
21
21
|
private timeoutTester;
|
|
@@ -26,7 +26,7 @@ export declare class ArkadiumArenaSdk {
|
|
|
26
26
|
private gamePingListener;
|
|
27
27
|
$pingNotification: Observable<number>;
|
|
28
28
|
version: string;
|
|
29
|
-
constructor(rpcProvider: RpcProvider, backendApi: Backend, host: HostArena, lifecycle: GameLifecycleContract, ads:
|
|
29
|
+
constructor(rpcProvider: RpcProvider, backendApi: Backend, host: HostArena, lifecycle: GameLifecycleContract, ads: AdsArena, auth: Auth, analytics: AnalyticsApiContract, timeoutTester: TimeoutTesterContract, persistence: PersistenceArena);
|
|
30
30
|
setEnv(e: ApiEnv): void;
|
|
31
31
|
initialize(env: ApiEnv, isGameSide: boolean, sessionStorage?: SessionStorageType | null): Promise<void>;
|
|
32
32
|
private envDiscoverListener;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ApiEnv, Backend } from './api/features/backend/backend.api';
|
|
2
2
|
import { GameLifecycleContract } from './api/features/game-lifecycle/game-lifecycle.api';
|
|
3
|
-
import {
|
|
3
|
+
import { AdsGame } from './api/features/ads/';
|
|
4
4
|
import { Auth } from './api/features/auth/';
|
|
5
5
|
import { AnalyticsApiContract } from './api/features/analytics/analytics.api';
|
|
6
6
|
import { RpcProvider } from './api/core/rpc';
|
|
@@ -18,7 +18,7 @@ export declare class ArkadiumGameSdk {
|
|
|
18
18
|
private backendApi;
|
|
19
19
|
host: HostGame;
|
|
20
20
|
lifecycle: GameLifecycleContract;
|
|
21
|
-
ads:
|
|
21
|
+
ads: AdsGame;
|
|
22
22
|
auth: Auth;
|
|
23
23
|
analytics: AnalyticsApiContract;
|
|
24
24
|
private timeoutTester;
|
|
@@ -29,7 +29,7 @@ export declare class ArkadiumGameSdk {
|
|
|
29
29
|
backendApi: Backend;
|
|
30
30
|
host: HostGame;
|
|
31
31
|
lifecycle: GameLifecycleContract;
|
|
32
|
-
ads:
|
|
32
|
+
ads: AdsGame;
|
|
33
33
|
auth: Auth;
|
|
34
34
|
analytics: AnalyticsApiContract;
|
|
35
35
|
timeoutTester: TimeoutTesterContract;
|