@singcl/ad-execute-manager 2.0.6 → 2.0.8
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.
|
@@ -29,12 +29,13 @@ declare class InterstitialAdFather {
|
|
|
29
29
|
* @param {Object} ctx 上下文对象,用于传递数据和状态
|
|
30
30
|
* @param {Object} ctx.options 广告执行选项
|
|
31
31
|
* @param {Object} ctx.collection 回调集合
|
|
32
|
-
* @returns {Promise} 广告执行结果的Promise
|
|
33
32
|
*/
|
|
34
33
|
static executeWithManager(adInstance: any, ctx: {
|
|
35
34
|
options: any;
|
|
36
35
|
collection: any;
|
|
37
|
-
}): Promise<
|
|
36
|
+
}): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
|
|
37
|
+
[key: string]: any;
|
|
38
|
+
}>;
|
|
38
39
|
/**
|
|
39
40
|
* @param {IConstructArgs} args
|
|
40
41
|
*/
|
|
@@ -85,12 +86,13 @@ declare class InterstitialAdFather {
|
|
|
85
86
|
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
86
87
|
* @param {IRewordAdConfig} [ctx.options] 广告执行选项
|
|
87
88
|
* @param {CallbackCollection} [ctx.collection] 回调集合
|
|
88
|
-
* @returns {Promise.<unknown>} 广告执行结果的Promise
|
|
89
89
|
*/
|
|
90
90
|
addExecuteManager(ctx?: {
|
|
91
91
|
options?: IRewordAdConfig;
|
|
92
92
|
collection?: CallbackCollection;
|
|
93
|
-
}): Promise<
|
|
93
|
+
}): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
|
|
94
|
+
[key: string]: any;
|
|
95
|
+
}>;
|
|
94
96
|
destroy(): void;
|
|
95
97
|
/**
|
|
96
98
|
* 清理广告实例
|
|
@@ -79,24 +79,6 @@ export type ICloseArgs = {
|
|
|
79
79
|
*/
|
|
80
80
|
count: number;
|
|
81
81
|
};
|
|
82
|
-
export type IEndArgs = {
|
|
83
|
-
/**
|
|
84
|
-
* 是否解锁全部
|
|
85
|
-
*/
|
|
86
|
-
can_unlock_all?: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* 是否解锁小说
|
|
89
|
-
*/
|
|
90
|
-
can_unlock_novel?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* 剩余次数
|
|
93
|
-
*/
|
|
94
|
-
remain?: number;
|
|
95
|
-
/**
|
|
96
|
-
* 结束类型
|
|
97
|
-
*/
|
|
98
|
-
end_type?: "halfway" | "finished";
|
|
99
|
-
};
|
|
100
82
|
export type IRewardedVideoAd = {
|
|
101
83
|
/**
|
|
102
84
|
* 显示激励视频广告
|
|
@@ -136,14 +118,6 @@ export type IRewardedVideoAd = {
|
|
|
136
118
|
* @property {boolean} isEnded 是否看完
|
|
137
119
|
* @property {number} count 完整观看次数
|
|
138
120
|
*/
|
|
139
|
-
/**
|
|
140
|
-
* @typedef IEndArgs
|
|
141
|
-
* @property {boolean} [can_unlock_all] 是否解锁全部
|
|
142
|
-
* @property {boolean} [can_unlock_novel] 是否解锁小说
|
|
143
|
-
* @property {number} [remain] 剩余次数
|
|
144
|
-
* @property {'halfway' | 'finished'} [end_type] 结束类型
|
|
145
|
-
*
|
|
146
|
-
*/
|
|
147
121
|
/**
|
|
148
122
|
* @typedef IRewardedVideoAd
|
|
149
123
|
* @property {() => Promise.<void>} show 显示激励视频广告
|
|
@@ -326,18 +300,6 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
|
|
|
326
300
|
ad_is_completed: number;
|
|
327
301
|
}): any;
|
|
328
302
|
get rewardAd(): any;
|
|
329
|
-
/**
|
|
330
|
-
* 确保广告按顺序执行
|
|
331
|
-
* @override
|
|
332
|
-
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
333
|
-
* @param {IRewordAdConfig} [ctx.options] 广告执行选项
|
|
334
|
-
* @param {import('./typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
|
|
335
|
-
* @returns {Promise.<IEndArgs & ICloseArgs | Undefined>}
|
|
336
|
-
*/
|
|
337
|
-
override addExecuteManager(ctx?: {
|
|
338
|
-
options?: IRewordAdConfig;
|
|
339
|
-
collection?: import("./typings/ad.js").CallbackCollection;
|
|
340
|
-
}): Promise<(IEndArgs & ICloseArgs) | undefined>;
|
|
341
303
|
/**
|
|
342
304
|
* ATTENTION: 应用一旦进入后台,90%概率.show() 方法的.then() 回调将不会被执行, .catch() 回调也不会被执行。
|
|
343
305
|
* 此时将进入超时处理逻辑
|
|
@@ -346,12 +308,12 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
|
|
|
346
308
|
* @param {import('./typings/ad.js').IRewordAdConfig} [ctx.options] 广告执行选项
|
|
347
309
|
* @param {import('./typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
|
|
348
310
|
* @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
|
|
349
|
-
* @returns {Promise.<
|
|
311
|
+
* @returns {Promise.<object | Undefined>}
|
|
350
312
|
*/
|
|
351
313
|
override ad(ctx?: {
|
|
352
314
|
options?: import("./typings/ad.js").IRewordAdConfig;
|
|
353
315
|
collection?: import("./typings/ad.js").CallbackCollection;
|
|
354
|
-
}, next?: Function): Promise<
|
|
316
|
+
}, next?: Function): Promise<object | undefined>;
|
|
355
317
|
/**
|
|
356
318
|
* ATTENTION: 应用一旦进入后台,90%概率.show() 方法的.then() 回调将不会被执行, .catch() 回调也不会被执行。
|
|
357
319
|
* 此时将进入超时处理逻辑
|
|
@@ -103,6 +103,18 @@ export type ITaskResult = {
|
|
|
103
103
|
* 广告任务后台恢复前台时预估重试次数的原因
|
|
104
104
|
*/
|
|
105
105
|
recovered?: import("./typings/ad.js").RecoveredInfo;
|
|
106
|
+
/**
|
|
107
|
+
* 广告场景
|
|
108
|
+
*/
|
|
109
|
+
scene?: string;
|
|
110
|
+
/**
|
|
111
|
+
* 广告类型 1:激励视频 2:插屏
|
|
112
|
+
*/
|
|
113
|
+
adTypeR?: 1 | 2;
|
|
114
|
+
/**
|
|
115
|
+
* 广告结束类型
|
|
116
|
+
*/
|
|
117
|
+
end_type?: "finished" | "halfway";
|
|
106
118
|
};
|
|
107
119
|
declare class AdExecuteManager {
|
|
108
120
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singcl/ad-execute-manager",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.8",
|
|
4
4
|
"description": "A powerful and flexible ad execution management library for handling reward-based ads, interstitial ads, and other advertising formats in JavaScript applications.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"typescript": "^5.9.3"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@ad-execute-manager/core": "^2.0.
|
|
69
|
-
"@ad-execute-manager/logger": "^2.0.
|
|
70
|
-
"@ad-execute-manager/ad-reward": "^2.0.
|
|
71
|
-
"@ad-execute-manager/ad-interstitial": "^2.0.
|
|
68
|
+
"@ad-execute-manager/core": "^2.0.3",
|
|
69
|
+
"@ad-execute-manager/logger": "^2.0.3",
|
|
70
|
+
"@ad-execute-manager/ad-reward": "^2.0.3",
|
|
71
|
+
"@ad-execute-manager/ad-interstitial": "^2.0.3",
|
|
72
72
|
"@ad-execute-manager/count-recorder": "^2.0.2",
|
|
73
73
|
"@ad-execute-manager/serializable-error": "^2.0.2",
|
|
74
74
|
"@ad-execute-manager/storage": "^2.0.2",
|