@tarojs/taro-h5 4.0.0-alpha.2 → 4.0.0-alpha.21

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.
Files changed (93) hide show
  1. package/dist/api/base/index.js +1 -1
  2. package/dist/api/base/index.js.map +1 -1
  3. package/dist/api/base/system.js +2 -2
  4. package/dist/api/base/system.js.map +1 -1
  5. package/dist/api/base/weapp/app-event.js +2 -2
  6. package/dist/api/base/weapp/app-event.js.map +1 -1
  7. package/dist/api/canvas/CanvasContext.d.ts +1 -1
  8. package/dist/api/canvas/CanvasContext.js.map +1 -1
  9. package/dist/api/canvas/canvasGetImageData.js.map +1 -1
  10. package/dist/api/canvas/canvasPutImageData.js.map +1 -1
  11. package/dist/api/canvas/canvasToTempFilePath.js.map +1 -1
  12. package/dist/api/device/accelerometer.js.map +1 -1
  13. package/dist/api/device/battery.js +1 -1
  14. package/dist/api/device/battery.js.map +1 -1
  15. package/dist/api/device/calendar.js.map +1 -1
  16. package/dist/api/device/clipboard.js +2 -2
  17. package/dist/api/device/clipboard.js.map +1 -1
  18. package/dist/api/device/compass.js.map +1 -1
  19. package/dist/api/device/motion.js.map +1 -1
  20. package/dist/api/device/network.js.map +1 -1
  21. package/dist/api/device/phone.js.map +1 -1
  22. package/dist/api/device/sms.js.map +1 -1
  23. package/dist/api/device/vibrate.js.map +1 -1
  24. package/dist/api/index.js +2 -1
  25. package/dist/api/index.js.map +1 -1
  26. package/dist/api/location/chooseLocation.js +2 -2
  27. package/dist/api/location/chooseLocation.js.map +1 -1
  28. package/dist/api/location/getLocation.js +3 -3
  29. package/dist/api/location/getLocation.js.map +1 -1
  30. package/dist/api/location/index.d.ts +2 -7
  31. package/dist/api/location/index.js +2 -8
  32. package/dist/api/location/index.js.map +1 -1
  33. package/dist/api/location/locationChange.d.ts +7 -0
  34. package/dist/api/location/locationChange.js +130 -0
  35. package/dist/api/location/locationChange.js.map +1 -0
  36. package/dist/api/location/style.scss.js +1 -1
  37. package/dist/api/location/utils.d.ts +2 -0
  38. package/dist/api/location/utils.js +4 -0
  39. package/dist/api/location/utils.js.map +1 -0
  40. package/dist/api/media/audio/InnerAudioContext.js.map +1 -1
  41. package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +1 -1
  42. package/dist/api/media/background-audio/BackgroundAudioManager.js.map +1 -1
  43. package/dist/api/media/image/chooseImage.js.map +1 -1
  44. package/dist/api/media/image/getImageInfo.js.map +1 -1
  45. package/dist/api/media/image/previewImage.js.map +1 -1
  46. package/dist/api/media/image/saveImageToPhotosAlbum.js.map +1 -1
  47. package/dist/api/media/video/chooseMedia.js +3 -3
  48. package/dist/api/media/video/chooseMedia.js.map +1 -1
  49. package/dist/api/media/video/chooseVideo.js.map +1 -1
  50. package/dist/api/media/video/getVideoInfo.js.map +1 -1
  51. package/dist/api/media/video/saveVideoToPhotosAlbum.js.map +1 -1
  52. package/dist/api/network/request/index.js.map +1 -1
  53. package/dist/api/network/upload.js.map +1 -1
  54. package/dist/api/network/utils.js +4 -4
  55. package/dist/api/network/utils.js.map +1 -1
  56. package/dist/api/network/websocket/index.js.map +1 -1
  57. package/dist/api/network/websocket/socketTask.js.map +1 -1
  58. package/dist/api/storage/index.js.map +1 -1
  59. package/dist/api/taro.js +2 -2
  60. package/dist/api/taro.js.map +1 -1
  61. package/dist/api/ui/animation/index.js.map +1 -1
  62. package/dist/api/ui/fonts.js.map +1 -1
  63. package/dist/api/ui/interaction/actionSheet.js.map +1 -1
  64. package/dist/api/ui/interaction/index.js +2 -2
  65. package/dist/api/ui/interaction/index.js.map +1 -1
  66. package/dist/api/ui/interaction/modal.js.map +1 -1
  67. package/dist/api/ui/interaction/toast.js.map +1 -1
  68. package/dist/api/ui/navigation-bar/index.d.ts +8 -2
  69. package/dist/api/ui/navigation-bar/index.js +20 -4
  70. package/dist/api/ui/navigation-bar/index.js.map +1 -1
  71. package/dist/api/ui/scroll/index.js.map +1 -1
  72. package/dist/api/ui/tab-bar.js.map +1 -1
  73. package/dist/api/ui/window.js.map +1 -1
  74. package/dist/api/wxml/IntersectionObserver.js.map +1 -1
  75. package/dist/api/wxml/MediaQueryObserver.js.map +1 -1
  76. package/dist/api/wxml/selectorQuery.js.map +1 -1
  77. package/dist/index.cjs.d.ts +18 -11
  78. package/dist/index.cjs.js +168 -30
  79. package/dist/index.cjs.js.map +1 -1
  80. package/dist/index.esm.d.ts +18 -11
  81. package/dist/index.esm.js +172 -34
  82. package/dist/index.esm.js.map +1 -1
  83. package/dist/index.js +2 -1
  84. package/dist/index.js.map +1 -1
  85. package/dist/utils/animation.js.map +1 -1
  86. package/dist/utils/handler.d.ts +2 -0
  87. package/dist/utils/handler.js +4 -0
  88. package/dist/utils/handler.js.map +1 -1
  89. package/dist/utils/index.js +1 -1
  90. package/dist/utils/index.js.map +1 -1
  91. package/package.json +16 -25
  92. /package/dist/node_modules/.pnpm/{registry.npmjs.org_style-inject@0.3.0 → style-inject@0.3.0}/node_modules/style-inject/dist/style-inject.es.js +0 -0
  93. /package/dist/node_modules/.pnpm/{registry.npmjs.org_style-inject@0.3.0 → style-inject@0.3.0}/node_modules/style-inject/dist/style-inject.es.js.map +0 -0
