@arkadiuminc/sdk 2.4.0 → 2.6.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.
@@ -0,0 +1,8 @@
1
+ export declare class DisplayAd {
2
+ static getInstance(): DisplayAd;
3
+ protected _scriptLoaded: Promise<void>;
4
+ private ads;
5
+ constructor();
6
+ removeAllAds(): void;
7
+ show(containerId: string, dimensions: number[][]): void;
8
+ }
@@ -1,6 +1,23 @@
1
+ import { ApiEnv } from "../../backend/backend.api";
1
2
  export declare class VideoAd {
2
3
  static getInstance(): VideoAd;
4
+ protected _scriptLoaded: Promise<void>;
5
+ protected timer: any;
3
6
  constructor();
4
- interstitial(): Promise<unknown>;
5
- rewarded(): Promise<unknown>;
7
+ preroll({ duration, env }: {
8
+ duration?: number | undefined;
9
+ env?: ApiEnv | undefined;
10
+ }): Promise<void>;
11
+ interstitial({ duration, env }: {
12
+ duration?: number | undefined;
13
+ env?: ApiEnv | undefined;
14
+ }): Promise<void>;
15
+ rewarded({ duration, env }: {
16
+ duration?: number | undefined;
17
+ env?: ApiEnv | undefined;
18
+ }): Promise<void>;
19
+ protected render({ duration, env }: {
20
+ duration: any;
21
+ env: any;
22
+ }): Promise<void>;
6
23
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,9 @@ import { RpcProvider } from '../../core/rpc';
2
2
  import { ApiEnv } from '../backend/backend.api';
3
3
  import { Auth } from '../auth/';
4
4
  export interface GameAdsContract {
5
+ showPrerollAd?(options: {
6
+ duration?: number;
7
+ }): Promise<void>;
5
8
  showInterstitialAd(options: {
6
9
  duration?: number;
7
10
  }): Promise<void>;
@@ -28,7 +31,11 @@ export declare enum AdTypes {
28
31
  export declare class GameAds implements GameAdsContract {
29
32
  private interstitial;
30
33
  private rewarded;
34
+ private preroll;
31
35
  constructor(rpcProvider: RpcProvider, auth: Auth);
36
+ showPrerollAd({ duration }: {
37
+ duration?: number;
38
+ }): Promise<void>;
32
39
  showInterstitialAd({ duration }?: {
33
40
  duration?: number | undefined;
34
41
  }): Promise<void>;
@@ -4,6 +4,10 @@ export declare class VideoAd {
4
4
  protected _scriptLoaded: Promise<void>;
5
5
  protected timer: any;
6
6
  constructor();
7
+ preroll({ duration, env }: {
8
+ duration?: number | undefined;
9
+ env?: ApiEnv | undefined;
10
+ }): Promise<void>;
7
11
  interstitial({ duration, env }: {
8
12
  duration?: number | undefined;
9
13
  env?: ApiEnv | undefined;
@@ -24,7 +24,9 @@ export interface GameLifecycleContract {
24
24
  export declare class GameLifecycle implements GameLifecycleContract {
25
25
  private rpcProvider;
26
26
  private cb;
27
+ private subscribers;
27
28
  constructor(rpcProvider: RpcProvider);
29
+ private processLifecycleEvent;
28
30
  onTestReady(): Promise<void>;
29
31
  onGameStart(): Promise<void>;
30
32
  onInteract(): Promise<void>;
@@ -39,7 +39,7 @@ export declare class GameApi {
39
39
  static version: string;
40
40
  private static sdk;
41
41
  private static envDiscoverer;
42
- static onGameSDKLoaded(): void;
42
+ static onGameSDKLoaded(): Promise<void>;
43
43
  static getInstance(): Promise<ArkadiumGameSdk>;
44
44
  static setEnvDiscoverer(d: EnvDiscoverer): void;
45
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkadiuminc/sdk",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/pkg/arkadium-sdk.umd.js",
@@ -38,6 +38,7 @@
38
38
  "precommit": "lint-staged",
39
39
  "release": "standard-version --skip.tag",
40
40
  "ci-release": "standard-version && git push origin && git push origin $(git tag --sort=creatordate | tail -n 1)",
41
+ "test:coverage": "vitest run --coverage",
41
42
  "prepare": "husky"
42
43
  },
43
44
  "lint-staged": {
@@ -64,8 +65,9 @@
64
65
  "@arkadium/eagle-user-client": "^0.0.90",
65
66
  "@commitlint/cli": "^17.8.1",
66
67
  "@commitlint/config-conventional": "^17.8.1",
67
- "@types/jest": "^28.1.6",
68
+ "@types/jest": "^29.5.11",
68
69
  "@types/node": "^18.0.6",
70
+ "@vitest/coverage-v8": "^1.6.0",
69
71
  "colors": "^1.4.0",
70
72
  "coveralls": "^3.1.1",
71
73
  "cross-env": "^7.0.3",