igsdk 1.1.15 → 1.1.16
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/igsdk.d.ts +39 -37
- package/igsdk.js +1 -1
- package/package.json +1 -1
package/igsdk.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare namespace IG {
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
4
|
+
* 广告位置(横幅、模板广告使用)
|
|
5
|
+
*/
|
|
6
|
+
export enum AdPosition {
|
|
7
7
|
BOTTOM = 0,
|
|
8
8
|
CENTER = 1,
|
|
9
9
|
TOP = 2
|
|
@@ -18,7 +18,7 @@ declare namespace IG {
|
|
|
18
18
|
/**
|
|
19
19
|
* 初始化可配置参数
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export class InitOpt implements IParam {
|
|
22
22
|
/** 媒体标识(必传) */
|
|
23
23
|
mediaId: string;
|
|
24
24
|
/** 自定义渠道标识。广告数据可以根据自定义渠道进行拆分 */
|
|
@@ -34,7 +34,7 @@ declare namespace IG {
|
|
|
34
34
|
/**
|
|
35
35
|
* 广告请求可配置参数
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
37
|
+
export class AdOpt implements IParam {
|
|
38
38
|
/** 广告位id(必传) */
|
|
39
39
|
adId: string;
|
|
40
40
|
/** 广告回调id */
|
|
@@ -124,7 +124,7 @@ declare namespace IG {
|
|
|
124
124
|
/**
|
|
125
125
|
* 广告SDK
|
|
126
126
|
*/
|
|
127
|
-
export
|
|
127
|
+
export class AdSdk implements IAdSdk {
|
|
128
128
|
private static adSdk;
|
|
129
129
|
hasInit: boolean;
|
|
130
130
|
private constructor();
|
|
@@ -150,7 +150,7 @@ declare namespace IG {
|
|
|
150
150
|
/**
|
|
151
151
|
* 广告类型(小游戏使用)
|
|
152
152
|
*/
|
|
153
|
-
export
|
|
153
|
+
export enum AD_TYPE {
|
|
154
154
|
BANNER = 1,
|
|
155
155
|
CUSTOM = 2,
|
|
156
156
|
INTERSTITIAL = 3,
|
|
@@ -159,7 +159,7 @@ declare namespace IG {
|
|
|
159
159
|
/**
|
|
160
160
|
* 初始化参数
|
|
161
161
|
*/
|
|
162
|
-
export
|
|
162
|
+
export class ASWInitOpt extends InitOpt {
|
|
163
163
|
/** Web端媒体id */
|
|
164
164
|
mediaIdWeb: string;
|
|
165
165
|
/** Android端媒体id */
|
|
@@ -172,7 +172,7 @@ declare namespace IG {
|
|
|
172
172
|
/**
|
|
173
173
|
* 请求广告参数
|
|
174
174
|
*/
|
|
175
|
-
export
|
|
175
|
+
export class ASWAdOpt {
|
|
176
176
|
/** 广告类型 */
|
|
177
177
|
adType: AD_TYPE;
|
|
178
178
|
/** Web端广告位id */
|
|
@@ -248,7 +248,7 @@ declare namespace IG {
|
|
|
248
248
|
/**
|
|
249
249
|
* 广告SDK
|
|
250
250
|
*/
|
|
251
|
-
export
|
|
251
|
+
export class AdSdkWrapper {
|
|
252
252
|
/**
|
|
253
253
|
* 获取客户端类型
|
|
254
254
|
* @returns 客户端类型
|
|
@@ -271,7 +271,7 @@ declare namespace IG {
|
|
|
271
271
|
/**
|
|
272
272
|
* 广告请求可配置参数
|
|
273
273
|
*/
|
|
274
|
-
export
|
|
274
|
+
export class MiniGameAdOpt {
|
|
275
275
|
/** 广告位id(必传) */
|
|
276
276
|
adId: string;
|
|
277
277
|
/** 广告自动刷新的间隔时间,单位为秒,参数值必须大于等于30(该参数不传入时 Banner 广告不会自动刷新) */
|
|
@@ -354,7 +354,7 @@ declare namespace IG {
|
|
|
354
354
|
/**
|
|
355
355
|
* 小游戏用户数据
|
|
356
356
|
*/
|
|
357
|
-
export
|
|
357
|
+
export class MiniGameUserData {
|
|
358
358
|
/** 用户昵称 */
|
|
359
359
|
nick: string;
|
|
360
360
|
/** 用户头像地址 */
|
|
@@ -367,7 +367,7 @@ declare namespace IG {
|
|
|
367
367
|
/**
|
|
368
368
|
* 小游戏节点位置信息
|
|
369
369
|
*/
|
|
370
|
-
export
|
|
370
|
+
export class MiniGameNodePosition {
|
|
371
371
|
/** 左上角横坐标 */
|
|
372
372
|
left: number;
|
|
373
373
|
/** 左上角纵坐标 */
|
|
@@ -384,7 +384,7 @@ declare namespace IG {
|
|
|
384
384
|
* 参数说明:
|
|
385
385
|
* 图片优先级:imageUrlId+imageUrl > useCanvasImg > 默认
|
|
386
386
|
*/
|
|
387
|
-
export
|
|
387
|
+
export class MiniGameShareOpt {
|
|
388
388
|
/** 是否展示分享按钮(被动转发分享时设置) */
|
|
389
389
|
show?: boolean;
|
|
390
390
|
/** 分享标题 */
|
|
@@ -409,11 +409,13 @@ declare namespace IG {
|
|
|
409
409
|
imagePreviewUrl?: string;
|
|
410
410
|
/** 转发内容类型(仅抖音小游戏时可用) */
|
|
411
411
|
channel?: string;
|
|
412
|
+
/** 实际分享代理(比如使用友盟统计分享时,传入:uma) */
|
|
413
|
+
proxy?: string;
|
|
412
414
|
}
|
|
413
415
|
/**
|
|
414
416
|
* 微信Canvas截图分享可配置参数(仅微信小游戏可用)
|
|
415
417
|
*/
|
|
416
|
-
export
|
|
418
|
+
export class MiniGameWxCanvasShareOpt {
|
|
417
419
|
/** 截取 canvas 的左上角横坐标 */
|
|
418
420
|
x?: number;
|
|
419
421
|
/** 截取 canvas 的左上角纵坐标 */
|
|
@@ -434,7 +436,7 @@ declare namespace IG {
|
|
|
434
436
|
/**
|
|
435
437
|
* 戏圈按钮可配参数
|
|
436
438
|
*/
|
|
437
|
-
export
|
|
439
|
+
export class MiniGameClubButtonOpt extends MiniGameNodePosition {
|
|
438
440
|
/** 活动页面 */
|
|
439
441
|
openlink: string;
|
|
440
442
|
/** 传递了openlink值时,此字段生效,决定创建的按钮是否需要拥有红点,默认为true */
|
|
@@ -443,7 +445,7 @@ declare namespace IG {
|
|
|
443
445
|
/**
|
|
444
446
|
* 打开客服可配参数
|
|
445
447
|
*/
|
|
446
|
-
export
|
|
448
|
+
export class MiniGameOpenCustomerServiceOpt {
|
|
447
449
|
/** 抖音客服类型。1:小 6 客服,2:抖音IM 客服(仅支持抖音),3:抖音客服平台(基础库 3.41.0 开始支持) */
|
|
448
450
|
type?: number;
|
|
449
451
|
/** 微信客服链接 */
|
|
@@ -454,7 +456,7 @@ declare namespace IG {
|
|
|
454
456
|
/**
|
|
455
457
|
* 媒体类型
|
|
456
458
|
*/
|
|
457
|
-
export
|
|
459
|
+
export enum MEDIA_TYPE {
|
|
458
460
|
/** 图片 */
|
|
459
461
|
IMAGE = "image",
|
|
460
462
|
/** 视频 */
|
|
@@ -465,7 +467,7 @@ declare namespace IG {
|
|
|
465
467
|
/**
|
|
466
468
|
* 来源类型
|
|
467
469
|
*/
|
|
468
|
-
export
|
|
470
|
+
export enum SOURCE_TYPE {
|
|
469
471
|
/** 从相册选择 */
|
|
470
472
|
ALBUM = "album",
|
|
471
473
|
/** 使用相机拍摄 */
|
|
@@ -474,7 +476,7 @@ declare namespace IG {
|
|
|
474
476
|
/**
|
|
475
477
|
* 相机类型
|
|
476
478
|
*/
|
|
477
|
-
export
|
|
479
|
+
export enum CAMERA_TYPE {
|
|
478
480
|
/** 使用后置摄像头 */
|
|
479
481
|
BACK = "back",
|
|
480
482
|
/** 使用前置摄像头 */
|
|
@@ -483,7 +485,7 @@ declare namespace IG {
|
|
|
483
485
|
/**
|
|
484
486
|
* 选择媒体文件可配参数
|
|
485
487
|
*/
|
|
486
|
-
export
|
|
488
|
+
export class MiniGameChooseMediaOpt {
|
|
487
489
|
/** 最多可以选择的数量 */
|
|
488
490
|
count?: number;
|
|
489
491
|
/** 媒体类型 */
|
|
@@ -498,7 +500,7 @@ declare namespace IG {
|
|
|
498
500
|
/**
|
|
499
501
|
* 媒体数据
|
|
500
502
|
*/
|
|
501
|
-
export
|
|
503
|
+
export class MiniGameMediaData {
|
|
502
504
|
/** 本地临时文件路径 (本地路径) */
|
|
503
505
|
tempFilePath: string;
|
|
504
506
|
/** 本地临时文件大小,单位 B */
|
|
@@ -610,7 +612,7 @@ declare namespace IG {
|
|
|
610
612
|
/**
|
|
611
613
|
* 小游戏SDK
|
|
612
614
|
*/
|
|
613
|
-
export
|
|
615
|
+
export class MiniGameSdk implements IMiniGameSdk {
|
|
614
616
|
private static sdk;
|
|
615
617
|
private constructor();
|
|
616
618
|
/**
|
|
@@ -729,7 +731,7 @@ declare namespace IG {
|
|
|
729
731
|
/**
|
|
730
732
|
* Http请求配置
|
|
731
733
|
*/
|
|
732
|
-
export
|
|
734
|
+
export class HttpConfig {
|
|
733
735
|
/** 请求超时时间(ms) */
|
|
734
736
|
timeout: number;
|
|
735
737
|
/** 上传文件超时时间(ms) */
|
|
@@ -784,7 +786,7 @@ declare namespace IG {
|
|
|
784
786
|
/**
|
|
785
787
|
* HTTP请求
|
|
786
788
|
*/
|
|
787
|
-
export
|
|
789
|
+
export class Http implements IHttp {
|
|
788
790
|
private static httpConfig;
|
|
789
791
|
private static httpType;
|
|
790
792
|
private http;
|
|
@@ -840,7 +842,7 @@ declare namespace IG {
|
|
|
840
842
|
/**
|
|
841
843
|
* Http请求配置
|
|
842
844
|
*/
|
|
843
|
-
export
|
|
845
|
+
export class HttpWrapperConfig extends HttpConfig {
|
|
844
846
|
/** 请求基地址 */
|
|
845
847
|
baseUrl?: string;
|
|
846
848
|
/** 客户端版本号 */
|
|
@@ -857,7 +859,7 @@ declare namespace IG {
|
|
|
857
859
|
/**
|
|
858
860
|
* Http请求响应基础数据
|
|
859
861
|
*/
|
|
860
|
-
export
|
|
862
|
+
export class HttpResData {
|
|
861
863
|
/** 响应成功 */
|
|
862
864
|
static C_SUC: number;
|
|
863
865
|
/** 响应码 */
|
|
@@ -868,7 +870,7 @@ declare namespace IG {
|
|
|
868
870
|
/**
|
|
869
871
|
* HTTP请求回调Bean
|
|
870
872
|
*/
|
|
871
|
-
export
|
|
873
|
+
export class HttpCallbackBean<T extends HttpResData> implements IHttpCallback {
|
|
872
874
|
onSuc?(data: string): void;
|
|
873
875
|
onFail?(code: number, msg: string): void;
|
|
874
876
|
/**
|
|
@@ -885,7 +887,7 @@ declare namespace IG {
|
|
|
885
887
|
/**
|
|
886
888
|
* Http请求封装类
|
|
887
889
|
*/
|
|
888
|
-
export
|
|
890
|
+
export class HttpWrapper {
|
|
889
891
|
private static readonly KEY_UUID;
|
|
890
892
|
private static readonly KEY_TOKEN;
|
|
891
893
|
private static httpConfig;
|
|
@@ -933,6 +935,7 @@ declare namespace IG {
|
|
|
933
935
|
/**
|
|
934
936
|
* 获取请求头
|
|
935
937
|
* @param encryptedData 加密后的数据
|
|
938
|
+
* @param contentType 请求内容类型
|
|
936
939
|
* @returns 请求头
|
|
937
940
|
*/
|
|
938
941
|
private getHeaders;
|
|
@@ -956,7 +959,7 @@ declare namespace IG {
|
|
|
956
959
|
/**
|
|
957
960
|
* 加解密工具类
|
|
958
961
|
*/
|
|
959
|
-
export
|
|
962
|
+
export class CryptoUtil {
|
|
960
963
|
private static key;
|
|
961
964
|
private static iv;
|
|
962
965
|
/**
|
|
@@ -1028,7 +1031,7 @@ declare namespace IG {
|
|
|
1028
1031
|
/**
|
|
1029
1032
|
* 日志等级
|
|
1030
1033
|
*/
|
|
1031
|
-
export
|
|
1034
|
+
export enum LOG_LEVEL {
|
|
1032
1035
|
/** 追踪级别日志 */
|
|
1033
1036
|
TRACE = 1,
|
|
1034
1037
|
/** 调试级别日志 */
|
|
@@ -1045,7 +1048,7 @@ declare namespace IG {
|
|
|
1045
1048
|
/**
|
|
1046
1049
|
* 日志工具
|
|
1047
1050
|
*/
|
|
1048
|
-
export
|
|
1051
|
+
export class LogUtil {
|
|
1049
1052
|
private static readonly LOG_TAG;
|
|
1050
1053
|
private static logLevel;
|
|
1051
1054
|
/**
|
|
@@ -1101,7 +1104,7 @@ declare namespace IG {
|
|
|
1101
1104
|
/**
|
|
1102
1105
|
* 本地存储工具类
|
|
1103
1106
|
*/
|
|
1104
|
-
export
|
|
1107
|
+
export class StorageUtil {
|
|
1105
1108
|
/**
|
|
1106
1109
|
* 检查是否可以缓存
|
|
1107
1110
|
* @param key 数据key
|
|
@@ -1140,7 +1143,7 @@ declare namespace IG {
|
|
|
1140
1143
|
/**
|
|
1141
1144
|
* 客户端类型
|
|
1142
1145
|
*/
|
|
1143
|
-
export
|
|
1146
|
+
export enum CLIENT_TYPE {
|
|
1144
1147
|
/** 未获取 */
|
|
1145
1148
|
UNKNOWN = 0,
|
|
1146
1149
|
/** Android原生应用 */
|
|
@@ -1165,7 +1168,7 @@ declare namespace IG {
|
|
|
1165
1168
|
/**
|
|
1166
1169
|
* 操作系统类型
|
|
1167
1170
|
*/
|
|
1168
|
-
export
|
|
1171
|
+
export enum OS_TYPE {
|
|
1169
1172
|
/** 未获取 */
|
|
1170
1173
|
UNKNOWN = 0,
|
|
1171
1174
|
/** Android(包含其他由Android系统封装的系统) */
|
|
@@ -1186,7 +1189,7 @@ declare namespace IG {
|
|
|
1186
1189
|
/**
|
|
1187
1190
|
* SDK基类
|
|
1188
1191
|
*/
|
|
1189
|
-
export
|
|
1192
|
+
export class IGSdk {
|
|
1190
1193
|
private static sys;
|
|
1191
1194
|
private static reflection;
|
|
1192
1195
|
private static inited;
|
|
@@ -1245,7 +1248,6 @@ declare namespace IG {
|
|
|
1245
1248
|
*/
|
|
1246
1249
|
private static initOsType;
|
|
1247
1250
|
}
|
|
1248
|
-
|
|
1249
1251
|
}
|
|
1250
1252
|
|
|
1251
1253
|
export = IG;
|