@@ -348,17 +348,10 @@ declare const getFileInfo: (option?: {}, ...args: any[]) => Promise<Partial<Taro
348
348
  declare const getApp: typeof Taro.getApp;
349
349
  // 自定义组件
350
350
  declare const getCurrentInstance: () => Taro.getCurrentInstance.Current;
351
- // 位置
352
- declare const stopLocationUpdate: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
353
351
  declare const startLocationUpdateBackground: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
354
- declare const startLocationUpdate: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
355
352
  declare const openLocation: (options?: Partial<{
356
353
  scale: number;
357
354
  }>, ...args: any[]) => Promise<any>;
358
- declare const onLocationChangeError: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
359
- declare const onLocationChange: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
360
- declare const offLocationChangeError: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
361
- declare const offLocationChange: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
362
355
  declare const getLocation: (options?: Partial<Taro.getLocation.Option>, ...args: any[]) => Promise<Taro.getLocation.SuccessCallbackResult>;
363
356
  declare const choosePoi: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
364
357
  declare const getFuzzyLocation: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -366,6 +359,12 @@ declare const getFuzzyLocation: (option?: {}, ...args: any[]) => Promise<Partial
366
359
  * 打开地图选择位置。
367
360
  */
368
361
  declare const chooseLocation: typeof Taro.chooseLocation;
362
+ declare function onLocationChange(callback: Taro.onLocationChange.Callback): void;
363
+ declare function offLocationChange(callback: Taro.onLocationChange.Callback): void;
364
+ declare function onLocationChangeError(callback: Taro.onLocationChange.Callback): void;
365
+ declare function offLocationChangeError(callback: Taro.onLocationChange.Callback): void;
366
+ declare const stopLocationUpdate: (options?: Partial<import("@tarojs/taro").stopLocationUpdate.Option>, ...args: any[]) => Promise<TaroGeneral.CallbackResult>;
367
+ declare const startLocationUpdate: (options?: Partial<import("@tarojs/taro").startLocationUpdate.Option>, ...args: any[]) => Promise<TaroGeneral.CallbackResult>;
369
368
  // 音频
370
369
  declare const stopVoice: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
371
370
  declare const setInnerAudioOption: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
@@ -396,6 +395,8 @@ declare class CallbackManager<T extends unknown[] = unknown[]> {
396
395
  count: () => number;
397
396
  /** 触发回调 */
398
397
  trigger: (...args: T) => void;
398
+ /** 清空所有回调 */
399
+ clear: () => void;
399
400
  }
