@momo-cloud/gami-sdk 0.0.28 → 0.0.30

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.
@@ -1,3 +1,5 @@
1
+ import { EventEmitter } from 'eventemitter3';
2
+
1
3
  export declare const Calendar: CalendarAPI;
2
4
 
3
5
  declare interface CalendarAPI {
@@ -14,14 +16,7 @@ declare interface CalendarAPI {
14
16
  }): Promise<boolean>;
15
17
  }
16
18
 
17
- export declare const GameEvent: GameEventEmitter;
18
-
19
- declare class GameEventEmitter extends EventTarget {
20
- on(event: string, listener: EventListener): this;
21
- off(event: string, listener: EventListener): this;
22
- emit(event: string, data?: any): boolean;
23
- once(event: string, listener: EventListener): this;
24
- }
19
+ export declare const GameEvent: EventEmitter<string | symbol, any>;
25
20
 
26
21
  declare const GamiSDK: {
27
22
  setServerTime: (value: number) => void;
@@ -30,13 +25,13 @@ declare const GamiSDK: {
30
25
  gameId: string;
31
26
  userId: string | undefined;
32
27
  userInfo: IUserInfo | null;
33
- deviceInfo: TDeviceInfo;
28
+ deviceInfo: TDeviceInfo_2;
34
29
  isBrowser: boolean;
35
30
  feature: any;
36
31
  isIos: boolean;
37
32
  isProd: boolean;
38
33
  isUat: boolean;
39
- closeApp: () => void;
34
+ close: () => void;
40
35
  goHome: () => void;
41
36
  init: ({ gameId, source, appjson, userId }: {
42
37
  gameId?: string;
@@ -79,31 +74,31 @@ declare const GamiSDK: {
79
74
  description: string;
80
75
  duration: number;
81
76
  type?: "success" | "failure" | "info";
82
- }) => any;
83
- showAlert: (title: string, message: string, buttons?: string[]) => any;
77
+ }) => void;
78
+ showAlert: (title: string, message: string, buttons?: string[]) => void;
84
79
  setItem: (key: string, obj: any) => void;
85
- getItem: (key: string) => Promise<unknown>;
80
+ getItem: (key: string) => Promise<any>;
86
81
  openWeb: ({ url, html, title }: {
87
82
  url?: string;
88
83
  html?: string;
89
84
  title?: string;
90
- }) => Promise<any>;
91
- openURL: (url: string) => Promise<any>;
92
- scanQRCode: () => Promise<any>;
85
+ }) => Promise<boolean>;
86
+ openURL: (url: string) => Promise<boolean>;
87
+ scanQRCode: () => Promise<null>;
93
88
  shareExternal: (params: {
94
89
  title?: string;
95
90
  message?: string;
96
91
  url?: string;
97
92
  subject?: string;
98
- }) => Promise<any>;
99
- copyToClipBoard: (text: string, message?: string) => Promise<any>;
100
- shareFacebook: (url: string) => Promise<any>;
101
- shareMessenger: (url: string) => Promise<any>;
102
- requestPermission: (permission: string) => Promise<any>;
103
- checkPermission: (permission: string) => Promise<any>;
104
- getContacts: () => Promise<any>;
93
+ }) => Promise<boolean>;
94
+ copyToClipBoard: (text: string, message?: string) => Promise<boolean>;
95
+ shareFacebook: (url: string) => Promise<boolean>;
96
+ shareMessenger: (url: string) => Promise<boolean>;
97
+ requestPermission: (permission: string) => Promise<string>;
98
+ checkPermission: (permission: string) => Promise<string>;
99
+ getContacts: () => Promise<null>;
105
100
  formatUrl: (origin: string, args?: any[]) => string;
106
- request: ({ path, method, subDomain, params, body, extraHeader, useCloudMsg }: {
101
+ request: ({ path, method, subDomain, params, body, extraHeader }: {
107
102
  path: string;
108
103
  method: string;
109
104
  subDomain?: string;
@@ -137,12 +132,12 @@ declare const GamiSDK: {
137
132
  alarm: number | Date;
138
133
  des: string;
139
134
  toast?: string;
140
- }) => Promise<unknown>;
141
- requestPlatformApi: (name: string, ...params: any[]) => Promise<unknown>;
135
+ }) => Promise<boolean>;
136
+ requestPlatformApi: (name: string, ...params: any[]) => null;
142
137
  listen: (name: string, callback: (args: any[]) => void) => void;
143
138
  listenShaking: ({ onShake }: {
144
139
  onShake: (data: any) => void;
145
- }) => any;
140
+ }) => undefined;
146
141
  onFocusApp: (callback: () => void) => void;
147
142
  onBlurApp: (callback: () => void) => void;
148
143
  registerNoti: (action: (data: any) => void) => void;
@@ -168,7 +163,7 @@ declare const GamiSDK: {
168
163
  refId: string;
169
164
  refExtra?: string | object;
170
165
  useWeb?: boolean;
171
- }) => any;
166
+ }) => void;
172
167
  };
173
168
  export { GamiSDK }
174
169
  export default GamiSDK;
@@ -217,6 +212,17 @@ export declare type TDeviceInfo = {
217
212
  buildVersion: string;
218
213
  bundleId: string;
219
214
  deviceManufacturer?: string;
215
+ deviceName?: string;
216
+ devicePerformance?: string;
217
+ };
218
+
219
+ declare type TDeviceInfo_2 = {
220
+ appVersion: string;
221
+ buildVersion: string;
222
+ bundleId: string;
223
+ deviceManufacturer?: string;
224
+ deviceName?: string;
225
+ devicePerformance?: string;
220
226
  };
221
227
 
222
228
  declare type TEvent = {