@singcl/ad-execute-manager 2.0.0-alpha.0 → 2.0.1
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/README.md +558 -199
- package/dist/ad/dist/index.d.cts +1 -0
- package/dist/ad/dist/index.d.ts +229 -0
- package/dist/ad/{InterstitialAdFather.d.ts → src/InterstitialAdFather.d.ts} +42 -10
- package/dist/ad/{InterstitialAdNovel.d.ts → src/InterstitialAdNovel.d.ts} +12 -8
- package/dist/ad/{RewardAdFather.d.ts → src/RewardAdFather.d.ts} +60 -10
- package/dist/ad/{RewardAdNovel.d.ts → src/RewardAdNovel.d.ts} +113 -24
- package/dist/ad/src/index.d.ts +5 -0
- package/dist/{typings → ad/src/typings}/ad.d.ts +28 -8
- package/dist/ad/src/typings/create-interstitial-ad.d.ts +42 -0
- package/dist/ad/src/typings/create-rewarded-video-ad.d.ts +42 -0
- package/dist/analytics/dist/index.d.cts +1 -0
- package/dist/analytics/dist/index.d.ts +23 -0
- package/dist/{helper → analytics/src}/AdAnalyticsJS.d.ts +9 -0
- package/dist/analytics/src/index.d.ts +1 -0
- package/dist/core/dist/index.d.cts +1 -0
- package/dist/core/dist/index.d.ts +41 -0
- package/dist/core/src/AdExecuteManager.d.ts +252 -0
- package/dist/core/src/_util.d.ts +18 -0
- package/dist/core/{index.d.ts → src/index.d.ts} +0 -1
- package/dist/core/src/typings/ad.d.ts +208 -0
- package/dist/core/typings/ad.d.ts +208 -0
- package/dist/helper/dist/index.d.cts +1 -0
- package/dist/helper/dist/index.d.ts +96 -0
- package/dist/helper/{PubSub.d.ts → src/PubSub.d.ts} +1 -1
- package/dist/helper/{SerializableError.d.ts → src/SerializableError.d.ts} +5 -1
- package/dist/helper/src/index.d.ts +6 -0
- package/dist/index.cjs +2 -1
- package/dist/index.d.ts +14 -14
- package/dist/index.js +2 -1
- package/dist/tools/dist/index.d.cts +1 -0
- package/dist/tools/dist/index.d.ts +69 -0
- package/dist/{helper → tools/src}/RewardAdGlobalRecorder.d.ts +2 -2
- package/dist/{helper → tools/src}/RewardAdSceneTriggerManager.d.ts +16 -10
- 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 +208 -0
- package/dist/tools/src/typings/common.d.ts +14 -0
- package/dist/tools/src/typings/create-interstitial-ad.d.ts +42 -0
- package/dist/tools/src/typings/create-rewarded-video-ad.d.ts +42 -0
- package/dist/tools/src/typings/tracker.d.ts +1 -0
- package/package.json +33 -22
- package/dist/ad/index.d.ts +0 -4
- package/dist/core/AdExecuteManager.d.ts +0 -129
- package/dist/helper/index.d.ts +0 -10
- package/dist/subpackages/ad/index.js +0 -1
- package/dist/subpackages/core/index.js +0 -1
- package/dist/subpackages/helper/index.js +0 -1
- package/dist/subpackages/utils/index.js +0 -1
- /package/dist/{const → ad/src/const}/const.d.ts +0 -0
- /package/dist/{typings → ad/src/typings}/common.d.ts +0 -0
- /package/dist/{typings → ad/src/typings}/tracker.d.ts +0 -0
- /package/dist/{utils → ad/src/utils}/functional.d.ts +0 -0
- /package/dist/core/{compose.d.ts → src/compose.d.ts} +0 -0
- /package/dist/helper/{CountRecorder.d.ts → src/CountRecorder.d.ts} +0 -0
- /package/dist/helper/{EventEmitter.d.ts → src/EventEmitter.d.ts} +0 -0
- /package/dist/helper/{Logger.d.ts → src/Logger.d.ts} +0 -0
- /package/dist/helper/{Storage.d.ts → src/Storage.d.ts} +0 -0
- /package/dist/{helper → tools/src}/LovelUnlockManager.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const __esModule: boolean;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { AdExecuteManager as e } from "@ad-execute-manager/core";
|
|
2
|
+
declare let r: typeof l;
|
|
3
|
+
declare let A: typeof c;
|
|
4
|
+
declare let n: typeof s;
|
|
5
|
+
declare let _: typeof h;
|
|
6
|
+
declare class l {
|
|
7
|
+
static args: any;
|
|
8
|
+
static buildArgs(e: any): void;
|
|
9
|
+
static executeWithManager(t: any, r: any): Promise<any>;
|
|
10
|
+
constructor(e: any);
|
|
11
|
+
_logger: any;
|
|
12
|
+
_initSign: string;
|
|
13
|
+
_preserveOnEnd: boolean;
|
|
14
|
+
_interstitialAd: any;
|
|
15
|
+
__ad__: any;
|
|
16
|
+
_ttErrorMsgs: string[];
|
|
17
|
+
_ttErrorCodes: number[];
|
|
18
|
+
_adConfig: any;
|
|
19
|
+
initialize(e: any, i: any): this;
|
|
20
|
+
initialized(): boolean;
|
|
21
|
+
ad(e: any, i?: any): Promise<void>;
|
|
22
|
+
addExecuteManager(e: any): Promise<any>;
|
|
23
|
+
destroy(): void;
|
|
24
|
+
clear(): void;
|
|
25
|
+
record(e: any): this;
|
|
26
|
+
onClose(e: any): void;
|
|
27
|
+
offClose(e: any): void;
|
|
28
|
+
show(): any;
|
|
29
|
+
load(): any;
|
|
30
|
+
onError(e: any): void;
|
|
31
|
+
offError(e: any): void;
|
|
32
|
+
onLoad(e: any): void;
|
|
33
|
+
offLoad(e: any): void;
|
|
34
|
+
placeholder(): any;
|
|
35
|
+
}
|
|
36
|
+
declare class c extends l {
|
|
37
|
+
static build(e: any): any;
|
|
38
|
+
static getInstance(): any;
|
|
39
|
+
static "new"(e: any): c;
|
|
40
|
+
_onHalfway: any;
|
|
41
|
+
_onShow: any;
|
|
42
|
+
_onFinish: any;
|
|
43
|
+
_onAlways: any;
|
|
44
|
+
_onError: any;
|
|
45
|
+
_alwaysCallback: any;
|
|
46
|
+
_halfwayCallback: any;
|
|
47
|
+
_finishedCallback: any;
|
|
48
|
+
_resolve: any;
|
|
49
|
+
_next: any;
|
|
50
|
+
_scene: any;
|
|
51
|
+
_adTypeR: number;
|
|
52
|
+
_adTimeout: any;
|
|
53
|
+
_adTimeoutTime: number;
|
|
54
|
+
_adBeforeShowTimer: any;
|
|
55
|
+
_adBeforeShowTime: number;
|
|
56
|
+
_adSpeedCloseTimer: any;
|
|
57
|
+
_adSpeedCloseTime: number;
|
|
58
|
+
_needEndOnTimeout: boolean;
|
|
59
|
+
_needSpeedEndOnTimeout: boolean;
|
|
60
|
+
bindAdCloseLister: any;
|
|
61
|
+
bindAdErrorLister: any;
|
|
62
|
+
bindAdLoadLister: any;
|
|
63
|
+
bindApiAdErrorLister: any;
|
|
64
|
+
_bindShiftCloseLister: any;
|
|
65
|
+
_bindShiftErrorLister: any;
|
|
66
|
+
initialize(e: any, i: any): this;
|
|
67
|
+
_initAdLister(): void;
|
|
68
|
+
_initNovelConfig(e: any): void;
|
|
69
|
+
novelConfig: f;
|
|
70
|
+
_onInnerExecuteBefore(): any;
|
|
71
|
+
_onInnerAdShowSuccess(): any;
|
|
72
|
+
_setAdTimeout(e: any): void;
|
|
73
|
+
_adPreludeInterval(e: any): void;
|
|
74
|
+
_clearAdTimeout(): void;
|
|
75
|
+
_adShowBeforeAnalytics(e: any): any;
|
|
76
|
+
_adShowSuccessAnalytics(e: any): any;
|
|
77
|
+
_adShowFailureAnalytics(e: any): any;
|
|
78
|
+
_adLoadSuccessAnalytics(e: any): any;
|
|
79
|
+
_adLoadFailureAnalytics(e: any): any;
|
|
80
|
+
_adCloseSuccessAnalytics(e: any): any;
|
|
81
|
+
get rewardAd(): any;
|
|
82
|
+
ad(e: any, i?: any): Promise<any>;
|
|
83
|
+
_adInner(e: any, i?: any): void;
|
|
84
|
+
_before: any;
|
|
85
|
+
_success: any;
|
|
86
|
+
adLoad(): any;
|
|
87
|
+
adShow(): any;
|
|
88
|
+
_outerCloseCallback(e: any): void;
|
|
89
|
+
_outerHalfwayCallback(e: any): void;
|
|
90
|
+
_outerFinishedCallback(e: any): void;
|
|
91
|
+
adCloseLister(): void;
|
|
92
|
+
adErrorLister(e: any): void;
|
|
93
|
+
apiAdErrorLister(e: any): void;
|
|
94
|
+
adLoadLister(e: any): void;
|
|
95
|
+
adDestroy(): void;
|
|
96
|
+
_shiftCloseLister(e: any): void;
|
|
97
|
+
_shiftErrorLister(e: any): void;
|
|
98
|
+
shift(): void;
|
|
99
|
+
}
|
|
100
|
+
declare class s {
|
|
101
|
+
static args: any;
|
|
102
|
+
static buildArgs(e: any): void;
|
|
103
|
+
static executeWithManager(t: any, l: any): Promise<any>;
|
|
104
|
+
constructor(e: any);
|
|
105
|
+
_logger: any;
|
|
106
|
+
_adTimeoutTime: number;
|
|
107
|
+
_initSign: string;
|
|
108
|
+
_preserveOnEnd: boolean;
|
|
109
|
+
_rewardAd: any;
|
|
110
|
+
__ad__: any;
|
|
111
|
+
_ttErrorMsgs: string[];
|
|
112
|
+
_ttErrorCodes: number[];
|
|
113
|
+
__bindAdErrorForeverHandler: any;
|
|
114
|
+
_adConfig: any;
|
|
115
|
+
initialize(e: any, i: any): this;
|
|
116
|
+
initialized(): boolean;
|
|
117
|
+
__adErrorForeverHandler(e: any): void;
|
|
118
|
+
adErrorForeverHandler(e: any): any;
|
|
119
|
+
ad(e: any, i?: any): Promise<void>;
|
|
120
|
+
addExecuteManager(e: any): Promise<any>;
|
|
121
|
+
destroy(): void;
|
|
122
|
+
clear(): void;
|
|
123
|
+
record(e: any): this;
|
|
124
|
+
onClose(e: any): void;
|
|
125
|
+
offClose(e: any): void;
|
|
126
|
+
show(): any;
|
|
127
|
+
load(): any;
|
|
128
|
+
onError(e: any): void;
|
|
129
|
+
offError(e: any): void;
|
|
130
|
+
onLoad(e: any): void;
|
|
131
|
+
offLoad(e: any): void;
|
|
132
|
+
placeholder(): any;
|
|
133
|
+
}
|
|
134
|
+
declare class h extends s {
|
|
135
|
+
static build(e: any): any;
|
|
136
|
+
static getInstance(): any;
|
|
137
|
+
static "new"(e: any): h;
|
|
138
|
+
_onHalfway: any;
|
|
139
|
+
_onShow: any;
|
|
140
|
+
_onFinish: any;
|
|
141
|
+
_onAlways: any;
|
|
142
|
+
_onError: any;
|
|
143
|
+
_alwaysCallback: any;
|
|
144
|
+
_halfwayCallback: any;
|
|
145
|
+
_finishedCallback: any;
|
|
146
|
+
_resolve: any;
|
|
147
|
+
_next: any;
|
|
148
|
+
_scene: any;
|
|
149
|
+
_adTypeR: number;
|
|
150
|
+
_adTimeout: any;
|
|
151
|
+
_adBeforeShowTimer: any;
|
|
152
|
+
_adBeforeShowTime: number;
|
|
153
|
+
_adSpeedCloseTimer: any;
|
|
154
|
+
_adSpeedCloseTime: number;
|
|
155
|
+
_needEndOnTimeout: boolean;
|
|
156
|
+
_needSpeedEndOnTimeout: boolean;
|
|
157
|
+
bindAdCloseLister: any;
|
|
158
|
+
bindAdErrorLister: any;
|
|
159
|
+
bindAdLoadLister: any;
|
|
160
|
+
bindApiAdErrorLister: any;
|
|
161
|
+
_bindShiftCloseLister: any;
|
|
162
|
+
_bindShiftErrorLister: any;
|
|
163
|
+
initialize(e: any, i: any): this;
|
|
164
|
+
_initAdLister(): void;
|
|
165
|
+
_initNovelConfig(e: any): void;
|
|
166
|
+
novelConfig: u;
|
|
167
|
+
_onInnerExecuteBefore(): any;
|
|
168
|
+
_onInnerAdShowSuccess(e: any): any;
|
|
169
|
+
_setAdTimeout(e: any): void;
|
|
170
|
+
_adTimeoutBeforeEnd(e: any): any;
|
|
171
|
+
_adPreludeInterval(e: any): void;
|
|
172
|
+
_clearAdTimeout(): void;
|
|
173
|
+
_adShowBeforeAnalytics(e: any): any;
|
|
174
|
+
_adShowSuccessAnalytics(e: any): any;
|
|
175
|
+
_adShowFailureAnalytics(e: any): any;
|
|
176
|
+
_adLoadSuccessAnalytics(e: any): any;
|
|
177
|
+
_adLoadFailureAnalytics(e: any): any;
|
|
178
|
+
_adCloseSuccessAnalytics(e: any): any;
|
|
179
|
+
get rewardAd(): any;
|
|
180
|
+
ad(e: any, i?: any): Promise<any>;
|
|
181
|
+
_recovered: any;
|
|
182
|
+
_adInner(e: any, i?: any): void;
|
|
183
|
+
_before: any;
|
|
184
|
+
_success: any;
|
|
185
|
+
adLoad(): any;
|
|
186
|
+
adShow(): any;
|
|
187
|
+
_outerCloseCallback(e: any): void;
|
|
188
|
+
_outerHalfwayCallback(e: any): void;
|
|
189
|
+
_outerFinishedCallback(e: any): void;
|
|
190
|
+
__adCloseLister__(e: any): void;
|
|
191
|
+
adCloseLister(e: any, i: any): void;
|
|
192
|
+
__adErrorLister__(e: any): void;
|
|
193
|
+
adErrorLister(e: any): any;
|
|
194
|
+
__apiAdErrorLister__(e: any): void;
|
|
195
|
+
apiAdErrorLister(e: any): any;
|
|
196
|
+
__adLoadLister__(e: any): void;
|
|
197
|
+
adLoadLister(e: any): any;
|
|
198
|
+
adDestroy(): void;
|
|
199
|
+
_shiftCloseLister(e: any): void;
|
|
200
|
+
_shiftErrorLister(e: any): void;
|
|
201
|
+
shift(): void;
|
|
202
|
+
}
|
|
203
|
+
declare class f {
|
|
204
|
+
static "new"(e: any): f;
|
|
205
|
+
constructor(e: any);
|
|
206
|
+
frequency: {
|
|
207
|
+
total: number;
|
|
208
|
+
current: number;
|
|
209
|
+
};
|
|
210
|
+
_init(e: any): void;
|
|
211
|
+
_adTimes(e: any): void;
|
|
212
|
+
reset(): void;
|
|
213
|
+
updateRetry(): void;
|
|
214
|
+
remain(): number;
|
|
215
|
+
}
|
|
216
|
+
declare class u {
|
|
217
|
+
static "new"(e: any): u;
|
|
218
|
+
constructor(e: any);
|
|
219
|
+
frequency: {
|
|
220
|
+
total: number;
|
|
221
|
+
current: number;
|
|
222
|
+
};
|
|
223
|
+
_init(e: any): void;
|
|
224
|
+
_adTimes(e: any): void;
|
|
225
|
+
reset(): void;
|
|
226
|
+
updateRetry(): void;
|
|
227
|
+
remain(): number;
|
|
228
|
+
}
|
|
229
|
+
export { e as AdExecuteManager, r as InterstitialAdFather, A as InterstitialAdNovel, n as RewardAdFather, _ as RewardAdNovel };
|
|
@@ -1,7 +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
|
+
/**
|
|
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
|
-
|
|
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
|
-
|
|
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("
|
|
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('
|
|
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('
|
|
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("
|
|
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('
|
|
345
|
-
* @param {import('
|
|
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("
|
|
351
|
-
collection?: import("
|
|
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("
|
|
3
|
-
export type CallbackCollection = import("
|
|
4
|
-
export type
|
|
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
|
-
|
|
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
|
-
|
|
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';
|