@ad-execute-manager/ad-reward 2.0.2 → 2.0.3

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.
@@ -27,12 +27,13 @@ declare class RewardAdFather {
27
27
  * @param {Object} ctx 上下文对象,用于传递数据和状态
28
28
  * @param {Object} ctx.options 广告执行选项
29
29
  * @param {Object} ctx.collection 回调集合
30
- * @returns {Promise} 广告执行结果的Promise
31
30
  */
32
31
  static executeWithManager(adInstance: any, ctx: {
33
32
  options: any;
34
33
  collection: any;
35
- }): Promise<any>;
34
+ }): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
35
+ [key: string]: any;
36
+ }>;
36
37
  /**
37
38
  * @param {IConstructArgs} args
38
39
  */
@@ -103,12 +104,13 @@ declare class RewardAdFather {
103
104
  * @param {Object} [ctx] 上下文对象,用于传递数据和状态
104
105
  * @param {IRewordAdConfig} [ctx.options] 广告执行选项
105
106
  * @param {CallbackCollection} [ctx.collection] 回调集合
106
- * @returns {Promise.<unknown>} 广告执行结果的Promise
107
107
  */
108
108
  addExecuteManager(ctx?: {
109
109
  options?: IRewordAdConfig;
110
110
  collection?: CallbackCollection;
111
- }): Promise<unknown>;
111
+ }): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
112
+ [key: string]: any;
113
+ }>;
112
114
  destroy(): void;
113
115
  /**
114
116
  * 清理广告实例
@@ -1,5 +1,5 @@
1
1
  export default RewardAdNovel;
2
- export type IRewordAdConfig = any;
2
+ export type IRewordAdConfig = import("./typings/ad.js").IRewordAdConfig;
3
3
  export type ICallbackArgs = {
4
4
  /**
5
5
  * 广告执行场景
@@ -83,24 +83,6 @@ export type ICloseArgs = {
83
83
  */
84
84
  count: number;
85
85
  };
