@jolibox/types 1.1.27 → 1.1.29-beta.1
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/commands/api.d.ts +4 -0
- package/dist/env.d.ts +5 -0
- package/dist/events/index.d.ts +6 -0
- package/dist/index.d.ts +1 -0
- package/dist/sdks/ads.d.ts +41 -8
- package/package.json +7 -1
package/dist/commands/api.d.ts
CHANGED
|
@@ -3,6 +3,10 @@ import { StandardResponse } from './response';
|
|
|
3
3
|
export declare const API_GET_SYSTEM_INFO = "API.getSystemInfo";
|
|
4
4
|
export declare const API_GET_SYSTEM_INFO_SYNC = "API.getSystemInfoSync";
|
|
5
5
|
export declare const API_ENV = "API.env";
|
|
6
|
+
/**
|
|
7
|
+
* @public
|
|
8
|
+
* Describes the system information of the device and application environment.
|
|
9
|
+
*/
|
|
6
10
|
export interface ISystemInfo {
|
|
7
11
|
system: string;
|
|
8
12
|
platform: 'h5' | 'android' | 'ios';
|
package/dist/env.d.ts
CHANGED
package/dist/events/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { LifeCycleEventParams } from './lifecycle';
|
|
2
2
|
import { RumtimeEventParams } from './runtime';
|
|
3
3
|
export * from './lifecycle';
|
|
4
|
+
export * from './runtime';
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
* A map defining the parameters for various host events.
|
|
8
|
+
* It combines event parameters from different modules.
|
|
9
|
+
*/
|
|
4
10
|
export type HostEventParamsMap = LifeCycleEventParams & RumtimeEventParams;
|
|
5
11
|
export type HostEventType = keyof HostEventParamsMap;
|
package/dist/index.d.ts
CHANGED
package/dist/sdks/ads.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
* Initialization parameters for the Ads SDK.
|
|
4
|
+
*/
|
|
1
5
|
export interface IAdsInitParams {
|
|
2
6
|
/**
|
|
3
7
|
* (OPTIONAL) Game ID provided by Jolibox
|
|
4
8
|
*/
|
|
5
9
|
gameId?: string;
|
|
6
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @public
|
|
13
|
+
* Configuration parameters for ads, used with `adConfig`.
|
|
14
|
+
*/
|
|
7
15
|
export interface IAdConfigParams {
|
|
8
16
|
/**
|
|
9
17
|
* (OPTIONAL) Whether ads should always be preloaded before the first call to adBreak()
|
|
@@ -30,7 +38,9 @@ export interface IAdConfigParams {
|
|
|
30
38
|
onReady?: () => void;
|
|
31
39
|
}
|
|
32
40
|
/**
|
|
33
|
-
*
|
|
41
|
+
* @public
|
|
42
|
+
* PlacementInfo object passed by the **adBreakDone** function.
|
|
43
|
+
* Contains details about an ad placement after an ad break attempt.
|
|
34
44
|
*/
|
|
35
45
|
export interface IPlacementInfo {
|
|
36
46
|
/**
|
|
@@ -61,11 +71,18 @@ export interface IPlacementInfo {
|
|
|
61
71
|
breakStatus: 'notReady' | 'timeout' | 'error' | 'noAdPreloaded' | 'frequencyCapped' | 'ignored' | 'other' | 'dismissed' | 'viewed';
|
|
62
72
|
}
|
|
63
73
|
/**
|
|
64
|
-
*
|
|
74
|
+
* @public
|
|
75
|
+
* Represents the different sets of parameters that can be passed when calling `adBreak`.
|
|
76
|
+
* It's a union of parameters for preroll, interstitial, and rewarded ads.
|
|
77
|
+
* @see {@link IPrerollParams}
|
|
78
|
+
* @see {@link IInterstitialsParams}
|
|
79
|
+
* @see {@link IRewardParams}
|
|
65
80
|
*/
|
|
66
81
|
export type IAdBreakParams = IPrerollParams | IInterstitialsParams | IRewardParams;
|
|
67
82
|
/**
|
|
68
|
-
*
|
|
83
|
+
* @public
|
|
84
|
+
* Parameters for a 'preroll' type `adBreak`.
|
|
85
|
+
* Preroll ads are typically shown before the game loads.
|
|
69
86
|
*/
|
|
70
87
|
export interface IPrerollParams {
|
|
71
88
|
/**
|
|
@@ -79,6 +96,11 @@ export interface IPrerollParams {
|
|
|
79
96
|
*/
|
|
80
97
|
adBreakDone?: (placementInfo: IPlacementInfo) => void;
|
|
81
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* @public
|
|
101
|
+
* Parameters for interstitial `adBreak` types (e.g., 'start', 'pause', 'next', 'browse').
|
|
102
|
+
* Interstitial ads are full-screen ads shown at natural transition points.
|
|
103
|
+
*/
|
|
82
104
|
export interface IInterstitialsParams {
|
|
83
105
|
/**
|
|
84
106
|
* 'start' before the gameplay starts (after UI has rendered)
|
|
@@ -112,6 +134,11 @@ export interface IInterstitialsParams {
|
|
|
112
134
|
*/
|
|
113
135
|
adBreakDone?: (placementInfo: IPlacementInfo) => void;
|
|
114
136
|
}
|
|
137
|
+
/**
|
|
138
|
+
* @public
|
|
139
|
+
* Parameters for a 'reward' type `adBreak`.
|
|
140
|
+
* Rewarded ads offer users an in-game reward for watching an ad.
|
|
141
|
+
*/
|
|
115
142
|
export interface IRewardParams {
|
|
116
143
|
/**
|
|
117
144
|
* 'reward' a rewarded ad
|
|
@@ -157,9 +184,14 @@ export interface IRewardParams {
|
|
|
157
184
|
adViewed: () => void;
|
|
158
185
|
}
|
|
159
186
|
/**
|
|
160
|
-
*
|
|
187
|
+
* @public
|
|
188
|
+
* Defines the possible formats for an ad unit.
|
|
161
189
|
*/
|
|
162
190
|
export type AdUnitFormat = 'rectangle' | 'vertical' | 'horizontal';
|
|
191
|
+
/**
|
|
192
|
+
* @public
|
|
193
|
+
* Parameters for creating and configuring an ad unit with `adUnit`.
|
|
194
|
+
*/
|
|
163
195
|
export interface IAdUnitParams {
|
|
164
196
|
/**
|
|
165
197
|
* The element to attach the ad unit to, either an HTMLElement or a string selector. Should be the parent element of the ad unit (<ins> tag).
|
|
@@ -183,7 +215,9 @@ export interface IAdUnitParams {
|
|
|
183
215
|
style?: string;
|
|
184
216
|
}
|
|
185
217
|
/**
|
|
186
|
-
*
|
|
218
|
+
* @public
|
|
219
|
+
* Jolibox Ads SDK interface defining available ad operations.
|
|
220
|
+
* This interface is typically implemented by the Ads SDK module.
|
|
187
221
|
*/
|
|
188
222
|
export interface JoliboxAds {
|
|
189
223
|
/**
|
|
@@ -200,7 +234,7 @@ export interface JoliboxAds {
|
|
|
200
234
|
/**
|
|
201
235
|
* adBreak() is the key function for placing ads within your game. It defines an ad placement and takes an object called a placement config that specifies everything required to show an ad.
|
|
202
236
|
*
|
|
203
|
-
*
|
|
237
|
+
* This function determines if an ad should be shown based on various factors including:
|
|
204
238
|
*
|
|
205
239
|
* - The type of ad placement that you declared
|
|
206
240
|
* - Is this ad at the start of the game? Between levels? At a moment when the player has paused the game?
|
|
@@ -231,8 +265,7 @@ export interface JoliboxAds {
|
|
|
231
265
|
*
|
|
232
266
|
* After calling this method, the ad unit is attached to the parent element you specify as el in the params object.
|
|
233
267
|
*
|
|
234
|
-
* By default,
|
|
235
|
-
*
|
|
268
|
+
* By default, a client ID and channel ID are automatically set by the SDK. And the slot name is set to the position of the ad unit. You can override these values by passing the slot and channelId in the params object.
|
|
236
269
|
* @param params
|
|
237
270
|
* @returns
|
|
238
271
|
*/
|
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.1.
|
|
4
|
+
"version": "1.1.29-beta.1",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
"@jolibox/eslint-config": "1.0.0",
|
|
14
14
|
"rimraf": "6.0.1"
|
|
15
15
|
},
|
|
16
|
+
"typedocOptions": {
|
|
17
|
+
"entryPoints": [
|
|
18
|
+
"src/index.ts"
|
|
19
|
+
],
|
|
20
|
+
"name": "Jolibox Types"
|
|
21
|
+
},
|
|
16
22
|
"scripts": {
|
|
17
23
|
"clean": "rimraf ./dist",
|
|
18
24
|
"build": "npm run clean && tsc",
|