@arkadiuminc/sdk 2.58.0 → 2.59.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.
@@ -4,6 +4,7 @@ declare type RpcRequest = {
4
4
  payload: any[];
5
5
  executionTimeLimitMs?: number;
6
6
  };
7
+ export declare const EXECUTION_TIME_NO_LIMIT = -1;
7
8
  declare class RpcPublisher {
8
9
  private rpcCallbacks;
9
10
  private target;
@@ -3,9 +3,17 @@ import { ApiEnv } from '../backend/backend.api';
3
3
  import { Auth } from '../auth/';
4
4
  import { VideoAdOptions } from './video-ad';
5
5
  import { BannerAdOptions, AdTypes } from './display-ad';
6
- import { GameLifecycleArena } from '../game-lifecycle/game-lifecycle.api';
6
+ import { GameLifecycleArena, GameLifecycleGame } from '../game-lifecycle/game-lifecycle.api';
7
7
  import { IHost } from '../host';
8
8
 
9
+ export declare type ShowInterstitialAdOptions = {
10
+ duration?: number;
11
+ };
12
+ export declare type ShowRewardAdOptions = {
13
+ duration?: number;
14
+ context?: 'core' | 'default';
15
+ data?: any;
16
+ };
9
17
  /** @hidden */
10
18
  export interface AdsArena extends Ads, AdsArenaBanner {
11
19
  }
@@ -46,19 +54,16 @@ export declare class AdsArenaProvider implements AdsArena {
46
54
  showBannerAd(options: BannerAdOptions): any;
47
55
  }
48
56
  export declare class AdsGameProvider implements AdsGame {
49
- bannerSizes: typeof AdTypes;
50
- private interstitial;
51
- private rewarded;
52
- private banner;
53
- constructor(rpcProvider: RpcProvider, env: ApiEnv, auth: Auth);
54
- showInterstitialAd({ duration }?: {
55
- duration?: number | undefined;
56
- }): Promise<void>;
57
- showRewardAd({ duration }?: {
58
- duration?: number | undefined;
59
- }): Promise<{
57
+ private readonly lifecycle;
58
+ readonly bannerSizes: typeof AdTypes;
59
+ private readonly interstitial;
60
+ private readonly rewarded;
61
+ private readonly banner;
62
+ constructor(rpcProvider: RpcProvider, env: ApiEnv, auth: Auth, lifecycle: GameLifecycleGame);
63
+ showInterstitialAd({ duration }?: ShowInterstitialAdOptions): Promise<void>;
64
+ showRewardAd({ duration, context, data }?: ShowRewardAdOptions): Promise<{
60
65
  value: number;
61
66
  }>;
62
- showBannerAd(adId: string, dimensions: AdTypes[]): any;
67
+ showBannerAd(adId: string, dimensions: AdTypes[]): Promise<void>;
63
68
  }
64
69
  export {};
@@ -17,7 +17,10 @@ export declare enum LifecycleEvent {
17
17
  AD_REWARDED_REQUESTED = 12,
18
18
  AD_REWARDED_SHOWN = 13,
19
19
  LEVEL_START = 14,
20
- LEVEL_END = 15
20
+ LEVEL_END = 15,
21
+ REDEEM_POWERUP = 16,
22
+ OPT_LOG_IN = 17,
23
+ REWARD_START = 18
21
24
  }
22
25
  declare type LifecycleFn = (event: LifecycleEvent, payload?: any) => void;
23
26
  declare global {
@@ -34,7 +37,7 @@ export declare class GameLifecycleArena {
34
37
  LifecycleEvent: typeof LifecycleEvent;
35
38
  constructor(rpcProvider: RpcProvider, host: IHost);
36
39
  setVirtualItemsApiProvider(provider: VirtualItemsApiProvider): void;
37
- onEvent(event: LifecycleEvent, payload?: any): Promise<void>;
40
+ onEvent(event: LifecycleEvent, payload?: any): Promise<any>;
38
41
  dispatchEvent(event: LifecycleEvent): Promise<void>;
39
42
  subscribe(cb: LifecycleFn, override?: boolean): void;
40
43
  onFtueEvent(eventId: string): Promise<boolean>;
@@ -54,6 +57,7 @@ export declare class GameLifecycleGame {
54
57
  LifecycleEvent: typeof LifecycleEvent;
55
58
  constructor(rpcProvider: RpcProvider);
56
59
  private onEvent;
60
+ private getExecutionTimeLimitMs;
57
61
  dispatchEvent(event: LifecycleEvent, payload?: any): Promise<any>;
58
62
  onTestReady(): Promise<void>;
59
63
  onGameStart(): Promise<void>;
@@ -75,5 +79,11 @@ export declare class GameLifecycleGame {
75
79
  onLevelEnd(level: number): Promise<void>;
76
80
  registerEventCallback(event: LifecycleEvent, callback: () => void): void;
77
81
  onFtueEvent(eventId: string): Promise<boolean>;
82
+ onRedeemPowerup(data: any): Promise<any>;
83
+ onOptLogin(data: any): Promise<any>;
84
+ onRewardStart(data: any): Promise<any>;
85
+ private getPromiseForEvent;
86
+ private getCallbackType;
87
+ private setupPostMessageHandler;
78
88
  }
79
89
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.58.0",
3
+ "version": "2.59.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",