@singcl/ad-execute-manager 1.0.4 → 1.0.6
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/AdExecuteManager.d.ts +115 -0
- package/dist/ad/AdUnlock/RewardAdNovelUnlock.d.ts +110 -0
- package/dist/ad/AdUnlock/UnlockSettings.d.ts +42 -0
- package/dist/ad/CommonSettings.d.ts +179 -0
- package/dist/ad/CountRecorder.d.ts +50 -0
- package/dist/ad/ExbAnalyticsJS.d.ts +131 -0
- package/dist/ad/Logger.d.ts +34 -0
- package/dist/ad/LovelUnlockManager.d.ts +233 -0
- package/dist/ad/RewardAdFather.d.ts +123 -0
- package/dist/ad/RewardAdGlobalRecorder.d.ts +111 -0
- package/dist/ad/RewardAdLaunch.d.ts +87 -0
- package/dist/ad/RewardAdLaunchAlone.d.ts +59 -0
- package/dist/ad/RewardAdNovel.d.ts +373 -0
- package/dist/ad/RewardAdReadingLoad.d.ts +80 -0
- package/dist/ad/RewardAdReadingUnload.d.ts +46 -0
- package/dist/ad/RewardAdSceneTriggerManager.d.ts +65 -0
- package/dist/ad/SerializableError.d.ts +9 -0
- package/dist/ad/Storage.d.ts +98 -0
- package/dist/ad/compose.d.ts +12 -0
- package/dist/ad/const.d.ts +10 -0
- package/dist/index.d.ts +6 -0
- package/dist/typings/ad.d.ts +193 -0
- package/dist/typings/tracker.d.ts +115 -0
- package/dist/utils/functional.d.ts +13 -0
- package/package.json +8 -5
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
export default LovelUnlockManager;
|
|
2
|
+
export type InitSign = "bookStore" | "reader" | "bookIntro";
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {'bookStore'|'reader'|'bookIntro'} InitSign
|
|
5
|
+
*/
|
|
6
|
+
declare class LovelUnlockManager {
|
|
7
|
+
static instance: any;
|
|
8
|
+
/**
|
|
9
|
+
* @static
|
|
10
|
+
* @param {object} args
|
|
11
|
+
* @param {InitSign} args.sign 初始化标识
|
|
12
|
+
* @param {number} args.unlockChapterThreshold 单次解锁章节阈值
|
|
13
|
+
* @param {number} args.unlockChapterNum 解锁章节数
|
|
14
|
+
* @param {number} args.unlockChapterWaterLevel 解锁章节水滴阈值
|
|
15
|
+
*/
|
|
16
|
+
static build(args: {
|
|
17
|
+
sign: InitSign;
|
|
18
|
+
unlockChapterThreshold: number;
|
|
19
|
+
unlockChapterNum: number;
|
|
20
|
+
unlockChapterWaterLevel: number;
|
|
21
|
+
}): any;
|
|
22
|
+
/**
|
|
23
|
+
* @static
|
|
24
|
+
* @returns {LovelUnlockManager}
|
|
25
|
+
*/
|
|
26
|
+
static getInstance(): LovelUnlockManager;
|
|
27
|
+
/**
|
|
28
|
+
* @param {object} args
|
|
29
|
+
* @param {InitSign} args.sign 初始化标识
|
|
30
|
+
* @param {number} args.unlockChapterThreshold 单次解锁章节阈值
|
|
31
|
+
* @param {number} args.unlockChapterNum 解锁章节数
|
|
32
|
+
* @param {number} args.unlockChapterWaterLevel 解锁章节水滴阈值
|
|
33
|
+
*/
|
|
34
|
+
static "new"(args: {
|
|
35
|
+
sign: InitSign;
|
|
36
|
+
unlockChapterThreshold: number;
|
|
37
|
+
unlockChapterNum: number;
|
|
38
|
+
unlockChapterWaterLevel: number;
|
|
39
|
+
}): LovelUnlockManager;
|
|
40
|
+
/**
|
|
41
|
+
* @param {object} args
|
|
42
|
+
* @param {InitSign} args.sign 初始化标识
|
|
43
|
+
* @param {number} args.unlockChapterThreshold 单次解锁章节阈值
|
|
44
|
+
* @param {number} args.unlockChapterNum 解锁章节数
|
|
45
|
+
* @param {number} args.unlockChapterWaterLevel 解锁章节水滴阈值
|
|
46
|
+
*/
|
|
47
|
+
constructor(args: {
|
|
48
|
+
sign: InitSign;
|
|
49
|
+
unlockChapterThreshold: number;
|
|
50
|
+
unlockChapterNum: number;
|
|
51
|
+
unlockChapterWaterLevel: number;
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* 初始化标识 'bookStore' | 'reader' | 'bookIntro'
|
|
55
|
+
* @access private
|
|
56
|
+
*/
|
|
57
|
+
_initSign: string;
|
|
58
|
+
/**
|
|
59
|
+
* 剧情详情数据
|
|
60
|
+
* @access private
|
|
61
|
+
* @type {Array.<DramaDetailRecord>}
|
|
62
|
+
*/
|
|
63
|
+
_dramaDetailData: Array<{
|
|
64
|
+
/**
|
|
65
|
+
* 章节id
|
|
66
|
+
*/
|
|
67
|
+
episodeId: string;
|
|
68
|
+
/**
|
|
69
|
+
* 1 已解锁 0 未解锁 null 未解锁
|
|
70
|
+
*/
|
|
71
|
+
flagTag: number | null;
|
|
72
|
+
/**
|
|
73
|
+
* 章节名称
|
|
74
|
+
*/
|
|
75
|
+
albumId: string;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* 单次解锁章节阈值
|
|
79
|
+
* @access private
|
|
80
|
+
*/
|
|
81
|
+
_unlockChapterThreshold: number;
|
|
82
|
+
/**
|
|
83
|
+
* 解锁章节数
|
|
84
|
+
* @access private
|
|
85
|
+
*/
|
|
86
|
+
_unlockChapterNum: number;
|
|
87
|
+
/**
|
|
88
|
+
* 解锁章节水滴阈值
|
|
89
|
+
* @access private
|
|
90
|
+
*/
|
|
91
|
+
_unlockChapterWaterLevel: number;
|
|
92
|
+
/**
|
|
93
|
+
* 是否达到阈值
|
|
94
|
+
* @access private
|
|
95
|
+
*/
|
|
96
|
+
_isReachThreshold: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* 已经解锁的章节id数组
|
|
99
|
+
* @access private
|
|
100
|
+
* @type {Array.<string>}
|
|
101
|
+
*/
|
|
102
|
+
_unlockedIdArr: Array<string>;
|
|
103
|
+
/**
|
|
104
|
+
* 设置剧情详情数据
|
|
105
|
+
* @param {Array.<DramaDetailRecord>} value 剧情详情数据
|
|
106
|
+
*/
|
|
107
|
+
set drama(value: Array<{
|
|
108
|
+
/**
|
|
109
|
+
* 章节id
|
|
110
|
+
*/
|
|
111
|
+
episodeId: string;
|
|
112
|
+
/**
|
|
113
|
+
* 1 已解锁 0 未解锁 null 未解锁
|
|
114
|
+
*/
|
|
115
|
+
flagTag: number | null;
|
|
116
|
+
/**
|
|
117
|
+
* 章节名称
|
|
118
|
+
*/
|
|
119
|
+
albumId: string;
|
|
120
|
+
}>);
|
|
121
|
+
/**
|
|
122
|
+
* @typedef {object} DramaDetailRecord
|
|
123
|
+
* @property {string} episodeId 章节id
|
|
124
|
+
* @property {number | null} flagTag 1 已解锁 0 未解锁 null 未解锁
|
|
125
|
+
* @property {string} albumId 章节名称
|
|
126
|
+
*/
|
|
127
|
+
/**
|
|
128
|
+
* 获取剧情详情数据
|
|
129
|
+
* @returns {Array.<DramaDetailRecord>} 剧情详情数据
|
|
130
|
+
*/
|
|
131
|
+
get drama(): Array<{
|
|
132
|
+
/**
|
|
133
|
+
* 章节id
|
|
134
|
+
*/
|
|
135
|
+
episodeId: string;
|
|
136
|
+
/**
|
|
137
|
+
* 1 已解锁 0 未解锁 null 未解锁
|
|
138
|
+
*/
|
|
139
|
+
flagTag: number | null;
|
|
140
|
+
/**
|
|
141
|
+
* 章节名称
|
|
142
|
+
*/
|
|
143
|
+
albumId: string;
|
|
144
|
+
}>;
|
|
145
|
+
/**
|
|
146
|
+
* 设置是否达到阈值
|
|
147
|
+
* @access private
|
|
148
|
+
* @param {Array.<DramaDetailRecord>} value 剧情详情数据
|
|
149
|
+
*/
|
|
150
|
+
_checkReachThreshold(v?: any[]): void;
|
|
151
|
+
/**
|
|
152
|
+
* 判断达到阈值
|
|
153
|
+
* @access private
|
|
154
|
+
* @returns
|
|
155
|
+
*/
|
|
156
|
+
_isUnlockThreshold(): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* 从指定chapterId开始解锁指定数量的章节,前后章节数量相等
|
|
159
|
+
* @access private
|
|
160
|
+
* @param {string} chapterId 章节id
|
|
161
|
+
* @param {number} count 解锁章节数量
|
|
162
|
+
* @returns {Array.<string>} 解锁的章节id数组
|
|
163
|
+
*/
|
|
164
|
+
_unlockChapterIds(chapterId: string, count?: number): Array<string>;
|
|
165
|
+
/**
|
|
166
|
+
* 从指定chapterId开始解锁指定数量的章节,增加水位
|
|
167
|
+
* @access private
|
|
168
|
+
* @param {string} chapterId 章节id
|
|
169
|
+
* @param {number} count 解锁章节数量
|
|
170
|
+
* @returns {Array.<string> | undefined} 解锁的章节id数组
|
|
171
|
+
*/
|
|
172
|
+
_unlockChapterIdsWithWater(chapterId: string, count?: number): Array<string> | undefined;
|
|
173
|
+
/**
|
|
174
|
+
* 判断是否达到解锁阈值,走不同的逻辑
|
|
175
|
+
* @access public
|
|
176
|
+
* @param {() => void} callback 原逻辑【达到阈值前】回调函数
|
|
177
|
+
* @param {(ids: Array.<string>) => void} [callbackThreshold] 新逻辑【达到阈值后】回调函数
|
|
178
|
+
* @param {string} [chapterId] 章节id
|
|
179
|
+
*/
|
|
180
|
+
ready(callback: () => void, callbackThreshold?: (ids: Array<string>) => void, chapterId?: string): void;
|
|
181
|
+
/**
|
|
182
|
+
* @typedef {object} ProcessUpdateResult
|
|
183
|
+
* @property {string} chapterId 章节id
|
|
184
|
+
* @property {number} percent 当前章节的阅读进度
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* 章节阅读进度更新
|
|
188
|
+
* @access public
|
|
189
|
+
* @param {ProcessUpdateResult} r 当前章节的阅读进度
|
|
190
|
+
* @param {(ids: Array.<string>) => void} callback 达到阈值后回调函数
|
|
191
|
+
*/
|
|
192
|
+
onProcessUpdate(r: {
|
|
193
|
+
/**
|
|
194
|
+
* 章节id
|
|
195
|
+
*/
|
|
196
|
+
chapterId: string;
|
|
197
|
+
/**
|
|
198
|
+
* 当前章节的阅读进度
|
|
199
|
+
*/
|
|
200
|
+
percent: number;
|
|
201
|
+
}, callback: (ids: Array<string>) => void): void;
|
|
202
|
+
/**
|
|
203
|
+
* @typedef {object} ChapterChangeResult
|
|
204
|
+
* @property {string} currentChapterId 变化前的章节ID
|
|
205
|
+
* @property {string} nextChapterId 变化后的章节ID
|
|
206
|
+
* @property {string} [nextOutChapterId] 开发者自己的章节ID
|
|
207
|
+
*/
|
|
208
|
+
/**
|
|
209
|
+
* 章节变化
|
|
210
|
+
* @access public
|
|
211
|
+
* @param {ChapterChangeResult} r 当前章节的阅读进度
|
|
212
|
+
* @param {(ids: Array.<string>) => void} callback 达到阈值后回调函数
|
|
213
|
+
*/
|
|
214
|
+
onChapterChange(r: {
|
|
215
|
+
/**
|
|
216
|
+
* 变化前的章节ID
|
|
217
|
+
*/
|
|
218
|
+
currentChapterId: string;
|
|
219
|
+
/**
|
|
220
|
+
* 变化后的章节ID
|
|
221
|
+
*/
|
|
222
|
+
nextChapterId: string;
|
|
223
|
+
/**
|
|
224
|
+
* 开发者自己的章节ID
|
|
225
|
+
*/
|
|
226
|
+
nextOutChapterId?: string;
|
|
227
|
+
}, callback: (ids: Array<string>) => void): void;
|
|
228
|
+
/**
|
|
229
|
+
* 解锁所有章节
|
|
230
|
+
* @access public
|
|
231
|
+
*/
|
|
232
|
+
unlockAll(): void;
|
|
233
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export default RewardAdFather;
|
|
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
|
+
export type IRewardedVideoAd = {
|
|
6
|
+
/**
|
|
7
|
+
* 显示激励视频广告
|
|
8
|
+
*/
|
|
9
|
+
show: () => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @typedef IRewardedVideoAd
|
|
13
|
+
* @property {() => Promise.<void>} show 显示激励视频广告
|
|
14
|
+
*/
|
|
15
|
+
declare class RewardAdFather {
|
|
16
|
+
/** @type {IRewordAdConfig | null} */
|
|
17
|
+
static args: IRewordAdConfig | null;
|
|
18
|
+
/**
|
|
19
|
+
* @param {IRewordAdConfig} args
|
|
20
|
+
*/
|
|
21
|
+
static buildArgs(args: IRewordAdConfig): void;
|
|
22
|
+
/**
|
|
23
|
+
* 使用管理器执行广告
|
|
24
|
+
* @param {Object} adInstance 广告实例
|
|
25
|
+
* @param {Object} ctx 上下文对象,用于传递数据和状态
|
|
26
|
+
* @param {Object} ctx.options 广告执行选项
|
|
27
|
+
* @param {Object} ctx.options.log 是否打印日志
|
|
28
|
+
* @param {Object} ctx.collection 回调集合
|
|
29
|
+
* @returns {Promise} 广告执行结果的Promise
|
|
30
|
+
*/
|
|
31
|
+
static executeWithManager(adInstance: any, ctx: {
|
|
32
|
+
options: {
|
|
33
|
+
log: any;
|
|
34
|
+
};
|
|
35
|
+
collection: any;
|
|
36
|
+
}): Promise<any>;
|
|
37
|
+
/**
|
|
38
|
+
* @param {IConstructArgs} args
|
|
39
|
+
*/
|
|
40
|
+
constructor(args: IConstructArgs);
|
|
41
|
+
_initSign: string;
|
|
42
|
+
_preserveOnEnd: boolean;
|
|
43
|
+
_rewardAd: any;
|
|
44
|
+
_ttErrorMsgs: string[];
|
|
45
|
+
_ttErrorCodes: number[];
|
|
46
|
+
_adConfig: {};
|
|
47
|
+
/**
|
|
48
|
+
* 初始化
|
|
49
|
+
* 子类可以选择覆盖此方法,或使用默认实现
|
|
50
|
+
* @param {IRewordAdConfig} params
|
|
51
|
+
* @param {(v: IRewardedVideoAd) => void} [callback] 初始化成功回调
|
|
52
|
+
* @returns {this} 当前实例
|
|
53
|
+
*/
|
|
54
|
+
initialize(params: IRewordAdConfig, callback?: (v: IRewardedVideoAd) => void): this;
|
|
55
|
+
initialized(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* 执行广告展示
|
|
58
|
+
* @abstract
|
|
59
|
+
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
60
|
+
* @param {IRewordAdConfig} [ctx.options] 广告执行选项
|
|
61
|
+
* @param {CallbackCollection} [ctx.collection] 回调集合
|
|
62
|
+
* @param {Function} next 执行下一个任务的回调函数,在洋葱模型中手动调用以继续执行流程
|
|
63
|
+
* @returns {Promise<unknown>} 广告执行结果的Promise
|
|
64
|
+
* @throws {Error} 子类必须实现此方法
|
|
65
|
+
*/
|
|
66
|
+
ad(ctx?: {
|
|
67
|
+
options?: IRewordAdConfig;
|
|
68
|
+
collection?: CallbackCollection;
|
|
69
|
+
}, next?: Function): Promise<unknown>;
|
|
70
|
+
/**
|
|
71
|
+
* 确保广告按顺序执行
|
|
72
|
+
* @template T
|
|
73
|
+
* @param {T} value - 泛型参数
|
|
74
|
+
* @param {Object} [ctx] 上下文对象,用于传递数据和状态
|
|
75
|
+
* @param {IRewordAdConfig} [ctx.options] 广告执行选项
|
|
76
|
+
* @param {CallbackCollection} [ctx.collection] 回调集合
|
|
77
|
+
* @returns {Promise.<T>} 广告执行结果的Promise
|
|
78
|
+
*/
|
|
79
|
+
addExecuteManager<T>(ctx?: {
|
|
80
|
+
options?: IRewordAdConfig;
|
|
81
|
+
collection?: CallbackCollection;
|
|
82
|
+
}): Promise<T>;
|
|
83
|
+
destroy(): void;
|
|
84
|
+
clear(): void;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @param {({isEnded: boolean, count: number}) => void} callback
|
|
88
|
+
*/
|
|
89
|
+
onClose(callback: ({ isEnded: boolean, count: number }: any) => void): void;
|
|
90
|
+
/**
|
|
91
|
+
*
|
|
92
|
+
* @param {({isEnded: boolean, count: number}) => void} callback
|
|
93
|
+
*/
|
|
94
|
+
offClose(callback: ({ isEnded: boolean, count: number }: any) => void): void;
|
|
95
|
+
/**
|
|
96
|
+
* show
|
|
97
|
+
* @returns { Promise.<void>}
|
|
98
|
+
* @params {{errMsg: string; errCode: number}} err
|
|
99
|
+
*/
|
|
100
|
+
show(): Promise<void>;
|
|
101
|
+
/**
|
|
102
|
+
* show
|
|
103
|
+
* @returns { Promise.<void>}
|
|
104
|
+
*/
|
|
105
|
+
load(): Promise<void>;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @param {({errMsg: string; errCode: number}) => void} callback
|
|
109
|
+
*/
|
|
110
|
+
onError(callback: any): void;
|
|
111
|
+
/**
|
|
112
|
+
*
|
|
113
|
+
* @param {({errMsg: string; errCode: number}) => void} callback
|
|
114
|
+
*/
|
|
115
|
+
offError(callback: any): void;
|
|
116
|
+
onLoad(callback: any): void;
|
|
117
|
+
offLoad(callback: any): void;
|
|
118
|
+
/**
|
|
119
|
+
* 站位方法,没有任何左右
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
placeholder(): any;
|
|
123
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export default RewardAdGlobalRecorder;
|
|
2
|
+
export type RecordType = "halfway" | "finished" | "completed";
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {'halfway' | 'finished' | 'completed'} RecordType
|
|
5
|
+
*/
|
|
6
|
+
declare class RewardAdGlobalRecorder {
|
|
7
|
+
static instance: any;
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {object} args
|
|
11
|
+
* @param {InitSign} args.sign 初始化标识
|
|
12
|
+
* @returns {RewardAdGlobalRecorder}
|
|
13
|
+
*/
|
|
14
|
+
static build(args: {
|
|
15
|
+
sign: InitSign;
|
|
16
|
+
}): RewardAdGlobalRecorder;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @returns {RewardAdGlobalRecorder}
|
|
20
|
+
*/
|
|
21
|
+
static getInstance(): RewardAdGlobalRecorder;
|
|
22
|
+
/**
|
|
23
|
+
* @param {object} args
|
|
24
|
+
* @param {string} args.sign 初始化标识
|
|
25
|
+
*/
|
|
26
|
+
constructor(args: {
|
|
27
|
+
sign: string;
|
|
28
|
+
});
|
|
29
|
+
_initSign: string;
|
|
30
|
+
_halfway: {
|
|
31
|
+
scene: 6;
|
|
32
|
+
count: number;
|
|
33
|
+
}[];
|
|
34
|
+
_finished: {
|
|
35
|
+
scene: 6;
|
|
36
|
+
count: number;
|
|
37
|
+
}[];
|
|
38
|
+
/**
|
|
39
|
+
* @param {object} args
|
|
40
|
+
* @param {string} args.sign 初始化标识
|
|
41
|
+
*/
|
|
42
|
+
initialize(args: {
|
|
43
|
+
sign: string;
|
|
44
|
+
}): void;
|
|
45
|
+
/**
|
|
46
|
+
* 找到相同的场景值,如果没有则新增
|
|
47
|
+
* @param {object} args
|
|
48
|
+
* @param {RecordType} args.type
|
|
49
|
+
* @param {number} args.scene
|
|
50
|
+
*/
|
|
51
|
+
_halfwayUpdate(args: {
|
|
52
|
+
type: RecordType;
|
|
53
|
+
scene: number;
|
|
54
|
+
}): void;
|
|
55
|
+
/**
|
|
56
|
+
* @param {object} args
|
|
57
|
+
* @param {number[]} args.scenes
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
_halfwayGet(args: {
|
|
61
|
+
scenes: number[];
|
|
62
|
+
}): number;
|
|
63
|
+
_halfwayReset(): void;
|
|
64
|
+
/**
|
|
65
|
+
* 找到相同的场景值,如果没有则新增
|
|
66
|
+
* @param {object} args
|
|
67
|
+
* @param {RecordType} args.type
|
|
68
|
+
* @param {number} args.scene
|
|
69
|
+
*/
|
|
70
|
+
_finishedUpdate(args: {
|
|
71
|
+
type: RecordType;
|
|
72
|
+
scene: number;
|
|
73
|
+
}): void;
|
|
74
|
+
/**
|
|
75
|
+
* @param {object} args
|
|
76
|
+
* @param {number[]} args.scenes
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
_finishedGet(args: {
|
|
80
|
+
scenes: number[];
|
|
81
|
+
}): number;
|
|
82
|
+
_finishedReset(): void;
|
|
83
|
+
/**
|
|
84
|
+
* @param {object} args
|
|
85
|
+
* @param {RecordType} args.type
|
|
86
|
+
* @param {number} args.scene
|
|
87
|
+
*/
|
|
88
|
+
record(args: {
|
|
89
|
+
type: RecordType;
|
|
90
|
+
scene: number;
|
|
91
|
+
}): void;
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @param {RecordType} type
|
|
95
|
+
*/
|
|
96
|
+
rest(type: RecordType): void;
|
|
97
|
+
/**
|
|
98
|
+
* @param {object} args
|
|
99
|
+
* @param {number[]} [args.scenes]
|
|
100
|
+
* @param {RecordType} args.type
|
|
101
|
+
*/
|
|
102
|
+
get(args: {
|
|
103
|
+
scenes?: number[];
|
|
104
|
+
type: RecordType;
|
|
105
|
+
}): number;
|
|
106
|
+
/**
|
|
107
|
+
* 站位方法,没有任何左右
|
|
108
|
+
* @returns
|
|
109
|
+
*/
|
|
110
|
+
placeholder(): any;
|
|
111
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export default RewardAdLaunch;
|
|
2
|
+
export type IRewordAdConfig = import("../typings/ad.js").IRewordAdConfig;
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('../typings/ad.js').IRewordAdConfig} IRewordAdConfig
|
|
5
|
+
*/
|
|
6
|
+
declare class RewardAdLaunch extends RewardAdNovel {
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param {IConstructArgs} args
|
|
10
|
+
* @returns {RewardAdLaunch}
|
|
11
|
+
*/
|
|
12
|
+
static build(args: IConstructArgs): RewardAdLaunch;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @returns {RewardAdLaunch}
|
|
16
|
+
*/
|
|
17
|
+
static getInstance(): RewardAdLaunch;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param {IConstructArgs} args
|
|
21
|
+
* @returns {RewardAdLaunch}
|
|
22
|
+
*/
|
|
23
|
+
static "new"(args: IConstructArgs): RewardAdLaunch;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {Promise.<unknown>}
|
|
27
|
+
*/
|
|
28
|
+
static ad: Promise<unknown>;
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
* @param {object} options 启动参数
|
|
32
|
+
* @param {string} options.path 启动路径
|
|
33
|
+
* @param {object} options.query 启动参数
|
|
34
|
+
* @param {string} options.query.promotionid 推广参数
|
|
35
|
+
* @param {(args: { options: object } | null) => Promise.<void>} callback 回调
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
static satisfy(options: {
|
|
39
|
+
path: string;
|
|
40
|
+
query: {
|
|
41
|
+
promotionid: string;
|
|
42
|
+
};
|
|
43
|
+
}, callback: (args: {
|
|
44
|
+
options: object;
|
|
45
|
+
} | null) => Promise<void>): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* @param {object} args
|
|
48
|
+
* @param {string} args.sign 初始化标识
|
|
49
|
+
*/
|
|
50
|
+
constructor(args: {
|
|
51
|
+
sign: string;
|
|
52
|
+
});
|
|
53
|
+
_scene: 0;
|
|
54
|
+
launchSettings: RewardAdLaunchSettings;
|
|
55
|
+
}
|
|
56
|
+
import RewardAdNovel from './RewardAdNovel';
|
|
57
|
+
declare class RewardAdLaunchSettings {
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param {object} args
|
|
61
|
+
* @param {InitSign} args.sign 初始化标识
|
|
62
|
+
* @returns {RewardAdLaunchSettings}
|
|
63
|
+
*/
|
|
64
|
+
static "new"(args: {
|
|
65
|
+
sign: InitSign;
|
|
66
|
+
}): RewardAdLaunchSettings;
|
|
67
|
+
_fixedFrequency: any;
|
|
68
|
+
frequency: {
|
|
69
|
+
total: number;
|
|
70
|
+
current: number;
|
|
71
|
+
};
|
|
72
|
+
commonSettings: CommonSettings;
|
|
73
|
+
countRecorder: CountRecorder;
|
|
74
|
+
/**
|
|
75
|
+
* 获取启动广告的展示次数
|
|
76
|
+
* @returns {number} 启动广告的展示次数配置,如果没有配置则返回0
|
|
77
|
+
*/
|
|
78
|
+
_adTimes(): number;
|
|
79
|
+
updateToday(): void;
|
|
80
|
+
updateFrequency(): void;
|
|
81
|
+
remainFrequency(): number;
|
|
82
|
+
timesPerFrequency(): number;
|
|
83
|
+
_remain(): number;
|
|
84
|
+
condition(): boolean;
|
|
85
|
+
}
|
|
86
|
+
import CommonSettings from './CommonSettings';
|
|
87
|
+
import { CountRecorder } from './CountRecorder';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export default RewardAdLaunchAlone;
|
|
2
|
+
export type IRewordAdConfig = import("../typings/ad.js").IRewordAdConfig;
|
|
3
|
+
export type CallbackCollection = import("../typings/ad.js").CallbackCollection;
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('../typings/ad.js').IRewordAdConfig} IRewordAdConfig
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {import('../typings/ad.js').CallbackCollection} CallbackCollection
|
|
9
|
+
*/
|
|
10
|
+
declare class RewardAdLaunchAlone extends RewardAdNovel {
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @param {IConstructArgs} args
|
|
14
|
+
* @returns {RewardAdLaunchAlone}
|
|
15
|
+
*/
|
|
16
|
+
static build(args: IConstructArgs): RewardAdLaunchAlone;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* @returns {RewardAdLaunchAlone}
|
|
20
|
+
*/
|
|
21
|
+
static getInstance(): RewardAdLaunchAlone;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param {IConstructArgs} args
|
|
25
|
+
* @returns {RewardAdLaunchAlone}
|
|
26
|
+
*/
|
|
27
|
+
static "new"(args: IConstructArgs): RewardAdLaunchAlone;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {Promise.<unknown>}
|
|
31
|
+
*/
|
|
32
|
+
static ad: Promise<unknown>;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param {object} options 启动参数
|
|
36
|
+
* @param {string} options.path 启动路径
|
|
37
|
+
* @param {object} options.query 启动参数
|
|
38
|
+
* @param {string} options.query.promotionid 推广参数
|
|
39
|
+
* @param {() => Promise.<void>} callback 回调
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
static satisfy(options: {
|
|
43
|
+
path: string;
|
|
44
|
+
query: {
|
|
45
|
+
promotionid: string;
|
|
46
|
+
};
|
|
47
|
+
}, callback: () => Promise<void>): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* @param {object} args
|
|
50
|
+
* @param {string} args.sign 初始化标识
|
|
51
|
+
* @param {IRewordAdConfig=} args.adConfig 激励视频参数 (可选)
|
|
52
|
+
*/
|
|
53
|
+
constructor(args: {
|
|
54
|
+
sign: string;
|
|
55
|
+
adConfig?: IRewordAdConfig | undefined;
|
|
56
|
+
});
|
|
57
|
+
_scene: 9;
|
|
58
|
+
}
|
|
59
|
+
import RewardAdNovel from './RewardAdNovel';
|