zmp-sdk 2.25.1 → 2.25.3

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/index.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { MPEEmitter as MPEEmitter$1 } from '@common/eventEmitter';
2
-
3
1
  /**
4
2
  * Minimal `EventEmitter` interface that is molded against the Node.js
5
3
  * `EventEmitter` interface.
@@ -133,14 +131,10 @@ declare namespace EventEmitter {
133
131
  export const EventEmitter: EventEmitterStatic;
134
132
  }
135
133
 
136
- declare class MPEEmitter extends EventEmitter {
137
- private static instance;
138
- private readonly debug;
139
- static getInstance(): MPEEmitter;
140
- constructor();
141
- h5ConfirmHandleEvent(eventId: string, eventName: string | symbol, callbackData?: string): void;
142
- on<T extends string | symbol>(event: T, fn: (...args: any[]) => void, context?: any): this;
143
- once<T extends string | symbol>(event: T, fn: (...args: any[]) => void, context?: any): this;
134
+ declare namespace eventemitter3 {
135
+ export {
136
+ EventEmitter as default,
137
+ };
144
138
  }
145
139
 
146
140
  /**
@@ -464,7 +458,7 @@ type CreateOrderIAPReturns = {
464
458
 
465
459
  declare function login(args?: AsyncCallback<string>): Promise<string>;
466
460
 
467
- declare function getAccessToken(args: AsyncCallback<string>): Promise<string>;
461
+ declare function getAccessToken(args?: AsyncCallback<string>): Promise<string>;
468
462
 
469
463
  declare function getVersion(): string;
470
464
 
@@ -1463,7 +1457,7 @@ declare const getStorageArgs: ZodOptional<ZodObject<{
1463
1457
  }>>[];
1464
1458
  declare function getStorage(args: AsyncCallback<GetStorageReturns> & TypeOf<typeof getStorageArgs[0]>): Promise<GetStorageReturns>;
1465
1459
 
1466
- declare function getStorageInfo(args: AsyncCallback<StorageInfo>): Promise<StorageInfo>;
1460
+ declare function getStorageInfo(args?: AsyncCallback<StorageInfo>): Promise<StorageInfo>;
1467
1461
 
1468
1462
  declare const removeStorageArgs: ZodOptional<ZodObject<{
1469
1463
  keys: ZodArray<ZodString, "many">;
@@ -1490,9 +1484,9 @@ declare const getUserInfoArgs: ZodOptional<ZodObject<{
1490
1484
  }, {
1491
1485
  avatarType?: "normal" | "small" | "large" | undefined;
1492
1486
  }>>[];
1493
- declare function getUserInfo(args: AsyncCallback<GetUserInfoReturns> & TypeOf<typeof getUserInfoArgs[0]>): Promise<GetUserInfoReturns>;
1487
+ declare function getUserInfo(args?: AsyncCallback<GetUserInfoReturns> & TypeOf<typeof getUserInfoArgs[0]>): Promise<GetUserInfoReturns>;
1494
1488
 
1495
- declare function getNetworkType(args: AsyncCallback<GetNetworkTypeReturns>): Promise<GetNetworkTypeReturns>;
1489
+ declare function getNetworkType(args?: AsyncCallback<GetNetworkTypeReturns>): Promise<GetNetworkTypeReturns>;
1496
1490
 
1497
1491
  declare const onNetworkStatusChangeArgs: ZodFunction<ZodTuple<[ZodObject<{
1498
1492
  isConnected: ZodBoolean;
@@ -1606,11 +1600,11 @@ declare function startBeaconDiscovery(args: AsyncCallback<boolean> & TypeOf<type
1606
1600
 
1607
1601
  declare function stopBeaconDiscovery(args: AsyncCallback<boolean>): Promise<boolean>;
1608
1602
 
1609
- declare function getBeacons(args: AsyncCallback<GetBeaconDiscoveryReturns>): Promise<GetBeaconDiscoveryReturns>;
1603
+ declare function getBeacons(args?: AsyncCallback<GetBeaconDiscoveryReturns>): Promise<GetBeaconDiscoveryReturns>;
1610
1604
 
1611
- declare function closeApp(args: AsyncVoidCallback): Promise<void>;
1605
+ declare function closeApp(args?: AsyncVoidCallback): Promise<void>;
1612
1606
 
1613
- declare function scanQRCode(args: AsyncCallback<ScanQRCodeReturns>): Promise<ScanQRCodeReturns>;
1607
+ declare function scanQRCode(args?: AsyncCallback<ScanQRCodeReturns>): Promise<ScanQRCodeReturns>;
1614
1608
 
1615
1609
  declare const openProfileArgs: ZodOptional<ZodObject<{
1616
1610
  id: ZodString;
@@ -1889,7 +1883,7 @@ declare const openShareSheetArgs: ZodUnion<[ZodObject<{
1889
1883
  }>]>[];
1890
1884
  declare function openShareSheet(args: AsyncCallback<OpenShareSheetReturns> & TypeOf<typeof openShareSheetArgs[0]>): Promise<OpenShareSheetReturns>;
1891
1885
 
1892
- declare function requestCameraPermission(args: AsyncCallback<RequestCameraPermissionReturns>): Promise<RequestCameraPermissionReturns>;
1886
+ declare function requestCameraPermission(args?: AsyncCallback<RequestCameraPermissionReturns>): Promise<RequestCameraPermissionReturns>;
1893
1887
 
1894
1888
  declare const createShortcutArgs: ZodOptional<ZodObject<{
1895
1889
  params: ZodOptional<ZodRecord<ZodString, ZodString>>;
@@ -1898,7 +1892,7 @@ declare const createShortcutArgs: ZodOptional<ZodObject<{
1898
1892
  }, {
1899
1893
  params?: Record<string, string> | undefined;
1900
1894
  }>>[];
1901
- declare function createShortcut(args: AsyncCallback<any> & TypeOf<typeof createShortcutArgs[0]>): Promise<any>;
1895
+ declare function createShortcut(args?: AsyncCallback<any> & TypeOf<typeof createShortcutArgs[0]>): Promise<any>;
1902
1896
 
1903
1897
  declare const openBioAuthenticationArgs: ZodOptional<ZodObject<{
1904
1898
  secretData: ZodString;
@@ -1935,7 +1929,7 @@ declare const openBioAuthenticationArgs: ZodOptional<ZodObject<{
1935
1929
  }>>[];
1936
1930
  declare function openBioAuthentication(args: AsyncCallback<OpenBioAuthenticationReturns> & TypeOf<typeof openBioAuthenticationArgs[0]>): Promise<OpenBioAuthenticationReturns>;
1937
1931
 
1938
- declare function checkStateBioAuthentication(args: AsyncCallback<CheckStateBioAuthenticationReturns>): Promise<CheckStateBioAuthenticationReturns>;
1932
+ declare function checkStateBioAuthentication(args?: AsyncCallback<CheckStateBioAuthenticationReturns>): Promise<CheckStateBioAuthenticationReturns>;
1939
1933
 
1940
1934
  declare const showToastArgs: ZodOptional<ZodObject<{
1941
1935
  message: ZodString;
@@ -1946,7 +1940,7 @@ declare const showToastArgs: ZodOptional<ZodObject<{
1946
1940
  }>>[];
1947
1941
  declare function showToast(args: AsyncVoidCallback & TypeOf<typeof showToastArgs[0]>): Promise<void>;
1948
1942
 
1949
- declare function hideKeyboard(args: AsyncVoidCallback): Promise<void>;
1943
+ declare function hideKeyboard(args?: AsyncVoidCallback): Promise<void>;
1950
1944
 
1951
1945
  declare const openPhoneArgs: ZodObject<{
1952
1946
  phoneNumber: ZodString;
@@ -1990,9 +1984,9 @@ declare const keepScreenArgs: ZodObject<{
1990
1984
  }>[];
1991
1985
  declare function keepScreen(args: AsyncCallback<KeepScreenReturns> & TypeOf<typeof keepScreenArgs[0]>): Promise<void>;
1992
1986
 
1993
- declare function onKeepScreen(args: AsyncVoidCallback): Promise<void>;
1987
+ declare function onKeepScreen(args?: AsyncVoidCallback): Promise<void>;
1994
1988
 
1995
- declare function offKeepScreen(args: AsyncVoidCallback): Promise<void>;
1989
+ declare function offKeepScreen(args?: AsyncVoidCallback): Promise<void>;
1996
1990
 
1997
1991
  declare const saveImageToGalleryArgs: ZodOptional<ZodObject<{
1998
1992
  imageBase64Data: ZodOptional<ZodString>;
@@ -2028,7 +2022,7 @@ declare const vibrateArgs: ZodObject<{
2028
2022
  type?: "oneShot" | undefined;
2029
2023
  milliseconds?: number | undefined;
2030
2024
  }>[];
2031
- declare function vibrate(args: AsyncVoidCallback & TypeOf<typeof vibrateArgs[0]>): Promise<void>;
2025
+ declare function vibrate(args?: AsyncVoidCallback & TypeOf<typeof vibrateArgs[0]>): Promise<void>;
2032
2026
 
2033
2027
  declare const openWebviewArgs: ZodObject<{
2034
2028
  url: ZodString;
@@ -2041,7 +2035,7 @@ declare function openWebview(args: AsyncCallback<OpenWebviewReturns> & TypeOf<ty
2041
2035
 
2042
2036
  declare function getRouteParams(): Record<string, string>;
2043
2037
 
2044
- declare function getAppInfo(args: AsyncCallback<GetAppInfoReturns>): Promise<GetAppInfoReturns>;
2038
+ declare function getAppInfo(args?: AsyncCallback<GetAppInfoReturns>): Promise<GetAppInfoReturns>;
2045
2039
 
2046
2040
  declare const sendDataToPreviousMiniAppArgs: ZodObject<{
2047
2041
  data: ZodAny;
@@ -2052,7 +2046,7 @@ declare const sendDataToPreviousMiniAppArgs: ZodObject<{
2052
2046
  }>[];
2053
2047
  declare function sendDataToPreviousMiniApp(args: AsyncVoidCallback & TypeOf<typeof sendDataToPreviousMiniAppArgs[0]>): Promise<void>;
2054
2048
 
2055
- declare function getPhoneNumber(args: AsyncCallback<GetPhoneNumberReturns>): Promise<GetPhoneNumberReturns>;
2049
+ declare function getPhoneNumber(args?: AsyncCallback<GetPhoneNumberReturns>): Promise<GetPhoneNumberReturns>;
2056
2050
 
2057
2051
  declare const openProfilePickerArgs: ZodObject<{
2058
2052
  maxProfile: ZodDefault<ZodOptional<ZodNumber>>;
@@ -2061,7 +2055,7 @@ declare const openProfilePickerArgs: ZodObject<{
2061
2055
  }, {
2062
2056
  maxProfile?: number | undefined;
2063
2057
  }>[];
2064
- declare function openProfilePicker(args: AsyncCallback<OpenProfilePickerReturns> & TypeOf<typeof openProfilePickerArgs[0]>): Promise<OpenProfilePickerReturns>;
2058
+ declare function openProfilePicker(args?: AsyncCallback<OpenProfilePickerReturns> & TypeOf<typeof openProfilePickerArgs[0]>): Promise<OpenProfilePickerReturns>;
2065
2059
 
2066
2060
  declare const connectWifiArgs: ZodObject<{
2067
2061
  SSID: ZodString;
@@ -2135,9 +2129,9 @@ declare const getShareableLinkArgs: ZodObject<{
2135
2129
  }>[];
2136
2130
  declare function getShareableLink(args: AsyncCallback<string> & TypeOf<typeof getShareableLinkArgs[0]>): Promise<string>;
2137
2131
 
2138
- declare function closeLoading(args: AsyncVoidCallback): Promise<void>;
2132
+ declare function closeLoading(args?: AsyncVoidCallback): Promise<void>;
2139
2133
 
2140
- declare function requestUpdateZalo(args: AsyncVoidCallback): Promise<void>;
2134
+ declare function requestUpdateZalo(args?: AsyncVoidCallback): Promise<void>;
2141
2135
 
2142
2136
  declare const onConfirmToExitArgs: ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>[];
2143
2137
  declare function onConfirmToExit(args: TypeOf<typeof onConfirmToExitArgs[0]>): void;
@@ -2146,15 +2140,15 @@ declare function offConfirmToExit(): void;
2146
2140
 
2147
2141
  declare function getDeviceId(): string;
2148
2142
 
2149
- declare function getDeviceIdAsync(args: AsyncCallback<string>): Promise<string>;
2143
+ declare function getDeviceIdAsync(args?: AsyncCallback<string>): Promise<string>;
2150
2144
 
2151
2145
  declare function getContext(): ContextInfo | null;
2152
2146
 
2153
- declare function getContextAsync(args: AsyncCallback<ContextInfo>): Promise<ContextInfo | null>;
2147
+ declare function getContextAsync(args?: AsyncCallback<ContextInfo>): Promise<ContextInfo | null>;
2154
2148
 
2155
- declare function getAuthCode(args: AsyncCallback<GetAuthCodeReturns>): Promise<GetAuthCodeReturns>;
2149
+ declare function getAuthCode(args?: AsyncCallback<GetAuthCodeReturns>): Promise<GetAuthCodeReturns>;
2156
2150
 
2157
- declare function getZPIToken(args: AsyncCallback<GetZPITokenReturns>): Promise<GetZPITokenReturns>;
2151
+ declare function getZPIToken(args?: AsyncCallback<GetZPITokenReturns>): Promise<GetZPITokenReturns>;
2158
2152
 
2159
2153
  declare const setAccessTokenArgs: ZodString[];
2160
2154
  declare function setAccessToken(args: TypeOf<typeof setAccessTokenArgs[0]>): void;
@@ -2183,7 +2177,7 @@ declare const chooseImageArgs: ZodObject<{
2183
2177
  }>[];
2184
2178
  declare function chooseImage(args: AsyncCallback<ChooseImageReturns> & TypeOf<typeof chooseImageArgs[0]>): Promise<ChooseImageReturns>;
2185
2179
 
2186
- declare function getLocation(args: AsyncCallback<GetLocationReturns>): Promise<GetLocationReturns>;
2180
+ declare function getLocation(args?: AsyncCallback<GetLocationReturns>): Promise<GetLocationReturns>;
2187
2181
 
2188
2182
  declare const onCallbackDataArgs: ZodFunction<ZodTuple<[ZodObject<{
2189
2183
  data: ZodAny;
@@ -2224,7 +2218,7 @@ declare const checkTransactionArgs: ZodObject<{
2224
2218
  }>[];
2225
2219
  declare function checkTransaction(args: AsyncCallback<CheckTransactionReturns> & TypeOf<typeof checkTransactionArgs[0]>): Promise<CheckTransactionReturns>;
2226
2220
 
2227
- declare const events: MPEEmitter$1;
2221
+ declare const events: EventEmitter;
2228
2222
 
2229
2223
  declare const setAndroidBottomNavigationBarArgs: ZodOptional<ZodObject<{
2230
2224
  hide: ZodOptional<ZodDefault<ZodBoolean>>;
@@ -2384,7 +2378,7 @@ declare const otherApis: {
2384
2378
  chooseImage: typeof chooseImage;
2385
2379
  getLocation: typeof getLocation;
2386
2380
  onCallbackData: typeof onCallbackData;
2387
- events: MPEEmitter;
2381
+ events: eventemitter3<string | symbol, any>;
2388
2382
  setAndroidBottomNavigationBar: typeof setAndroidBottomNavigationBar;
2389
2383
  setIOSBottomSafeArea: typeof setIOSBottomSafeArea;
2390
2384
  setStatusBar: typeof setStatusBar;