@singcl/ad-execute-manager 1.13.1 → 1.13.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.
|
@@ -63,7 +63,7 @@ export type IConstructArgs = {
|
|
|
63
63
|
/**
|
|
64
64
|
* 激励视频参数 (可选)
|
|
65
65
|
*/
|
|
66
|
-
adConfig?:
|
|
66
|
+
adConfig?: any;
|
|
67
67
|
/**
|
|
68
68
|
* 回调集合
|
|
69
69
|
*/
|
|
@@ -110,7 +110,7 @@ export type IRewardedVideoAd = {
|
|
|
110
110
|
* @property {string} [sign] 初始化标识
|
|
111
111
|
* @property {boolean} [preserveOnEnd] 是否保留tt激励视频广告实例
|
|
112
112
|
* @property {boolean} [needEndOnTimeout] 是否需要在超时情况下结束广告
|
|
113
|
-
* @property {IRewordAdConfig
|
|
113
|
+
* @property {import('../typings/ad.js').IRewordAdConfig} [adConfig] 激励视频参数 (可选)
|
|
114
114
|
* @property {IConnection=} [collection] 回调集合
|
|
115
115
|
*/
|
|
116
116
|
/**
|
|
@@ -173,6 +173,7 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
|
|
|
173
173
|
bindApiAdErrorLister: any;
|
|
174
174
|
_bindShiftCloseLister: any;
|
|
175
175
|
_bindShiftErrorLister: any;
|
|
176
|
+
_adConfig: any;
|
|
176
177
|
/**
|
|
177
178
|
* 初始化
|
|
178
179
|
* 子类可以选择覆盖此方法,或使用默认实现
|
|
@@ -1,82 +1,6 @@
|
|
|
1
1
|
export default RewardAdNovel;
|
|
2
2
|
export type IRewordAdConfig = import("./typings/ad.js").IRewordAdConfig;
|
|
3
|
-
export type
|
|
4
|
-
/**
|
|
5
|
-
* 广告执行场景
|
|
6
|
-
*/
|
|
7
|
-
scene: number;
|
|
8
|
-
/**
|
|
9
|
-
* 是否看完
|
|
10
|
-
*/
|
|
11
|
-
isEnded: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* 完整观看次数
|
|
14
|
-
*/
|
|
15
|
-
count: number;
|
|
16
|
-
/**
|
|
17
|
-
* 执行下一个任务的回调函数,手动调用以继续执行流程[end]
|
|
18
|
-
*/
|
|
19
|
-
end?: () => void;
|
|
20
|
-
/**
|
|
21
|
-
* 执行下一个任务的回调函数, 手动调用以继续执行流程[circle]
|
|
22
|
-
*/
|
|
23
|
-
circle?: (args: {
|
|
24
|
-
ignoreRemain: boolean;
|
|
25
|
-
scene: number;
|
|
26
|
-
}) => void;
|
|
27
|
-
};
|
|
28
|
-
export type IConnection = {
|
|
29
|
-
/**
|
|
30
|
-
* 广告中途退出回调
|
|
31
|
-
*/
|
|
32
|
-
onHalfway?: (args: ICallbackArgs) => void;
|
|
33
|
-
/**
|
|
34
|
-
* 广告展示回调
|
|
35
|
-
*/
|
|
36
|
-
onShow?: (args: ICallbackArgs) => void;
|
|
37
|
-
/**
|
|
38
|
-
* 广告执行成功回调
|
|
39
|
-
*/
|
|
40
|
-
onFinish?: (args: ICallbackArgs) => void;
|
|
41
|
-
/**
|
|
42
|
-
* 广告执行成功回调
|
|
43
|
-
*/
|
|
44
|
-
onAlways?: (args: ICallbackArgs) => void;
|
|
45
|
-
/**
|
|
46
|
-
* 广告执行失败回调
|
|
47
|
-
*/
|
|
48
|
-
onError?: (e: unknown) => void;
|
|
49
|
-
};
|
|
50
|
-
export type IConstructArgs = {
|
|
51
|
-
/**
|
|
52
|
-
* 初始化标识
|
|
53
|
-
*/
|
|
54
|
-
sign?: string;
|
|
55
|
-
/**
|
|
56
|
-
* 是否开启日志
|
|
57
|
-
*/
|
|
58
|
-
log?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* 是否保留tt激励视频广告实例
|
|
61
|
-
*/
|
|
62
|
-
preserveOnEnd?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* 是否需要在超时情况下结束广告
|
|
65
|
-
*/
|
|
66
|
-
needEndOnTimeout?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* 是否需要在错误情况下查询剩余次数
|
|
69
|
-
*/
|
|
70
|
-
lookUpRemainOnError?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* 激励视频参数 (可选)
|
|
73
|
-
*/
|
|
74
|
-
adConfig?: IRewordAdConfig | undefined;
|
|
75
|
-
/**
|
|
76
|
-
* 回调集合
|
|
77
|
-
*/
|
|
78
|
-
collection?: IConnection | undefined;
|
|
79
|
-
};
|
|
3
|
+
export type IConstructArgs = import("./typings/ad.js").IConstructArgs;
|
|
80
4
|
export type ICloseArgs = {
|
|
81
5
|
/**
|
|
82
6
|
* 是否看完
|
|
@@ -97,31 +21,7 @@ export type IRewardedVideoAd = {
|
|
|
97
21
|
* @typedef {import('./typings/ad.js').IRewordAdConfig} IRewordAdConfig
|
|
98
22
|
*/
|
|
99
23
|
/**
|
|
100
|
-
* @typedef
|
|
101
|
-
* @property {number} scene 广告执行场景
|
|
102
|
-
* @property {boolean} isEnded 是否看完
|
|
103
|
-
* @property {number} count 完整观看次数
|
|
104
|
-
* @property {() => void} [end] 执行下一个任务的回调函数,手动调用以继续执行流程[end]
|
|
105
|
-
* @property {(args: {ignoreRemain: boolean, scene: number}) => void} [circle] 执行下一个任务的回调函数, 手动调用以继续执行流程[circle]
|
|
106
|
-
*
|
|
107
|
-
*/
|
|
108
|
-
/**
|
|
109
|
-
* @typedef IConnection
|
|
110
|
-
* @property {(args: ICallbackArgs) => void} [onHalfway] 广告中途退出回调
|
|
111
|
-
* @property {(args: ICallbackArgs) => void} [onShow] 广告展示回调
|
|
112
|
-
* @property {(args: ICallbackArgs) => void} [onFinish] 广告执行成功回调
|
|
113
|
-
* @property {(args: ICallbackArgs) => void} [onAlways] 广告执行成功回调
|
|
114
|
-
* @property {(e:unknown) => void} [onError] 广告执行失败回调
|
|
115
|
-
*/
|
|
116
|
-
/**
|
|
117
|
-
* @typedef IConstructArgs
|
|
118
|
-
* @property {string} [sign] 初始化标识
|
|
119
|
-
* @property {boolean} [log] 是否开启日志
|
|
120
|
-
* @property {boolean} [preserveOnEnd] 是否保留tt激励视频广告实例
|
|
121
|
-
* @property {boolean} [needEndOnTimeout] 是否需要在超时情况下结束广告
|
|
122
|
-
* @property {boolean} [lookUpRemainOnError] 是否需要在错误情况下查询剩余次数
|
|
123
|
-
* @property {IRewordAdConfig=} [adConfig] 激励视频参数 (可选)
|
|
124
|
-
* @property {IConnection=} [collection] 回调集合
|
|
24
|
+
* @typedef {import('./typings/ad.js').IConstructArgs} IConstructArgs
|
|
125
25
|
*/
|
|
126
26
|
/**
|
|
127
27
|
* @typedef ICloseArgs
|
|
@@ -150,11 +50,6 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
150
50
|
* @returns {RewardAdNovel}
|
|
151
51
|
*/
|
|
152
52
|
static "new"(args: IConstructArgs): RewardAdNovel;
|
|
153
|
-
/**
|
|
154
|
-
* @param {IConstructArgs} args
|
|
155
|
-
*
|
|
156
|
-
*/
|
|
157
|
-
constructor(args: IConstructArgs);
|
|
158
53
|
_onHalfway: any;
|
|
159
54
|
_onShow: any;
|
|
160
55
|
_onFinish: any;
|
|
@@ -281,6 +176,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
281
176
|
/**
|
|
282
177
|
* 广告展示失败分析
|
|
283
178
|
* 子类需要埋点可以选择覆盖此方法
|
|
179
|
+
* ATTENTION:该方法可能会调用两次,一次是show().catch(),一次是onError(),所以需要做好去重处理
|
|
284
180
|
* @protected
|
|
285
181
|
* @param {object} _args
|
|
286
182
|
* @param {string} _args.scene 广告执行场景 必填
|
|
@@ -187,11 +187,19 @@ export type IConstructArgs = {
|
|
|
187
187
|
/**
|
|
188
188
|
* 初始化标识
|
|
189
189
|
*/
|
|
190
|
-
sign
|
|
190
|
+
sign?: string;
|
|
191
191
|
/**
|
|
192
192
|
* 是否保留tt激励视频广告实例
|
|
193
193
|
*/
|
|
194
|
-
preserveOnEnd
|
|
194
|
+
preserveOnEnd?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* 是否需要在超时情况下结束广告
|
|
197
|
+
*/
|
|
198
|
+
needEndOnTimeout?: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* 是否需要在错误情况下查询剩余次数
|
|
201
|
+
*/
|
|
202
|
+
lookUpRemainOnError?: boolean;
|
|
195
203
|
/**
|
|
196
204
|
* 激励视频参数 (可选)
|
|
197
205
|
*/
|
package/package.json
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@singcl/ad-execute-manager",
|
|
3
|
-
"version": "1.13.
|
|
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
|
-
"packages:install": "node build-packages.js install",
|
|
59
|
-
"packages:build": "node build-packages.js build",
|
|
60
|
-
"packages:publish": "node build-packages.js publish",
|
|
61
|
-
"packages:publish:patch": "node build-packages.js publish patch",
|
|
62
|
-
"packages:publish:minor": "node build-packages.js publish minor",
|
|
63
|
-
"packages:publish:major": "node build-packages.js publish major",
|
|
64
|
-
"packages:lint": "node build-packages.js lint",
|
|
65
|
-
"packages:format": "node build-packages.js format",
|
|
66
|
-
"packages:clean": "node build-packages.js clean",
|
|
67
|
-
"packages:all": "node build-packages.js all",
|
|
68
|
-
"packages:all:patch": "node build-packages.js all patch",
|
|
69
|
-
"packages:all:minor": "node build-packages.js all minor",
|
|
70
|
-
"packages:all:major": "node build-packages.js all major"
|
|
71
|
-
},
|
|
72
|
-
"devDependencies": {
|
|
73
|
-
"@babel/eslint-parser": "^7.28.5",
|
|
74
|
-
"@babel/preset-env": "^7.28.5",
|
|
75
|
-
"@douyin-microapp/typings": "^1.3.1",
|
|
76
|
-
"@eslint/js": "^9.39.1",
|
|
77
|
-
"@rslib/core": "^0.18.5",
|
|
78
|
-
"@rstest/core": "^0.7.2",
|
|
79
|
-
"@singcl/ad-execute-manager": "^1.11.12",
|
|
80
|
-
"eslint": "^9.39.2",
|
|
81
|
-
"eslint-plugin-import": "^2.32.0",
|
|
82
|
-
"globals": "^16.5.0",
|
|
83
|
-
"prettier": "^3.7.3",
|
|
84
|
-
"typescript": "^5.9.3"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@singcl/ad-execute-manager",
|
|
3
|
+
"version": "1.13.3",
|
|
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
|
+
"packages:install": "node build-packages.js install",
|
|
59
|
+
"packages:build": "node build-packages.js build",
|
|
60
|
+
"packages:publish": "node build-packages.js publish",
|
|
61
|
+
"packages:publish:patch": "node build-packages.js publish patch",
|
|
62
|
+
"packages:publish:minor": "node build-packages.js publish minor",
|
|
63
|
+
"packages:publish:major": "node build-packages.js publish major",
|
|
64
|
+
"packages:lint": "node build-packages.js lint",
|
|
65
|
+
"packages:format": "node build-packages.js format",
|
|
66
|
+
"packages:clean": "node build-packages.js clean",
|
|
67
|
+
"packages:all": "node build-packages.js all",
|
|
68
|
+
"packages:all:patch": "node build-packages.js all patch",
|
|
69
|
+
"packages:all:minor": "node build-packages.js all minor",
|
|
70
|
+
"packages:all:major": "node build-packages.js all major"
|
|
71
|
+
},
|
|
72
|
+
"devDependencies": {
|
|
73
|
+
"@babel/eslint-parser": "^7.28.5",
|
|
74
|
+
"@babel/preset-env": "^7.28.5",
|
|
75
|
+
"@douyin-microapp/typings": "^1.3.1",
|
|
76
|
+
"@eslint/js": "^9.39.1",
|
|
77
|
+
"@rslib/core": "^0.18.5",
|
|
78
|
+
"@rstest/core": "^0.7.2",
|
|
79
|
+
"@singcl/ad-execute-manager": "^1.11.12",
|
|
80
|
+
"eslint": "^9.39.2",
|
|
81
|
+
"eslint-plugin-import": "^2.32.0",
|
|
82
|
+
"globals": "^16.5.0",
|
|
83
|
+
"prettier": "^3.7.3",
|
|
84
|
+
"typescript": "^5.9.3"
|
|
85
|
+
}
|
|
86
|
+
}
|