86
- export type IEndArgs = {
87
- /**
88
- * 是否解锁全部
89
- */
90
- can_unlock_all?: boolean;
91
- /**
92
- * 是否解锁小说
93
- */
94
- can_unlock_novel?: boolean;
95
- /**
96
- * 剩余次数
97
- */
98
- remain?: number;
99
- /**
100
- * 结束类型
101
- */
102
- end_type?: "halfway" | "finished";
103
- };
104
86
  export type IRewardedVideoAd = {
105
87
  /**
106
88
  * 显示激励视频广告
@@ -108,7 +90,7 @@ export type IRewardedVideoAd = {
108
90
  show: () => Promise<void>;
109
91
  };
110
92
  /**
111
- * @typedef {import('../typings/ad.js').IRewordAdConfig} IRewordAdConfig
93
+ * @typedef {import('./typings/ad.js').IRewordAdConfig} IRewordAdConfig
112
94
  */
113
95
  /**
114
96
  * @typedef ICallbackArgs
@@ -141,14 +123,6 @@ export type IRewardedVideoAd = {
141
123
  * @property {boolean} isEnded 是否看完
142
124
  * @property {number} count 完整观看次数
143
125
  */
144
- /**
145
- * @typedef IEndArgs
146
- * @property {boolean} [can_unlock_all] 是否解锁全部
147
- * @property {boolean} [can_unlock_novel] 是否解锁小说
148
- * @property {number} [remain] 剩余次数
149
- * @property {'halfway' | 'finished'} [end_type] 结束类型
150
- *
151
- */
152
126
  /**
153
127
  * @typedef IRewardedVideoAd
154
128
  * @property {() => Promise.<void>} show 显示激励视频广告
@@ -203,7 +177,6 @@ declare class RewardAdNovel extends RewardAdFather {
203
177
  bindApiAdErrorLister: any;
204
178
  _bindShiftCloseLister: any;
205
179
  _bindShiftErrorLister: any;
206
- _adConfig: any;
207
180
  /**
208
181
  * 初始化
209
182
  * 子类可以选择覆盖此方法,或使用默认实现
@@ -226,13 +199,13 @@ declare class RewardAdNovel extends RewardAdFather {
226
199
  * @param {object} _args
227
200
  * @param {string} _args.scene 广告执行场景 必填
228
201
  * @param {number} [_args.result] 广告执行成功结果 必填
229
- * @param {import('../typings/ad.js').RecoveredInfo} [_args.recovered] 恢复重试信息
202
+ * @param {import('./typings/ad.js').RecoveredInfo} [_args.recovered] 恢复重试信息
230
203
  * @returns
231
204
  */
232
205
  _onInnerAdShowSuccess(_args: {
233
206
  scene: string;
234
207
  result?: number;
235
- recovered?: any;
208
+ recovered?: import("./typings/ad.js").RecoveredInfo;
236
209
  }): any;
237
210
  /**
238
211
  * 广告展示超时设置
@@ -290,14 +263,14 @@ declare class RewardAdNovel extends RewardAdFather {
290
263
  * @param {string} _args.scene 广告执行场景 必填
291
264
  * @param {string} [_args.msg] 广告执行成功原因
292
265
  * @param {0|1} _args.result 广告执行成功结果 必填
293
- * @param {import('../typings/ad.js').RecoveredInfo} [_args.recovered] 恢复重试信息
266
+ * @param {import('./typings/ad.js').RecoveredInfo} [_args.recovered] 恢复重试信息
294
267
  * @returns
295
268
  */
296
269
  protected _adShowSuccessAnalytics(_args: {
297
270
  scene: string;
298
271
  msg?: string;
299
272
  result: 0 | 1;
300
- recovered?: any;
273
+ recovered?: import("./typings/ad.js").RecoveredInfo;
301
274
  }): any;
302
275
  /**
303
276
  * 广告展示失败分析
@@ -369,40 +342,28 @@ declare class RewardAdNovel extends RewardAdFather {
369
342
  ad_count: number;
370
343
  }): any;
371
344
  get rewardAd(): import("./typings/create-rewarded-video-ad.js").RewardedVideoAd;
372
- /**
373
- * 确保广告按顺序执行
374
- * @override
375
- * @param {Object} [ctx] 上下文对象,用于传递数据和状态
376
- * @param {IRewordAdConfig} [ctx.options] 广告执行选项
377
- * @param {import('../typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
378
- * @returns {Promise.<IEndArgs & ICloseArgs | Undefined>}
379
- */
380
- override addExecuteManager(ctx?: {
381
- options?: IRewordAdConfig;
382
- collection?: any;
383
- }): Promise<(IEndArgs & ICloseArgs) | undefined>;
384
345
  /**
385
346
  * @override
386
347
  * @param {object} [ctx] 广告执行上下文
387
- * @param {import('../typings/ad.js').IRewordAdConfig} [ctx.options] 广告执行选项
388
- * @param {import('../typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
389
- * @param {import('../typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
348
+ * @param {import('./typings/ad.js').IRewordAdConfig} [ctx.options] 广告执行选项
349
+ * @param {import('./typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
350
+ * @param {import('./typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
390
351
  * @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
391
- * @returns {Promise.<IEndArgs & ICloseArgs | Undefined>}
352
+ * @returns {Promise.<object | Undefined>}
392
353
  */
393
354
  override ad(ctx?: {
394
- options?: any;
395
- collection?: any;
396
- recovered?: any;
397
- }, next?: Function): Promise<(IEndArgs & ICloseArgs) | undefined>;
398
- _recovered: any;
355
+ options?: import("./typings/ad.js").IRewordAdConfig;
356
+ collection?: import("./typings/ad.js").CallbackCollection;
357
+ recovered?: import("./typings/ad.js").RecoveredInfo;
358
+ }, next?: Function): Promise<object | undefined>;
359
+ _recovered: import("./typings/ad.js").RecoveredInfo;
399
360
  /**
400
361
  * @param {object} [ctx] 广告执行上下文
401
362
  * @param {object} [ctx.options] 广告执行选项
402
363
  * @param {number} [ctx.options.scene] 广告执行场景 必填
403
364
  * @param {number} [ctx.options.timeout] 广告超时时间 单位ms
404
365
  * @param {object} ctx.collection 回调集合
405
- * @param {import('../typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
366
+ * @param {import('./typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
406
367
  * @param {(v?: unknown) => void} ctx.collection.resolve 广告执行成功的回调函数
407
368
  * @param {(v?: unknown) => void} [ctx.collection.reject] 广告执行失败的回调函数
408
369
  * @param {(v?: unknown) => void} [ctx.collection.before] 广告执行前的回调函数
@@ -416,7 +377,7 @@ declare class RewardAdNovel extends RewardAdFather {
416
377
  timeout?: number;
417
378
  };
418
379
  collection: object;
419
- recovered?: any;
380
+ recovered?: import("./typings/ad.js").RecoveredInfo;
420
381
  }, next?: Function): void;
421
382
  _before: any;
422
383
  _success: any;
@@ -69,7 +69,7 @@ export type IExeCallbackArgs = {
69
69
  };
70
70
  export type CallbackCollection = {
71
71
  /**
72
- * 每次外部回调
72
+ * 完成广告外部回调 不管看不看完
73
73
  */
74
74
  always?: (ctx?: IExeCallbackArgs) => void;
75
75
  /**
@@ -80,14 +80,10 @@ export type CallbackCollection = {
80
80
  * 半途退出广告外部回调
81
81
  */
82
82
  halfway?: (ctx?: IExeCallbackArgs) => void;
83
- /**
84
- * 完成广告外部回调 不管看不看完
85
- */
86
- complete?: (ctx?: IExeCallbackArgs) => void;
87
83
  /**
88
84
  * 取消广告外部回调
89
85
  */
90
- onCancel?: (ctx?: IExeCallbackArgs) => void;
86
+ cancel?: (ctx?: IExeCallbackArgs) => void;
91
87
  /**
92
88
  * 展示广告外部回调
93
89
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ad-execute-manager/ad-reward",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "Reward ad-related classes including RewardAdFather and RewardAdNovel for ad management.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -57,7 +57,7 @@
57
57
  "@ad-execute-manager/serializable-error": "^2.0.2"
58
58
  },
59
59
  "peerDependencies": {
60
- "@ad-execute-manager/core": "^2.0.2",
60
+ "@ad-execute-manager/core": "^2.0.3",
61
61
  "@ad-execute-manager/logger": "^2.0.2"
62
62
  },
63
63
  "devDependencies": {