400
401
  declare class BackgroundAudioManager implements Taro.BackgroundAudioManager {
401
402
  Instance?: HTMLAudioElement;
@@ -435,7 +436,7 @@ declare class BackgroundAudioManager implements Taro.BackgroundAudioManager {
435
436
  stop: () => void;
436
437
  onCanplay: (callback?: () => void) => void | undefined;
437
438
  onWaiting: (callback?: () => void) => void | undefined;
438
- onError: (callback?: ((res: Taro.InnerAudioContext.onErrorDetail) => void) | undefined) => void;
439
+ onError: (callback?: ((res: Taro.InnerAudioContext.onErrorDetail) => void)) => void;
439
440
  onPlay: (callback?: () => void) => void | undefined;
440
441
  onPause: (callback?: () => void) => void | undefined;
441
442
  onSeeking: (callback?: () => void) => void | undefined;
@@ -781,13 +782,19 @@ declare const disableAlertBeforeUnload: (option?: {}, ...args: any[]) => Promise
781
782
  // 菜单
782
783
  declare const getMenuButtonBoundingClientRect: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
783
784
  // 导航栏
784
- declare const showNavigationBarLoading: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
785
+ /**
786
+ * 展示导航栏 loading 状态
787
+ */
788
+ declare function showNavigationBarLoading(options?: Taro.showNavigationBarLoading.Option): Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
785
789
  declare function setNavigationBarTitle(options?: Taro.setNavigationBarTitle.Option): Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
786
790
  /**
787
791
  * 设置页面导航条颜色
788
792
  */
789
793
  declare const setNavigationBarColor: typeof Taro.setNavigationBarColor;
790
- declare const hideNavigationBarLoading: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
794
+ /**
795
+ * 隐藏导航栏 loading 状态
796
+ */
797
+ declare function hideNavigationBarLoading(options?: Taro.hideNavigationBarLoading.Option): Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
791
798
  declare const hideHomeButton: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
792
799
  /**
793
800
  * 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。
@@ -887,5 +894,5 @@ declare class NodesRef implements Taro.NodesRef {
887
894
  declare const createSelectorQuery: typeof Taro.createSelectorQuery;
888
895
  declare const createIntersectionObserver: typeof Taro.createIntersectionObserver;
889
896
  declare const createMediaQueryObserver: typeof Taro.createMediaQueryObserver;
890
- export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, getInferenceEnvInfo, createInferenceSession, isVKSupport, createVKSession, getOpenUserInfo, tradePay, env, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, preloadWebview, preloadSkylineView, preloadAssets, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, getSkylineInfoSync, getSkylineInfo, getRendererUserAgent, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onLazyLoadError, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offLazyLoadError, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, onScreenRecordingStateChanged, offScreenRecordingStateChanged, getScreenRecordingState, sendSms, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnectedWithPartialInfo, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, stopLocationUpdate, startLocationUpdateBackground, startLocationUpdate, openLocation, onLocationChangeError, onLocationChange, offLocationChangeError, offLocationChange, getLocation, choosePoi, getFuzzyLocation, chooseLocation, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, editImage, cropImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseMedia, chooseVideo, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPChatSpeakersChanged, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, join1v1Chat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, SocketTask, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsUserProfile, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsShareKey, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, requestDeviceVoIP, getDeviceVoIPList, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, checkIsAddedToMyMiniProgram, requirePrivacyAuthorize, openPrivacyContract, onNeedPrivacyAuthorization, getPrivacySetting, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, requestSubscribeDeviceMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestPluginPayment, requestOrderPayment, openQzonePublish, getQQRunData, setOfficialDress, setCustomDress, updateQQApp, addRecentColorSign, getGuildInfo, applyAddToMyApps, isAddedToMyApps, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, batchSetStorageSync, batchSetStorage, batchGetStorageSync, batchGetStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, createCacheManager, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, checkIsPictureInPictureActive, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, NodesRef, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
897
+ export { taro as default, taro, createRewardedVideoAd, createInterstitialAd, stopFaceDetect, initFaceDetect, faceDetect, getInferenceEnvInfo, createInferenceSession, isVKSupport, createVKSession, getOpenUserInfo, tradePay, env, arrayBufferToBase64, base64ToArrayBuffer, getUserCryptoManager, setEnableDebug, getRealtimeLogManager, getLogManager, reportPerformance, getPerformance, preloadWebview, preloadSkylineView, preloadAssets, openSystemBluetoothSetting, openAppAuthorizeSetting, getWindowInfo, getSystemSetting, getDeviceInfo, getAppBaseInfo, getAppAuthorizeSetting, getSystemInfoSync, getSystemInfoAsync, getSystemInfo, getSkylineInfoSync, getSkylineInfo, getRendererUserAgent, updateWeChatApp, getUpdateManager, onUnhandledRejection, onThemeChange, onPageNotFound, onLazyLoadError, onError, onAudioInterruptionEnd, onAudioInterruptionBegin, onAppShow, onAppHide, offUnhandledRejection, offThemeChange, offPageNotFound, offLazyLoadError, offError, offAudioInterruptionEnd, offAudioInterruptionBegin, offAppShow, offAppHide, getLaunchOptionsSync, getEnterOptionsSync, createOffscreenCanvas, createCanvasContext, canvasToTempFilePath, canvasPutImageData, canvasGetImageData, cloud, reportMonitor, reportAnalytics, reportEvent, getExptInfoSync, stopAccelerometer, startAccelerometer, onAccelerometerChange, offAccelerometerChange, checkIsOpenAccessibility, getBatteryInfoSync, getBatteryInfo, stopBluetoothDevicesDiscovery, startBluetoothDevicesDiscovery, openBluetoothAdapter, onBluetoothDeviceFound, onBluetoothAdapterStateChange, offBluetoothDeviceFound, offBluetoothAdapterStateChange, makeBluetoothPair, isBluetoothDevicePaired, getConnectedBluetoothDevices, getBluetoothDevices, getBluetoothAdapterState, closeBluetoothAdapter, writeBLECharacteristicValue, setBLEMTU, readBLECharacteristicValue, onBLEMTUChange, onBLEConnectionStateChange, onBLECharacteristicValueChange, offBLEMTUChange, offBLEConnectionStateChange, offBLECharacteristicValueChange, notifyBLECharacteristicValueChange, getBLEMTU, getBLEDeviceServices, getBLEDeviceRSSI, getBLEDeviceCharacteristics, createBLEConnection, closeBLEConnection, onBLEPeripheralConnectionStateChanged, offBLEPeripheralConnectionStateChanged, createBLEPeripheralServer, addPhoneRepeatCalendar, addPhoneCalendar, setClipboardData, getClipboardData, stopCompass, startCompass, onCompassChange, offCompassChange, chooseContact, addPhoneContact, getRandomValues, stopGyroscope, startGyroscope, onGyroscopeChange, offGyroscopeChange, stopBeaconDiscovery, startBeaconDiscovery, onBeaconUpdate, onBeaconServiceChange, offBeaconUpdate, offBeaconServiceChange, getBeacons, onKeyboardHeightChange, offKeyboardHeightChange, hideKeyboard, getSelectedTextRange, onMemoryWarning, offMemoryWarning, stopDeviceMotionListening, startDeviceMotionListening, onDeviceMotionChange, offDeviceMotionChange, getNetworkType, onNetworkWeakChange, onNetworkStatusChange, offNetworkWeakChange, offNetworkStatusChange, getLocalIPAddress, stopHCE, startHCE, sendHCEMessage, onHCEMessage, offHCEMessage, getNFCAdapter, getHCEState, makePhoneCall, scanCode, setVisualEffectOnCapture, setScreenBrightness, setKeepScreenOn, onUserCaptureScreen, offUserCaptureScreen, getScreenBrightness, onScreenRecordingStateChanged, offScreenRecordingStateChanged, getScreenRecordingState, sendSms, vibrateShort, vibrateLong, stopWifi, startWifi, setWifiList, onWifiConnectedWithPartialInfo, onWifiConnected, onGetWifiList, offWifiConnectedWithPartialInfo, offWifiConnected, offGetWifiList, getWifiList, getConnectedWifi, connectWifi, getExtConfigSync, getExtConfig, saveFileToDisk, saveFile, removeSavedFile, openDocument, getSavedFileList, getSavedFileInfo, getFileSystemManager, getFileInfo, getApp, getCurrentInstance, startLocationUpdateBackground, openLocation, getLocation, choosePoi, getFuzzyLocation, chooseLocation, offLocationChange, offLocationChangeError, onLocationChange, onLocationChangeError, startLocationUpdate, stopLocationUpdate, stopVoice, setInnerAudioOption, playVoice, pauseVoice, getAvailableAudioSources, createWebAudioContext, createMediaAudioPlayer, createInnerAudioContext, createAudioContext, stopBackgroundAudio, seekBackgroundAudio, playBackgroundAudio, pauseBackgroundAudio, onBackgroundAudioStop, onBackgroundAudioPlay, onBackgroundAudioPause, getBackgroundAudioPlayerState, getBackgroundAudioManager, createCameraContext, saveImageToPhotosAlbum, previewMedia, getImageInfo, previewImage, compressImage, chooseMessageFile, chooseImage, editImage, cropImage, createLivePusherContext, createLivePlayerContext, createMapContext, createMediaRecorder, stopRecord, startRecord, getRecorderManager, saveVideoToPhotosAlbum, openVideoEditor, getVideoInfo, createVideoContext, compressVideo, chooseMedia, chooseVideo, createVideoDecoder, createMediaContainer, updateVoIPChatMuteConfig, subscribeVoIPVideoMembers, setEnable1v1Chat, onVoIPVideoMembersChanged, onVoIPChatStateChanged, onVoIPChatSpeakersChanged, onVoIPChatMembersChanged, onVoIPChatInterrupted, offVoIPChatSpeakersChanged, offVoIPVideoMembersChanged, offVoIPChatStateChanged, offVoIPChatMembersChanged, offVoIPChatInterrupted, joinVoIPChat, join1v1Chat, exitVoIPChat, openEmbeddedMiniProgram, navigateToMiniProgram, navigateBackMiniProgram, exitMiniProgram, openBusinessView, downloadFile, stopLocalServiceDiscovery, startLocalServiceDiscovery, onLocalServiceResolveFail, onLocalServiceLost, onLocalServiceFound, onLocalServiceDiscoveryStop, offLocalServiceResolveFail, offLocalServiceLost, offLocalServiceFound, offLocalServiceDiscoveryStop, request, addInterceptor, cleanInterceptors, createTCPSocket, createUDPSocket, uploadFile, sendSocketMessage, onSocketOpen, onSocketMessage, onSocketError, onSocketClose, connectSocket, closeSocket, SocketTask, getAccountInfoSync, chooseAddress, authorizeForMiniProgram, authorize, openCard, addCard, reserveChannelsLive, openChannelsUserProfile, openChannelsLive, openChannelsEvent, openChannelsActivity, getChannelsShareKey, getChannelsLiveNoticeInfo, getChannelsLiveInfo, openCustomerServiceChat, requestDeviceVoIP, getDeviceVoIPList, checkIsSupportFacialRecognition, startFacialRecognitionVerify, startFacialRecognitionVerifyAndUploadVideo, faceVerifyForPay, addVideoToFavorites, addFileToFavorites, getGroupEnterInfo, chooseInvoiceTitle, chooseInvoice, chooseLicensePlate, pluginLogin, login, checkSession, checkIsAddedToMyMiniProgram, requirePrivacyAuthorize, openPrivacyContract, onNeedPrivacyAuthorization, getPrivacySetting, showRedPackage, openSetting, getSetting, startSoterAuthentication, checkIsSupportSoterAuthentication, checkIsSoterEnrolledInDevice, requestSubscribeMessage, requestSubscribeDeviceMessage, getUserProfile, getUserInfo, shareToWeRun, getWeRunData, requestPayment, requestPluginPayment, requestOrderPayment, openQzonePublish, getQQRunData, setOfficialDress, setCustomDress, updateQQApp, addRecentColorSign, getGuildInfo, applyAddToMyApps, isAddedToMyApps, updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage, setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, batchSetStorageSync, batchSetStorage, batchGetStorageSync, batchGetStorage, setBackgroundFetchToken, onBackgroundFetchData, getBackgroundFetchToken, getBackgroundFetchData, createCacheManager, setPageInfo, ocrIdCard, ocrBankCard, ocrDrivingLicense, ocrVehicleLicense, textReview, textToAudio, imageAudit, advancedGeneralIdentify, objectDetectIdentify, carClassify, dishClassify, logoClassify, animalClassify, plantClassify, getSwanId, requestPolymerPayment, navigateToSmartGameProgram, navigateToSmartProgram, navigateBackSmartProgram, preloadSubPackage, createAnimation, setBackgroundTextStyle, setBackgroundColor, nextTick, loadFontFace, disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast, getMenuButtonBoundingClientRect, showNavigationBarLoading, setNavigationBarTitle, setNavigationBarColor, hideNavigationBarLoading, hideHomeButton, startPullDownRefresh, stopPullDownRefresh, pageScrollTo, setTopBarText, initTabBarApis, showTabBarRedDot, showTabBar, setTabBarStyle, setTabBarItem, setTabBarBadge, removeTabBarBadge, hideTabBarRedDot, hideTabBar, setWindowSize, onWindowResize, offWindowResize, checkIsPictureInPictureActive, createWorker, createSelectorQuery, createIntersectionObserver, createMediaQueryObserver, NodesRef, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
891
898
  export { getCurrentPages, navigateBack, navigateTo, redirectTo, reLaunch, switchTab } from "@tarojs/router";
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Taro from '@tarojs/api';
2
- import { setTitle, setNavigationBarStyle, history, navigateBack, navigateTo, reLaunch, redirectTo, getCurrentPages, switchTab } from '@tarojs/router';
2
+ import { setNavigationBarLoading, setTitle, setNavigationBarStyle, history, navigateBack, navigateTo, reLaunch, redirectTo, getCurrentPages, switchTab } from '@tarojs/router';
3
3
  export { getCurrentPages, history, navigateBack, navigateTo, reLaunch, redirectTo, switchTab } from '@tarojs/router';
4
4
  import { isFunction, toKebabCase, PLATFORM_TYPE } from '@tarojs/shared';
5
5
  import { hooks, Current as Current$1, getCurrentPage, getHomePage, eventCenter as eventCenter$1 } from '@tarojs/runtime';
@@ -7,7 +7,7 @@ import { fromByteArray, toByteArray } from 'base64-js';
7
7
  import { __awaiter, __rest } from 'tslib';
8
8
  import platform from 'platform';
9
9
  import isNil from 'lodash-es/isNil';
10
- import { parse, stringify } from 'query-string';
10
+ import queryString from 'query-string';
11
11
  import throttle from 'lodash-es/throttle';
12
12
  import * as ics from 'ics';
13
13
  import { defineCustomElementTaroSwiperCore, defineCustomElementTaroSwiperItemCore } from '@tarojs/components/dist/components';
@@ -91,6 +91,10 @@ class CallbackManager {
91
91
  }
92
92
  });
93
93
  };
94
+ /** 清空所有回调 */
95
+ this.clear = () => {
96
+ this.callbacks = [];
97
+ };
94
98
  }
95
99
  }
