@singcl/ad-execute-manager 2.0.13 → 2.1.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.
|
@@ -113,7 +113,11 @@ declare class RewardAdFather {
|
|
|
113
113
|
options?: import("./typings/ad.js").IAdOptions;
|
|
114
114
|
collection?: CallbackCollection;
|
|
115
115
|
}): Promise<ITaskResultGeneric<T> | undefined>;
|
|
116
|
-
|
|
116
|
+
/**
|
|
117
|
+
* 销毁广告实例
|
|
118
|
+
* @param {boolean} preserved 是否保留广告实例
|
|
119
|
+
*/
|
|
120
|
+
destroy(preserved?: boolean): void;
|
|
117
121
|
/**
|
|
118
122
|
* 清理广告实例
|
|
119
123
|
* @abstract 清理广告实例,子类必须实现此方法
|
|
@@ -50,11 +50,36 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
50
50
|
* @returns {RewardAdNovel}
|
|
51
51
|
*/
|
|
52
52
|
static "new"(args: IConstructArgs): RewardAdNovel;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
/**
|
|
54
|
+
* @private 内部方法请勿使用,如需要请使用.onHalfway()替代
|
|
55
|
+
* @description 广告中途退出回调
|
|
56
|
+
* 初始化广告实例.new()中传入的参数args.collection.onHalfway回调
|
|
57
|
+
*/
|
|
58
|
+
private _onHalfway;
|
|
59
|
+
/**
|
|
60
|
+
* @private 内部方法请勿使用,如需要请使用.onShow()替代
|
|
61
|
+
* @description 广告展示回调
|
|
62
|
+
* 初始化广告实例.new()中传入的参数args.collection.onShow回调
|
|
63
|
+
*/
|
|
64
|
+
private _onShow;
|
|
65
|
+
/**
|
|
66
|
+
* @private 内部方法请勿使用,如需要请使用.onFinish()替代
|
|
67
|
+
* @description 广告执行成功回调
|
|
68
|
+
* 初始化广告实例.new()中传入的参数args.collection.onFinish回调
|
|
69
|
+
*/
|
|
70
|
+
private _onFinish;
|
|
71
|
+
/**
|
|
72
|
+
* @private 内部方法请勿使用,如需要请使用.onAlways()替代
|
|
73
|
+
* @description 广告执行成功回调
|
|
74
|
+
* 初始化广告实例.new()中传入的参数args.collection.onAlways回调
|
|
75
|
+
*/
|
|
76
|
+
private _onAlways;
|
|
77
|
+
/**
|
|
78
|
+
* @private 内部方法请勿使用,如需要请使用.onError()替代
|
|
79
|
+
* @description 广告执行失败回调
|
|
80
|
+
* 初始化广告实例.new()中传入的参数args.collection.onError回调
|
|
81
|
+
*/
|
|
82
|
+
private _onError;
|
|
58
83
|
_alwaysCallback: any;
|
|
59
84
|
_halfwayCallback: any;
|
|
60
85
|
_finishedCallback: any;
|
|
@@ -72,12 +97,38 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
72
97
|
_lookUpRemainOnError: boolean;
|
|
73
98
|
/** @deprecated TODO 移除 */
|
|
74
99
|
_needSpeedEndOnTimeout: boolean;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
100
|
+
/**
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
private bindAdCloseLister;
|
|
104
|
+
/**
|
|
105
|
+
* @private 内部方法请勿使用
|
|
106
|
+
*/
|
|
107
|
+
private bindAdErrorLister;
|
|
108
|
+
/**
|
|
109
|
+
* @private 内部方法请勿使用
|
|
110
|
+
*/
|
|
111
|
+
private bindAdLoadLister;
|
|
112
|
+
/**
|
|
113
|
+
* @private 内部方法请勿使用
|
|
114
|
+
*/
|
|
115
|
+
private bindApiAdErrorLister;
|
|
116
|
+
/**
|
|
117
|
+
* @private 内部方法请勿使用
|
|
118
|
+
*/
|
|
119
|
+
private _bindShiftCloseLister;
|
|
120
|
+
/**
|
|
121
|
+
* @private 内部方法请勿使用
|
|
122
|
+
*/
|
|
123
|
+
private _bindShiftErrorLister;
|
|
124
|
+
/**
|
|
125
|
+
* @private 内部方法请勿使用
|
|
126
|
+
*/
|
|
127
|
+
private bindAdTimeoutCloseLister;
|
|
128
|
+
/**
|
|
129
|
+
* @private 内部方法请勿使用
|
|
130
|
+
*/
|
|
131
|
+
private bindAdTimeoutErrorLister;
|
|
81
132
|
/**
|
|
82
133
|
* 初始化
|
|
83
134
|
* 子类可以选择覆盖此方法,或使用默认实现
|
|
@@ -114,11 +165,13 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
114
165
|
* @param {string} args.scene 广告执行场景 必填
|
|
115
166
|
* @param {number} [args.timeout] 广告超时时间 单位ms
|
|
116
167
|
* @param {Function} args.end 结束当前广告任务的回调函数 必填
|
|
168
|
+
* @param {boolean} [args.preserved] 是否在超时情况下保留广告实例 - 自用参数,非tt API要求的参数
|
|
117
169
|
*/
|
|
118
170
|
_setAdTimeout(args: {
|
|
119
171
|
scene: string;
|
|
120
172
|
timeout?: number;
|
|
121
173
|
end: Function;
|
|
174
|
+
preserved?: boolean;
|
|
122
175
|
}): void;
|
|
123
176
|
/**
|
|
124
177
|
* 子类可以选择覆盖此方法
|
|
@@ -259,6 +312,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
259
312
|
recovered?: import("./typings/ad.js").RecoveredInfo;
|
|
260
313
|
}, next?: Function): Promise<object | undefined>;
|
|
261
314
|
_recovered: import("./typings/ad.js").RecoveredInfo;
|
|
315
|
+
_preservedOnTimeout: boolean;
|
|
262
316
|
/**
|
|
263
317
|
* @param {object} [ctx] 广告执行上下文
|
|
264
318
|
* @param {object} [ctx.options] 广告执行选项
|
|
@@ -293,9 +347,88 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
293
347
|
* @returns
|
|
294
348
|
*/
|
|
295
349
|
adShow(): Promise<void>;
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
350
|
+
/**
|
|
351
|
+
* @deprecated - 已废弃,使用onExeAlways代替
|
|
352
|
+
* - 关闭广告时候调用的回调,不管是否看完视频都会调用
|
|
353
|
+
* - 调用adExecuteManager时collection.always回调
|
|
354
|
+
* @param {Array.<unknown>} args
|
|
355
|
+
*/
|
|
356
|
+
_outerCloseCallback(...args: Array<unknown>): any;
|
|
357
|
+
/**
|
|
358
|
+
* - 关闭广告时候调用的回调 不管是否看完视频都会调用
|
|
359
|
+
* - 调用adExecuteManager时collection.always回调
|
|
360
|
+
* @param {Array.<unknown>} args
|
|
361
|
+
*/
|
|
362
|
+
onExeAlways(...args: Array<unknown>): any;
|
|
363
|
+
/**
|
|
364
|
+
* @deprecated 已废弃,使用onExeHalfway代替
|
|
365
|
+
* - 广告未看完时候调用的回调
|
|
366
|
+
* - 调用adExecuteManager时collection.halfway回调
|
|
367
|
+
* @param {Array.<unknown>} args
|
|
368
|
+
*/
|
|
369
|
+
_outerHalfwayCallback(...args: Array<unknown>): any;
|
|
370
|
+
/**
|
|
371
|
+
* - 广告未看完时候调用的回调
|
|
372
|
+
* - 调用adExecuteManager时collection.halfway回调
|
|
373
|
+
* @param {Array.<unknown>} args
|
|
374
|
+
*/
|
|
375
|
+
onExeHalfway(...args: Array<unknown>): any;
|
|
376
|
+
/**
|
|
377
|
+
* @deprecated 已废弃,使用onExeFinished代替
|
|
378
|
+
* - 广告看完时候调用的回调
|
|
379
|
+
* - 调用adExecuteManager时collection.finished回调
|
|
380
|
+
* @param {Array.<unknown>} args
|
|
381
|
+
*/
|
|
382
|
+
_outerFinishedCallback(...args: Array<unknown>): any;
|
|
383
|
+
/**
|
|
384
|
+
* - 广告看完时候调用的回调
|
|
385
|
+
* - 调用adExecuteManager时collection.finished回调
|
|
386
|
+
* @param {Array.<unknown>} args
|
|
387
|
+
*/
|
|
388
|
+
onExeFinished(...args: Array<unknown>): any;
|
|
389
|
+
/**
|
|
390
|
+
* @description 广告中途退出回调
|
|
391
|
+
* 初始化广告实例.new()中传入的参数args.collection.onHalfway回调
|
|
392
|
+
* @param {Array.<unknown>} args
|
|
393
|
+
*/
|
|
394
|
+
onFinish(...args: Array<unknown>): any;
|
|
395
|
+
/**
|
|
396
|
+
*
|
|
397
|
+
* @description 广告展示回调
|
|
398
|
+
* 初始化广告实例.new()中传入的参数args.collection.onShow回调
|
|
399
|
+
* @param {Array.<unknown>} args
|
|
400
|
+
*/
|
|
401
|
+
onHalfway(...args: Array<unknown>): any;
|
|
402
|
+
/**
|
|
403
|
+
* @description 广告展示回调
|
|
404
|
+
* 初始化广告实例.new()中传入的参数args.collection.onAlways回调
|
|
405
|
+
* @param {Array.<unknown>} args
|
|
406
|
+
*/
|
|
407
|
+
onAlways(...args: Array<unknown>): any;
|
|
408
|
+
/**
|
|
409
|
+
* 内部关闭激励视频
|
|
410
|
+
* @private
|
|
411
|
+
* @param {ICloseArgs} args
|
|
412
|
+
*/
|
|
413
|
+
private __adTimeoutCloseLister__;
|
|
414
|
+
/**
|
|
415
|
+
* 子类可以选择覆盖此方法
|
|
416
|
+
* @param {*} args
|
|
417
|
+
* @returns
|
|
418
|
+
*/
|
|
419
|
+
adTimeoutCloseLister(args: any): any;
|
|
420
|
+
/**
|
|
421
|
+
* 内部关闭激励视频
|
|
422
|
+
* @private
|
|
423
|
+
* @param {*} e
|
|
424
|
+
*/
|
|
425
|
+
private __adTimeoutErrorLister__;
|
|
426
|
+
/**
|
|
427
|
+
* 子类可以选择覆盖此方法
|
|
428
|
+
* @param {*} e
|
|
429
|
+
* @returns
|
|
430
|
+
*/
|
|
431
|
+
adTimeoutErrorLister(e: any): any;
|
|
299
432
|
/**
|
|
300
433
|
* 内部关闭激励视频
|
|
301
434
|
* @private
|
|
@@ -361,7 +494,12 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
361
494
|
* @param {unknown} e
|
|
362
495
|
*/
|
|
363
496
|
protected adLoadLister(e: unknown): unknown;
|
|
364
|
-
|
|
497
|
+
/**
|
|
498
|
+
* 销毁广告实例
|
|
499
|
+
* @protected
|
|
500
|
+
* @param {boolean} preserved 是否保留广告实例
|
|
501
|
+
*/
|
|
502
|
+
protected adDestroy(preserved?: boolean): void;
|
|
365
503
|
_shiftCloseLister(args: any): void;
|
|
366
504
|
_shiftErrorLister(args: any): void;
|
|
367
505
|
/**
|
|
@@ -122,6 +122,10 @@ export type IAdOptionsOther = {
|
|
|
122
122
|
* 重试次数 - 自用参数 ,非tt API要求的参数
|
|
123
123
|
*/
|
|
124
124
|
retry: number;
|
|
125
|
+
/**
|
|
126
|
+
* 是否在超时情况下保留广告实例 - 自用参数,非tt API要求的参数
|
|
127
|
+
*/
|
|
128
|
+
preservedOnTimeout: boolean;
|
|
125
129
|
};
|
|
126
130
|
export type IAdOptions = IRewordAdConfig & IRewordAdOther & IAdOptionsOther;
|
|
127
131
|
export type RecoveredInfo = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singcl/ad-execute-manager",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
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": {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@ad-execute-manager/core": "^2.0.6",
|
|
88
88
|
"@ad-execute-manager/logger": "^2.0.5",
|
|
89
|
-
"@ad-execute-manager/ad-reward": "^2.
|
|
89
|
+
"@ad-execute-manager/ad-reward": "^2.1.1",
|
|
90
90
|
"@ad-execute-manager/ad-interstitial": "^2.0.6",
|
|
91
91
|
"@ad-execute-manager/count-recorder": "^2.0.5",
|
|
92
92
|
"@ad-execute-manager/serializable-error": "^2.0.5",
|