@momo-cloud/gami-sdk 0.0.33 → 0.0.35
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/index.public.d.ts +36 -125
- package/dist/index.public.js +1123 -952
- package/package.json +2 -24
package/dist/index.public.d.ts
CHANGED
|
@@ -25,13 +25,13 @@ declare const GamiSDK: {
|
|
|
25
25
|
gameId: string;
|
|
26
26
|
userId: string | undefined;
|
|
27
27
|
userInfo: IUserInfo | null;
|
|
28
|
-
deviceInfo:
|
|
28
|
+
deviceInfo: TDeviceInfo;
|
|
29
29
|
isBrowser: boolean;
|
|
30
30
|
feature: any;
|
|
31
31
|
isIos: boolean;
|
|
32
32
|
isProd: boolean;
|
|
33
33
|
isUat: boolean;
|
|
34
|
-
|
|
34
|
+
closeApp: () => void;
|
|
35
35
|
goHome: () => void;
|
|
36
36
|
init: ({ gameId, source, appjson, userId }: {
|
|
37
37
|
gameId?: string;
|
|
@@ -39,73 +39,74 @@ declare const GamiSDK: {
|
|
|
39
39
|
appjson: string;
|
|
40
40
|
userId?: string;
|
|
41
41
|
}) => Promise<void>;
|
|
42
|
-
customGameRequest: (
|
|
42
|
+
customGameRequest: (params: {
|
|
43
43
|
subDomain?: string;
|
|
44
44
|
path: string;
|
|
45
45
|
method: string;
|
|
46
46
|
body?: any;
|
|
47
47
|
extraHeader?: any;
|
|
48
|
-
|
|
48
|
+
mockData?: any;
|
|
49
|
+
}) => Promise<any>;
|
|
49
50
|
startGame: () => Promise<any>;
|
|
50
51
|
endGame: () => Promise<void>;
|
|
51
|
-
getBalance: (
|
|
52
|
+
getBalance: (params: {
|
|
52
53
|
balanceIds: string[];
|
|
53
|
-
}) => Promise<
|
|
54
|
-
getBalanceConfig: () => Promise<
|
|
54
|
+
}) => Promise<any>;
|
|
55
|
+
getBalanceConfig: () => Promise<any>;
|
|
55
56
|
getConfig: () => Promise<any>;
|
|
56
|
-
getTheme: (
|
|
57
|
+
getTheme: (params: {
|
|
57
58
|
ext: string;
|
|
58
59
|
name: string;
|
|
59
60
|
}) => Promise<any>;
|
|
60
|
-
submit: (
|
|
61
|
+
submit: (params: {
|
|
61
62
|
steps: any[];
|
|
62
63
|
score: number;
|
|
63
64
|
}) => Promise<any>;
|
|
64
65
|
spin: () => Promise<any>;
|
|
65
66
|
getMilestone: () => Promise<any>;
|
|
66
|
-
getLeaderboard: (
|
|
67
|
+
getLeaderboard: (params: {
|
|
67
68
|
boardId: string;
|
|
68
|
-
group
|
|
69
|
+
group?: "friend" | "global";
|
|
69
70
|
limit?: number;
|
|
70
71
|
page?: number;
|
|
71
|
-
}) => Promise<
|
|
72
|
-
getEvent: (
|
|
72
|
+
}) => Promise<any>;
|
|
73
|
+
getEvent: (params: {
|
|
73
74
|
eventId: string;
|
|
74
|
-
}) => Promise<
|
|
75
|
-
getHistory: (
|
|
75
|
+
}) => Promise<any>;
|
|
76
|
+
getHistory: (params: {
|
|
76
77
|
page: number;
|
|
77
78
|
limit: number;
|
|
78
|
-
}) => Promise<
|
|
79
|
+
}) => Promise<any>;
|
|
79
80
|
showToast: (params: {
|
|
80
81
|
title?: string;
|
|
81
82
|
description: string;
|
|
82
83
|
duration: number;
|
|
83
84
|
type?: "success" | "failure" | "info";
|
|
84
|
-
}) =>
|
|
85
|
-
showAlert: (title: string, message: string, buttons?: string[]) =>
|
|
85
|
+
}) => any;
|
|
86
|
+
showAlert: (title: string, message: string, buttons?: string[]) => any;
|
|
86
87
|
setItem: (key: string, obj: any) => void;
|
|
87
|
-
getItem: (key: string) => Promise<
|
|
88
|
+
getItem: (key: string) => Promise<unknown>;
|
|
88
89
|
openWeb: ({ url, html, title }: {
|
|
89
90
|
url?: string;
|
|
90
91
|
html?: string;
|
|
91
92
|
title?: string;
|
|
92
|
-
}) => Promise<
|
|
93
|
-
openURL: (url: string) => Promise<
|
|
94
|
-
scanQRCode: () => Promise<
|
|
93
|
+
}) => Promise<any>;
|
|
94
|
+
openURL: (url: string) => Promise<any>;
|
|
95
|
+
scanQRCode: () => Promise<any>;
|
|
95
96
|
shareExternal: (params: {
|
|
96
97
|
title?: string;
|
|
97
98
|
message?: string;
|
|
98
99
|
url?: string;
|
|
99
100
|
subject?: string;
|
|
100
|
-
}) => Promise<
|
|
101
|
-
copyToClipBoard: (text: string, message?: string) => Promise<
|
|
102
|
-
shareFacebook: (url: string) => Promise<
|
|
103
|
-
shareMessenger: (url: string) => Promise<
|
|
104
|
-
requestPermission: (permission: string) => Promise<
|
|
105
|
-
checkPermission: (permission: string) => Promise<
|
|
106
|
-
getContacts: () => Promise<
|
|
101
|
+
}) => Promise<any>;
|
|
102
|
+
copyToClipBoard: (text: string, message?: string) => Promise<any>;
|
|
103
|
+
shareFacebook: (url: string) => Promise<any>;
|
|
104
|
+
shareMessenger: (url: string) => Promise<any>;
|
|
105
|
+
requestPermission: (permission: string) => Promise<any>;
|
|
106
|
+
checkPermission: (permission: string) => Promise<any>;
|
|
107
|
+
getContacts: () => Promise<any>;
|
|
107
108
|
formatUrl: (origin: string, args?: any[]) => string;
|
|
108
|
-
request: ({ path, method, subDomain, params, body, extraHeader }: {
|
|
109
|
+
request: ({ path, method, subDomain, params, body, extraHeader, useCloudMsg, mockData }: {
|
|
109
110
|
path: string;
|
|
110
111
|
method: string;
|
|
111
112
|
subDomain?: string;
|
|
@@ -113,6 +114,7 @@ declare const GamiSDK: {
|
|
|
113
114
|
body?: any;
|
|
114
115
|
extraHeader?: any;
|
|
115
116
|
useCloudMsg?: boolean;
|
|
117
|
+
mockData?: any;
|
|
116
118
|
}) => Promise<any>;
|
|
117
119
|
fetch: ({ path, method, subDomain, params, body, extraHeader }: {
|
|
118
120
|
path: string;
|
|
@@ -139,12 +141,12 @@ declare const GamiSDK: {
|
|
|
139
141
|
alarm: number | Date;
|
|
140
142
|
des: string;
|
|
141
143
|
toast?: string;
|
|
142
|
-
}) => Promise<
|
|
143
|
-
requestPlatformApi: (name: string, ...params: any[]) =>
|
|
144
|
+
}) => Promise<unknown>;
|
|
145
|
+
requestPlatformApi: (name: string, ...params: any[]) => Promise<unknown>;
|
|
144
146
|
listen: (name: string, callback: (args: any[]) => void) => void;
|
|
145
147
|
listenShaking: ({ onShake }: {
|
|
146
148
|
onShake: (data: any) => void;
|
|
147
|
-
}) =>
|
|
149
|
+
}) => any;
|
|
148
150
|
onFocusApp: (callback: () => void) => void;
|
|
149
151
|
onBlurApp: (callback: () => void) => void;
|
|
150
152
|
registerNoti: (action: (data: any) => void) => void;
|
|
@@ -170,7 +172,7 @@ declare const GamiSDK: {
|
|
|
170
172
|
refId: string;
|
|
171
173
|
refExtra?: string | object;
|
|
172
174
|
useWeb?: boolean;
|
|
173
|
-
}) =>
|
|
175
|
+
}) => any;
|
|
174
176
|
};
|
|
175
177
|
export { GamiSDK }
|
|
176
178
|
export default GamiSDK;
|
|
@@ -194,26 +196,6 @@ declare interface StorageAPI {
|
|
|
194
196
|
cacheFile(url: string): Promise<string>;
|
|
195
197
|
}
|
|
196
198
|
|
|
197
|
-
declare type TBalance = {
|
|
198
|
-
response_info: {
|
|
199
|
-
error_message: string;
|
|
200
|
-
error_code: number;
|
|
201
|
-
event_tracking: string;
|
|
202
|
-
};
|
|
203
|
-
result: {
|
|
204
|
-
config?: TBalanceConfig[];
|
|
205
|
-
balances: {
|
|
206
|
-
[key: string]: number;
|
|
207
|
-
};
|
|
208
|
-
};
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
declare type TBalanceConfig = {
|
|
212
|
-
balanceId: string;
|
|
213
|
-
name: string;
|
|
214
|
-
icon: string;
|
|
215
|
-
};
|
|
216
|
-
|
|
217
199
|
export declare type TDeviceInfo = {
|
|
218
200
|
appVersion: string;
|
|
219
201
|
buildVersion: string;
|
|
@@ -223,77 +205,6 @@ export declare type TDeviceInfo = {
|
|
|
223
205
|
devicePerformance?: string;
|
|
224
206
|
};
|
|
225
207
|
|
|
226
|
-
declare type TDeviceInfo_2 = {
|
|
227
|
-
appVersion: string;
|
|
228
|
-
buildVersion: string;
|
|
229
|
-
bundleId: string;
|
|
230
|
-
deviceManufacturer?: string;
|
|
231
|
-
deviceName?: string;
|
|
232
|
-
devicePerformance?: string;
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
declare type TEvent = {
|
|
236
|
-
response_info: {
|
|
237
|
-
error_message: string;
|
|
238
|
-
error_code: number;
|
|
239
|
-
event_tracking: string;
|
|
240
|
-
};
|
|
241
|
-
result: TeventItem[];
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
declare type TeventItem = {
|
|
245
|
-
id: string;
|
|
246
|
-
startMs: number;
|
|
247
|
-
endMs: number;
|
|
248
|
-
title: string;
|
|
249
|
-
banner1x2: string;
|
|
250
|
-
banner1x1: string;
|
|
251
|
-
refId: string;
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
declare type THistory = {
|
|
255
|
-
response_info: {
|
|
256
|
-
error_message: string;
|
|
257
|
-
error_code: number;
|
|
258
|
-
event_tracking: string;
|
|
259
|
-
};
|
|
260
|
-
result: {
|
|
261
|
-
history: THistoryItem[];
|
|
262
|
-
category: string[];
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
declare type THistoryItem = {
|
|
267
|
-
tag: string[];
|
|
268
|
-
icon: string;
|
|
269
|
-
title: string;
|
|
270
|
-
desc: string;
|
|
271
|
-
refId: string;
|
|
272
|
-
refExtra: string;
|
|
273
|
-
timestamp: number;
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
declare type TLeaderboard = {
|
|
277
|
-
response_info: {
|
|
278
|
-
error_message: string;
|
|
279
|
-
error_code: number;
|
|
280
|
-
event_tracking: string;
|
|
281
|
-
};
|
|
282
|
-
result: {
|
|
283
|
-
serverTime: number;
|
|
284
|
-
resetTime: number;
|
|
285
|
-
metadata: TLeaderboardItem;
|
|
286
|
-
board: TLeaderboardItem[];
|
|
287
|
-
};
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
declare type TLeaderboardItem = {
|
|
291
|
-
name: string;
|
|
292
|
-
avatar: string;
|
|
293
|
-
rank: number;
|
|
294
|
-
score: number;
|
|
295
|
-
};
|
|
296
|
-
|
|
297
208
|
export declare const Utils: {
|
|
298
209
|
num10to11: (number: string) => string;
|
|
299
210
|
num11to10: (number: string) => string;
|