96
100
 
@@ -141,7 +145,7 @@ function findDOM(inst) {
141
145
  }
142
146
  const page = Current$1.page;
143
147
  const path = page === null || page === void 0 ? void 0 : page.path;
144
- const msg = '没有找到已经加载了的页面,请在页面加载完成后时候此 API。';
148
+ const msg = '没有找到已经加载了的页面,请在页面加载完成后使用此 API。';
145
149
  if (path == null) {
146
150
  throw new Error(msg);
147
151
  }
@@ -486,7 +490,7 @@ const getSystemInfoSync = () => {
486
490
  return info;
487
491
  };
488
492
  /** 获取系统信息 */
489
- const getSystemInfoAsync = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
493
+ const getSystemInfoAsync = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (options = {}) {
490
494
  const { success, fail, complete } = options;
491
495
  const handle = new MethodHandler({ name: 'getSystemInfoAsync', success, fail, complete });
492
496
  try {
@@ -500,7 +504,7 @@ const getSystemInfoAsync = (options = {}) => __awaiter(void 0, void 0, void 0, f
500
504
  }
501
505
  });
502
506
  /** 获取系统信息 */
503
- const getSystemInfo = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
507
+ const getSystemInfo = (...args_2) => __awaiter(void 0, [...args_2], void 0, function* (options = {}) {
504
508
  const { success, fail, complete } = options;
505
509
  const handle = new MethodHandler({ name: 'getSystemInfo', success, fail, complete });
506
510
  try {
@@ -550,7 +554,7 @@ const getApp$1 = () => {
550
554
  /** 小程序切前台的路径 */
551
555
  path: (path === null || path === void 0 ? void 0 : path.substring(0, path.indexOf('?'))) || '',
552
556
  /** 小程序切前台的 query 参数 */
553
- query: parse(location.search),
557
+ query: queryString.parse(location.search),
554
558
  /** 来源信息。 */
555
559
  referrerInfo: {},
556
560
  /** 小程序切前台的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */
@@ -678,7 +682,7 @@ const env = {
678
682
  TARO_VERSION: process.env.TARO_VERSION,
679
683
  };
680
684
  // Note: 该方法由 taro-plugin-platform-h5 实现
681
-
685
+ // export const canIUse = /* @__PURE__ */ temporarilyNotSupport('canIUse')
682
686
  function arrayBufferToBase64(arrayBuffer) {
683
687
  return fromByteArray(arrayBuffer);
684
688
  }
@@ -1092,7 +1096,7 @@ const checkIsOpenAccessibility = /* @__PURE__ */ temporarilyNotSupport('checkIsO
1092
1096
  // 电量
1093
1097
  // Note: 浏览器标准下不支持,其他实现方案不准确,不建议开发者使用
1094
1098
  const getBatteryInfoSync = /* @__PURE__ */ permanentlyNotSupport('getBatteryInfoSync');
1095
- const getBatteryInfo = ({ success, fail, complete } = {}) => __awaiter(void 0, void 0, void 0, function* () {
1099
+ const getBatteryInfo = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ success, fail, complete } = {}) {
1096
1100
  var _a;
1097
1101
  const handle = new MethodHandler({ name: 'getBatteryInfo', success, fail, complete });
1098
1102
  try {
@@ -2149,7 +2153,7 @@ const hideLoading = ({ noConflict = false, success, fail, complete } = {}) => {
2149
2153
  toast.hide(0, noConflict ? 'loading' : '');
2150
2154
  return handle.success();
2151
2155
  };
2152
- const showModal = (options = {}) => __awaiter(void 0, void 0, void 0, function* () {
2156
+ const showModal = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* (options = {}) {
2153
2157
  init(document);
2154
2158
  options = Object.assign({
2155
2159
  title: '',
@@ -2243,7 +2247,7 @@ function hideModal() {
2243
2247
  return;
2244
2248
  modal.hide();
2245
2249
  }
2246
- const showActionSheet = (options = { itemList: [] }, methodName = 'showActionSheet') => __awaiter(void 0, void 0, void 0, function* () {
2250
+ const showActionSheet = (...args_2) => __awaiter(void 0, [...args_2], void 0, function* (options = { itemList: [] }, methodName = 'showActionSheet') {
2247
2251
  init(document);
2248
2252
  options = Object.assign({
2249
2253
  itemColor: '#000000',
@@ -2333,7 +2337,7 @@ document.addEventListener('copy', () => {
2333
2337
  /**
2334
2338
  * 设置系统剪贴板的内容
2335
2339
  */
2336
- const setClipboardData = ({ data, success, fail, complete }) => __awaiter(void 0, void 0, void 0, function* () {
2340
+ const setClipboardData = (_a) => __awaiter(void 0, [_a], void 0, function* ({ data, success, fail, complete }) {
2337
2341
  const handle = new MethodHandler({ name: 'setClipboardData', success, fail, complete });
2338
2342
  try {
2339
2343
  setStorageSync(CLIPBOARD_STORAGE_NAME, data);
@@ -2372,7 +2376,7 @@ const setClipboardData = ({ data, success, fail, complete }) => __awaiter(void 0
2372
2376
  /**
2373
2377
  * 获取系统剪贴板的内容
2374
2378
  */
2375
- const getClipboardData = ({ success, fail, complete } = {}) => __awaiter(void 0, void 0, void 0, function* () {
2379
+ const getClipboardData = (...args_1) => __awaiter(void 0, [...args_1], void 0, function* ({ success, fail, complete } = {}) {
2376
2380
  const handle = new MethodHandler({ name: 'getClipboardData', success, fail, complete });
2377
2381
  try {
2378
2382
  const data = getStorageSync(CLIPBOARD_STORAGE_NAME);
@@ -2762,6 +2766,8 @@ const getApp = function () {
2762
2766
  // 自定义组件
2763
2767
  const getCurrentInstance = Taro.getCurrentInstance;
2764
2768
 
2769
+ const isGeolocationSupported = () => !!navigator.geolocation;
2770
+
2765
2771
  const getLocationByW3CApi = (options) => {
2766
2772
  var _a;
2767
2773
  // 断言 options 必须是 Object
@@ -2776,7 +2782,7 @@ const getLocationByW3CApi = (options) => {
2776
2782
  const handle = new MethodHandler({ name: 'getLocation', success, fail, complete });
2777
2783
  // const defaultMaximumAge = 5 * 1000
2778
2784
  const positionOptions = {
2779
- enableHighAccuracy: options.isHighAccuracy || (options.altitude != null),
2785
+ enableHighAccuracy: options.isHighAccuracy || (options.altitude != null), // 海拔定位需要高精度
2780
2786
  // maximumAge: defaultMaximumAge, // 允许取多久以内的缓存位置
2781
2787
  timeout: options.highAccuracyExpireTime // 高精度定位超时时间
2782
2788
  };
@@ -2787,8 +2793,7 @@ const getLocationByW3CApi = (options) => {
2787
2793
  });
2788
2794
  }
2789
2795
  // 判断当前浏览器是否支持位置API
2790
- const geolocationSupported = navigator.geolocation;
2791
- if (!geolocationSupported) {
2796
+ if (!isGeolocationSupported()) {
2792
2797
  return handle.fail({
2793
2798
  errMsg: 'The current browser does not support this feature'
2794
2799
  });
@@ -2869,7 +2874,7 @@ function createLocationChooser(handler, key = LOCATION_APIKEY, mapOpt = {}) {
2869
2874
  <p class='taro_choose_location_title'>位置</p>
2870
2875
  <button class='taro_choose_location_submit'>完成</button>
2871
2876
  </div>
2872
- <iframe class='taro_choose_location_frame' frameborder='0' src="https://apis.map.qq.com/tools/locpicker?${stringify(query, { arrayFormat: 'comma', skipNull: true })}" />
2877
+ <iframe class='taro_choose_location_frame' frameborder='0' src="https://apis.map.qq.com/tools/locpicker?${queryString.stringify(query, { arrayFormat: 'comma', skipNull: true })}" />
2873
2878
  </div>
2874
2879
  `;
2875
2880
  container = document.createElement('div');
@@ -2954,18 +2959,135 @@ const chooseLocation = ({ success, fail, complete, mapOpts } = {}) => {
2954
2959
  });
2955
2960
  };
2956
2961
 
2957
- // 位置
2958
- const stopLocationUpdate = /* @__PURE__ */ temporarilyNotSupport('stopLocationUpdate');
2962
+ const _successCbManager = new CallbackManager();
2963
+ const _errorCbManager = new CallbackManager();
2964
+ let _watchID = -1;
2965
+ function onLocationChange(callback) {
2966
+ _successCbManager.add(callback);
2967
+ }
2968
+ function offLocationChange(callback) {
2969
+ if (callback && typeof callback === 'function') {
2970
+ _successCbManager.remove(callback);
2971
+ }
2972
+ else if (callback === undefined) {
2973
+ _successCbManager.clear();
2974
+ }
2975
+ else {
2976
+ console.warn('offLocationChange failed');
2977
+ }
2978
+ }
2979
+ function onLocationChangeError(callback) {
2980
+ _errorCbManager.add(callback);
2981
+ }
2982
+ function offLocationChangeError(callback) {
2983
+ if (callback && typeof callback === 'function') {
2984
+ _errorCbManager.remove(callback);
2985
+ }
2986
+ else if (callback === undefined) {
2987
+ _errorCbManager.clear();
2988
+ }
2989
+ else {
2990
+ console.warn('offLocationChangeError failed');
2991
+ }
2992
+ }
2993
+ /**
2994
+ * 开始监听位置信息
2995
+ * @param opts
2996
+ * @returns
2997
+ */
2998
+ function startLocationUpdateByW3CApi(opts) {
2999
+ // 断言 options 必须是 Object
3000
+ const isObject = shouldBeObject(opts);
3001
+ if (!isObject.flag) {
3002
+ const res = { errMsg: `startLocationUpdate:fail ${isObject.msg}` };
3003
+ console.error(res.errMsg);
3004
+ return Promise.reject(res);
3005
+ }
3006
+ const { success, fail, complete } = opts;
3007
+ const handle = new MethodHandler({ name: 'startLocationUpdate', success, fail, complete });
3008
+ // 判断当前浏览器是否支持位置API
3009
+ if (!isGeolocationSupported()) {
3010
+ return handle.fail({
3011
+ errMsg: 'The current browser does not support this feature'
3012
+ });
3013
+ }
3014
+ try {
3015
+ if (_watchID > -1) {
3016
+ console.error('startLocationUpdate:fail');
3017
+ return handle.fail();
3018
+ }
3019
+ else {
3020
+ _watchID = navigator.geolocation.watchPosition(({ coords }) => {
3021
+ const { latitude, longitude, altitude, accuracy, speed } = coords;
3022
+ _successCbManager.trigger({
3023
+ accuracy,
3024
+ altitude,
3025
+ horizontalAccuracy: 0,
3026
+ verticalAccuracy: 0,
3027
+ latitude,
3028
+ longitude,
3029
+ speed,
3030
+ });
3031
+ }, err => {
3032
+ _errorCbManager.trigger({
3033
+ errMsg: 'Watch Position error',
3034
+ err
3035
+ });
3036
+ }, {
3037
+ timeout: 10,
3038
+ maximumAge: 0,
3039
+ enableHighAccuracy: true,
3040
+ });
3041
+ return handle.success();
3042
+ }
3043
+ }
3044
+ catch (error) {
3045
+ return handle.fail();
3046
+ }
3047
+ }
3048
+ /**
3049
+ * 停止监听位置信息
3050
+ * @param opts
3051
+ * @returns
3052
+ */
3053
+ function stopLocationUpdateByW3CApi(opts) {
3054
+ const isObject = shouldBeObject(opts);
3055
+ if (!isObject.flag) {
3056
+ const res = { errMsg: `stopLocationUpdate:fail ${isObject.msg}` };
3057
+ console.error(res.errMsg);
3058
+ return Promise.reject(res);
3059
+ }
3060
+ const { success, fail, complete } = opts;
3061
+ const handle = new MethodHandler({ name: 'stopLocationUpdate', success, fail, complete });
3062
+ // 判断当前浏览器是否支持位置API
3063
+ if (!isGeolocationSupported()) {
3064
+ return handle.fail({
3065
+ errMsg: 'The current browser does not support this feature'
3066
+ });
3067
+ }
3068
+ try {
3069
+ navigator.geolocation.clearWatch(_watchID);
3070
+ _watchID = -1;
3071
+ return handle.success();
3072
+ }
3073
+ catch (error) {
3074
+ return handle.fail();
3075
+ }
3076
+ }
3077
+ const stopLocationUpdate = /* @__PURE__ */ processOpenApi({
3078
+ name: 'stopLocationUpdate',
3079
+ standardMethod: stopLocationUpdateByW3CApi
3080
+ });
3081
+ const startLocationUpdate = /* @__PURE__ */ processOpenApi({
3082
+ name: 'startLocationUpdate',
3083
+ standardMethod: startLocationUpdateByW3CApi
3084
+ });
3085
+
2959
3086
  const startLocationUpdateBackground = /* @__PURE__ */ temporarilyNotSupport('startLocationUpdateBackground');
2960
- const startLocationUpdate = /* @__PURE__ */ temporarilyNotSupport('startLocationUpdate');
2961
3087
  const openLocation = /* @__PURE__ */ processOpenApi({
2962
3088
  name: 'openLocation',
2963
3089
  defaultOptions: { scale: 18 }
2964
3090
  });
2965
- const onLocationChangeError = /* @__PURE__ */ temporarilyNotSupport('onLocationChangeError');
2966
- const onLocationChange = /* @__PURE__ */ temporarilyNotSupport('onLocationChange');
2967
- const offLocationChangeError = /* @__PURE__ */ temporarilyNotSupport('offLocationChangeError');
2968
- const offLocationChange = /* @__PURE__ */ temporarilyNotSupport('offLocationChange');
2969
3091
  const choosePoi = /* @__PURE__ */ temporarilyNotSupport('choosePoi');
2970
3092
  const getFuzzyLocation = /* @__PURE__ */ temporarilyNotSupport('getFuzzyLocation');
2971
3093
 
@@ -3718,7 +3840,15 @@ const loadFontFace = (options) => __awaiter(void 0, void 0, void 0, function* ()
3718
3840
  const getMenuButtonBoundingClientRect = /* @__PURE__ */ temporarilyNotSupport('getMenuButtonBoundingClientRect');
3719
3841
 
3720
3842
  // 导航栏
3721
- const showNavigationBarLoading = /* @__PURE__ */ temporarilyNotSupport('showNavigationBarLoading');
3843
+ /**
3844
+ * 展示导航栏 loading 状态
3845
+ */
3846
+ function showNavigationBarLoading(options = {}) {
3847
+ const { success, fail, complete } = options;
3848
+ const handle = new MethodHandler({ name: 'showNavigationBarLoading', success, fail, complete });
3849
+ setNavigationBarLoading(true);
3850
+ return handle.success();
3851
+ }
3722
3852
  function setNavigationBarTitle(options) {
3723
3853
  // options must be an Object
3724
3854
  const isObject = shouldBeObject(options);
@@ -3754,7 +3884,15 @@ const setNavigationBarColor = (options) => {
3754
3884
  setNavigationBarStyle({ frontColor, backgroundColor });
3755
3885
  return handle.success();
3756
3886
  };
3757
- const hideNavigationBarLoading = /* @__PURE__ */ temporarilyNotSupport('hideNavigationBarLoading');
3887
+ /**
3888
+ * 隐藏导航栏 loading 状态
3889
+ */
3890
+ function hideNavigationBarLoading(options = {}) {
3891
+ const { success, fail, complete } = options;
3892
+ const handle = new MethodHandler({ name: 'hideNavigationBarLoading', success, fail, complete });
3893
+ setNavigationBarLoading(false);
3894
+ return handle.success();
3895
+ }
3758
3896
  const hideHomeButton = /* @__PURE__ */ temporarilyNotSupport('hideHomeButton');
3759
3897
 
3760
3898
  /**
@@ -4181,9 +4319,9 @@ const checkIsPictureInPictureActive = /* @__PURE__ */ temporarilyNotSupport('che
4181
4319
  /**
4182
4320
  * 拍摄或从手机相册中选择图片或视频。
4183
4321
  */
4184
- const chooseMedia = function (options, methodName = 'chooseMedia') {
4185
- var _a;
4186
- return __awaiter(this, void 0, void 0, function* () {
4322
+ const chooseMedia = function (options_1) {
4323
+ return __awaiter(this, arguments, void 0, function* (options, methodName = 'chooseMedia') {
4324
+ var _a;
4187
4325
  // options must be an Object
4188
4326
  const isObject = shouldBeObject(options);
4189
4327
  if (!isObject.flag) {
@@ -4624,10 +4762,10 @@ const openBusinessView = /* @__PURE__ */ temporarilyNotSupport('openBusinessView
4624
4762
  */
4625
4763
  const NETWORK_TIMEOUT = 60000;
4626
4764
  const XHR_STATS = {
4627
- UNSENT: 0,
4628
- OPENED: 1,
4629
- HEADERS_RECEIVED: 2,
4630
- LOADING: 3,
4765
+ UNSENT: 0, // Client has been created. open() not called yet.
4766
+ OPENED: 1, // open() has been called.
4767
+ HEADERS_RECEIVED: 2, // send() has been called, and headers and status are available.
4768
+ LOADING: 3, // Downloading; responseText holds partial data.
4631
4769
  DONE: 4 // The operation is complete.
4632
4770
  };
4633
4771
  /**
@@ -5905,9 +6043,9 @@ const pxTransform = function (size = 0) {
5905
6043
  const config = getConfig.call(this);
5906
6044
  const baseFontSize = config.baseFontSize || defaultBaseFontSize;
5907
6045
  const deviceRatio = config.deviceRatio || defaultDesignRatio;
5908
- const designWidth = (((input = 0) => isFunction(config.designWidth)
6046
+ const designWidth = ((input = 0) => isFunction(config.designWidth)
5909
6047
  ? config.designWidth(input)
5910
- : config.designWidth))(size);
6048
+ : config.designWidth)(size);
5911
6049
  if (!(designWidth in config.deviceRatio)) {
5912
6050
  throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`);
5913
6051
  }