@singcl/ad-execute-manager 1.12.8 → 1.13.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.
- package/dist/ad/src/index.d.ts +3 -0
- package/dist/{ad → ad-interstitial/src}/InterstitialAdFather.d.ts +15 -15
- package/dist/{ad → ad-interstitial/src}/InterstitialAdNovel.d.ts +17 -13
- package/dist/ad-interstitial/src/index.d.ts +3 -0
- package/dist/{ad → ad-reward/src}/RewardAdFather.d.ts +18 -18
- package/dist/{ad → ad-reward/src}/RewardAdNovel.d.ts +126 -33
- package/dist/ad-reward/src/const/const.d.ts +20 -0
- package/dist/ad-reward/src/index.d.ts +3 -0
- package/dist/ad-reward/src/typings/ad.d.ts +221 -0
- package/dist/ad-reward/src/typings/common.d.ts +14 -0
- package/dist/ad-reward/src/utils/functional.d.ts +13 -0
- package/dist/analytics/{AdAnalyticsJS.d.ts → src/AdAnalyticsJS.d.ts} +1 -1
- package/dist/analytics/src/index.d.ts +1 -0
- package/dist/core/{AdExecuteManager.d.ts → src/AdExecuteManager.d.ts} +5 -5
- package/dist/core/src/index.d.ts +1 -0
- package/dist/core/src/typings/ad.d.ts +218 -0
- package/dist/{helper → count-recorder/src}/CountRecorder.d.ts +1 -1
- package/dist/count-recorder/src/index.d.ts +1 -0
- package/dist/{helper → event/src}/PubSub.d.ts +1 -1
- package/dist/event/src/index.d.ts +2 -0
- package/dist/helper/src/index.d.ts +4 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +12 -14
- package/dist/index.js +2 -2
- package/dist/logger/src/index.d.ts +1 -0
- package/dist/serializable-error/src/index.d.ts +1 -0
- package/dist/{helper → storage/src}/Storage.d.ts +1 -1
- package/dist/storage/src/index.d.ts +1 -0
- package/dist/{other → tools/src}/RewardAdGlobalRecorder.d.ts +2 -2
- package/dist/{other → tools/src}/RewardAdSceneTriggerManager.d.ts +11 -11
- package/dist/tools/src/const.d.ts +3 -0
- package/dist/tools/src/index.d.ts +3 -0
- package/dist/tools/src/typings/ad.d.ts +204 -0
- package/package.json +15 -2
- package/dist/typings/tracker.d.ts +0 -1
- /package/dist/{const → ad-interstitial/src/const}/const.d.ts +0 -0
- /package/dist/{typings → ad-interstitial/src/typings}/ad.d.ts +0 -0
- /package/dist/{typings → ad-interstitial/src/typings}/common.d.ts +0 -0
- /package/dist/{typings → ad-interstitial/src/typings}/create-interstitial-ad.d.ts +0 -0
- /package/dist/{utils → ad-interstitial/src/utils}/functional.d.ts +0 -0
- /package/dist/{typings → ad-reward/src/typings}/create-rewarded-video-ad.d.ts +0 -0
- /package/dist/core/{_util.d.ts → src/_util.d.ts} +0 -0
- /package/dist/core/{compose.d.ts → src/compose.d.ts} +0 -0
- /package/dist/{helper → event/src}/EventEmitter.d.ts +0 -0
- /package/dist/{helper → logger/src}/Logger.d.ts +0 -0
- /package/dist/{helper → serializable-error/src}/SerializableError.d.ts +0 -0
- /package/dist/{other → tools/src}/LovelUnlockManager.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export default InterstitialAdFather;
|
|
2
|
-
export type IRewordAdConfig = import("
|
|
3
|
-
export type CallbackCollection = import("
|
|
4
|
-
export type IConstructArgs = import("
|
|
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
5
|
/**
|
|
6
6
|
* 激励视频实例
|
|
7
7
|
*/
|
|
8
|
-
export type InterstitialAd = import("
|
|
8
|
+
export type InterstitialAd = import("./typings/create-interstitial-ad.js").InterstitialAd;
|
|
9
9
|
export type IRewardedVideoAd = {
|
|
10
10
|
/**
|
|
11
11
|
* 显示激励视频广告
|
|
@@ -27,13 +27,13 @@ declare class InterstitialAdFather {
|
|
|
27
27
|
* 使用管理器执行广告
|
|
28
28
|
* @param {Object} adInstance 广告实例
|
|
29
29
|
* @param {Object} ctx 上下文对象,用于传递数据和状态
|
|
30
|
-
* @param {
|
|
31
|
-
* @param {CallbackCollection}
|
|
30
|
+
* @param {import('./typings/ad.js').IAdOptions} ctx.options 广告执行选项
|
|
31
|
+
* @param {CallbackCollection} ctx.collection 回调集合
|
|
32
32
|
*/
|
|
33
33
|
static executeWithManager(adInstance: any, ctx: {
|
|
34
|
-
options
|
|
35
|
-
collection
|
|
36
|
-
}): Promise<import("
|
|
34
|
+
options: import("./typings/ad.js").IAdOptions;
|
|
35
|
+
collection: CallbackCollection;
|
|
36
|
+
}): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
|
|
37
37
|
[key: string]: any;
|
|
38
38
|
}>;
|
|
39
39
|
/**
|
|
@@ -61,11 +61,11 @@ declare class InterstitialAdFather {
|
|
|
61
61
|
/**
|
|
62
62
|
* 初始化
|
|
63
63
|
* 子类可以选择覆盖此方法,或使用默认实现
|
|
64
|
-
* @param {
|
|
64
|
+
* @param {import('./typings/ad.js').IAdOptions} params
|
|
65
65
|
* @param {(v: IRewardedVideoAd) => void} [callback] 初始化成功回调
|
|
66
66
|
* @returns {this} 当前实例
|
|
67
67
|
*/
|
|
68
|
-
initialize(params:
|
|
68
|
+
initialize(params: import("./typings/ad.js").IAdOptions, callback?: (v: IRewardedVideoAd) => void): this;
|
|
69
69
|
initialized(): boolean;
|
|
70
70
|
/**
|
|
71
71
|
* 执行广告展示
|
|
@@ -84,13 +84,13 @@ declare class InterstitialAdFather {
|
|
|
84
84
|
/**
|
|
85
85
|
* 确保广告按顺序执行
|
|
86
86
|
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
87
|
-
* @param {
|
|
87
|
+
* @param {import('./typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
|
|
88
88
|
* @param {CallbackCollection} [ctx.collection] 回调集合
|
|
89
89
|
*/
|
|
90
90
|
addExecuteManager(ctx?: {
|
|
91
|
-
options?:
|
|
91
|
+
options?: import("./typings/ad.js").IAdOptions;
|
|
92
92
|
collection?: CallbackCollection;
|
|
93
|
-
}): Promise<import("
|
|
93
|
+
}): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
|
|
94
94
|
[key: string]: any;
|
|
95
95
|
}>;
|
|
96
96
|
destroy(): void;
|
|
@@ -162,4 +162,4 @@ declare class InterstitialAdFather {
|
|
|
162
162
|
*/
|
|
163
163
|
placeholder(): any;
|
|
164
164
|
}
|
|
165
|
-
import { Logger } from '
|
|
165
|
+
import { Logger } from '@ad-execute-manager/logger';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export default InterstitialAdNovel;
|
|
2
|
+
export type IRewordAdConfig = import("./typings/ad.js").IRewordAdConfig;
|
|
2
3
|
export type ICallbackArgs = {
|
|
3
4
|
/**
|
|
4
5
|
* 广告执行场景
|
|
@@ -62,7 +63,7 @@ export type IConstructArgs = {
|
|
|
62
63
|
/**
|
|
63
64
|
* 激励视频参数 (可选)
|
|
64
65
|
*/
|
|
65
|
-
adConfig?:
|
|
66
|
+
adConfig?: IRewordAdConfig | undefined;
|
|
66
67
|
/**
|
|
67
68
|
* 回调集合
|
|
68
69
|
*/
|
|
@@ -84,6 +85,9 @@ export type IRewardedVideoAd = {
|
|
|
84
85
|
*/
|
|
85
86
|
show: () => Promise<void>;
|
|
86
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* @typedef {import('./typings/ad.js').IRewordAdConfig} IRewordAdConfig
|
|
90
|
+
*/
|
|
87
91
|
/**
|
|
88
92
|
* @typedef ICallbackArgs
|
|
89
93
|
* @property {number} scene 广告执行场景
|
|
@@ -106,7 +110,7 @@ export type IRewardedVideoAd = {
|
|
|
106
110
|
* @property {string} [sign] 初始化标识
|
|
107
111
|
* @property {boolean} [preserveOnEnd] 是否保留tt激励视频广告实例
|
|
108
112
|
* @property {boolean} [needEndOnTimeout] 是否需要在超时情况下结束广告
|
|
109
|
-
* @property {
|
|
113
|
+
* @property {IRewordAdConfig=} [adConfig] 激励视频参数 (可选)
|
|
110
114
|
* @property {IConnection=} [collection] 回调集合
|
|
111
115
|
*/
|
|
112
116
|
/**
|
|
@@ -172,11 +176,11 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
|
|
|
172
176
|
/**
|
|
173
177
|
* 初始化
|
|
174
178
|
* 子类可以选择覆盖此方法,或使用默认实现
|
|
175
|
-
* @param {import('
|
|
179
|
+
* @param {import('./typings/ad.js').IAdOptions} args
|
|
176
180
|
* @param {(v: IRewardedVideoAd) => void} [callback] 初始化成功回调
|
|
177
181
|
* @returns {this} 当前实例
|
|
178
182
|
*/
|
|
179
|
-
initialize(args: import("
|
|
183
|
+
initialize(args: import("./typings/ad.js").IAdOptions, callback?: (v: IRewardedVideoAd) => void): this;
|
|
180
184
|
_initAdLister(): void;
|
|
181
185
|
/**
|
|
182
186
|
* @param {object} args
|
|
@@ -300,13 +304,13 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
|
|
|
300
304
|
* 确保广告按顺序执行
|
|
301
305
|
* @override
|
|
302
306
|
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
303
|
-
* @param {import('
|
|
304
|
-
* @param {import('
|
|
307
|
+
* @param {import('. /typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
|
|
308
|
+
* @param {import('./typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
|
|
305
309
|
*/
|
|
306
310
|
override addExecuteManager(ctx?: {
|
|
307
|
-
options?:
|
|
308
|
-
collection?: import("
|
|
309
|
-
}): Promise<import("
|
|
311
|
+
options?: any;
|
|
312
|
+
collection?: import("./typings/ad.js").CallbackCollection;
|
|
313
|
+
}): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
|
|
310
314
|
[key: string]: any;
|
|
311
315
|
}>;
|
|
312
316
|
/**
|
|
@@ -314,14 +318,14 @@ declare class InterstitialAdNovel extends InterstitialAdFather {
|
|
|
314
318
|
* 此时将进入超时处理逻辑
|
|
315
319
|
* @override
|
|
316
320
|
* @param {object} [ctx] 广告执行上下文
|
|
317
|
-
* @param {import('
|
|
318
|
-
* @param {import('
|
|
321
|
+
* @param {import('./typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
|
|
322
|
+
* @param {import('./typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
|
|
319
323
|
* @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
|
|
320
324
|
* @returns {Promise.<object | Undefined>}
|
|
321
325
|
*/
|
|
322
326
|
override ad(ctx?: {
|
|
323
|
-
options?: import("
|
|
324
|
-
collection?: import("
|
|
327
|
+
options?: import("./typings/ad.js").IAdOptions;
|
|
328
|
+
collection?: import("./typings/ad.js").CallbackCollection;
|
|
325
329
|
}, next?: Function): Promise<object | undefined>;
|
|
326
330
|
/**
|
|
327
331
|
* ATTENTION: 应用一旦进入后台,90%概率.show() 方法的.then() 回调将不会被执行, .catch() 回调也不会被执行。
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export default RewardAdFather;
|
|
2
|
-
export type IRewordAdConfig = import("
|
|
3
|
-
export type CallbackCollection = import("
|
|
4
|
-
export type RecoveredInfo = import("
|
|
5
|
-
export type IConstructArgs = import("
|
|
6
|
-
export type RewardedVideoAd = import("
|
|
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;
|
|
7
7
|
export type IRewardedVideoAd = {
|
|
8
8
|
/**
|
|
9
9
|
* 显示激励视频广告
|
|
@@ -25,13 +25,13 @@ declare class RewardAdFather {
|
|
|
25
25
|
* 使用管理器执行广告
|
|
26
26
|
* @param {Object} adInstance 广告实例
|
|
27
27
|
* @param {Object} ctx 上下文对象,用于传递数据和状态
|
|
28
|
-
* @param {
|
|
29
|
-
* @param {CallbackCollection}
|
|
28
|
+
* @param {import('./typings/ad.js').IAdOptions} ctx.options 广告执行选项
|
|
29
|
+
* @param {CallbackCollection} ctx.collection 回调集合
|
|
30
30
|
*/
|
|
31
31
|
static executeWithManager(adInstance: any, ctx: {
|
|
32
|
-
options
|
|
33
|
-
collection
|
|
34
|
-
}): Promise<import("
|
|
32
|
+
options: import("./typings/ad.js").IAdOptions;
|
|
33
|
+
collection: CallbackCollection;
|
|
34
|
+
}): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
|
|
35
35
|
[key: string]: any;
|
|
36
36
|
}>;
|
|
37
37
|
/**
|
|
@@ -61,11 +61,11 @@ declare class RewardAdFather {
|
|
|
61
61
|
/**
|
|
62
62
|
* 初始化
|
|
63
63
|
* 子类可以选择覆盖此方法,或使用默认实现
|
|
64
|
-
* @param {import('
|
|
64
|
+
* @param {import('./typings/ad.js').IAdOptions} params
|
|
65
65
|
* @param {(v: IRewardedVideoAd) => void} [callback] 初始化成功回调
|
|
66
66
|
* @returns {this} 当前实例
|
|
67
67
|
*/
|
|
68
|
-
initialize(params: import("
|
|
68
|
+
initialize(params: import("./typings/ad.js").IAdOptions, callback?: (v: IRewardedVideoAd) => void): this;
|
|
69
69
|
initialized(): boolean;
|
|
70
70
|
/**
|
|
71
71
|
* 激励视频展示失败时始终执行的一个方法
|
|
@@ -87,7 +87,7 @@ declare class RewardAdFather {
|
|
|
87
87
|
* 执行广告展示
|
|
88
88
|
* @abstract
|
|
89
89
|
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
90
|
-
* @param {
|
|
90
|
+
* @param {import('./typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
|
|
91
91
|
* @param {CallbackCollection} [ctx.collection] 回调集合
|
|
92
92
|
* @param {RecoveredInfo} [ctx.recovered] 恢复重试信息
|
|
93
93
|
* @param {Function} next 执行下一个任务的回调函数,在洋葱模型中手动调用以继续执行流程
|
|
@@ -95,20 +95,20 @@ declare class RewardAdFather {
|
|
|
95
95
|
* @throws {Error} 子类必须实现此方法
|
|
96
96
|
*/
|
|
97
97
|
ad(ctx?: {
|
|
98
|
-
options?:
|
|
98
|
+
options?: import("./typings/ad.js").IAdOptions;
|
|
99
99
|
collection?: CallbackCollection;
|
|
100
100
|
recovered?: RecoveredInfo;
|
|
101
101
|
}, next?: Function): Promise<unknown>;
|
|
102
102
|
/**
|
|
103
103
|
* 确保广告按顺序执行
|
|
104
104
|
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
105
|
-
* @param {
|
|
105
|
+
* @param {import('./typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
|
|
106
106
|
* @param {CallbackCollection} [ctx.collection] 回调集合
|
|
107
107
|
*/
|
|
108
108
|
addExecuteManager(ctx?: {
|
|
109
|
-
options?:
|
|
109
|
+
options?: import("./typings/ad.js").IAdOptions;
|
|
110
110
|
collection?: CallbackCollection;
|
|
111
|
-
}): Promise<import("
|
|
111
|
+
}): Promise<import("@ad-execute-manager/core/dist/AdExecuteManager.js").ITaskResult & {
|
|
112
112
|
[key: string]: any;
|
|
113
113
|
}>;
|
|
114
114
|
destroy(): void;
|
|
@@ -180,4 +180,4 @@ declare class RewardAdFather {
|
|
|
180
180
|
*/
|
|
181
181
|
placeholder(): any;
|
|
182
182
|
}
|
|
183
|
-
import { Logger } from '
|
|
183
|
+
import { Logger } from '@ad-execute-manager/logger';
|
|
@@ -1,6 +1,82 @@
|
|
|
1
1
|
export default RewardAdNovel;
|
|
2
|
-
export type IRewordAdConfig = import("
|
|
3
|
-
export type
|
|
2
|
+
export type IRewordAdConfig = import("./typings/ad.js").IRewordAdConfig;
|
|
3
|
+
export type ICallbackArgs = {
|
|
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
|
+
};
|
|
4
80
|
export type ICloseArgs = {
|
|
5
81
|
/**
|
|
6
82
|
* 是否看完
|
|
@@ -18,10 +94,34 @@ export type IRewardedVideoAd = {
|
|
|
18
94
|
show: () => Promise<void>;
|
|
19
95
|
};
|
|
20
96
|
/**
|
|
21
|
-
* @typedef {import('
|
|
97
|
+
* @typedef {import('./typings/ad.js').IRewordAdConfig} IRewordAdConfig
|
|
22
98
|
*/
|
|
23
99
|
/**
|
|
24
|
-
* @typedef
|
|
100
|
+
* @typedef ICallbackArgs
|
|
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] 回调集合
|
|
25
125
|
*/
|
|
26
126
|
/**
|
|
27
127
|
* @typedef ICloseArgs
|
|
@@ -50,6 +150,11 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
50
150
|
* @returns {RewardAdNovel}
|
|
51
151
|
*/
|
|
52
152
|
static "new"(args: IConstructArgs): RewardAdNovel;
|
|
153
|
+
/**
|
|
154
|
+
* @param {IConstructArgs} args
|
|
155
|
+
*
|
|
156
|
+
*/
|
|
157
|
+
constructor(args: IConstructArgs);
|
|
53
158
|
_onHalfway: any;
|
|
54
159
|
_onShow: any;
|
|
55
160
|
_onFinish: any;
|
|
@@ -69,6 +174,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
69
174
|
_adSpeedCloseTimer: any;
|
|
70
175
|
_adSpeedCloseTime: number;
|
|
71
176
|
_needEndOnTimeout: boolean;
|
|
177
|
+
_lookUpRemainOnError: boolean;
|
|
72
178
|
/** @deprecated TODO 移除 */
|
|
73
179
|
_needSpeedEndOnTimeout: boolean;
|
|
74
180
|
bindAdCloseLister: any;
|
|
@@ -80,11 +186,11 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
80
186
|
/**
|
|
81
187
|
* 初始化
|
|
82
188
|
* 子类可以选择覆盖此方法,或使用默认实现
|
|
83
|
-
* @param {
|
|
189
|
+
* @param {import('./typings/ad.js').IAdOptions} args
|
|
84
190
|
* @param {(v: IRewardedVideoAd) => void} [callback] 初始化成功回调
|
|
85
191
|
* @returns {this} 当前实例
|
|
86
192
|
*/
|
|
87
|
-
initialize(args:
|
|
193
|
+
initialize(args: import("./typings/ad.js").IAdOptions, callback?: (v: IRewardedVideoAd) => void): this;
|
|
88
194
|
_initAdLister(): void;
|
|
89
195
|
/**
|
|
90
196
|
* @param {object} args
|
|
@@ -99,13 +205,13 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
99
205
|
* @param {object} _args
|
|
100
206
|
* @param {string} _args.scene 广告执行场景 必填
|
|
101
207
|
* @param {number} [_args.result] 广告执行成功结果 必填
|
|
102
|
-
* @param {import('
|
|
208
|
+
* @param {import('./typings/ad.js').RecoveredInfo} [_args.recovered] 恢复重试信息
|
|
103
209
|
* @returns
|
|
104
210
|
*/
|
|
105
211
|
_onInnerAdShowSuccess(_args: {
|
|
106
212
|
scene: string;
|
|
107
213
|
result?: number;
|
|
108
|
-
recovered?: import("
|
|
214
|
+
recovered?: import("./typings/ad.js").RecoveredInfo;
|
|
109
215
|
}): any;
|
|
110
216
|
/**
|
|
111
217
|
* 广告展示超时设置
|
|
@@ -163,14 +269,14 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
163
269
|
* @param {string} _args.scene 广告执行场景 必填
|
|
164
270
|
* @param {string} [_args.msg] 广告执行成功原因
|
|
165
271
|
* @param {0|1} _args.result 广告执行成功结果 必填
|
|
166
|
-
* @param {import('
|
|
272
|
+
* @param {import('./typings/ad.js').RecoveredInfo} [_args.recovered] 恢复重试信息
|
|
167
273
|
* @returns
|
|
168
274
|
*/
|
|
169
275
|
protected _adShowSuccessAnalytics(_args: {
|
|
170
276
|
scene: string;
|
|
171
277
|
msg?: string;
|
|
172
278
|
result: 0 | 1;
|
|
173
|
-
recovered?: import("
|
|
279
|
+
recovered?: import("./typings/ad.js").RecoveredInfo;
|
|
174
280
|
}): any;
|
|
175
281
|
/**
|
|
176
282
|
* 广告展示失败分析
|
|
@@ -241,42 +347,29 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
241
347
|
ad_is_completed: number;
|
|
242
348
|
ad_count: number;
|
|
243
349
|
}): any;
|
|
244
|
-
get rewardAd(): import("
|
|
245
|
-
/**
|
|
246
|
-
* 确保广告按顺序执行
|
|
247
|
-
* @override
|
|
248
|
-
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
249
|
-
* @param {import('../typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
|
|
250
|
-
* @param {import('../typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
|
|
251
|
-
*/
|
|
252
|
-
override addExecuteManager(ctx?: {
|
|
253
|
-
options?: import("../typings/ad.js").IAdOptions;
|
|
254
|
-
collection?: import("../typings/ad.js").CallbackCollection;
|
|
255
|
-
}): Promise<import("../core/AdExecuteManager.js").ITaskResult & {
|
|
256
|
-
[key: string]: any;
|
|
257
|
-
}>;
|
|
350
|
+
get rewardAd(): import("./typings/create-rewarded-video-ad.js").RewardedVideoAd;
|
|
258
351
|
/**
|
|
259
352
|
* @override
|
|
260
353
|
* @param {object} [ctx] 广告执行上下文
|
|
261
|
-
* @param {import('
|
|
262
|
-
* @param {import('
|
|
263
|
-
* @param {import('
|
|
354
|
+
* @param {import('./typings/ad.js').IAdOptions} [ctx.options] 广告执行选项
|
|
355
|
+
* @param {import('./typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
|
|
356
|
+
* @param {import('./typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
|
|
264
357
|
* @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
|
|
265
358
|
* @returns {Promise.<object | Undefined>}
|
|
266
359
|
*/
|
|
267
360
|
override ad(ctx?: {
|
|
268
|
-
options?: import("
|
|
269
|
-
collection?: import("
|
|
270
|
-
recovered?: import("
|
|
361
|
+
options?: import("./typings/ad.js").IAdOptions;
|
|
362
|
+
collection?: import("./typings/ad.js").CallbackCollection;
|
|
363
|
+
recovered?: import("./typings/ad.js").RecoveredInfo;
|
|
271
364
|
}, next?: Function): Promise<object | undefined>;
|
|
272
|
-
_recovered: import("
|
|
365
|
+
_recovered: import("./typings/ad.js").RecoveredInfo;
|
|
273
366
|
/**
|
|
274
367
|
* @param {object} [ctx] 广告执行上下文
|
|
275
368
|
* @param {object} [ctx.options] 广告执行选项
|
|
276
369
|
* @param {number} [ctx.options.scene] 广告执行场景 必填
|
|
277
370
|
* @param {number} [ctx.options.timeout] 广告超时时间 单位ms
|
|
278
371
|
* @param {object} ctx.collection 回调集合
|
|
279
|
-
* @param {import('
|
|
372
|
+
* @param {import('./typings/ad.js').RecoveredInfo} [ctx.recovered] 恢复重试信息
|
|
280
373
|
* @param {(v?: unknown) => void} ctx.collection.resolve 广告执行成功的回调函数
|
|
281
374
|
* @param {(v?: unknown) => void} [ctx.collection.reject] 广告执行失败的回调函数
|
|
282
375
|
* @param {(v?: unknown) => void} [ctx.collection.before] 广告执行前的回调函数
|
|
@@ -290,7 +383,7 @@ declare class RewardAdNovel extends RewardAdFather {
|
|
|
290
383
|
timeout?: number;
|
|
291
384
|
};
|
|
292
385
|
collection: object;
|
|
293
|
-
recovered?: import("
|
|
386
|
+
recovered?: import("./typings/ad.js").RecoveredInfo;
|
|
294
387
|
}, next?: Function): void;
|
|
295
388
|
_before: any;
|
|
296
389
|
_success: any;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 广告场景类型映射对象
|
|
3
|
+
* @type {import('../typings/ad.js').SceneTypeMap}
|
|
4
|
+
*/
|
|
5
|
+
export const DEFAULT_SCENT_TYPE_OBJ: import("../typings/ad.js").SceneTypeMap;
|
|
6
|
+
/**
|
|
7
|
+
* 广告场景文本映射对象
|
|
8
|
+
* @type {import('../typings/ad.js').SceneTextMap}
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_SCENT_TEXT_OBJ: import("../typings/ad.js").SceneTextMap;
|
|
11
|
+
/**
|
|
12
|
+
* 用户类型文本映射对象(反向映射)
|
|
13
|
+
* @type {import('../typings/common.js').IAdType}
|
|
14
|
+
*/
|
|
15
|
+
export const AD_TYPE_ENUM: import("../typings/common.js").IAdType;
|
|
16
|
+
/**
|
|
17
|
+
* 广告类型文本映射对象(反向映射)
|
|
18
|
+
* @type {import('../typings/common.js').IAdTypeReverse}
|
|
19
|
+
*/
|
|
20
|
+
export const AD_TYPE_ENUM_REVERSE: import("../typings/common.js").IAdTypeReverse;
|