@ad-execute-manager/ad 2.0.0-alpha.1 → 2.0.0-alpha.4

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 singcl
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # @singcl/ad
2
+
3
+ Ad-related classes including InterstitialAdFather, InterstitialAdNovel, RewardAdFather, and RewardAdNovel for ad management.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @singcl/ad
9
+ ```
10
+
11
+ ## Features
12
+
13
+ - **InterstitialAdFather**: Base class for interstitial ads
14
+ - **InterstitialAdNovel**: Novel-specific interstitial ad implementation
15
+ - **RewardAdFather**: Base class for reward ads
16
+ - **RewardAdNovel**: Novel-specific reward ad implementation
17
+
18
+ ## Usage
19
+
20
+ ### InterstitialAdNovel
21
+
22
+ ```javascript
23
+ import { InterstitialAdNovel } from '@singcl/ad';
24
+
25
+ const interstitialAd = InterstitialAdNovel.new({
26
+ sign: 'novel_interstitial',
27
+ preserveOnEnd: false,
28
+ needEndOnTimeout: true,
29
+ collection: {
30
+ onHalfway: (args) => {
31
+ console.log('Ad halfway:', args);
32
+ },
33
+ onShow: (args) => {
34
+ console.log('Ad shown:', args);
35
+ },
36
+ onFinish: (args) => {
37
+ console.log('Ad finished:', args);
38
+ },
39
+ onAlways: (args) => {
40
+ console.log('Ad always:', args);
41
+ },
42
+ onError: (error) => {
43
+ console.error('Ad error:', error);
44
+ }
45
+ }
46
+ });
47
+
48
+ // Initialize ad
49
+ interstitialAd.initialize({
50
+ adUnitId: 'your-ad-unit-id',
51
+ retry: 3
52
+ });
53
+
54
+ // Show ad
55
+ const result = await interstitialAd.addExecuteManager({
56
+ options: {
57
+ scene: 1
58
+ }
59
+ });
60
+
61
+ console.log('Ad result:', result);
62
+ ```
63
+
64
+ ### RewardAdNovel
65
+
66
+ ```javascript
67
+ import { RewardAdNovel } from '@singcl/ad';
68
+
69
+ const rewardAd = RewardAdNovel.new({
70
+ sign: 'novel_reward',
71
+ preserveOnEnd: false,
72
+ needEndOnTimeout: true,
73
+ collection: {
74
+ onHalfway: (args) => {
75
+ console.log('Ad halfway:', args);
76
+ },
77
+ onShow: (args) => {
78
+ console.log('Ad shown:', args);
79
+ },
80
+ onFinish: (args) => {
81
+ console.log('Ad finished:', args);
82
+ },
83
+ onAlways: (args) => {
84
+ console.log('Ad always:', args);
85
+ },
86
+ onError: (error) => {
87
+ console.error('Ad error:', error);
88
+ }
89
+ }
90
+ });
91
+
92
+ // Initialize ad
93
+ rewardAd.initialize({
94
+ adUnitId: 'your-ad-unit-id',
95
+ retry: 3
96
+ });
97
+
98
+ // Show ad
99
+ const result = await rewardAd.addExecuteManager({
100
+ options: {
101
+ scene: 2,
102
+ timeout: 10000
103
+ }
104
+ });
105
+
106
+ console.log('Ad result:', result);
107
+ ```
108
+
109
+ ## API
110
+
111
+ ### InterstitialAdFather
112
+
113
+ Base class for interstitial ads with common functionality.
114
+
115
+ ### InterstitialAdNovel
116
+
117
+ ```typescript
118
+ class InterstitialAdNovel extends InterstitialAdFather {
119
+ static build(args: IConstructArgs): InterstitialAdNovel;
120
+ static getInstance(): InterstitialAdNovel;
121
+ static new(args: IConstructArgs): InterstitialAdNovel;
122
+ initialize(params: IRewordAdConfig, callback?: (v: IRewardedVideoAd) => void): this;
123
+ addExecuteManager(ctx: any): Promise<any>;
124
+ clear(): void;
125
+ shift(): void;
126
+ }
127
+ ```
128
+
129
+ ### RewardAdFather
130
+
131
+ Base class for reward ads with common functionality.
132
+
133
+ ### RewardAdNovel
134
+
135
+ ```typescript
136
+ class RewardAdNovel extends RewardAdFather {
137
+ static build(args: IConstructArgs): RewardAdNovel;
138
+ static getInstance(): RewardAdNovel;
139
+ static new(args: IConstructArgs): RewardAdNovel;
140
+ initialize(params: IRewordAdConfig, callback?: (v: IRewardedVideoAd) => void): this;
141
+ addExecuteManager(ctx: any): Promise<any>;
142
+ clear(): void;
143
+ shift(): void;
144
+ }
145
+ ```
146
+
147
+ ## License
148
+
149
+ MIT
@@ -1,7 +1,11 @@
1
1
  export default InterstitialAdFather;
2
- export type IRewordAdConfig = import("../typings/ad.js").IRewordAdConfig;
3
- export type CallbackCollection = import("../typings/ad.js").CallbackCollection;
4
- export type IConstructArgs = import("../typings/ad.js").IConstructArgs;
2
+ export type IRewordAdConfig = import("./typings/ad.js").IRewordAdConfig;
3
+ export type CallbackCollection = import("./typings/ad.js").CallbackCollection;
4
+ export type IConstructArgs = import("./typings/ad.js").IConstructArgs;
5
+ /**
6
+ * 激励视频实例
7
+ */
8
+ export type InterstitialAd = import("./typings/create-interstitial-ad.js").InterstitialAd;
5
9
  export type IRewardedVideoAd = {
6
10
  /**
7
11
  * 显示激励视频广告
@@ -24,23 +28,32 @@ declare class InterstitialAdFather {
24
28
  * @param {Object} adInstance 广告实例
25
29
  * @param {Object} ctx 上下文对象,用于传递数据和状态
26
30
  * @param {Object} ctx.options 广告执行选项
27
- * @param {Object} ctx.options.log 是否打印日志
28
31
  * @param {Object} ctx.collection 回调集合
29
32
  * @returns {Promise} 广告执行结果的Promise
30
33
  */
31
34
  static executeWithManager(adInstance: any, ctx: {
32
- options: {
33
- log: any;
34
- };
35
+ options: any;
35
36
  collection: any;
36
37
  }): Promise<any>;
37
38
  /**
38
39
  * @param {IConstructArgs} args
39
40
  */
40
41
  constructor(args: IConstructArgs);
42
+ /** @private */
43
+ /** @type {Logger} */
44
+ _logger: Logger;
41
45
  _initSign: string;
42
46
  _preserveOnEnd: boolean;
43
- _interstitialAd: any;
47
+ /**
48
+ * 激励视频实例
49
+ * @type {InterstitialAd | null}
50
+ */
51
+ _interstitialAd: InterstitialAd | null;
52
+ /**
53
+ * 激励视频实例
54
+ * @type {InterstitialAd | null}
55
+ */
56
+ __ad__: InterstitialAd | null;
44
57
  _ttErrorMsgs: string[];
45
58
  _ttErrorCodes: number[];
46
59
  _adConfig: {};
@@ -88,8 +101,26 @@ declare class InterstitialAdFather {
88
101
  * 任务执行完成后始终执行的一个方法
89
102
  * @abstract 任务执行完成后始终执行的一个方法,子类需要用到时实现此方法
90
103
  * @param {object} [_args] 执行结果信息
91
- */
92
- record(_args?: object): this;
104
+ * @param {number} [_args.scene] 场景信息
105
+ * @param {string} _args.id 任务id
106
+ * @param {object} [_args.apiError] 广告api错误信息
107
+ * @param {number} [_args.adTypeR] 广告类型 1 激励视频 2插屏广告
108
+ * @param {object} _args.recovered 后台恢复重试
109
+ * @param {boolean} [_args.recovered.retry] 后台恢复预估是否重试
110
+ * @param {number} [_args.recovered.count] 后台恢复预估重试次数
111
+ * @param {string} [_args.recovered.message] 后台恢复预估重试原因
112
+ */
113
+ record(_args?: {
114
+ scene?: number;
115
+ id: string;
116
+ apiError?: object;
117
+ adTypeR?: number;
118
+ recovered: {
119
+ retry?: boolean;
120
+ count?: number;
121
+ message?: string;
122
+ };
123
+ }): this;
93
124
  /**
94
125
  *
95
126
  * @param {({isEnded: boolean, count: number}) => void} callback
@@ -129,3 +160,4 @@ declare class InterstitialAdFather {
129
160
  */
130
161
  placeholder(): any;
131
162
  }
163
+ import { Logger } from '@ad-execute-manager/helper';
@@ -1,5 +1,5 @@
1
1
  export default InterstitialAdNovel;
2
- export type IRewordAdConfig = import("../typings/ad.js").IRewordAdConfig;
2
+ export type IRewordAdConfig = import("./typings/ad.js").IRewordAdConfig;
3
3
  export type ICallbackArgs = {
4
4
  /**
5
5
  * 广告执行场景
@@ -104,7 +104,7 @@ export type IRewardedVideoAd = {
104
104
  show: () => Promise<void>;
105
105
  };
106
106
  /**
107
- * @typedef {import('../typings/ad.js').IRewordAdConfig} IRewordAdConfig
107
+ * @typedef {import('./typings/ad.js').IRewordAdConfig} IRewordAdConfig
108
108
  */
109
109
  /**
110
110
  * @typedef ICallbackArgs
@@ -331,26 +331,30 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
331
331
  * @override
332
332
  * @param {Object} [ctx] 上下文对象,用于传递数据和状态
333
333
  * @param {IRewordAdConfig} [ctx.options] 广告执行选项
334
- * @param {import('../typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
334
+ * @param {import('./typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
335
335
  * @returns {Promise.<IEndArgs & ICloseArgs | Undefined>}
336
336
  */
337
337
  override addExecuteManager(ctx?: {
338
338
  options?: IRewordAdConfig;
339
- collection?: import("../typings/ad.js").CallbackCollection;
339
+ collection?: import("./typings/ad.js").CallbackCollection;
340
340
  }): Promise<(IEndArgs & ICloseArgs) | undefined>;
341
341
  /**
342
+ * ATTENTION: 应用一旦进入后台,90%概率.show() 方法的.then() 回调将不会被执行, .catch() 回调也不会被执行。
343
+ * 此时将进入超时处理逻辑
342
344
  * @override
343
345
  * @param {object} [ctx] 广告执行上下文
344
- * @param {import('../typings/ad.js').IRewordAdConfig} [ctx.options] 广告执行选项
345
- * @param {import('../typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
346
+ * @param {import('./typings/ad.js').IRewordAdConfig} [ctx.options] 广告执行选项
347
+ * @param {import('./typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
346
348
  * @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
347
349
  * @returns {Promise.<IEndArgs & ICloseArgs | Undefined>}
348
350
  */
349
351
  override ad(ctx?: {
350
- options?: import("../typings/ad.js").IRewordAdConfig;
351
- collection?: import("../typings/ad.js").CallbackCollection;
352
+ options?: import("./typings/ad.js").IRewordAdConfig;
353
+ collection?: import("./typings/ad.js").CallbackCollection;
352
354
  }, next?: Function): Promise<(IEndArgs & ICloseArgs) | undefined>;
353
355
  /**
356
+ * ATTENTION: 应用一旦进入后台,90%概率.show() 方法的.then() 回调将不会被执行, .catch() 回调也不会被执行。
357
+ * 此时将进入超时处理逻辑
354
358
  * @param {object} [ctx] 广告执行上下文
355
359
  * @param {object} [ctx.options] 广告执行选项
356
360
  * @param {number} [ctx.options.scene] 广告执行场景
@@ -1,7 +1,9 @@
1
1
  export default RewardAdFather;
2
- export type IRewordAdConfig = import("../typings/ad.js").IRewordAdConfig;
3
- export type CallbackCollection = import("../typings/ad.js").CallbackCollection;
4
- export type IConstructArgs = import("../typings/ad.js").IConstructArgs;
2
+ export type IRewordAdConfig = import("./typings/ad.js").IRewordAdConfig;
3
+ export type CallbackCollection = import("./typings/ad.js").CallbackCollection;
4
+ export type RecoveredInfo = import("./typings/ad.js").RecoveredInfo;
5
+ export type IConstructArgs = import("./typings/ad.js").IConstructArgs;
6
+ export type RewardedVideoAd = import("./typings/create-rewarded-video-ad.js").RewardedVideoAd;
5
7
  export type IRewardedVideoAd = {
6
8
  /**
7
9
  * 显示激励视频广告
@@ -24,25 +26,36 @@ declare class RewardAdFather {
24
26
  * @param {Object} adInstance 广告实例
25
27
  * @param {Object} ctx 上下文对象,用于传递数据和状态
26
28
  * @param {Object} ctx.options 广告执行选项
27
- * @param {Object} ctx.options.log 是否打印日志
28
29
  * @param {Object} ctx.collection 回调集合
29
30
  * @returns {Promise} 广告执行结果的Promise
30
31
  */
31
32
  static executeWithManager(adInstance: any, ctx: {
32
- options: {
33
- log: any;
34
- };
33
+ options: any;
35
34
  collection: any;
36
35
  }): Promise<any>;
37
36
  /**
38
37
  * @param {IConstructArgs} args
39
38
  */
40
39
  constructor(args: IConstructArgs);
40
+ /** @private */
41
+ /** @type {Logger} */
42
+ _logger: Logger;
43
+ _adTimeoutTime: number;
41
44
  _initSign: string;
42
45
  _preserveOnEnd: boolean;
43
- _rewardAd: any;
46
+ /**
47
+ * 激励视频实例
48
+ * @type {RewardedVideoAd | null}
49
+ */
50
+ _rewardAd: RewardedVideoAd | null;
51
+ /**
52
+ * 激励视频实例
53
+ * @type {RewardedVideoAd | null}
54
+ */
55
+ __ad__: RewardedVideoAd | null;
44
56
  _ttErrorMsgs: string[];
45
57
  _ttErrorCodes: number[];
58
+ __bindAdErrorForeverHandler: any;
46
59
  _adConfig: {};
47
60
  /**
48
61
  * 初始化
@@ -53,12 +66,29 @@ declare class RewardAdFather {
53
66
  */
54
67
  initialize(params: IRewordAdConfig, callback?: (v: IRewardedVideoAd) => void): this;
55
68
  initialized(): boolean;
69
+ /**
70
+ * 激励视频展示失败时始终执行的一个方法
71
+ * @private
72
+ * @param {{errMsg: string; errCode: number}} e 错误信息
73
+ */
74
+ private __adErrorForeverHandler;
75
+ /**
76
+ * 激励视频展示失败时始终执行的一个方法
77
+ * @abstract 激励视频展示失败时始终执行的一个方法,子类需要用到时实现此方法
78
+ * @param {{errMsg: string; errCode: number}} _e 错误信息
79
+ * @returns
80
+ */
81
+ adErrorForeverHandler(_e: {
82
+ errMsg: string;
83
+ errCode: number;
84
+ }): any;
56
85
  /**
57
86
  * 执行广告展示
58
87
  * @abstract
59
88
  * @param {Object} [ctx] 上下文对象,用于传递数据和状态
60
89
  * @param {IRewordAdConfig} [ctx.options] 广告执行选项
61
90
  * @param {CallbackCollection} [ctx.collection] 回调集合
91
+ * @param {RecoveredInfo} [ctx.recovered] 恢复重试信息
62
92
  * @param {Function} next 执行下一个任务的回调函数,在洋葱模型中手动调用以继续执行流程
63
93
  * @returns {Promise<unknown>} 广告执行结果的Promise
64
94
  * @throws {Error} 子类必须实现此方法
@@ -66,6 +96,7 @@ declare class RewardAdFather {
66
96
  ad(ctx?: {
67
97
  options?: IRewordAdConfig;
68
98
  collection?: CallbackCollection;
99
+ recovered?: RecoveredInfo;
69
100
  }, next?: Function): Promise<unknown>;
70
101
  /**
71
102
  * 确保广告按顺序执行
@@ -88,8 +119,26 @@ declare class RewardAdFather {
88
119
  * 任务执行完成后始终执行的一个方法
89
120
  * @abstract 任务执行完成后始终执行的一个方法,子类需要用到时实现此方法
90
121
  * @param {object} [_args] 执行结果信息
91
- */
92
- record(_args?: object): this;
122
+ * @param {number} [_args.scene] 场景信息
123
+ * @param {string} _args.id 任务id
124
+ * @param {object} [_args.apiError] 广告api错误信息
125
+ * @param {number} [_args.adTypeR] 广告类型 1 激励视频 2插屏广告
126
+ * @param {object} _args.recovered 后台恢复重试
127
+ * @param {boolean} [_args.recovered.retry] 后台恢复预估是否重试
128
+ * @param {number} [_args.recovered.count] 后台恢复预估重试次数
129
+ * @param {string} [_args.recovered.message] 后台恢复预估重试原因
130
+ */
131
+ record(_args?: {
132
+ scene?: number;
133
+ id: string;
134
+ apiError?: object;
135
+ adTypeR?: number;
136
+ recovered: {
137
+ retry?: boolean;
138
+ count?: number;
139
+ message?: string;
140
+ };
141
+ }): this;
93
142
  /**
94
143
  *
95
144
  * @param {({isEnded: boolean, count: number}) => void} callback
@@ -129,3 +178,4 @@ declare class RewardAdFather {
129
178
  */
130
179
  placeholder(): any;
131
180
  }
181
+ import { Logger } from '@ad-execute-manager/helper';
@@ -1,5 +1,5 @@
1
1
  export default RewardAdNovel;
2
- export type IRewordAdConfig = import("../typings/ad.js").IRewordAdConfig;
2
+ export type IRewordAdConfig = any;
3
3
  export type ICallbackArgs = {
4
4
  /**
5
5
  * 广告执行场景
@@ -52,6 +52,10 @@ export type IConstructArgs = {
52
52
  * 初始化标识
53
53
  */
54
54
  sign?: string;
55
+ /**
56
+ * 是否开启日志
57
+ */
58
+ log?: boolean;
55
59
  /**
56
60
  * 是否保留tt激励视频广告实例
57
61
  */
@@ -126,6 +130,7 @@ export type IRewardedVideoAd = {
126
130
  /**
127
131
  * @typedef IConstructArgs
128
132
  * @property {string} [sign] 初始化标识
133
+ * @property {boolean} [log] 是否开启日志
129
134
  * @property {boolean} [preserveOnEnd] 是否保留tt激励视频广告实例
130
135
  * @property {boolean} [needEndOnTimeout] 是否需要在超时情况下结束广告
131
136
  * @property {IRewordAdConfig=} [adConfig] 激励视频参数 (可选)
@@ -185,7 +190,6 @@ declare class RewardAdNovel extends RewardAdFather {
185
190
  _scene: number;
186
191
  _adTypeR: 1;
187
192
  _adTimeout: any;
188
- _adTimeoutTime: number;
189
193
  _adBeforeShowTimer: any;
190
194
  _adBeforeShowTime: number;
191
195
  _adSpeedCloseTimer: any;
@@ -199,6 +203,7 @@ declare class RewardAdNovel extends RewardAdFather {
199
203
  bindApiAdErrorLister: any;
200
204
  _bindShiftCloseLister: any;
201
205
  _bindShiftErrorLister: any;
206
+ _adConfig: any;
202
207
  /**
203
208
  * 初始化
204
209
  * 子类可以选择覆盖此方法,或使用默认实现
@@ -217,7 +222,18 @@ declare class RewardAdNovel extends RewardAdFather {
217
222
  }): void;
218
223
  novelConfig: RewardAdNovelConfig;
219
224
  _onInnerExecuteBefore(): any;
220
- _onInnerAdShowSuccess(): any;
225
+ /**
226
+ * @param {object} _args
227
+ * @param {string} _args.scene 广告执行场景 必填
228
+ * @param {number} [_args.result] 广告执行成功结果 必填
229
+ * @param {import('../typings/ad.js').RecoveredInfo} [_args.recovered] 恢复重试信息
230
+ * @returns
231
+ */
232
+ _onInnerAdShowSuccess(_args: {
233
+ scene: string;
234
+ result?: number;
235
+ recovered?: any;
236
+ }): any;
221
237
  /**
222
238
  * 广告展示超时设置
223
239
  * @param {object} args
@@ -230,6 +246,20 @@ declare class RewardAdNovel extends RewardAdFather {
230
246
  timeout?: number;
231
247
  end: Function;
232
248
  }): void;
249
+ /**
250
+ * 子类可以选择覆盖此方法
251
+ * 添加超时情况下结束任务前的回调
252
+ * @param {object} args
253
+ * @param {string} args.scene 广告执行场景 必填
254
+ * @param {number} args.timeout 广告超时时间 单位ms 必填
255
+ */
256
+ _adTimeoutBeforeEnd(args: {
257
+ scene: string;
258
+ timeout: number;
259
+ }): {
260
+ scene: string;
261
+ timeout: number;
262
+ };
233
263
  /**
234
264
  * 广告展示前定时器
235
265
  * @param {object} args
@@ -259,13 +289,15 @@ declare class RewardAdNovel extends RewardAdFather {
259
289
  * @param {object} _args
260
290
  * @param {string} _args.scene 广告执行场景 必填
261
291
  * @param {string} [_args.msg] 广告执行成功原因
262
- * @param {0|1} _args.result 广告执行成功结果
292
+ * @param {0|1} _args.result 广告执行成功结果 必填
293
+ * @param {import('../typings/ad.js').RecoveredInfo} [_args.recovered] 恢复重试信息
263
294
  * @returns
264
295
  */
265
296
  protected _adShowSuccessAnalytics(_args: {
266
297
  scene: string;
267
298
  msg?: string;
268
299
  result: 0 | 1;
300
+ recovered?: any;
269
301
  }): any;
270
302
  /**
271
303
  * 广告展示失败分析
@@ -291,13 +323,20 @@ declare class RewardAdNovel extends RewardAdFather {
291
323
  * @param {object} _args
292
324
  * @param {string} _args.scene 广告执行场景 必填
293
325
  * @param {string} [_args.msg] 广告执行成功原因
294
- * @param {0|1} _args.result 广告执行成功结果
326
+ * @param {0|1} _args.result 广告执行成功结果 必填
327
+ * @param {object} [_args.frequency] 广告执行重试参数
328
+ * @param {number} _args.frequency.total 广告执行总次数 必填
329
+ * @param {number} _args.frequency.current 广告执行当前次数 必填
295
330
  * @returns
296
331
  */
297
332
  protected _adLoadSuccessAnalytics(_args: {
298
333
  scene: string;
299
334
  msg?: string;
300
335
  result: 0 | 1;
336
+ frequency?: {
337
+ total: number;
338
+ current: number;
339
+ };
301
340
  }): any;
302
341
  /**
303
342
  * 广告加载失败分析
@@ -329,7 +368,7 @@ declare class RewardAdNovel extends RewardAdFather {
329
368
  ad_is_completed: number;
330
369
  ad_count: number;
331
370
  }): any;
332
- get rewardAd(): any;
371
+ get rewardAd(): import("./typings/create-rewarded-video-ad.js").RewardedVideoAd;
333
372
  /**
334
373
  * 确保广告按顺序执行
335
374
  * @override
@@ -340,26 +379,30 @@ declare class RewardAdNovel extends RewardAdFather {
340
379
  */
341
380
  override addExecuteManager(ctx?: {
342
381
  options?: IRewordAdConfig;
343
- collection?: import("../typings/ad.js").CallbackCollection;
382
+ collection?: any;
344
383
  }): Promise<(IEndArgs & ICloseArgs) | undefined>;
345
384
  /**
346
385
  * @override
347
386
  * @param {object} [ctx] 广告执行上下文
348
387
  * @param {import('../typings/ad.js').IRewordAdConfig} [ctx.options] 广告执行选项
349
388
  * @param {import('../typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
389
+ * @param {import('../typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
350
390
  * @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
351
391
  * @returns {Promise.<IEndArgs & ICloseArgs | Undefined>}
352
392
  */
353
393
  override ad(ctx?: {
354
- options?: import("../typings/ad.js").IRewordAdConfig;
355
- collection?: import("../typings/ad.js").CallbackCollection;
394
+ options?: any;
395
+ collection?: any;
396
+ recovered?: any;
356
397
  }, next?: Function): Promise<(IEndArgs & ICloseArgs) | undefined>;
398
+ _recovered: any;
357
399
  /**
358
400
  * @param {object} [ctx] 广告执行上下文
359
401
  * @param {object} [ctx.options] 广告执行选项
360
402
  * @param {number} [ctx.options.scene] 广告执行场景 必填
361
403
  * @param {number} [ctx.options.timeout] 广告超时时间 单位ms
362
404
  * @param {object} ctx.collection 回调集合
405
+ * @param {import('../typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
363
406
  * @param {(v?: unknown) => void} ctx.collection.resolve 广告执行成功的回调函数
364
407
  * @param {(v?: unknown) => void} [ctx.collection.reject] 广告执行失败的回调函数
365
408
  * @param {(v?: unknown) => void} [ctx.collection.before] 广告执行前的回调函数
@@ -372,16 +415,11 @@ declare class RewardAdNovel extends RewardAdFather {
372
415
  scene?: number;
373
416
  timeout?: number;
374
417
  };
375
- collection: {
376
- resolve: (v?: unknown) => void;
377
- reject?: (v?: unknown) => void;
378
- before?: (v?: unknown) => void;
379
- success?: (v?: unknown) => void;
380
- prelude?: (v?: unknown) => void;
381
- };
418
+ collection: object;
419
+ recovered?: any;
382
420
  }, next?: Function): void;
383
- _before: (v?: unknown) => void;
384
- _success: (v?: unknown) => void;
421
+ _before: any;
422
+ _success: any;
385
423
  /**
386
424
  * 广告加载
387
425
  * @returns
@@ -396,19 +434,70 @@ declare class RewardAdNovel extends RewardAdFather {
396
434
  _outerHalfwayCallback(args: any): void;
397
435
  _outerFinishedCallback(args: any): void;
398
436
  /**
399
- * 关闭激励视频
400
- * 子类重写该方法时,必须调用this._clearAdTimeout();清除超时定时器
437
+ * 内部关闭激励视频
438
+ * @private
401
439
  * @param {ICloseArgs} args
402
440
  */
403
- adCloseLister(args: ICloseArgs): void;
404
- adErrorLister(e: any): void;
405
- apiAdErrorLister(e: any): void;
441
+ private __adCloseLister__;
406
442
  /**
443
+ * 关闭激励视频
444
+ * 子类可重写该方法
445
+ * @protected
446
+ * @param {object} args
447
+ * @param {boolean} args.isEnded 广告是否完成
448
+ * @param {number} args.count 广告执行次数
449
+ * @param {string} args.scene 广告执行场景
450
+ * @param {number} args.adTypeR 广告类型
451
+ * @param {string} args.end_type 广告关闭类型
452
+ * @param {object} [connection] 广告关闭回调集合
453
+ * @param {(ctx: object) => void} [connection.conn] 调用外部传入的回调
454
+ * @param {(ctx: object) => void} [connection.end] 结束任务的回调
455
+ *
456
+ */
457
+ protected adCloseLister(args: {
458
+ isEnded: boolean;
459
+ count: number;
460
+ scene: string;
461
+ adTypeR: number;
462
+ end_type: string;
463
+ }, connection?: {
464
+ conn?: (ctx: object) => void;
465
+ end?: (ctx: object) => void;
466
+ }): void;
467
+ /**
468
+ * 激励视频广告组件**失败**时会触发
469
+ * @private
470
+ */
471
+ private __adErrorLister__;
472
+ /**
473
+ * 激励视频广告组件**失败**时会触发
474
+ * @protected
475
+ */
476
+ protected adErrorLister(e: any): any;
477
+ /**
478
+ * 激励视频广告组件api**失败**时会触发
479
+ * @private
480
+ */
481
+ private __apiAdErrorLister__;
482
+ /**
483
+ * 激励视频广告组件api**失败**时会触发
484
+ * @protected
485
+ */
486
+ protected apiAdErrorLister(e: any): any;
487
+ /**
488
+ * @private
489
+ * 激励视频广告组件**成功**拉取广告素材时会触发
490
+ * 创建激励时候后会自动拉取广告素材,如果广告拉取成功,也会触发此事件,不管是否调用show方法
491
+ * @param {unknown} e
492
+ */
493
+ private __adLoadLister__;
494
+ /**
495
+ * @protected
407
496
  * 激励视频广告组件**成功**拉取广告素材时会触发
408
497
  * 创建激励时候后会自动拉取广告素材,如果广告拉取成功,也会触发此事件,不管是否调用show方法
409
498
  * @param {unknown} e
410
499
  */
411
- adLoadLister(e: unknown): void;
500
+ protected adLoadLister(e: unknown): unknown;
412
501
  adDestroy(): void;
413
502
  _shiftCloseLister(args: any): void;
414
503
  _shiftErrorLister(args: any): void;