@singcl/ad-execute-manager 1.0.12 → 1.0.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singcl/ad-execute-manager",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,114 +0,0 @@
1
- export default RewardAdNovelUnlock;
2
- export type IRewordAdConfig = any;
3
- export type ICallbackArgs = any;
4
- export type IConnection = {
5
- /**
6
- * 广告中途退出回调
7
- */
8
- onHalfway?: (args: ICallbackArgs) => void;
9
- /**
10
- * 广告展示回调
11
- */
12
- onShow?: (args: ICallbackArgs) => void;
13
- /**
14
- * 广告执行成功回调
15
- */
16
- onFinish?: (args: ICallbackArgs) => void;
17
- /**
18
- * 广告执行成功或失败回调
19
- */
20
- onAlways?: (args: ICallbackArgs) => void;
21
- /**
22
- * 广告执行失败回调
23
- */
24
- onError?: (e: unknown) => void;
25
- };
26
- export type ICloseArgs = {
27
- /**
28
- * 是否看完
29
- */
30
- isEnded: boolean;
31
- /**
32
- * 完整观看次数
33
- */
34
- count: number;
35
- };
36
- export type IConstructArgs = {
37
- /**
38
- * 初始化标识
39
- */
40
- sign: string;
41
- /**
42
- * 解锁设置
43
- */
44
- unlockSettings: import("./UnlockSettings").default;
45
- /**
46
- * 激励视频参数 (可选)
47
- */
48
- adConfig?: IRewordAdConfig | undefined;
49
- /**
50
- * 回调集合
51
- */
52
- collection?: IConnection | undefined;
53
- };
54
- /**
55
- * @typedef {import('../../typings/ad.js').IRewordAdConfig} IRewordAdConfig
56
- */
57
- /**
58
- * @typedef {import('../../typings/ad.js').ICallbackArgs} ICallbackArgs
59
- */
60
- /**
61
- * @typedef IConnection
62
- * @property {(args: ICallbackArgs) => void} [onHalfway] 广告中途退出回调
63
- * @property {(args: ICallbackArgs) => void} [onShow] 广告展示回调
64
- * @property {(args: ICallbackArgs) => void} [onFinish] 广告执行成功回调
65
- * @property {(args: ICallbackArgs) => void} [onAlways] 广告执行成功或失败回调
66
- * @property {(e:unknown) => void} [onError] 广告执行失败回调
67
- */
68
- /**
69
- * @typedef ICloseArgs
70
- * @property {boolean} isEnded 是否看完
71
- * @property {number} count 完整观看次数
72
- */
73
- /**
74
- * @typedef IConstructArgs
75
- * @property {string} sign 初始化标识
76
- * @property {import('./UnlockSettings').default} unlockSettings 解锁设置
77
- * @property {IRewordAdConfig=} adConfig 激励视频参数 (可选)
78
- * @property {IConnection=} collection 回调集合
79
- */
80
- declare class RewardAdNovelUnlock extends RewardAdNovel {
81
- /**
82
- *
83
- * @param {IConstructArgs} args
84
- * @returns {RewardAdNovelUnlock}
85
- */
86
- static build(args: IConstructArgs): RewardAdNovelUnlock;
87
- static unshift(): typeof RewardAdNovelUnlock;
88
- /**
89
- *
90
- * @returns {RewardAdNovelUnlock}
91
- */
92
- static getInstance(): RewardAdNovelUnlock;
93
- /**
94
- *
95
- * @returns {RewardAdNovelUnlock | null}
96
- */
97
- static getNovelInstance(): RewardAdNovelUnlock | null;
98
- /**
99
- *
100
- * @param {IConstructArgs} args
101
- * @returns {RewardAdNovelUnlock}
102
- */
103
- static "new"(args: IConstructArgs): RewardAdNovelUnlock;
104
- /**
105
- * @param {IConstructArgs} args
106
- */
107
- constructor(args: IConstructArgs);
108
- _scene: 2;
109
- /**
110
- * @type {import('./UnlockSettings').default}
111
- */
112
- unlockSettings: import("./UnlockSettings").default;
113
- }
114
- import RewardAdNovel from '../RewardAdNovel.js';
@@ -1,42 +0,0 @@
1
- export default UnlockSettings;
2
- declare class UnlockSettings {
3
- /**
4
- *
5
- * @param {object} args
6
- * @param {string} args.sign 初始化标识
7
- * @returns {UnlockSettings}
8
- */
9
- static "new"(args: {
10
- sign: string;
11
- }): UnlockSettings;
12
- /**
13
- *
14
- * @param {object} [args]
15
- */
16
- constructor(args?: object);
17
- max_tan_ad: {
18
- total: number;
19
- current: number;
20
- };
21
- look_jls_p: {
22
- is_look_complete: number;
23
- total: number;
24
- current: number;
25
- };
26
- commonSettings: CommonSettings;
27
- _init(): void;
28
- _adTimes(): void;
29
- reset(): void;
30
- updateMaxTan(): void;
31
- updateLookJlsP(): void;
32
- remainMaxTan(): number;
33
- remainLook(): number;
34
- /**
35
- * 看广告的次数和弹框的次数不一致
36
- * 并且需要完整的看完广告,并且弹框次数小于最大弹框次数
37
- * @returns
38
- */
39
- end(): boolean;
40
- ok(): boolean;
41
- }
42
- import CommonSettings from '../CommonSettings';
@@ -1,179 +0,0 @@
1
- export default CommonSettings;
2
- export type ISysConfig = {
3
- /**
4
- * 再看一次配置
5
- */
6
- free_incentive_frequency?: number | undefined;
7
- /**
8
- * 自定义解锁弹窗配置
9
- */
10
- c_unlock_pop_enable?: number | undefined;
11
- /**
12
- * 是否进入简介页
13
- */
14
- launch_go_jianjieye?: number | undefined;
15
- /**
16
- * 是否可以返回首页
17
- */
18
- launch_can_back_home?: number | undefined;
19
- /**
20
- * 返回书城激励视频每日展示次数 0 不展示 具体数量展示几次
21
- */
22
- back_book_store_ad?: number | undefined;
23
- /**
24
- * 是否开启启动激励
25
- */
26
- inter_site_pop_ups?: number | undefined;
27
- /**
28
- * 启动激励次数
29
- */
30
- inter_site_pop_ups_num?: number | undefined;
31
- /**
32
- * 阅读强激励循环次数
33
- */
34
- strong_incentive_frequency?: number | undefined;
35
- /**
36
- * 阅读页返回广告
37
- */
38
- read_page_back_ad?: number | undefined;
39
- /**
40
- * 进入阅读页每日自动展示激励次数
41
- */
42
- first_user_day?: number | undefined;
43
- };
44
- export type IUserConfig = {
45
- /**
46
- * 解锁章节中配置的观看解锁章节数
47
- */
48
- ad_unlock_chapter_num?: number | undefined;
49
- /**
50
- * 解锁章节中配置的观看奖励视频次数
51
- */
52
- look_jlsp_num?: number | undefined;
53
- /**
54
- * 解锁章节中配置的弹窗广告次数
55
- */
56
- max_tan_ad_num?: number | undefined;
57
- /**
58
- * 奖励视频是否观看完成
59
- */
60
- jlsp_is_look_complete?: number | undefined;
61
- /**
62
- * 书籍ID
63
- */
64
- dy_book_id?: number | undefined;
65
- /**
66
- * 默认书籍ID
67
- */
68
- default_book_id?: number | undefined;
69
- /**
70
- * 章节ID
71
- */
72
- index?: number | undefined;
73
- /**
74
- * 2 表示跳转至速度页面 1 不处理
75
- */
76
- open_page: string;
77
- /**
78
- * 是否解锁全部章节 0 未解锁 1 解锁
79
- */
80
- is_unlock_all: number;
81
- };
82
- export type IUserInfo = {
83
- /**
84
- * 用户ID
85
- */
86
- id: string;
87
- /**
88
- * 用户归因类型 1:信息流;2:工具版;3:新用户;4:老用户;5:未归因用户
89
- */
90
- user_type: 1 | 2 | 3 | 4 | 5;
91
- /**
92
- * 用户组 - 0:对照组A;1:测试组B
93
- */
94
- user_ab: 0 | 1;
95
- };
96
- /**
97
- * 投放渠道参数
98
- */
99
- export type IDeliverOption = {
100
- /**
101
- * 书籍ID
102
- */
103
- book_id: string;
104
- /**
105
- * 章节ID
106
- */
107
- chapter_id: string;
108
- /**
109
- * 过去的书籍ID
110
- */
111
- past_book_id: string;
112
- };
113
- declare class CommonSettings {
114
- static instance: any;
115
- /**
116
- *
117
- * @param {object} args
118
- * @param {string} args.sign 初始化标识
119
- * @returns {CommonSettings}
120
- */
121
- static build(args: {
122
- sign: string;
123
- }): CommonSettings;
124
- /**
125
- *
126
- * @returns {CommonSettings}
127
- */
128
- static getInstance(): CommonSettings;
129
- /**
130
- *
131
- * @param {object} args
132
- * @param {string} args.sign 初始化标识
133
- * @returns {CommonSettings}
134
- */
135
- static "new"(args: {
136
- sign: string;
137
- }): CommonSettings;
138
- /**
139
- * @param {object} args
140
- * @param {string} args.sign 初始化标识
141
- * @param {string} args.loginInfo 登录信息
142
- */
143
- constructor(args: {
144
- sign: string;
145
- loginInfo: string;
146
- });
147
- _initSign: string;
148
- _loginInfo: {};
149
- /**
150
- * 获取用户配置
151
- * @returns {IUserConfig}
152
- */
153
- getUserConfig(): IUserConfig;
154
- /**
155
- * 获取用户信息
156
- * @returns {IUserInfo}
157
- */
158
- getUserInfo(): IUserInfo;
159
- /**
160
- * 获取APP配置
161
- * @returns {ISysConfig}
162
- */
163
- getSysConfig(): ISysConfig;
164
- /**
165
- * 获取用户ID
166
- * @returns
167
- */
168
- getUserId(): string;
169
- /**
170
- * 1:测试组A 一般指全部功能都开启; 0:对照组B一般会有一个或者几个功能关闭
171
- * @returns
172
- */
173
- getUserAB(): number;
174
- /**
175
- * 站位方法,没有任何左右
176
- * @returns
177
- */
178
- placeholder(): any;
179
- }
@@ -1,91 +0,0 @@
1
- export default RewardAdLaunch;
2
- export type IRewordAdConfig = import("../src/typings/ad.js").IRewordAdConfig;
3
- export type IConstructArgs = import("../src/typings/ad.js").IConstructArgs;
4
- /**
5
- * @typedef {import('../src/typings/ad.js').IRewordAdConfig} IRewordAdConfig
6
- */
7
- /**
8
- * @typedef {import('../src/typings/ad.js').IConstructArgs} IConstructArgs
9
- */
10
- declare class RewardAdLaunch extends RewardAdNovel {
11
- /**
12
- *
13
- * @param {IConstructArgs} args
14
- * @returns {RewardAdLaunch}
15
- */
16
- static build(args: IConstructArgs): RewardAdLaunch;
17
- /**
18
- *
19
- * @returns {RewardAdLaunch}
20
- */
21
- static getInstance(): RewardAdLaunch;
22
- /**
23
- *
24
- * @param {IConstructArgs} args
25
- * @returns {RewardAdLaunch}
26
- */
27
- static "new"(args: IConstructArgs): RewardAdLaunch;
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 {(args: { options: object } | null) => Promise.<void>} callback 回调
40
- * @returns
41
- */
42
- static satisfy(options: {
43
- path: string;
44
- query: {
45
- promotionid: string;
46
- };
47
- }, callback: (args: {
48
- options: object;
49
- } | null) => Promise<void>): Promise<void>;
50
- /**
51
- * @param {object} args
52
- * @param {string} args.sign 初始化标识
53
- */
54
- constructor(args: {
55
- sign: string;
56
- });
57
- _scene: 0;
58
- launchSettings: RewardAdLaunchSettings;
59
- }
60
- import RewardAdNovel from './RewardAdNovel.js';
61
- declare class RewardAdLaunchSettings {
62
- /**
63
- *
64
- * @param {object} args
65
- * @param {string} args.sign 初始化标识
66
- * @returns {RewardAdLaunchSettings}
67
- */
68
- static "new"(args: {
69
- sign: string;
70
- }): RewardAdLaunchSettings;
71
- _fixedFrequency: any;
72
- frequency: {
73
- total: number;
74
- current: number;
75
- };
76
- commonSettings: CommonSettings;
77
- countRecorder: CountRecorder;
78
- /**
79
- * 获取启动广告的展示次数
80
- * @returns {number} 启动广告的展示次数配置,如果没有配置则返回0
81
- */
82
- _adTimes(): number;
83
- updateToday(): void;
84
- updateFrequency(): void;
85
- remainFrequency(): number;
86
- timesPerFrequency(): number;
87
- _remain(): number;
88
- condition(): boolean;
89
- }
90
- import CommonSettings from './CommonSettings';
91
- import { CountRecorder } from '../src/ad/CountRecorder.js';
@@ -1,63 +0,0 @@
1
- export default RewardAdLaunchAlone;
2
- export type IRewordAdConfig = import("../src/typings/ad.js").IRewordAdConfig;
3
- export type IConstructArgs = import("../src/typings/ad.js").IConstructArgs;
4
- export type CallbackCollection = import("../src/typings/ad.js").CallbackCollection;
5
- /**
6
- * @typedef {import('../src/typings/ad.js').IRewordAdConfig} IRewordAdConfig
7
- */
8
- /**
9
- * @typedef {import('../src/typings/ad.js').IConstructArgs} IConstructArgs
10
- */
11
- /**
12
- * @typedef {import('../src/typings/ad.js').CallbackCollection} CallbackCollection
13
- */
14
- declare class RewardAdLaunchAlone extends RewardAdNovel {
15
- /**
16
- *
17
- * @param {IConstructArgs} args
18
- * @returns {RewardAdLaunchAlone}
19
- */
20
- static build(args: IConstructArgs): RewardAdLaunchAlone;
21
- /**
22
- *
23
- * @returns {RewardAdLaunchAlone}
24
- */
25
- static getInstance(): RewardAdLaunchAlone;
26
- /**
27
- *
28
- * @param {IConstructArgs} args
29
- * @returns {RewardAdLaunchAlone}
30
- */
31
- static "new"(args: IConstructArgs): RewardAdLaunchAlone;
32
- /**
33
- *
34
- * @type {Promise.<unknown>}
35
- */
36
- static ad: Promise<unknown>;
37
- /**
38
- *
39
- * @param {object} options 启动参数
40
- * @param {string} options.path 启动路径
41
- * @param {object} options.query 启动参数
42
- * @param {string} options.query.promotionid 推广参数
43
- * @param {() => Promise.<void>} callback 回调
44
- * @returns
45
- */
46
- static satisfy(options: {
47
- path: string;
48
- query: {
49
- promotionid: string;
50
- };
51
- }, callback: () => Promise<void>): Promise<void>;
52
- /**
53
- * @param {object} args
54
- * @param {string} args.sign 初始化标识
55
- * @param {IRewordAdConfig=} args.adConfig 激励视频参数 (可选)
56
- */
57
- constructor(args: {
58
- sign: string;
59
- adConfig?: IRewordAdConfig | undefined;
60
- });
61
- _scene: 9;
62
- }
63
- import RewardAdNovel from './RewardAdNovel.js';
@@ -1,384 +0,0 @@
1
- export default RewardAdNovel;
2
- export type IRewordAdConfig = import("../src/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
- * 是否保留tt激励视频广告实例
57
- */
58
- preserveOnEnd?: boolean;
59
- /**
60
- * 是否需要在超时情况下结束广告
61
- */
62
- needEndOnTimeout?: boolean;
63
- /**
64
- * 激励视频参数 (可选)
65
- */
66
- adConfig?: IRewordAdConfig | undefined;
67
- /**
68
- * 回调集合
69
- */
70
- collection?: IConnection | undefined;
71
- };
72
- export type ICloseArgs = {
73
- /**
74
- * 是否看完
75
- */
76
- isEnded: boolean;
77
- /**
78
- * 完整观看次数
79
- */
80
- count: number;
81
- };
82
- export type IEndArgs = {
83
- /**
84
- * 是否解锁全部
85
- */
86
- can_unlock_all?: boolean;
87
- /**
88
- * 是否解锁小说
89
- */
90
- can_unlock_novel?: boolean;
91
- /**
92
- * 剩余次数
93
- */
94
- remain?: number;
95
- /**
96
- * 结束类型
97
- */
98
- end_type?: "halfway" | "finished";
99
- };
100
- export type IRewardedVideoAd = {
101
- /**
102
- * 显示激励视频广告
103
- */
104
- show: () => Promise<void>;
105
- };
106
- /**
107
- * @typedef {import('../src/typings/ad.js').IRewordAdConfig} IRewordAdConfig
108
- */
109
- /**
110
- * @typedef ICallbackArgs
111
- * @property {number} scene 广告执行场景
112
- * @property {boolean} isEnded 是否看完
113
- * @property {number} count 完整观看次数
114
- * @property {() => void} [end] 执行下一个任务的回调函数,手动调用以继续执行流程[end]
115
- * @property {(args: {ignoreRemain: boolean, scene: number}) => void} [circle] 执行下一个任务的回调函数, 手动调用以继续执行流程[circle]
116
- *
117
- */
118
- /**
119
- * @typedef IConnection
120
- * @property {(args: ICallbackArgs) => void} [onHalfway] 广告中途退出回调
121
- * @property {(args: ICallbackArgs) => void} [onShow] 广告展示回调
122
- * @property {(args: ICallbackArgs) => void} [onFinish] 广告执行成功回调
123
- * @property {(args: ICallbackArgs) => void} [onAlways] 广告执行成功回调
124
- * @property {(e:unknown) => void} [onError] 广告执行失败回调
125
- */
126
- /**
127
- * @typedef IConstructArgs
128
- * @property {string} [sign] 初始化标识
129
- * @property {boolean} [preserveOnEnd] 是否保留tt激励视频广告实例
130
- * @property {boolean} [needEndOnTimeout] 是否需要在超时情况下结束广告
131
- * @property {IRewordAdConfig=} [adConfig] 激励视频参数 (可选)
132
- * @property {IConnection=} [collection] 回调集合
133
- */
134
- /**
135
- * @typedef ICloseArgs
136
- * @property {boolean} isEnded 是否看完
137
- * @property {number} count 完整观看次数
138
- */
139
- /**
140
- * @typedef IEndArgs
141
- * @property {boolean} [can_unlock_all] 是否解锁全部
142
- * @property {boolean} [can_unlock_novel] 是否解锁小说
143
- * @property {number} [remain] 剩余次数
144
- * @property {'halfway' | 'finished'} [end_type] 结束类型
145
- *
146
- */
147
- /**
148
- * @typedef IRewardedVideoAd
149
- * @property {() => Promise.<void>} show 显示激励视频广告
150
- */
151
- declare class RewardAdNovel extends RewardAdFather {
152
- /**
153
- *
154
- * @param {IConstructArgs} args
155
- * @returns {RewardAdNovel}
156
- */
157
- static build(args: IConstructArgs): RewardAdNovel;
158
- /**
159
- *
160
- * @returns {RewardAdNovel}
161
- */
162
- static getInstance(): RewardAdNovel;
163
- /**
164
- *
165
- * @param {IConstructArgs} args
166
- * @returns {RewardAdNovel}
167
- */
168
- static "new"(args: IConstructArgs): RewardAdNovel;
169
- /**
170
- * @param {IConstructArgs} args
171
- *
172
- */
173
- constructor(args: IConstructArgs);
174
- _onHalfway: any;
175
- _onShow: any;
176
- _onFinish: any;
177
- _onAlways: any;
178
- _onError: any;
179
- _alwaysCallback: any;
180
- _halfwayCallback: any;
181
- _finishedCallback: any;
182
- _resolve: any;
183
- _next: any;
184
- /** @type {number} 广告执行场景 */
185
- _scene: number;
186
- _adTimeout: any;
187
- _adTimeoutTime: number;
188
- _adBeforeShowTimer: any;
189
- _adBeforeShowTime: number;
190
- _adSpeedCloseTimer: any;
191
- _adSpeedCloseTime: number;
192
- _needEndOnTimeout: boolean;
193
- /** @deprecated TODO 移除 */
194
- _needSpeedEndOnTimeout: boolean;
195
- bindAdCloseLister: any;
196
- bindAdErrorLister: any;
197
- bindAdLoadLister: any;
198
- bindApiAdErrorLister: any;
199
- _bindShiftCloseLister: any;
200
- _bindShiftErrorLister: any;
201
- /**
202
- * 初始化
203
- * 子类可以选择覆盖此方法,或使用默认实现
204
- * @param {IRewordAdConfig} params
205
- * @param {(v: IRewardedVideoAd) => void} [callback] 初始化成功回调
206
- * @returns {this} 当前实例
207
- */
208
- initialize(args: any, callback?: (v: IRewardedVideoAd) => void): this;
209
- _initAdLister(): void;
210
- /**
211
- * @param {object} args
212
- * @param {number} [args.retry] 重试次数
213
- */
214
- _initNovelConfig(args: {
215
- retry?: number;
216
- }): void;
217
- novelConfig: RewardAdNovelConfig;
218
- _onInnerExecuteBefore(): any;
219
- _onInnerAdShowSuccess(): any;
220
- /**
221
- * 广告展示超时设置
222
- * @param {object} args
223
- * @param {string} args.scene 广告执行场景 必填
224
- * @param {Function} args.end 结束当前广告任务的回调函数 必填
225
- */
226
- _setAdTimeout(args: {
227
- scene: string;
228
- end: Function;
229
- }): void;
230
- /**
231
- * 广告展示前定时器
232
- * @param {object} args
233
- * @param {string} args.scene 广告执行场景 必填
234
- * @param {Function} args.prelude 广告展示前回调函数 可选
235
- */
236
- _adPreludeInterval(args: {
237
- scene: string;
238
- prelude: Function;
239
- }): void;
240
- _clearAdTimeout(): void;
241
- get rewardAd(): any;
242
- /**
243
- * 确保广告按顺序执行
244
- * @param {Object} [ctx] 上下文对象,用于传递数据和状态
245
- * @param {IRewordAdConfig} [ctx.options] 广告执行选项
246
- * @param {import('../src/typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
247
- *
248
- * @returns {Promise.<IEndArgs & ICloseArgs | Undefined>}
249
- */
250
- addExecuteManager(ctx?: {
251
- options?: IRewordAdConfig;
252
- collection?: import("../src/typings/ad.js").CallbackCollection;
253
- }): Promise<(IEndArgs & ICloseArgs) | undefined>;
254
- /**
255
- * @param {object} [ctx] 广告执行上下文
256
- * @param {import('../src/typings/ad.js').IRewordAdConfig} [ctx.options] 广告执行选项
257
- * @param {import('../src/typings/ad.js').CallbackCollection} [ctx.collection] 回调集合
258
- * @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
259
- *
260
- * @returns {Promise.<IEndArgs & ICloseArgs | Undefined>}
261
- */
262
- ad(ctx?: {
263
- options?: import("../src/typings/ad.js").IRewordAdConfig;
264
- collection?: import("../src/typings/ad.js").CallbackCollection;
265
- }, next?: Function): Promise<(IEndArgs & ICloseArgs) | undefined>;
266
- /**
267
- * @param {object} [ctx] 广告执行上下文
268
- * @param {object} [ctx.options] 广告执行选项
269
- * @param {number} [ctx.options.scene] 广告执行场景
270
- * @param {object} ctx.collection 回调集合
271
- * @param {(v?: unknown) => void} ctx.collection.resolve 广告执行成功的回调函数
272
- * @param {(v?: unknown) => void} [ctx.collection.reject] 广告执行失败的回调函数
273
- * @param {(v?: unknown) => void} [ctx.collection.before] 广告执行前的回调函数
274
- * @param {(v?: unknown) => void} [ctx.collection.success] 广告执行成功的回调函数
275
- * @param {(v?: unknown) => void} [ctx.collection.prelude] 拉起广告前计时的回调函数
276
- * @param {Function} next 执行下一个任务的回调函数,手动调用以继续执行流程
277
- */
278
- _adInner(ctx?: {
279
- options?: {
280
- scene?: number;
281
- };
282
- collection: {
283
- resolve: (v?: unknown) => void;
284
- reject?: (v?: unknown) => void;
285
- before?: (v?: unknown) => void;
286
- success?: (v?: unknown) => void;
287
- prelude?: (v?: unknown) => void;
288
- };
289
- }, next?: Function): void;
290
- _before: (v?: unknown) => void;
291
- _success: (v?: unknown) => void;
292
- /**
293
- * 广告加载
294
- * @returns
295
- */
296
- adLoad(): Promise<void>;
297
- /**
298
- * 广告展示
299
- * @returns
300
- */
301
- adShow(): Promise<void>;
302
- _outerCloseCallback(args: any): void;
303
- _outerHalfwayCallback(args: any): void;
304
- _outerFinishedCallback(args: any): void;
305
- /**
306
- * 关闭激励视频
307
- * @param {ICloseArgs} args
308
- */
309
- adCloseLister(args: ICloseArgs): void;
310
- adErrorLister(e: any): void;
311
- apiAdErrorLister(e: any): void;
312
- /**
313
- * 激励视频广告组件**成功**拉取广告素材时会触发
314
- * 创建激励时候后会自动拉取广告素材,如果广告拉取成功,也会触发此事件,不管是否调用show方法
315
- * @param {unknown} e
316
- */
317
- adLoadLister(e: unknown): void;
318
- adDestroy(): void;
319
- _shiftCloseLister(args: any): void;
320
- _shiftErrorLister(args: any): void;
321
- /**
322
- * 手动出栈
323
- */
324
- shift(): void;
325
- }
326
- import RewardAdFather from '../src/ad/RewardAdFather.js';
327
- declare class RewardAdNovelConfig {
328
- /**
329
- *
330
- * @param {object} args
331
- * @param {string} args.sign 初始化标识
332
- * @param {number} [args.retry] 重试次数
333
- * @returns {RewardAdNovelConfig}
334
- */
335
- static "new"(args: {
336
- sign: string;
337
- retry?: number;
338
- }): RewardAdNovelConfig;
339
- /**
340
- *
341
- * @param {object} [args]
342
- * @param {number} [args.retry]
343
- */
344
- constructor(args?: {
345
- retry?: number;
346
- });
347
- free_incentive_frequency: number;
348
- frequency: {
349
- total: number;
350
- current: number;
351
- };
352
- commonSettings: CommonSettings;
353
- /**
354
- *
355
- * @param {object} [args]
356
- * @param {number} [args.retry]
357
- */
358
- _init(args?: {
359
- retry?: number;
360
- }): void;
361
- /**
362
- *
363
- * @param {object} [args]
364
- * @param {number} [args.retry]
365
- */
366
- _adTimes(args?: {
367
- retry?: number;
368
- }): void;
369
- reset(): void;
370
- updateRetry(): void;
371
- remain(): number;
372
- options(): {
373
- multiton: boolean;
374
- multitonRewardTimes: number;
375
- multitonRewardMsg: string[];
376
- progressTip: boolean;
377
- } | {
378
- multiton?: undefined;
379
- multitonRewardTimes?: undefined;
380
- multitonRewardMsg?: undefined;
381
- progressTip?: undefined;
382
- };
383
- }
384
- import CommonSettings from './CommonSettings.js';
@@ -1,83 +0,0 @@
1
- export default RewardAdReadingLoad;
2
- export type ISysConfig = {
3
- /**
4
- * 再看一次配置
5
- */
6
- free_incentive_frequency?: number | undefined;
7
- /**
8
- * 自定义解锁弹窗配置
9
- */
10
- c_unlock_pop_enable?: number | undefined;
11
- /**
12
- * 返回书城激励视频每日展示次数 0 不展示 具体数量展示几次
13
- */
14
- read_load_times?: number | undefined;
15
- };
16
- export type IRewordAdConfig = import("../src/typings/ad.js").IRewordAdConfig;
17
- export type IConstructArgs = import("../src/typings/ad.js").IConstructArgs;
18
- /**
19
- * @typedef {import('../src/typings/ad.js').IRewordAdConfig} IRewordAdConfig
20
- */
21
- /**
22
- * @typedef {import('../src/typings/ad.js').IConstructArgs} IConstructArgs
23
- */
24
- declare class RewardAdReadingLoad extends RewardAdNovel {
25
- /**
26
- *
27
- * @param {IConstructArgs} args
28
- * @returns {RewardAdReadingLoad}
29
- */
30
- static build(args: IConstructArgs): RewardAdReadingLoad;
31
- /**
32
- *
33
- * @returns {RewardAdReadingLoad}
34
- */
35
- static getInstance(): RewardAdReadingLoad;
36
- /**
37
- *
38
- * @param {IConstructArgs} args
39
- * @returns {RewardAdReadingLoad}
40
- */
41
- static "new"(args: IConstructArgs): RewardAdReadingLoad;
42
- constructor(args: any);
43
- loadSettings: RewardAdReadingLoadSettings;
44
- /**
45
- * @param {object} options
46
- * @param {(con:boolean, options:object) => void} [callback]
47
- */
48
- satisfy(options: object, callback?: (con: boolean, options: object) => void): void | Promise<void>;
49
- }
50
- import RewardAdNovel from './RewardAdNovel.js';
51
- declare class RewardAdReadingLoadSettings {
52
- /**
53
- *
54
- * @param {object} args
55
- * @param {string} args.sign 初始化标识
56
- * @returns {RewardAdReadingLoadSettings}
57
- */
58
- static "new"(args: {
59
- sign: string;
60
- }): RewardAdReadingLoadSettings;
61
- frequency: {
62
- total: number;
63
- current: number;
64
- };
65
- commonSettings: CommonSettings;
66
- storage: Storage;
67
- _init(): void;
68
- /**
69
- * 获取返回广告的展示次数
70
- * @returns {number} 返回广告的展示次数配置,如果没有配置则返回0
71
- */
72
- _adTimes(): number;
73
- _safeLocalValue(v: any): any;
74
- _initLocalTimes(): void;
75
- _initFrequency(): void;
76
- updateFrequency(): void;
77
- remainFrequency(): number;
78
- updateToday(): void;
79
- _remain(): number;
80
- condition(): boolean;
81
- }
82
- import CommonSettings from './CommonSettings';
83
- import Storage from '../src/ad/Storage.js';
@@ -1,44 +0,0 @@
1
- export default RewardAdReadingUnload;
2
- export type ISysConfig = {
3
- /**
4
- * 再看一次配置
5
- */
6
- free_incentive_frequency?: number | undefined;
7
- /**
8
- * 自定义解锁弹窗配置
9
- */
10
- c_unlock_pop_enable?: number | undefined;
11
- /**
12
- * 返回书城激励视频每日展示次数 0 不展示 具体数量展示几次
13
- */
14
- read_page_back_ad?: number | undefined;
15
- };
16
- export type IRewordAdConfig = import("../src/typings/ad.js").IRewordAdConfig;
17
- export type IConstructArgs = import("../src/typings/ad.js").IConstructArgs;
18
- /**
19
- * @typedef {import('../src/typings/ad.js').IRewordAdConfig} IRewordAdConfig
20
- */
21
- /**
22
- * @typedef {import('../src/typings/ad.js').IConstructArgs} IConstructArgs
23
- */
24
- declare class RewardAdReadingUnload extends RewardAdNovel {
25
- /**
26
- *
27
- * @param {IConstructArgs} args
28
- * @returns {RewardAdReadingUnload}
29
- */
30
- static build(args: IConstructArgs): RewardAdReadingUnload;
31
- /**
32
- *
33
- * @param {IConstructArgs} args
34
- * @returns {RewardAdReadingUnload}
35
- */
36
- static "new"(args: IConstructArgs): RewardAdReadingUnload;
37
- /**
38
- * @param {object} options
39
- * @param {(con:boolean, options:object) => void} [callback]
40
- */
41
- static satisfy(options: object, callback?: (con: boolean, options: object) => void): void | Promise<void>;
42
- constructor(args: any);
43
- }
44
- import RewardAdNovel from './RewardAdNovel.js';
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes