@arkadiuminc/sdk 2.51.2 → 2.52.2

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.
@@ -4,6 +4,7 @@ import { IHost } from '../features/host';
4
4
  export { defaultConfig };
5
5
  export declare type AdsConfig = {
6
6
  isEnabled: boolean;
7
+ gameIdChanged: boolean;
7
8
  adTypes?: string[];
8
9
  cooldown?: number;
9
10
  };
@@ -129,6 +130,7 @@ export declare class ConfigService {
129
130
  private _gameId;
130
131
  private _platformId;
131
132
  private _platformType;
133
+ private _host;
132
134
  private constructor();
133
135
  static get Instance(): ConfigService;
134
136
  subscribe(callback: ConfigChangeCallback): () => void;
@@ -1,6 +1,7 @@
1
1
  import { RpcProvider } from '../../core/rpc';
2
2
  import { ApiEnv } from '../backend/backend.api';
3
3
  import { Auth } from '../auth/';
4
+ import { VideoAdOptions } from './video-ad';
4
5
  import { BannerAdOptions, AdTypes } from './display-ad';
5
6
  import { GameLifecycleArena } from '../game-lifecycle/game-lifecycle.api';
6
7
 
@@ -10,18 +11,9 @@ export interface AdsArena extends Ads, AdsArenaBanner {
10
11
  export interface AdsGame extends Ads, AdsGameBanner {
11
12
  }
12
13
  interface Ads {
13
- showPrerollAd?(options: {
14
- duration?: number;
15
- product?: string;
16
- }): Promise<void>;
17
- showInterstitialAd(options: {
18
- duration?: number;
19
- product?: string;
20
- }): Promise<void>;
21
- showRewardAd(options: {
22
- duration?: number;
23
- product?: string;
24
- }): Promise<{
14
+ showPrerollAd?(options: VideoAdOptions): Promise<void>;
15
+ showInterstitialAd(options: VideoAdOptions): Promise<void>;
16
+ showRewardAd(options: VideoAdOptions): Promise<{
25
17
  value: number;
26
18
  }>;
27
19
  }
@@ -44,18 +36,9 @@ export declare class AdsArenaProvider implements AdsArena {
44
36
  setVideoAdsDomain(domain: string): void;
45
37
  setDisplayAdsUrl(url: string): void;
46
38
  setDisplayAdsDomain(domain: string): void;
47
- showPrerollAd({ duration, product }: {
48
- duration?: number;
49
- product?: string;
50
- }): Promise<void>;
51
- showInterstitialAd({ duration, product }?: {
52
- duration?: number | undefined;
53
- product?: string | undefined;
54
- }): Promise<void>;
55
- showRewardAd({ duration, product }?: {
56
- duration?: number | undefined;
57
- product?: string | undefined;
58
- }): Promise<{
39
+ showPrerollAd(options: VideoAdOptions): Promise<void>;
40
+ showInterstitialAd(options: VideoAdOptions): Promise<void>;
41
+ showRewardAd(options: VideoAdOptions): Promise<{
59
42
  value: number;
60
43
  }>;
61
44
  showBannerAd(options: BannerAdOptions): any;
@@ -1,5 +1,13 @@
1
1
  import { ApiEnv } from '../backend/backend.api';
2
2
 
3
+ export declare type VideoAdOptions = {
4
+ env?: ApiEnv;
5
+ duration?: number;
6
+ product?: string;
7
+ adPodding?: boolean;
8
+ keyvalues?: Record<string, string>;
9
+ position?: 'pre-roll' | 'reward' | 'interstitial';
10
+ };
3
11
  /** @hidden */
4
12
  export declare class VideoAd {
5
13
  private static domain;
@@ -8,25 +16,9 @@ export declare class VideoAd {
8
16
  static getInstance(domain?: string, url?: string): VideoAd;
9
17
  protected _scriptLoaded: Promise<void>;
10
18
  constructor(domain: string, url: string);
11
- preroll({ duration, env, product }: {
12
- duration?: number | undefined;
13
- env?: ApiEnv | undefined;
14
- product?: string | undefined;
15
- }): Promise<void>;
16
- interstitial({ duration, env, product }: {
17
- duration?: number | undefined;
18
- env?: ApiEnv | undefined;
19
- product?: string | undefined;
20
- }): Promise<void>;
21
- rewarded({ duration, env, product }: {
22
- duration?: number | undefined;
23
- env?: ApiEnv | undefined;
24
- product?: string | undefined;
25
- }): Promise<void>;
19
+ preroll(options: VideoAdOptions): Promise<void>;
20
+ interstitial(options: VideoAdOptions): Promise<void>;
21
+ rewarded(options: any): Promise<void>;
26
22
  isShowing(): boolean;
27
- protected render({ duration, env, product }: {
28
- duration: any;
29
- env: any;
30
- product: any;
31
- }): Promise<void>;
23
+ protected render({ duration, env, product, position, keyvalues, adPodding }?: VideoAdOptions): Promise<void>;
32
24
  }
@@ -9,6 +9,7 @@ export declare enum ArenaType {
9
9
  export interface IHost {
10
10
  getQueryParameter(key: string): Promise<string | null>;
11
11
  getGameId(): Promise<string>;
12
+ getGameIdSync?(): string;
12
13
  setGameId(id: string): void;
13
14
  getDetails(): Promise<WebEnvironmentDetails>;
14
15
  setDetails?(p: Partial<WebEnvironmentDetails>): Promise<void>;
@@ -46,6 +47,7 @@ export declare class HostArena implements IHost {
46
47
  noOp(): Promise<void>;
47
48
  getQueryParameter(key: string): Promise<string | null>;
48
49
  getGameId(): Promise<string>;
50
+ getGameIdSync(): string;
49
51
  setGameId(id: string): Promise<void>;
50
52
  getDetails(): Promise<WebEnvironmentDetails>;
51
53
  setDetails(p: Partial<WebEnvironmentDetails>): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.51.2",
3
+ "version": "2.52.2",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",