@momo-cloud/gami-sdk 0.0.34 → 0.0.36
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 +33 -33
- package/dist/index.public.js +1086 -1084
- package/package.json +2 -24
package/dist/index.public.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { eventemitter3 } from 'eventemitter3';
|
|
2
2
|
|
|
3
3
|
export declare const Calendar: CalendarAPI;
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ declare interface CalendarAPI {
|
|
|
16
16
|
}): Promise<boolean>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
export declare const GameEvent:
|
|
19
|
+
export declare const GameEvent: eventemitter3<string | symbol, any>;
|
|
20
20
|
|
|
21
21
|
declare const GamiSDK: {
|
|
22
22
|
setServerTime: (value: number) => void;
|
|
@@ -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;
|
|
@@ -45,6 +45,7 @@ declare const GamiSDK: {
|
|
|
45
45
|
method: string;
|
|
46
46
|
body?: any;
|
|
47
47
|
extraHeader?: any;
|
|
48
|
+
mockData?: any;
|
|
48
49
|
}) => Promise<any>;
|
|
49
50
|
startGame: () => Promise<any>;
|
|
50
51
|
endGame: () => Promise<void>;
|
|
@@ -81,47 +82,47 @@ declare const GamiSDK: {
|
|
|
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, mockData }: {
|
|
109
|
+
request: ({ path, method, subDomain, params, body, extraHeader, useCloudMsg, mockData }: {
|
|
109
110
|
path: string;
|
|
110
111
|
method: string;
|
|
111
112
|
subDomain?: string;
|
|
112
113
|
params?: any[];
|
|
113
114
|
body?: any;
|
|
114
115
|
extraHeader?: any;
|
|
116
|
+
useCloudMsg?: boolean;
|
|
115
117
|
mockData?: any;
|
|
116
118
|
}) => Promise<any>;
|
|
117
|
-
fetch: ({ path, method, subDomain, params, body, extraHeader
|
|
119
|
+
fetch: ({ path, method, subDomain, params, body, extraHeader }: {
|
|
118
120
|
path: string;
|
|
119
121
|
method: string;
|
|
120
122
|
params?: any[];
|
|
121
123
|
subDomain?: string;
|
|
122
124
|
body?: any;
|
|
123
125
|
extraHeader?: any;
|
|
124
|
-
mockData?: any;
|
|
125
126
|
}) => Promise<any>;
|
|
126
127
|
fetchBinary: ({ url }: {
|
|
127
128
|
url: string;
|
|
@@ -140,12 +141,20 @@ declare const GamiSDK: {
|
|
|
140
141
|
alarm: number | Date;
|
|
141
142
|
des: string;
|
|
142
143
|
toast?: string;
|
|
143
|
-
}) => Promise<
|
|
144
|
-
requestPlatformApi: (name: string, ...params: any[]) =>
|
|
144
|
+
}) => Promise<unknown>;
|
|
145
|
+
requestPlatformApi: (name: string, ...params: any[]) => Promise<unknown>;
|
|
146
|
+
saveImage: (base64: string) => Promise<unknown>;
|
|
147
|
+
getImage: (params: {
|
|
148
|
+
type?: "camera" | "album" | "photo" | "storage";
|
|
149
|
+
quality?: number;
|
|
150
|
+
maxWidth?: number;
|
|
151
|
+
maxHeight?: number;
|
|
152
|
+
allowEdit?: boolean;
|
|
153
|
+
}) => Promise<any>;
|
|
145
154
|
listen: (name: string, callback: (args: any[]) => void) => void;
|
|
146
155
|
listenShaking: ({ onShake }: {
|
|
147
156
|
onShake: (data: any) => void;
|
|
148
|
-
}) =>
|
|
157
|
+
}) => any;
|
|
149
158
|
onFocusApp: (callback: () => void) => void;
|
|
150
159
|
onBlurApp: (callback: () => void) => void;
|
|
151
160
|
registerNoti: (action: (data: any) => void) => void;
|
|
@@ -171,7 +180,7 @@ declare const GamiSDK: {
|
|
|
171
180
|
refId: string;
|
|
172
181
|
refExtra?: string | object;
|
|
173
182
|
useWeb?: boolean;
|
|
174
|
-
}) =>
|
|
183
|
+
}) => any;
|
|
175
184
|
};
|
|
176
185
|
export { GamiSDK }
|
|
177
186
|
export default GamiSDK;
|
|
@@ -204,15 +213,6 @@ export declare type TDeviceInfo = {
|
|
|
204
213
|
devicePerformance?: string;
|
|
205
214
|
};
|
|
206
215
|
|
|
207
|
-
declare type TDeviceInfo_2 = {
|
|
208
|
-
appVersion: string;
|
|
209
|
-
buildVersion: string;
|
|
210
|
-
bundleId: string;
|
|
211
|
-
deviceManufacturer?: string;
|
|
212
|
-
deviceName?: string;
|
|
213
|
-
devicePerformance?: string;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
216
|
export declare const Utils: {
|
|
217
217
|
num10to11: (number: string) => string;
|
|
218
218
|
num11to10: (number: string) => string;
|