@singcl/ad-execute-manager 2.1.1 → 2.2.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.
|
@@ -85,6 +85,14 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
85
85
|
_finishedCallback: any;
|
|
86
86
|
_resolve: any;
|
|
87
87
|
_next: any;
|
|
88
|
+
/** @type {{options: import('./typings/ad.js').IAdOptions, collection: import('./typings/ad.js').CallbackCollection, recovered: import('./typings/ad.js').RecoveredInfo}} */
|
|
89
|
+
_adExecuteArgs: {
|
|
90
|
+
options: import("./typings/ad.js").IAdOptions;
|
|
91
|
+
collection: import("./typings/ad.js").CallbackCollection;
|
|
92
|
+
recovered: import("./typings/ad.js").RecoveredInfo;
|
|
93
|
+
};
|
|
94
|
+
/** @type {Function} */
|
|
95
|
+
_adNext: Function;
|
|
88
96
|
/** @type {number} 广告执行场景 */
|
|
89
97
|
_scene: number;
|
|
90
98
|
_adTypeR: 1;
|
|
@@ -147,6 +155,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
147
155
|
}): void;
|
|
148
156
|
novelConfig: RewardAdNovelConfig;
|
|
149
157
|
_onInnerExecuteBefore(): any;
|
|
158
|
+
_onAdExecuteBefore(): any;
|
|
150
159
|
/**
|
|
151
160
|
* @param {object} _args
|
|
152
161
|
* @param {string} _args.scene 广告执行场景 必填
|
|
@@ -160,6 +169,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
160
169
|
recovered?: import("./typings/ad.js").RecoveredInfo;
|
|
161
170
|
}): any;
|
|
162
171
|
/**
|
|
172
|
+
* @private
|
|
163
173
|
* 广告展示超时设置
|
|
164
174
|
* @param {object} args
|
|
165
175
|
* @param {string} args.scene 广告执行场景 必填
|
|
@@ -167,12 +177,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
167
177
|
* @param {Function} args.end 结束当前广告任务的回调函数 必填
|
|
168
178
|
* @param {boolean} [args.preserved] 是否在超时情况下保留广告实例 - 自用参数,非tt API要求的参数
|
|
169
179
|
*/
|
|
170
|
-
_setAdTimeout
|
|
171
|
-
scene: string;
|
|
172
|
-
timeout?: number;
|
|
173
|
-
end: Function;
|
|
174
|
-
preserved?: boolean;
|
|
175
|
-
}): void;
|
|
180
|
+
private _setAdTimeout;
|
|
176
181
|
/**
|
|
177
182
|
* 子类可以选择覆盖此方法
|
|
178
183
|
* 添加超时情况下结束任务前的回调
|
|
@@ -314,29 +319,46 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
314
319
|
_recovered: import("./typings/ad.js").RecoveredInfo;
|
|
315
320
|
_preservedOnTimeout: boolean;
|
|
316
321
|
/**
|
|
322
|
+
* ATTENTION: 广告循环执行内部函数,如果需要循环执行,请使用adCircleInner()函数, 不要直接调用此函数
|
|
323
|
+
* @private
|
|
317
324
|
* @param {object} [ctx] 广告执行上下文
|
|
318
325
|
* @param {object} [ctx.options] 广告执行选项
|
|
319
326
|
* @param {number} [ctx.options.scene] 广告执行场景 必填
|
|
320
327
|
* @param {number} [ctx.options.timeout] 广告超时时间 单位ms
|
|
321
328
|
* @param {object} ctx.collection 回调集合
|
|
322
|
-
* @param {import('./typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
|
|
323
329
|
* @param {(v?: unknown) => void} ctx.collection.resolve 广告执行成功的回调函数
|
|
324
|
-
* @param {(v?: unknown) => void} [ctx.collection.reject] 广告执行失败的回调函数
|
|
325
330
|
* @param {(v?: unknown) => void} [ctx.collection.before] 广告执行前的回调函数
|
|
326
331
|
* @param {(v?: unknown) => void} [ctx.collection.success] 广告执行成功的回调函数
|
|
327
332
|
* @param {(v?: unknown) => void} [ctx.collection.prelude] 拉起广告前计时的回调函数
|
|
333
|
+
* @param {import('./typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
|
|
328
334
|
* @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
|
|
329
335
|
*/
|
|
330
|
-
_adInner
|
|
336
|
+
private _adInner;
|
|
337
|
+
_before: (v?: unknown) => void;
|
|
338
|
+
_success: (v?: unknown) => void;
|
|
339
|
+
/**
|
|
340
|
+
* 广告循环执行
|
|
341
|
+
* @public
|
|
342
|
+
* @param {object} [ctx] 广告执行上下文
|
|
343
|
+
* @param {object} [ctx.options] 广告执行选项
|
|
344
|
+
* @param {number} [ctx.options.scene] 广告执行场景 必填
|
|
345
|
+
* @param {number} [ctx.options.timeout] 广告超时时间 单位ms
|
|
346
|
+
* @param {object} ctx.collection 回调集合
|
|
347
|
+
* @param {(v?: unknown) => void} [ctx.collection.before] 广告执行前的回调函数
|
|
348
|
+
* @param {(v?: unknown) => void} [ctx.collection.success] 广告执行成功的回调函数
|
|
349
|
+
* @param {(v?: unknown) => void} [ctx.collection.prelude] 拉起广告前计时的回调函数
|
|
350
|
+
*/
|
|
351
|
+
public adCircleInner(ctx?: {
|
|
331
352
|
options?: {
|
|
332
353
|
scene?: number;
|
|
333
354
|
timeout?: number;
|
|
334
355
|
};
|
|
335
|
-
collection:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
356
|
+
collection: {
|
|
357
|
+
before?: (v?: unknown) => void;
|
|
358
|
+
success?: (v?: unknown) => void;
|
|
359
|
+
prelude?: (v?: unknown) => void;
|
|
360
|
+
};
|
|
361
|
+
}): void;
|
|
340
362
|
/**
|
|
341
363
|
* 广告加载
|
|
342
364
|
* @returns
|
|
@@ -348,7 +370,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
348
370
|
*/
|
|
349
371
|
adShow(): Promise<void>;
|
|
350
372
|
/**
|
|
351
|
-
* @deprecated -
|
|
373
|
+
* @deprecated - 2.x版本自v2.1.1开始已废弃,使用onExeAlways代替
|
|
352
374
|
* - 关闭广告时候调用的回调,不管是否看完视频都会调用
|
|
353
375
|
* - 调用adExecuteManager时collection.always回调
|
|
354
376
|
* @param {Array.<unknown>} args
|
|
@@ -361,7 +383,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
361
383
|
*/
|
|
362
384
|
onExeAlways(...args: Array<unknown>): any;
|
|
363
385
|
/**
|
|
364
|
-
* @deprecated
|
|
386
|
+
* @deprecated 2.x版本自v2.1.1开始已废弃,使用onExeHalfway代替
|
|
365
387
|
* - 广告未看完时候调用的回调
|
|
366
388
|
* - 调用adExecuteManager时collection.halfway回调
|
|
367
389
|
* @param {Array.<unknown>} args
|
|
@@ -374,7 +396,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
374
396
|
*/
|
|
375
397
|
onExeHalfway(...args: Array<unknown>): any;
|
|
376
398
|
/**
|
|
377
|
-
* @deprecated
|
|
399
|
+
* @deprecated 2.x版本自v2.1.1开始已废弃,使用onExeFinished代替
|
|
378
400
|
* - 广告看完时候调用的回调
|
|
379
401
|
* - 调用adExecuteManager时collection.finished回调
|
|
380
402
|
* @param {Array.<unknown>} args
|
|
@@ -33,6 +33,19 @@ export class CountRecorder {
|
|
|
33
33
|
_initLocalTimes(): void;
|
|
34
34
|
updateToday(): void;
|
|
35
35
|
remain(): number;
|
|
36
|
+
/**
|
|
37
|
+
* 保存指定次数
|
|
38
|
+
* @param {number} count 次数
|
|
39
|
+
*/
|
|
40
|
+
save(count: number): void;
|
|
41
|
+
/**
|
|
42
|
+
* 清除当前类的本地存储
|
|
43
|
+
*/
|
|
44
|
+
clear(): void;
|
|
45
|
+
/**
|
|
46
|
+
* 重置当前类的本地存储
|
|
47
|
+
*/
|
|
48
|
+
reset(): void;
|
|
36
49
|
}
|
|
37
50
|
export type IConstructorArgs = {
|
|
38
51
|
/**
|
|
@@ -106,6 +106,11 @@ declare class Storage {
|
|
|
106
106
|
* @param {number|'today'} expire 过期时间(毫秒)或'today'表示当天有效,可选
|
|
107
107
|
*/
|
|
108
108
|
setUserItem(key: string, value: any, expire: number | "today"): void;
|
|
109
|
+
/**
|
|
110
|
+
* 删除用户维度的存储项
|
|
111
|
+
* @param {string} key 存储键
|
|
112
|
+
*/
|
|
113
|
+
removeUserItem(key: string): void;
|
|
109
114
|
/**
|
|
110
115
|
* 删除存储项
|
|
111
116
|
* @param {string} key 存储键
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@singcl/ad-execute-manager",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
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": {
|
|
@@ -88,9 +88,9 @@
|
|
|
88
88
|
"@ad-execute-manager/logger": "^2.0.5",
|
|
89
89
|
"@ad-execute-manager/ad-reward": "^2.1.1",
|
|
90
90
|
"@ad-execute-manager/ad-interstitial": "^2.0.6",
|
|
91
|
-
"@ad-execute-manager/count-recorder": "^2.0
|
|
91
|
+
"@ad-execute-manager/count-recorder": "^2.1.0",
|
|
92
92
|
"@ad-execute-manager/serializable-error": "^2.0.5",
|
|
93
|
-
"@ad-execute-manager/storage": "^2.0
|
|
93
|
+
"@ad-execute-manager/storage": "^2.1.0",
|
|
94
94
|
"@ad-execute-manager/event": "^2.0.5",
|
|
95
95
|
"@ad-execute-manager/analytics": "^2.0.5"
|
|
96
96
|
}
|