@momo-cloud/gami-sdk 0.0.68 → 0.0.82
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/README.md +173 -775
- package/dist/index.public.d.ts +32 -311
- package/dist/index.public.js +1607 -1213
- package/package.json +3 -6
package/dist/index.public.d.ts
CHANGED
|
@@ -1,313 +1,34 @@
|
|
|
1
|
-
import { EventEmitter } from 'eventemitter3';
|
|
2
|
-
import { EventSource as EventSource_2 } from 'eventsource';
|
|
3
|
-
|
|
4
|
-
export declare const Calendar: CalendarAPI;
|
|
5
|
-
|
|
6
|
-
declare interface CalendarAPI {
|
|
7
|
-
checkExitsCalendar(key: string): Promise<boolean>;
|
|
8
|
-
checkAndRemindCalendar(params: {
|
|
9
|
-
title: string;
|
|
10
|
-
startDate: number | Date;
|
|
11
|
-
endDate: number | Date;
|
|
12
|
-
notes: string;
|
|
13
|
-
key: string;
|
|
14
|
-
alarm: number | Date;
|
|
15
|
-
desc: string;
|
|
16
|
-
toast?: string;
|
|
17
|
-
}): Promise<boolean>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export declare const GameEvent: EventEmitter<string | symbol, any>;
|
|
21
|
-
|
|
22
|
-
declare const GamiSDK: {
|
|
23
|
-
setServerTime: (value: number) => void;
|
|
24
|
-
getServerTime: () => number;
|
|
25
|
-
token: string;
|
|
26
|
-
gameId: string;
|
|
27
|
-
userId: string | undefined;
|
|
28
|
-
appProfile: TAppProfile;
|
|
29
|
-
userInfo: IUserInfo | null;
|
|
30
|
-
deviceInfo: TDeviceInfo;
|
|
31
|
-
isBrowser: boolean;
|
|
32
|
-
feature: any;
|
|
33
|
-
isIos: boolean;
|
|
34
|
-
isProd: boolean;
|
|
35
|
-
isUat: boolean;
|
|
36
|
-
wait: () => Promise<unknown>;
|
|
37
|
-
closeApp: () => void;
|
|
38
|
-
goHome: () => void;
|
|
39
|
-
init: ({ gameId, source, appjson, userId }: {
|
|
40
|
-
gameId?: string;
|
|
41
|
-
source?: string;
|
|
42
|
-
appjson: string;
|
|
43
|
-
userId?: string;
|
|
44
|
-
}) => Promise<void>;
|
|
45
|
-
customGameRequest: (params: {
|
|
46
|
-
subDomain?: string;
|
|
47
|
-
path: string;
|
|
48
|
-
method: string;
|
|
49
|
-
body?: any;
|
|
50
|
-
extraHeader?: any;
|
|
51
|
-
mockData?: any;
|
|
52
|
-
}) => Promise<any>;
|
|
53
|
-
startGame: () => Promise<any>;
|
|
54
|
-
endGame: () => Promise<void>;
|
|
55
|
-
getBalance: (params: {
|
|
56
|
-
balanceId: string;
|
|
57
|
-
}) => Promise<any>;
|
|
58
|
-
getBalanceConfig: () => Promise<any>;
|
|
59
|
-
getConfig: () => Promise<any>;
|
|
60
|
-
getCoinExchangeInfo: (params?: {
|
|
61
|
-
actionId?: string;
|
|
62
|
-
}) => Promise<TGetExchangeResponse>;
|
|
63
|
-
coinExchange: (params: {
|
|
64
|
-
amount: number;
|
|
65
|
-
actionId?: string;
|
|
66
|
-
}) => Promise<TPostExchangeResponse>;
|
|
67
|
-
spin: () => Promise<any>;
|
|
68
|
-
getLeaderboard: (params: {
|
|
69
|
-
boardId: string;
|
|
70
|
-
group?: "friend" | "global";
|
|
71
|
-
limit?: number;
|
|
72
|
-
page?: number;
|
|
73
|
-
}) => Promise<any>;
|
|
74
|
-
getEvent: (params: {
|
|
75
|
-
eventId: string;
|
|
76
|
-
}) => Promise<any>;
|
|
77
|
-
getHistory: (params: {
|
|
78
|
-
page: number;
|
|
79
|
-
limit: number;
|
|
80
|
-
}) => Promise<any>;
|
|
81
|
-
getMission: (params: {
|
|
82
|
-
viewId?: string;
|
|
83
|
-
}) => Promise<any>;
|
|
84
|
-
showToast: (params: {
|
|
85
|
-
title?: string;
|
|
86
|
-
description: string;
|
|
87
|
-
duration: number;
|
|
88
|
-
type?: "success" | "warning" | "error" | "info" | "failure";
|
|
89
|
-
}) => any;
|
|
90
|
-
showAlert: (title: string, message: string, buttons?: string[]) => any;
|
|
91
|
-
setItem: (key: string, obj: any) => void;
|
|
92
|
-
getItem: (key: string) => Promise<unknown>;
|
|
93
|
-
setProfile: (profile: {
|
|
94
|
-
avatar: string;
|
|
95
|
-
}) => void;
|
|
96
|
-
openWeb: ({ url, html, title }: {
|
|
97
|
-
url?: string;
|
|
98
|
-
html?: string;
|
|
99
|
-
title?: string;
|
|
100
|
-
}) => Promise<any>;
|
|
101
|
-
openURL: (url: string) => Promise<any>;
|
|
102
|
-
scanQRCode: () => Promise<any>;
|
|
103
|
-
shareExternal: (params: {
|
|
104
|
-
title?: string;
|
|
105
|
-
message?: string;
|
|
106
|
-
url?: string;
|
|
107
|
-
subject?: string;
|
|
108
|
-
}) => Promise<any>;
|
|
109
|
-
copyToClipBoard: (text: string, message?: string) => Promise<any>;
|
|
110
|
-
shareFacebook: (link: string) => Promise<any>;
|
|
111
|
-
shareFacebookImage: (image: string) => Promise<any>;
|
|
112
|
-
shareMessenger: (link: string) => Promise<any>;
|
|
113
|
-
requestPermission: (permission: string, showPopupPermission?: boolean) => Promise<any>;
|
|
114
|
-
checkPermission: (permission: string) => Promise<any>;
|
|
115
|
-
getContacts: ({ isMoMo, contactType }?: {
|
|
116
|
-
isMoMo?: boolean | undefined;
|
|
117
|
-
contactType?: "device" | string | undefined;
|
|
118
|
-
}) => Promise<any[]>;
|
|
119
|
-
formatUrl: (origin: string, args?: any[]) => string;
|
|
120
|
-
request: ({ path, method, subDomain, params, body, formData, extraHeader, useCloudMsg, useSendMessage, mockData, SignSecure }: {
|
|
121
|
-
path: string;
|
|
122
|
-
method: string;
|
|
123
|
-
subDomain?: string;
|
|
124
|
-
params?: any[];
|
|
125
|
-
body?: any;
|
|
126
|
-
formData?: any;
|
|
127
|
-
extraHeader?: any;
|
|
128
|
-
useCloudMsg?: boolean;
|
|
129
|
-
useSendMessage?: boolean;
|
|
130
|
-
mockData?: any;
|
|
131
|
-
SignSecure?: boolean;
|
|
132
|
-
}) => Promise<any>;
|
|
133
|
-
fetch: ({ path, method, subDomain, params, body, formData, extraHeader, mockData, useCloudMsg, useSendMessage }: {
|
|
134
|
-
path: string;
|
|
135
|
-
method: string;
|
|
136
|
-
params?: any[];
|
|
137
|
-
subDomain?: string;
|
|
138
|
-
body?: any;
|
|
139
|
-
formData?: any;
|
|
140
|
-
extraHeader?: any;
|
|
141
|
-
mockData?: any;
|
|
142
|
-
useCloudMsg?: boolean;
|
|
143
|
-
useSendMessage?: boolean;
|
|
144
|
-
}) => Promise<any>;
|
|
145
|
-
screenTracking: ({ game_id, event_name, action_name, screen_name, extra, error_code }: {
|
|
146
|
-
game_id?: string;
|
|
147
|
-
event_name: string;
|
|
148
|
-
action_name: string;
|
|
149
|
-
screen_name: string;
|
|
150
|
-
extra?: object;
|
|
151
|
-
error_code?: string | number;
|
|
152
|
-
}) => void;
|
|
153
|
-
fetchBinary: ({ url }: {
|
|
154
|
-
url: string;
|
|
155
|
-
}) => Promise<unknown>;
|
|
156
|
-
fetchProtobuf: ({ path, method, subDomain, param, body }: {
|
|
157
|
-
path: string;
|
|
158
|
-
method: string;
|
|
159
|
-
subDomain?: string;
|
|
160
|
-
param?: any;
|
|
161
|
-
body?: any;
|
|
162
|
-
}) => Promise<unknown>;
|
|
163
|
-
saveCalendarEvent: ({ title, startDate, endDate, notes, key, alarm, des, toast }: {
|
|
164
|
-
title: string;
|
|
165
|
-
startDate: number | Date;
|
|
166
|
-
endDate: number | Date;
|
|
167
|
-
notes: string;
|
|
168
|
-
key: string;
|
|
169
|
-
alarm: number | Date;
|
|
170
|
-
des: string;
|
|
171
|
-
toast?: string;
|
|
172
|
-
}) => Promise<unknown>;
|
|
173
|
-
requestPlatformApi: (name: string, ...params: any[]) => Promise<unknown>;
|
|
174
|
-
saveImage: (base64: string) => Promise<unknown>;
|
|
175
|
-
getImage: (params: {
|
|
176
|
-
type?: "camera" | "album" | "photo" | "storage";
|
|
177
|
-
quality?: number;
|
|
178
|
-
maxWidth?: number;
|
|
179
|
-
maxHeight?: number;
|
|
180
|
-
allowEdit?: boolean;
|
|
181
|
-
}) => Promise<any>;
|
|
182
|
-
listen: (name: string, callback: (args: any[]) => void) => void;
|
|
183
|
-
listenShaking: ({ onShake }: {
|
|
184
|
-
onShake: (data: any) => void;
|
|
185
|
-
}) => any;
|
|
186
|
-
onFocusApp: (callback: () => void) => void;
|
|
187
|
-
onBlurApp: (callback: () => void) => void;
|
|
188
|
-
registerNoti: (action: (data: any) => void) => void;
|
|
189
|
-
unregisterNoti: () => void;
|
|
190
|
-
openLoginApp: ({ path, subDomain, params, options, pinKey }: {
|
|
191
|
-
path: string;
|
|
192
|
-
subDomain?: "ai" | "aws" | "api";
|
|
193
|
-
params?: any;
|
|
194
|
-
options?: any;
|
|
195
|
-
pinKey?: string;
|
|
196
|
-
}, callback: (data: any) => void) => void;
|
|
197
|
-
UploadImage: (base64: string) => Promise<string>;
|
|
198
|
-
getScreenShot: () => Promise<unknown>;
|
|
199
|
-
trackingEvent: (event: string, data: any) => void;
|
|
200
|
-
startRefId: ({ refId, refExtra, useWeb }: {
|
|
201
|
-
refId: string;
|
|
202
|
-
refExtra?: string | object;
|
|
203
|
-
useWeb?: boolean;
|
|
204
|
-
}) => any;
|
|
205
|
-
};
|
|
206
|
-
export { GamiSDK }
|
|
207
|
-
export default GamiSDK;
|
|
208
|
-
|
|
209
|
-
declare interface IStorageAPI {
|
|
210
|
-
cacheJson(key: string, obj: any): void;
|
|
211
|
-
cacheValue(key: string, val: any): void;
|
|
212
|
-
getJson(key: string, defaultValue?: any): Promise<any>;
|
|
213
|
-
getValue(key: string, defaultValue?: any): Promise<any>;
|
|
214
|
-
getInCache(url: string): string | undefined;
|
|
215
|
-
cacheFile(url: string): Promise<string>;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export declare interface IUserInfo {
|
|
219
|
-
id: string;
|
|
220
|
-
name?: string;
|
|
221
|
-
displayName?: string;
|
|
222
|
-
avatar?: string;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
export declare class SSE {
|
|
226
|
-
static create(url: string): EventSource_2;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
declare const Storage_2: IStorageAPI;
|
|
230
|
-
export { Storage_2 as Storage }
|
|
231
|
-
|
|
232
|
-
declare type TAppProfile = {
|
|
233
|
-
id: string;
|
|
234
|
-
userId: string;
|
|
235
|
-
name: string;
|
|
236
|
-
displayName: string;
|
|
237
|
-
avatar: string;
|
|
238
|
-
userInputDateOfBirth: string;
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
export declare type TDeviceInfo = {
|
|
242
|
-
appVersion: string;
|
|
243
|
-
buildVersion: string;
|
|
244
|
-
bundleId: string;
|
|
245
|
-
deviceManufacturer?: string;
|
|
246
|
-
deviceName?: string;
|
|
247
|
-
devicePerformance?: string;
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
export declare type TGetExchangeResponse = {
|
|
251
|
-
response_info: {
|
|
252
|
-
error_message: string;
|
|
253
|
-
error_code: number;
|
|
254
|
-
event_tracking: string;
|
|
255
|
-
};
|
|
256
|
-
result: {
|
|
257
|
-
balance: number;
|
|
258
|
-
exchangeRate: number;
|
|
259
|
-
counter: number;
|
|
260
|
-
counterLimit: number;
|
|
261
|
-
fromCurrency: string;
|
|
262
|
-
toCurrency: string;
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
export declare type TPostExchangeResponse = {
|
|
267
|
-
response_info: {
|
|
268
|
-
error_message: string;
|
|
269
|
-
error_code: number;
|
|
270
|
-
event_tracking: string;
|
|
271
|
-
};
|
|
272
|
-
result: {
|
|
273
|
-
from: {
|
|
274
|
-
walletType: string;
|
|
275
|
-
currency: string;
|
|
276
|
-
before: number;
|
|
277
|
-
after: number;
|
|
278
|
-
};
|
|
279
|
-
to: {
|
|
280
|
-
walletType: string;
|
|
281
|
-
currency: string;
|
|
282
|
-
before: number;
|
|
283
|
-
after: number;
|
|
284
|
-
};
|
|
285
|
-
counter: {
|
|
286
|
-
value: number;
|
|
287
|
-
limit: number;
|
|
288
|
-
};
|
|
289
|
-
};
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
export declare const Utils: {
|
|
293
|
-
num10to11: (number: string) => string;
|
|
294
|
-
num11to10: (number: string) => string;
|
|
295
|
-
shortName: (name: string) => string;
|
|
296
|
-
shortName2: (name: string) => string;
|
|
297
|
-
numberWithDot: (x: number) => string;
|
|
298
|
-
};
|
|
299
|
-
|
|
300
|
-
export { }
|
|
1
|
+
import { EventEmitter } from 'eventemitter3';
|
|
301
2
|
|
|
302
|
-
declare
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
onHideLoading: any;
|
|
306
|
-
realtimeSinceStartup: any;
|
|
307
|
-
ReactNativeWebView: any;
|
|
308
|
-
traceScreenLoadId: string;
|
|
309
|
-
traceScreenInterractionId: string;
|
|
310
|
-
traceScreenGoalId: string;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
3
|
+
export declare const GameEvent: EventEmitter<string | symbol, any>;
|
|
4
|
+
export declare const GamiSDK: Record<string, any>;
|
|
5
|
+
export default GamiSDK;
|
|
313
6
|
|
|
7
|
+
export type IUserInfo = {
|
|
8
|
+
id: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
displayName?: string;
|
|
11
|
+
avatar?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type TDeviceInfo = {
|
|
15
|
+
appVersion: string;
|
|
16
|
+
buildVersion: string;
|
|
17
|
+
bundleId: string;
|
|
18
|
+
deviceManufacturer?: string;
|
|
19
|
+
deviceName?: string;
|
|
20
|
+
devicePerformance?: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type TGetExchangeResponse = any;
|
|
24
|
+
export type TPostExchangeResponse = any;
|
|
25
|
+
export type TSpin = any;
|
|
26
|
+
export type TShake = any;
|
|
27
|
+
export type TCoinBalanceResponse = any;
|
|
28
|
+
export type TBalance = any;
|
|
29
|
+
export type TBalanceConfig = any;
|
|
30
|
+
export type TGameConfig = any;
|
|
31
|
+
export type THistory = any;
|
|
32
|
+
export type TEvent = any;
|
|
33
|
+
export type TLeaderboard = any;
|
|
34
|
+
export type TMissionResponse = any;
|