@jolibox/types 1.3.7 → 1.3.9

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.
@@ -3,6 +3,7 @@ export declare const PURCHASE_GEM_IN_APP = "PaymentSDK.purchaseGem";
3
3
  export declare const GET_GEM_PRODUCT_INFO = "PaymentSDK.getGemProducts";
4
4
  export declare const GET_SUBSCRIPTION_PLANS = "PaymentSDK.getSubscriptionPlans";
5
5
  export declare const SUBSCRIBE = "PaymentSDK.subscribe";
6
+ export declare const SUBSCRIBE_SPIN = "PaymentSDK.subscribeSpin";
6
7
  export declare const FLUSH_SUB_INFO_CACHE = "PaymentSDK.flushSubInfoCache";
7
8
  export interface IGemProductInfo {
8
9
  productId: string;
@@ -67,6 +68,14 @@ export interface PaymentCommandParams {
67
68
  } | void, unknown>>;
68
69
  [SUBSCRIBE]: (params: {
69
70
  productId: string;
71
+ appStoreProductId?: string;
72
+ }) => Promise<StandardResponse<{
73
+ subPlanId: string;
74
+ errMsg: string;
75
+ } | void, unknown>>;
76
+ [SUBSCRIBE_SPIN]: (params: {
77
+ productId: string;
78
+ appStoreProductId?: string;
70
79
  }) => Promise<StandardResponse<{
71
80
  subPlanId: string;
72
81
  errMsg: string;
@@ -1,4 +1,4 @@
1
- export type TrackEvent = 'jsSdkBegin' | 'onBeforeExit' | 'bootstrapModuleBeginToLoad' | 'bootstrapModuleLoaded' | 'implModuleBeginToLoad' | 'implModuleLoaded' | 'onDocumentReady' | 'joliboxServiceReady' | 'apiInvoked' | 'joliboxSpeedAnalysis' | 'joliboxNetRequestResult' | 'globalJsError' | 'RecommendedGuide' | 'GameItem' | 'loadFinished' | 'unlock_popup_show' | 'coinorder_show' | 'coinorder_click' | 'ad_unlock_click' | 'coin_unlock_click' | 'order_pay_ensure' | 'order_pay_result' | 'mmp_ad_impression' | 'LoginGuideModal' | 'gem_unlock_popup_show' | 'gem_unlock_click' | 'gem_order_show' | 'gem_order_click' | 'gem_pay_ensure' | 'gem_pay_result' | 'gem_ad_unlock_click' | 'GemLoginGuideModal' | 'jolicoin_unlock_success' | 'gem_unlock_success' | 'subscription_unlock_success' | 'CallRuntimeLoadFinished' | 'AdBreakJumpOut' | 'AdBreakHide' | 'CallAdsInit' | 'LoadAdsenseCompleted' | 'CallAdConfig' | 'PreventAdsCheating' | 'CallShowAdFn' | 'CallAdBreak' | 'CallAdUnit' | 'CallAdBreakDone' | 'CallBeforeAd' | 'CallAfterAd' | 'CallAdBreakTimeout' | 'CallAFVRequest' | 'CallAFVLoad' | 'CallAFVPlaying' | 'CallAFVCompleted' | 'CallAFVError' | 'AdSenseUnitStatusChanged' | 'OpenGame' | 'OpenGame_2Plus' | 'PlayGame' | 'CloseGame' | 'LevelFinished' | 'LevelUpgrade' | 'GamePlayEnded' | 'GameFCP' | 'GameLCP' | 'GameTTFB';
1
+ export type TrackEvent = 'jsSdkBegin' | 'onBeforeExit' | 'bootstrapModuleBeginToLoad' | 'bootstrapModuleLoaded' | 'implModuleBeginToLoad' | 'implModuleLoaded' | 'onDocumentReady' | 'joliboxServiceReady' | 'apiInvoked' | 'joliboxSpeedAnalysis' | 'joliboxNetRequestResult' | 'globalJsError' | 'RecommendedGuide' | 'GameItem' | 'loadFinished' | 'gameTTI' | 'unlock_popup_show' | 'coinorder_show' | 'coinorder_click' | 'ad_unlock_click' | 'coin_unlock_click' | 'order_pay_ensure' | 'order_pay_result' | 'mmp_ad_impression' | 'LoginGuideModal' | 'gem_unlock_popup_show' | 'gem_unlock_click' | 'gem_order_show' | 'gem_order_click' | 'gem_pay_ensure' | 'gem_pay_result' | 'gem_ad_unlock_click' | 'GemLoginGuideModal' | 'jolicoin_unlock_success' | 'gem_unlock_success' | 'subscription_unlock_success' | 'CallRuntimeLoadFinished' | 'AdBreakJumpOut' | 'AdBreakHide' | 'CallAdsInit' | 'LoadAdsenseCompleted' | 'CallAdConfig' | 'PreventAdsCheating' | 'CallShowAdFn' | 'CallAdBreak' | 'CallAdUnit' | 'CallAdBreakDone' | 'CallBeforeAd' | 'CallAfterAd' | 'CallAdBreakTimeout' | 'CallAFVRequest' | 'CallAFVLoad' | 'CallAFVPlaying' | 'CallAFVCompleted' | 'CallAFVError' | 'AdSenseUnitStatusChanged' | 'OpenGame' | 'OpenGame_2Plus' | 'PlayGame' | 'CloseGame' | 'LevelStart' | 'LevelFinished' | 'LevelFailed' | 'LevelUpgrade' | 'GamePlayEnded' | 'GameFCP' | 'GameLCP' | 'GameTTFB' | 'HuaweiQuickAdsAdBreak' | 'HuaweiQuickAdsAdBreakBeforeAd';
2
2
  export type PerformanceType = 'bootstrapModuleLoaded' | 'implementModuleLoaded' | 'joliboxGameServiceReady';
3
3
  export declare const REPORT_SYSTEM_TIMELINE = "ReportSDK.traceSystemTimeline";
4
4
  export declare const REPORT_SYSTEM_LOG = "ReportSDK.traceSystem";
@@ -2,10 +2,12 @@ export declare const RUMTIME_NOTIFY_PROGRESS = "RuntimeSDK.notifyLoadProgress";
2
2
  export declare const RUMTIME_LOAD_FINISHED = "RuntimeSDK.loadFinished";
3
3
  export declare const RUMTIME_LOAD_FINISHED_EVENT = "RuntimeSDK.loadFinishedEvent";
4
4
  export declare const RUMTIME_LOAD_PROGRESS_EVENT = "RuntimeSDK.loadProgressEvent";
5
+ export declare const RUMTIME_GAME_TTI_EVENT = "RuntimeSDK.gameTTIEvent";
5
6
  export interface RumtimeCommandParams {
6
7
  [RUMTIME_NOTIFY_PROGRESS]: (procress: number) => void;
7
8
  [RUMTIME_LOAD_FINISHED]: () => void;
8
9
  [RUMTIME_LOAD_FINISHED_EVENT]: () => void;
9
10
  [RUMTIME_LOAD_PROGRESS_EVENT]: (procress: number) => void;
11
+ [RUMTIME_GAME_TTI_EVENT]: () => void;
10
12
  }
11
13
  export type RumtimeCommandType = keyof RumtimeCommandParams;
@@ -2,6 +2,8 @@ import { StandardResponse } from './response';
2
2
  export declare const LEVEL_FINISHED = "TaskTrackerSDK.levelFinished";
3
3
  export declare const GAME_PLAY_ENDED = "TaskTrackerSDK.gamePlayEnded";
4
4
  export declare const LEVEL_UPGRADE = "TaskTrackerSDK.levelUpgrade";
5
+ export declare const LEVEL_START = "TaskTrackerSDK.levelStart";
6
+ export declare const LEVEL_FAILED = "TaskTrackerSDK.levelFailed";
5
7
  export type TaskResponse = Promise<StandardResponse<void>>;
6
8
  export interface TaskTrackCommandParams {
7
9
  [LEVEL_FINISHED]: (params: {
@@ -21,5 +23,14 @@ export interface TaskTrackCommandParams {
21
23
  levelId: string | number;
22
24
  name?: string;
23
25
  }) => TaskResponse;
26
+ [LEVEL_START]: (params: {
27
+ levelId: string | number;
28
+ }) => TaskResponse;
29
+ [LEVEL_FAILED]: (params: {
30
+ levelId: string | number;
31
+ score?: number;
32
+ rating?: number;
33
+ duration?: number;
34
+ }) => TaskResponse;
24
35
  }
25
36
  export type TaskTrackCommandType = keyof TaskTrackCommandParams;
@@ -1,4 +1,5 @@
1
1
  export interface Runtime {
2
2
  notifyLoadProgress: (progress: number) => void;
3
3
  loadFinished: () => void;
4
+ gameTTI: () => void;
4
5
  }
@@ -47,4 +47,32 @@ export interface TaskTracker {
47
47
  levelId: string | number;
48
48
  name?: string;
49
49
  }): Promise<TaskResponse>;
50
+ /**
51
+ * Tracks when a game level starts
52
+ *
53
+ * @param params - Object containing level start details:
54
+ * @param params.levelId - Unique identifier for the level being started (string or number)
55
+ * @returns Promise resolving to TaskResponse or error message if validation fails
56
+ * @throws {Promise} Rejects with error if params is not an object
57
+ */
58
+ onLevelStart(params: {
59
+ levelId: string | number;
60
+ }): Promise<TaskResponse>;
61
+ /**
62
+ * Tracks when a game level fails
63
+ *
64
+ * @param params - Object containing level failure details:
65
+ * @param params.levelId - Unique identifier for the failed level (string or number)
66
+ * @param params.score - Optional total score achieved in the level
67
+ * @param params.rating - Optional star rating (how many stars earned)
68
+ * @param params.duration - Optional time spent in the level (milliseconds)
69
+ * @returns Promise resolving to TaskResponse or error message if validation fails
70
+ * @throws {Promise} Rejects with error if params is not an object
71
+ */
72
+ onLevelFailed(params: {
73
+ levelId: string | number;
74
+ score?: number;
75
+ rating?: number;
76
+ duration?: number;
77
+ }): Promise<TaskResponse>;
50
78
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jolibox/types",
3
3
  "description": "This project is common types used for JS-SDk interfere & implement",
4
- "version": "1.3.7",
4
+ "version": "1.3.9",
5
5
  "typings": "dist/index.d.ts",
6
6
  "license": "MIT",
7
7
  "files": [