@singcl/ad-execute-manager 1.12.6 → 1.12.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.
@@ -1,5 +1,4 @@
1
1
  export default InterstitialAdNovel;
2
- export type IRewordAdConfig = import("../typings/ad.js").IRewordAdConfig;
3
2
  export type ICallbackArgs = {
4
3
  /**
5
4
  * 广告执行场景
@@ -63,7 +62,7 @@ export type IConstructArgs = {
63
62
  /**
64
63
  * 激励视频参数 (可选)
65
64
  */
66
- adConfig?: IRewordAdConfig | undefined;
65
+ adConfig?: import("../typings/ad.js").IRewordAdConfig;
67
66
  /**
68
67
  * 回调集合
69
68
  */
@@ -85,9 +84,6 @@ export type IRewardedVideoAd = {
85
84
  */
86
85
  show: () => Promise<void>;
87
86
  };
88
- /**
89
- * @typedef {import('../typings/ad.js').IRewordAdConfig} IRewordAdConfig
90
- */
91
87
  /**
92
88
  * @typedef ICallbackArgs
93
89
  * @property {number} scene 广告执行场景
@@ -110,7 +106,7 @@ export type IRewardedVideoAd = {
110
106
  * @property {string} [sign] 初始化标识
111
107
  * @property {boolean} [preserveOnEnd] 是否保留tt激励视频广告实例
112
108
  * @property {boolean} [needEndOnTimeout] 是否需要在超时情况下结束广告
113
- * @property {IRewordAdConfig=} [adConfig] 激励视频参数 (可选)
109
+ * @property {import('../typings/ad.js').IRewordAdConfig} [adConfig] 激励视频参数 (可选)
114
110
  * @property {IConnection=} [collection] 回调集合
115
111
  */
116
112
  /**
@@ -176,11 +172,11 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
176
172
  /**
177
173
  * 初始化
178
174
  * 子类可以选择覆盖此方法,或使用默认实现
179
- * @param {IRewordAdConfig} args
175
+ * @param {import('../typings/ad.js').IAdOptions} args
180
176
  * @param {(v: IRewardedVideoAd) => void} [callback] 初始化成功回调
181
177
  * @returns {this} 当前实例
182
178
  */
183
- initialize(args: IRewordAdConfig, callback?: (v: IRewardedVideoAd) => void): this;
179
+ initialize(args: import("../typings/ad.js").IAdOptions, callback?: (v: IRewardedVideoAd) => void): this;
184
180
  _initAdLister(): void;
185
181
  /**
186
182
  * @param {object} args
@@ -300,18 +296,31 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
300
296
  ad_is_completed: number;
301
297
  }): any;
302
298
  get rewardAd(): any;
299
+ /**
300
+ * 确保广告按顺序执行
301
+ * @override
302
+ * @param {Object} [ctx] 上下文对象,用于传递数据和状态
303
+ * @param {import('../typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
304
+ * @param {import('../typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
305
+ */
306
+ override addExecuteManager(ctx?: {
307
+ options?: import("../typings/ad.js").IAdOptions;
308
+ collection?: import("../typings/ad.js").CallbackCollection;
309
+ }): Promise<import("../core/AdExecuteManager.js").ITaskResult & {
310
+ [key: string]: any;
311
+ }>;
303
312
  /**
304
313
  * ATTENTION: 应用一旦进入后台,90%概率.show() 方法的.then() 回调将不会被执行, .catch() 回调也不会被执行。
305
314
  * 此时将进入超时处理逻辑
306
315
  * @override
307
316
  * @param {object} [ctx] 广告执行上下文
308
- * @param {import('../typings/ad.js').IRewordAdConfig} [ctx.options] 广告执行选项
317
+ * @param {import('../typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
309
318
  * @param {import('../typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
310
319
  * @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
311
320
  * @returns {Promise.<object | Undefined>}
312
321
  */
313
322
  override ad(ctx?: {
314
- options?: import("../typings/ad.js").IRewordAdConfig;
323
+ options?: import("../typings/ad.js").IAdOptions;
315
324
  collection?: import("../typings/ad.js").CallbackCollection;
316
325
  }, next?: Function): Promise<object | undefined>;
317
326
  /**
@@ -61,11 +61,11 @@ declare class RewardAdFather {
61
61
  /**
62
62
  * 初始化
63
63
  * 子类可以选择覆盖此方法,或使用默认实现
64
- * @param {IRewordAdConfig} params
64
+ * @param {import('../typings/ad.js').IAdOptions} params
65
65
  * @param {(v: IRewardedVideoAd) => void} [callback] 初始化成功回调
66
66
  * @returns {this} 当前实例
67
67
  */
68
- initialize(params: IRewordAdConfig, callback?: (v: IRewardedVideoAd) => void): this;
68
+ initialize(params: import("../typings/ad.js").IAdOptions, callback?: (v: IRewardedVideoAd) => void): this;
69
69
  initialized(): boolean;
70
70
  /**
71
71
  * 激励视频展示失败时始终执行的一个方法
package/package.json CHANGED
@@ -1,73 +1,73 @@
1
- {
2
- "name": "@singcl/ad-execute-manager",
3
- "version": "1.12.6",
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
- "type": "module",
6
- "exports": {
7
- ".": {
8
- "import": "./dist/index.js",
9
- "require": "./dist/index.cjs",
10
- "types": "./dist/index.d.ts"
11
- }
12
- },
13
- "main": "./dist/index.cjs",
14
- "types": "./dist/index.d.ts",
15
- "files": [
16
- "dist"
17
- ],
18
- "author": {
19
- "name": "singcl",
20
- "email": "iambabyer@gmail.com",
21
- "url": "https://github.com/singcl"
22
- },
23
- "license": "MIT",
24
- "homepage": "https://npmx.dev/package/@singcl/ad-execute-manager",
25
- "repository": {
26
- "type": "git",
27
- "url": "git+https://github.com/singcl/ad-execute-manager.git"
28
- },
29
- "bugs": {
30
- "url": "https://github.com/singcl/ad-execute-manager/issues"
31
- },
32
- "engines": {
33
- "node": ">=8.0.0",
34
- "npm": ">=6.0.0",
35
- "yarn": ">=1.0.0",
36
- "pnpm": ">=8.0.0"
37
- },
38
- "publishConfig": {
39
- "access": "public"
40
- },
41
- "keywords": [
42
- "ad",
43
- "advertisement",
44
- "reward-ad",
45
- "interstitial-ad",
46
- "ad-manager",
47
- "ad-execution",
48
- "javascript",
49
- "nodejs"
50
- ],
51
- "scripts": {
52
- "build": "rslib build && tsc",
53
- "dev": "rslib build --watch",
54
- "format": "prettier --write .",
55
- "lint": "eslint .",
56
- "test": "rstest",
57
- "prepublishOnly": "npm i && npm run build"
58
- },
59
- "devDependencies": {
60
- "@babel/eslint-parser": "^7.28.5",
61
- "@babel/preset-env": "^7.28.5",
62
- "@douyin-microapp/typings": "^1.3.1",
63
- "@eslint/js": "^9.39.1",
64
- "@rslib/core": "^0.18.5",
65
- "@rstest/core": "^0.7.2",
66
- "@singcl/ad-execute-manager": "^1.11.12",
67
- "eslint": "^9.39.2",
68
- "eslint-plugin-import": "^2.32.0",
69
- "globals": "^16.5.0",
70
- "prettier": "^3.7.3",
71
- "typescript": "^5.9.3"
72
- }
73
- }
1
+ {
2
+ "name": "@singcl/ad-execute-manager",
3
+ "version": "1.12.8",
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
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/index.js",
9
+ "require": "./dist/index.cjs",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "main": "./dist/index.cjs",
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "author": {
19
+ "name": "singcl",
20
+ "email": "iambabyer@gmail.com",
21
+ "url": "https://github.com/singcl"
22
+ },
23
+ "license": "MIT",
24
+ "homepage": "https://npmx.dev/package/@singcl/ad-execute-manager",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/singcl/ad-execute-manager.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/singcl/ad-execute-manager/issues"
31
+ },
32
+ "engines": {
33
+ "node": ">=8.0.0",
34
+ "npm": ">=6.0.0",
35
+ "yarn": ">=1.0.0",
36
+ "pnpm": ">=8.0.0"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "keywords": [
42
+ "ad",
43
+ "advertisement",
44
+ "reward-ad",
45
+ "interstitial-ad",
46
+ "ad-manager",
47
+ "ad-execution",
48
+ "javascript",
49
+ "nodejs"
50
+ ],
51
+ "scripts": {
52
+ "build": "rslib build && tsc",
53
+ "dev": "rslib build --watch",
54
+ "format": "prettier --write .",
55
+ "lint": "eslint .",
56
+ "test": "rstest",
57
+ "prepublishOnly": "npm i && npm run build"
58
+ },
59
+ "devDependencies": {
60
+ "@babel/eslint-parser": "^7.28.5",
61
+ "@babel/preset-env": "^7.28.5",
62
+ "@douyin-microapp/typings": "^1.3.1",
63
+ "@eslint/js": "^9.39.1",
64
+ "@rslib/core": "^0.18.5",
65
+ "@rstest/core": "^0.7.2",
66
+ "@singcl/ad-execute-manager": "^1.11.12",
67
+ "eslint": "^9.39.2",
68
+ "eslint-plugin-import": "^2.32.0",
69
+ "globals": "^16.5.0",
70
+ "prettier": "^3.7.3",
71
+ "typescript": "^5.9.3"
72
+ }
73
+ }