@momo-cloud/gami-sdk 0.0.34 → 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 +23 -31
- package/dist/index.public.js +1078 -1079
- 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;
|
|
@@ -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,12 @@ 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>;
|
|
145
146
|
listen: (name: string, callback: (args: any[]) => void) => void;
|
|
146
147
|
listenShaking: ({ onShake }: {
|
|
147
148
|
onShake: (data: any) => void;
|
|
148
|
-
}) =>
|
|
149
|
+
}) => any;
|
|
149
150
|
onFocusApp: (callback: () => void) => void;
|
|
150
151
|
onBlurApp: (callback: () => void) => void;
|
|
151
152
|
registerNoti: (action: (data: any) => void) => void;
|
|
@@ -171,7 +172,7 @@ declare const GamiSDK: {
|
|
|
171
172
|
refId: string;
|
|
172
173
|
refExtra?: string | object;
|
|
173
174
|
useWeb?: boolean;
|
|
174
|
-
}) =>
|
|
175
|
+
}) => any;
|
|
175
176
|
};
|
|
176
177
|
export { GamiSDK }
|
|
177
178
|
export default GamiSDK;
|
|
@@ -204,15 +205,6 @@ export declare type TDeviceInfo = {
|
|
|
204
205
|
devicePerformance?: string;
|
|
205
206
|
};
|
|
206
207
|
|
|
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
208
|
export declare const Utils: {
|
|
217
209
|
num10to11: (number: string) => string;
|
|
218
210
|
num11to10: (number: string) => string;
|