SDKDefault.ts
5.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
/** 返回参数类型 */
interface IResult<T> {
/** 错误码 */
code?: number;
/** 错误信息 */
msg?: string;
/** 返回数据 */
data?: T;
/** 服务器时间 */
servertime?: number;
}
/** 微信api 返回用户信息 */
interface WxUserInfo {
/** 用户昵称 */
nickName: string;
/** 用户头像图片的 URL。URL 最后一个数值代表正方形头像大小
* (有 0、46、64、96、132 数值可选,0 代表 640x640 的正方形头像,46 表示 46x46 的正方形头像,
* 剩余数值以此类推。默认132),用户没有头像时该项为空。若用户更换头像,原有头像 URL 将失效。 */
avatarUrl: string;
/** 用户性别 gender的合法值(0未知,1男性,2女性) */
gender: number;
/** 用户所在国家 */
country: string;
/** 用户所在省份 */
province: string;
/** 用户所在城市 */
city: string;
/** 显示 country,province,city 所用的语言(en英文,zh_CN简体中文,zh_TW繁体中文) */
language: string;
}
/** 显示模态对话框参数类型 */
interface ShowModalType {
/** 提示的标题 */
title: string;
/** 提示的内容 */
content: string;
/** 是否显示取消按钮 */
showCancel?: boolean;
/** 取消按钮的文字,最多 4 个字符 */
cancelText?: string;
/** 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 */
cancelColor?: string;
/** 确认按钮的文字,最多 4 个字符 */
confirmText?: string;
/** 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 */
confirmColor?: string;
/** 接口调用成功的回调函数 */
success?: (res: { confirm: boolean, cancel: boolean }) => void;
/** 接口调用失败的回调函数 */
fail?: () => void;
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
complete?: () => void;
}
/**
* 排行榜数据
*/
interface IRankData {
fraction: number, // 对应type传入的分数、数量或者其他
headurl: string, //头像
nickname: string,//昵称
uid: number//用户id
rankData: any //扩展参数
}
interface _NetworkTypeSuccessObject {
networkType: string; // wifi/2g/3g/4g/unknown(Android 下不常见的网络类型)/none(无网络)
}
interface _StyleObject {
left?: number;
top?: number;
width?: number;
height?: number;
}
interface _StyleGameObject {
left?: number;
top?: number;
}
interface _BannerAdObject {
adUnitId: string;
adIntervals?: number;
style: _StyleObject;
}
interface _FeedbackButtonObject {
/**
* 按钮的类型
*/
type: string;
/**
* 按钮上的文本,仅当 type 为 text 时有效
*/
text?: string;
/**
* 按钮的背景图片,仅当 type 为 image 时有效
*/
image?: string;
/**
* 按钮的样式
*/
style: _ButtonStyle;
}
interface _UserInfoButton {
type: string;
text: string;
image: string;
style: _ButtonStyle;
show: Function;
hide: Function;
destroy: Function;
onTap: (callback: Function) => void;
offTap: (callback: Function) => void;
}
interface _ShareAppMessageObject {
/**
* 是否使用带 shareTicket 的转发详情
*/
withShareTicket?: boolean;
/**
* 发标题,不传则默认使用当前小游戏的昵称。
*/
title?: string;
/**
* 转发显示图片的链接,可以是网络图片路径或本地图片文件路径或相对代码包根目录的图片文件路径。显示图片长宽比是 5: 4
*/
imageUrl?: string;
/**
* 查询字符串,必须是 key1 = val1 & key2=val2 的格式。从这条转发消息进入后,可通过 wx.getLaunchOptionSync() 或 wx.onShow() 获取启动参数中的 query。
*/
query?: string;
/**
* 审核通过的图片 ID,详见 使用审核通过的转发图片
*/
imageUrlId?: string;
/**
* 10.10后废弃
*/
success?: (ret?: any) => void;
/**
* 接口调用失败的回调函数
*/
fail?: (err?: any) => void;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: () => void;
/**
* 接口取消的回调
*/
cancel?: () => void;
}
interface _UpdateShareMenuObject {
/**
* 是否使用带 shareTicket 的转发
*/
withShareTicket?: boolean;
/**
* 接口调用成功的回调函数
*/
success?: () => void;
/**
* 接口调用失败的回调函数
*/
fail?: () => void;
/**
* 接口调用结束的回调函数(调用成功、失败都会执行)
*/
complete?: () => void;
/**
* 接口取消的回调
*/
cancel?: () => void;
}
interface _getShareInfoSuccessObject {
/**
* 错误信息
*/
errMsg: string;
/**
* 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](./signature.md#加密数据解密算法)
*/
encryptedData: string;
/**
* 加密算法的初始向量,详细见[加密数据解密算法](./signature.md#加密数据解密算法)
*/
iv: string;
}
interface IGameList {
id: number,//唯一id
appid: string,//微信appid
path: string, //携带参数
icon: string, //游戏icon
game: string //游戏名称
adtyp: string,//类型
animation: string,//骨骼
highlight: string,//是否高亮
}