@tarojs/taro-h5 3.5.0-alpha.13 → 3.5.0-alpha.16
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/api/ad/index.d.ts +6 -0
- package/dist/api/ai/facial.d.ts +9 -0
- package/dist/api/ai/index.d.ts +2 -0
- package/dist/api/ai/visual.d.ts +6 -0
- package/dist/api/alipay/index.d.ts +3 -0
- package/dist/api/base/crypto.d.ts +3 -0
- package/dist/api/base/debug.d.ts +9 -0
- package/dist/api/base/index.d.ts +12 -0
- package/dist/api/base/performance.d.ts +6 -0
- package/dist/api/base/system.d.ts +27 -0
- package/dist/api/base/system.js +2 -2
- package/dist/api/base/update.d.ts +6 -0
- package/dist/api/base/weapp/app-event.d.ts +41 -0
- package/dist/api/base/weapp/app-event.js +55 -4
- package/dist/api/base/weapp/life-cycle.d.ts +6 -0
- package/dist/api/canvas/CanvasContext.d.ts +104 -0
- package/dist/api/canvas/canvasGetImageData.d.ts +5 -0
- package/dist/api/canvas/canvasPutImageData.d.ts +6 -0
- package/dist/api/canvas/canvasToTempFilePath.d.ts +6 -0
- package/dist/api/canvas/canvasToTempFilePath.js +1 -1
- package/dist/api/canvas/createCanvasContext.d.ts +5 -0
- package/dist/api/canvas/index.d.ts +12 -0
- package/dist/api/cloud/index.d.ts +31 -0
- package/dist/api/data-analysis/index.d.ts +12 -0
- package/dist/api/device/accelerometer.d.ts +17 -0
- package/dist/api/device/accessibility.d.ts +3 -0
- package/dist/api/device/battery.d.ts +5 -0
- package/dist/api/device/bluetooth-ble.d.ts +48 -0
- package/dist/api/device/bluetooth-peripheral.d.ts +9 -0
- package/dist/api/device/bluetooth.d.ts +39 -0
- package/dist/api/device/calendar.d.ts +6 -0
- package/dist/api/device/clipboard.d.ts +15 -0
- package/dist/api/device/compass.d.ts +17 -0
- package/dist/api/device/contact.d.ts +6 -0
- package/dist/api/device/crypto.d.ts +3 -0
- package/dist/api/device/gyroscope.d.ts +12 -0
- package/dist/api/device/iBeacon.d.ts +21 -0
- package/dist/api/device/index.d.ts +23 -0
- package/dist/api/device/keyboard.d.ts +12 -0
- package/dist/api/device/memory.d.ts +6 -0
- package/dist/api/device/motion.d.ts +17 -0
- package/dist/api/device/network.d.ts +20 -0
- package/dist/api/device/nfc.d.ts +21 -0
- package/dist/api/device/phone.d.ts +2 -0
- package/dist/api/device/scan.d.ts +3 -0
- package/dist/api/device/screen.d.ts +18 -0
- package/dist/api/device/vibrate.d.ts +9 -0
- package/dist/api/device/vibrate.js +5 -7
- package/dist/api/device/wifi.d.ts +33 -0
- package/dist/api/ext/index.d.ts +6 -0
- package/dist/api/files/index.d.ts +24 -0
- package/dist/api/framework/index.d.ts +4 -0
- package/dist/api/index.d.ts +24 -0
- package/dist/api/location/chooseLocation.d.ts +6 -0
- package/dist/api/location/getLocation.d.ts +2 -0
- package/dist/api/location/index.d.ts +32 -0
- package/dist/api/location/index.js +1 -0
- package/dist/api/media/EditorContext.d.ts +42 -0
- package/dist/api/media/audio/InnerAudioContext.d.ts +58 -0
- package/dist/api/media/audio/InnerAudioContext.js +1 -1
- package/dist/api/media/audio/index.d.ts +29 -0
- package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +71 -0
- package/dist/api/media/background-audio/index.d.ts +29 -0
- package/dist/api/media/camera.d.ts +3 -0
- package/dist/api/media/image/chooseImage.d.ts +5 -0
- package/dist/api/media/image/getImageInfo.d.ts +5 -0
- package/dist/api/media/image/index.d.ts +15 -0
- package/dist/api/media/image/previewImage.d.ts +8 -0
- package/dist/api/media/index.d.ts +12 -0
- package/dist/api/media/live.d.ts +6 -0
- package/dist/api/media/map.d.ts +3 -0
- package/dist/api/media/media-recorder.d.ts +3 -0
- package/dist/api/media/recorder.d.ts +9 -0
- package/dist/api/media/video/index.d.ts +24 -0
- package/dist/api/media/video-decoder.d.ts +3 -0
- package/dist/api/media/video-processing.d.ts +3 -0
- package/dist/api/media/voip.d.ts +42 -0
- package/dist/api/navigate/index.d.ts +12 -0
- package/dist/api/network/download.d.ts +6 -0
- package/dist/api/network/download.js +1 -0
- package/dist/api/network/index.d.ts +7 -0
- package/dist/api/network/mdns.d.ts +30 -0
- package/dist/api/network/request/index.d.ts +4 -0
- package/dist/api/network/tcp.d.ts +3 -0
- package/dist/api/network/udp.d.ts +3 -0
- package/dist/api/network/upload.d.ts +5 -0
- package/dist/api/network/upload.js +2 -1
- package/{src/api/network/utils.ts → dist/api/network/utils.d.ts} +44 -71
- package/dist/api/network/utils.js +1 -0
- package/dist/api/network/websocket/index.d.ts +7 -0
- package/dist/api/network/websocket/socketTask.d.ts +25 -0
- package/dist/api/open-api/account.d.ts +3 -0
- package/dist/api/open-api/address.d.ts +3 -0
- package/dist/api/open-api/authorize.d.ts +6 -0
- package/dist/api/open-api/card.d.ts +6 -0
- package/dist/api/open-api/channels-live.d.ts +18 -0
- package/dist/api/open-api/customer-service.d.ts +3 -0
- package/dist/api/open-api/facial.d.ts +12 -0
- package/dist/api/open-api/favorites.d.ts +6 -0
- package/dist/api/open-api/group.d.ts +3 -0
- package/dist/api/open-api/index.d.ts +18 -0
- package/dist/api/open-api/invoice.d.ts +6 -0
- package/dist/api/open-api/license-plate.d.ts +3 -0
- package/dist/api/open-api/login.d.ts +9 -0
- package/dist/api/open-api/red-package.d.ts +3 -0
- package/dist/api/open-api/settings.d.ts +6 -0
- package/dist/api/open-api/soter.d.ts +9 -0
- package/dist/api/open-api/subscribe-message.d.ts +3 -0
- package/dist/api/open-api/user-info.d.ts +6 -0
- package/dist/api/open-api/werun.d.ts +6 -0
- package/dist/api/payment/index.d.ts +6 -0
- package/dist/api/route/index.d.ts +1 -0
- package/dist/api/share/index.d.ts +30 -0
- package/dist/api/storage/background-fetch.d.ts +12 -0
- package/dist/api/storage/index.d.ts +18 -0
- package/dist/api/swan/index.d.ts +63 -0
- package/dist/api/taro.d.ts +12 -0
- package/dist/api/ui/animation/index.d.ts +2 -0
- package/dist/api/ui/background.d.ts +6 -0
- package/dist/api/ui/custom-component.d.ts +1 -0
- package/dist/api/ui/fonts.d.ts +2 -0
- package/dist/api/ui/index.d.ts +12 -0
- package/dist/api/ui/interaction/actionSheet.d.ts +61 -0
- package/dist/api/ui/interaction/index.d.ts +14 -0
- package/dist/api/ui/interaction/modal.d.ts +69 -0
- package/dist/api/ui/interaction/modal.js +1 -0
- package/dist/api/ui/interaction/toast.d.ts +85 -0
- package/dist/api/ui/menu.d.ts +3 -0
- package/dist/api/ui/navigation-bar/index.d.ts +15 -0
- package/dist/api/ui/navigation-bar/index.js +2 -3
- package/dist/api/ui/pull-down-refresh.d.ts +9 -0
- package/dist/api/ui/scroll/index.d.ts +5 -0
- package/dist/api/ui/sticky.d.ts +3 -0
- package/dist/api/ui/tab-bar.d.ts +34 -0
- package/dist/api/ui/window.d.ts +15 -0
- package/dist/api/worker/index.d.ts +3 -0
- package/dist/api/wxml/index.d.ts +5 -0
- package/dist/api/wxml/nodesRef.d.ts +13 -0
- package/dist/api/wxml/selectorQuery.d.ts +24 -0
- package/dist/api/wxml/selectorQuery.js +1 -1
- package/dist/index.cjs.d.ts +1373 -0
- package/dist/index.cjs.js +105 -81
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.esm.d.ts +1373 -0
- package/dist/index.esm.js +93 -69
- package/dist/index.esm.js.map +1 -1
- package/dist/taroApis.d.ts +1364 -0
- package/dist/taroApis.js +1 -1
- package/dist/utils/animation.d.ts +6 -0
- package/dist/utils/handler.d.ts +48 -0
- package/dist/utils/index.d.ts +39 -0
- package/dist/utils/index.js +3 -7
- package/dist/utils/lodash.d.ts +2 -0
- package/dist/utils/valid.d.ts +2 -0
- package/package.json +17 -19
- package/types/api.d.ts +4 -0
- package/types/define.d.ts +2 -0
- package/types/index.d.ts +33 -0
- package/types/overlay.d.ts +9 -0
- package/LICENSE +0 -21
- package/src/api/ad/index.ts +0 -5
- package/src/api/ai/facial.ts +0 -6
- package/src/api/ai/index.ts +0 -2
- package/src/api/ai/visual.ts +0 -7
- package/src/api/alipay/index.ts +0 -4
- package/src/api/base/crypto.ts +0 -4
- package/src/api/base/debug.ts +0 -5
- package/src/api/base/index.ts +0 -23
- package/src/api/base/performance.ts +0 -5
- package/src/api/base/system.ts +0 -207
- package/src/api/base/update.ts +0 -5
- package/src/api/base/weapp/app-event.ts +0 -19
- package/src/api/base/weapp/life-cycle.ts +0 -5
- package/src/api/canvas/CanvasContext.ts +0 -233
- package/src/api/canvas/canvasGetImageData.ts +0 -28
- package/src/api/canvas/canvasPutImageData.ts +0 -25
- package/src/api/canvas/canvasToTempFilePath.ts +0 -25
- package/src/api/canvas/createCanvasContext.ts +0 -19
- package/src/api/canvas/index.ts +0 -18
- package/src/api/cloud/index.ts +0 -32
- package/src/api/data-analysis/index.ts +0 -6
- package/src/api/device/accelerometer.ts +0 -79
- package/src/api/device/accessibility.ts +0 -4
- package/src/api/device/battery.ts +0 -23
- package/src/api/device/bluetooth-ble.ts +0 -19
- package/src/api/device/bluetooth-peripheral.ts +0 -6
- package/src/api/device/bluetooth.ts +0 -16
- package/src/api/device/calendar.ts +0 -5
- package/src/api/device/clipboard.ts +0 -68
- package/src/api/device/compass.ts +0 -83
- package/src/api/device/contact.ts +0 -5
- package/src/api/device/crypto.ts +0 -4
- package/src/api/device/gyroscope.ts +0 -7
- package/src/api/device/iBeacon.ts +0 -10
- package/src/api/device/index.ts +0 -23
- package/src/api/device/keyboard.ts +0 -7
- package/src/api/device/memory.ts +0 -5
- package/src/api/device/motion.ts +0 -77
- package/src/api/device/network.ts +0 -90
- package/src/api/device/nfc.ts +0 -10
- package/src/api/device/phone.ts +0 -31
- package/src/api/device/scan.ts +0 -11
- package/src/api/device/screen.ts +0 -9
- package/src/api/device/vibrate.ts +0 -37
- package/src/api/device/wifi.ts +0 -14
- package/src/api/ext/index.ts +0 -5
- package/src/api/files/index.ts +0 -11
- package/src/api/framework/index.ts +0 -10
- package/src/api/index.ts +0 -24
- package/src/api/location/chooseLocation.ts +0 -117
- package/src/api/location/getLocation.ts +0 -81
- package/src/api/location/index.ts +0 -22
- package/src/api/location/style.css +0 -79
- package/src/api/media/EditorContext.ts +0 -32
- package/src/api/media/audio/InnerAudioContext.ts +0 -99
- package/src/api/media/audio/index.ts +0 -21
- package/src/api/media/background-audio/BackgroundAudioManager.ts +0 -104
- package/src/api/media/background-audio/index.ts +0 -17
- package/src/api/media/camera.ts +0 -4
- package/src/api/media/image/chooseImage.ts +0 -95
- package/src/api/media/image/getImageInfo.ts +0 -50
- package/src/api/media/image/index.ts +0 -13
- package/src/api/media/image/previewImage.ts +0 -80
- package/src/api/media/index.ts +0 -12
- package/src/api/media/live.ts +0 -5
- package/src/api/media/map.ts +0 -4
- package/src/api/media/media-recorder.ts +0 -4
- package/src/api/media/recorder.ts +0 -6
- package/src/api/media/video/index.ts +0 -82
- package/src/api/media/video-decoder.ts +0 -4
- package/src/api/media/video-processing.ts +0 -4
- package/src/api/media/voip.ts +0 -17
- package/src/api/navigate/index.ts +0 -7
- package/src/api/network/download.ts +0 -141
- package/src/api/network/index.ts +0 -7
- package/src/api/network/mdns.ts +0 -13
- package/src/api/network/request/index.ts +0 -135
- package/src/api/network/tcp.ts +0 -4
- package/src/api/network/udp.ts +0 -4
- package/src/api/network/upload.ts +0 -169
- package/src/api/network/websocket/index.ts +0 -88
- package/src/api/network/websocket/socketTask.ts +0 -89
- package/src/api/open-api/account.ts +0 -4
- package/src/api/open-api/address.ts +0 -4
- package/src/api/open-api/authorize.ts +0 -5
- package/src/api/open-api/card.ts +0 -5
- package/src/api/open-api/channels-live.ts +0 -9
- package/src/api/open-api/customer-service.ts +0 -4
- package/src/api/open-api/facial.ts +0 -7
- package/src/api/open-api/favorites.ts +0 -5
- package/src/api/open-api/group.ts +0 -4
- package/src/api/open-api/index.ts +0 -18
- package/src/api/open-api/invoice.ts +0 -5
- package/src/api/open-api/license-plate.ts +0 -4
- package/src/api/open-api/login.ts +0 -6
- package/src/api/open-api/red-package.ts +0 -4
- package/src/api/open-api/settings.ts +0 -5
- package/src/api/open-api/soter.ts +0 -6
- package/src/api/open-api/subscribe-message.ts +0 -4
- package/src/api/open-api/user-info.ts +0 -5
- package/src/api/open-api/werun.ts +0 -5
- package/src/api/payment/index.ts +0 -5
- package/src/api/route/index.ts +0 -10
- package/src/api/share/index.ts +0 -13
- package/src/api/storage/background-fetch.ts +0 -7
- package/src/api/storage/index.ts +0 -182
- package/src/api/swan/index.ts +0 -31
- package/src/api/taro.ts +0 -84
- package/src/api/ui/animation/index.ts +0 -356
- package/src/api/ui/background.ts +0 -5
- package/src/api/ui/custom-component.ts +0 -4
- package/src/api/ui/fonts.ts +0 -64
- package/src/api/ui/index.ts +0 -12
- package/src/api/ui/interaction/actionSheet.ts +0 -212
- package/src/api/ui/interaction/index.ts +0 -302
- package/src/api/ui/interaction/modal.ts +0 -237
- package/src/api/ui/interaction/toast.ts +0 -220
- package/src/api/ui/menu.ts +0 -4
- package/src/api/ui/navigation-bar/index.ts +0 -52
- package/src/api/ui/pull-down-refresh.ts +0 -28
- package/src/api/ui/scroll/index.ts +0 -85
- package/src/api/ui/sticky.ts +0 -4
- package/src/api/ui/tab-bar.ts +0 -327
- package/src/api/ui/window.ts +0 -38
- package/src/api/worker/index.ts +0 -4
- package/src/api/wxml/index.ts +0 -10
- package/src/api/wxml/nodesRef.ts +0 -56
- package/src/api/wxml/selectorQuery.ts +0 -220
- package/src/index.ts +0 -6
- package/src/utils/animation.ts +0 -15
- package/src/utils/handler.ts +0 -105
- package/src/utils/index.ts +0 -184
- package/src/utils/lodash.ts +0 -30
- package/src/utils/valid.ts +0 -8
package/dist/taroApis.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
module.exports = new Set(["addCard","addFileToFavorites","addInterceptor","addPhoneCalendar","addPhoneContact","addPhoneRepeatCalendar","addVideoToFavorites","advancedGeneralIdentify","animalClassify","arrayBufferToBase64","authPrivateMessage","authorize","authorizeForMiniProgram","base64ToArrayBuffer","canIUse","canvasGetImageData","canvasPutImageData","canvasToTempFilePath","carClassify","checkIsOpenAccessibility","checkIsSoterEnrolledInDevice","checkIsSupportFacialRecognition","checkIsSupportSoterAuthentication","checkSession","chooseAddress","chooseContact","chooseImage","chooseInvoice","chooseInvoiceTitle","chooseLicensePlate","chooseLocation","chooseMedia","chooseMessageFile","choosePoi","chooseVideo","clearStorage","clearStorageSync","closeBLEConnection","closeBluetoothAdapter","closeSocket","cloud","compressImage","compressVideo","connectSocket","connectWifi","createAnimation","createAudioContext","createBLEConnection","createBLEPeripheralServer","createBufferURL","createCameraContext","createCanvasContext","createInnerAudioContext","createIntersectionObserver","createInterstitialAd","createLivePlayerContext","createLivePusherContext","createMapContext","createMediaAudioPlayer","createMediaContainer","createMediaRecorder","createOffscreenCanvas","createRewardedVideoAd","createSelectorQuery","createTCPSocket","createUDPSocket","createVKSession","createVideoContext","createVideoDecoder","createWebAudioContext","createWorker","disableAlertBeforeUnload","dishClassify","downloadFile","enableAlertBeforeUnload","exitMiniProgram","exitVoIPChat","faceDetect","faceVerifyForPay","getAccountInfoSync","getApp","getAppAuthorizeSetting","getAppBaseInfo","getAvailableAudioSources","getBLEDeviceCharacteristics","getBLEDeviceRSSI","getBLEDeviceServices","getBLEMTU","getBackgroundAudioManager","getBackgroundAudioPlayerState","getBackgroundFetchData","getBackgroundFetchToken","getBatteryInfo","getBatteryInfoSync","getBeacons","getBluetoothAdapterState","getBluetoothDevices","getChannelsLiveInfo","getChannelsLiveNoticeInfo","getClipboardData","getConnectedBluetoothDevices","getConnectedWifi","getCurrentInstance","getCurrentPages","getDeviceInfo","getEnterOptionsSync","getExptInfoSync","getExtConfig","getExtConfigSync","getFileInfo","getFileSystemManager","getGroupEnterInfo","getHCEState","getImageInfo","getLaunchOptionsSync","getLocalIPAddress","getLocation","getLogManager","getMenuButtonBoundingClientRect","getNFCAdapter","getNetworkType","getOpenUserInfo","getPerformance","getRandomValues","getRealtimeLogManager","getRecorderManager","getSavedFileInfo","getSavedFileList","getScreenBrightness","getSelectedTextRange","getSetting","getShareInfo","getStorage","getStorageInfo","getStorageInfoSync","getStorageSync","getSwanId","getSystemInfo","getSystemInfoAsync","getSystemInfoSync","getSystemSetting","getUpdateManager","getUserCryptoManager","getUserInfo","getUserProfile","getVideoInfo","getWeRunData","getWifiList","getWindowInfo","hideHomeButton","hideKeyboard","hideLoading","hideNavigationBarLoading","hideShareMenu","hideTabBar","hideTabBarRedDot","hideToast","imageAudit","initFaceDetect","initTabBarApis","isBluetoothDevicePaired","isVKSupport","joinVoIPChat","loadFontFace","login","logoClassify","makeBluetoothPair","makePhoneCall","navigateBack","navigateBackMiniProgram","navigateBackSmartProgram","navigateTo","navigateToMiniProgram","navigateToSmartGameProgram","navigateToSmartProgram","nextTick","notifyBLECharacteristicValueChange","objectDetectIdentify","ocrBankCard","ocrDrivingLicense","ocrIdCard","ocrVehicleLicense","offAccelerometerChange","offAppHide","offAppShow","offAudioInterruptionBegin","offAudioInterruptionEnd","offBLECharacteristicValueChange","offBLEConnectionStateChange","offBLEMTUChange","offBLEPeripheralConnectionStateChanged","offBeaconServiceChange","offBeaconUpdate","offBluetoothAdapterStateChange","offBluetoothDeviceFound","offCompassChange","offCopyUrl","offDeviceMotionChange","offError","offGetWifiList","offGyroscopeChange","offHCEMessage","offKeyboardHeightChange","offLocalServiceDiscoveryStop","offLocalServiceFound","offLocalServiceLost","offLocalServiceResolveFail","offLocationChange","offLocationChangeError","offMemoryWarning","offNetworkStatusChange","offNetworkWeakChange","offPageNotFound","offThemeChange","offUnhandledRejection","offUserCaptureScreen","offVoIPChatInterrupted","offVoIPChatMembersChanged","offVoIPChatStateChanged","offVoIPVideoMembersChanged","offWifiConnected","offWindowResize","onAccelerometerChange","onAppHide","onAppShow","onAudioInterruptionBegin","onAudioInterruptionEnd","onBLECharacteristicValueChange","onBLEConnectionStateChange","onBLEMTUChange","onBLEPeripheralConnectionStateChanged","onBackgroundAudioPause","onBackgroundAudioPlay","onBackgroundAudioStop","onBackgroundFetchData","onBeaconServiceChange","onBeaconUpdate","onBluetoothAdapterStateChange","onBluetoothDeviceFound","onCompassChange","onCopyUrl","onDeviceMotionChange","onError","onGetWifiList","onGyroscopeChange","onHCEMessage","onKeyboardHeightChange","onLocalServiceDiscoveryStop","onLocalServiceFound","onLocalServiceLost","onLocalServiceResolveFail","onLocationChange","onLocationChangeError","onMemoryWarning","onNetworkStatusChange","onNetworkWeakChange","onPageNotFound","onSocketClose","onSocketError","onSocketMessage","onSocketOpen","onThemeChange","onUnhandledRejection","onUserCaptureScreen","onVoIPChatInterrupted","onVoIPChatMembersChanged","onVoIPChatSpeakersChanged","onVoIPChatStateChanged","onVoIPVideoMembersChanged","onWifiConnected","onWifiConnectedWithPartialInfo","onWindowResize","openAppAuthorizeSetting","openBluetoothAdapter","openCard","openChannelsActivity","openChannelsEvent","openChannelsLive","openCustomerServiceChat","openDocument","openEmbeddedMiniProgram","openLocation","openSetting","openSystemBluetoothSetting","openVideoEditor","pageScrollTo","pauseBackgroundAudio","pauseVoice","plantClassify","playBackgroundAudio","playVoice","pluginLogin","preloadSubPackage","previewImage","previewMedia","reLaunch","readBLECharacteristicValue","redirectTo","removeSavedFile","removeStorage","removeStorageSync","removeTabBarBadge","reportAnalytics","reportEvent","reportMonitor","reportPerformance","request","requestOrderPayment","requestPayment","requestPolymerPayment","requestSubscribeMessage","reserveChannelsLive","revokeBufferURL","saveFile","saveFileToDisk","saveImageToPhotosAlbum","saveVideoToPhotosAlbum","scanCode","seekBackgroundAudio","sendHCEMessage","sendSocketMessage","setBLEMTU","setBackgroundColor","setBackgroundFetchToken","setBackgroundTextStyle","setClipboardData","setEnable1v1Chat","setEnableDebug","setInnerAudioOption","setKeepScreenOn","setNavigationBarColor","setNavigationBarTitle","setPageInfo","setScreenBrightness","setStorage","setStorageSync","setTabBarBadge","setTabBarItem","setTabBarStyle","setTopBarText","setVisualEffectOnCapture","setWifiList","setWindowSize","shareFileMessage","shareToWeRun","shareVideoMessage","showActionSheet","showLoading","showModal","showNavigationBarLoading","showRedPackage","showShareImageMenu","showShareMenu","showTabBar","showTabBarRedDot","showToast","startAccelerometer","startBeaconDiscovery","startBluetoothDevicesDiscovery","startCompass","startDeviceMotionListening","startFacialRecognitionVerify","startFacialRecognitionVerifyAndUploadVideo","startGyroscope","startHCE","startLocalServiceDiscovery","startLocationUpdate","startLocationUpdateBackground","startPullDownRefresh","startRecord","startSoterAuthentication","startWifi","stopAccelerometer","stopBackgroundAudio","stopBeaconDiscovery","stopBluetoothDevicesDiscovery","stopCompass","stopDeviceMotionListening","stopFaceDetect","stopGyroscope","stopHCE","stopLocalServiceDiscovery","stopLocationUpdate","stopPullDownRefresh","stopRecord","stopVoice","stopWifi","subscribeVoIPVideoMembers","switchTab","textReview","textToAudio","updateShareMenu","updateVoIPChatMuteConfig","updateWeChatApp","uploadFile","vibrateLong","vibrateShort","writeBLECharacteristicValue"])
|
|
1
|
+
module.exports = new Set(["addCard","addFileToFavorites","addInterceptor","addPhoneCalendar","addPhoneContact","addPhoneRepeatCalendar","addVideoToFavorites","advancedGeneralIdentify","animalClassify","arrayBufferToBase64","authPrivateMessage","authorize","authorizeForMiniProgram","base64ToArrayBuffer","canIUse","canvasGetImageData","canvasPutImageData","canvasToTempFilePath","carClassify","checkIsOpenAccessibility","checkIsSoterEnrolledInDevice","checkIsSupportFacialRecognition","checkIsSupportSoterAuthentication","checkSession","chooseAddress","chooseContact","chooseImage","chooseInvoice","chooseInvoiceTitle","chooseLicensePlate","chooseLocation","chooseMedia","chooseMessageFile","choosePoi","chooseVideo","clearStorage","clearStorageSync","closeBLEConnection","closeBluetoothAdapter","closeSocket","cloud","compressImage","compressVideo","connectSocket","connectWifi","createAnimation","createAudioContext","createBLEConnection","createBLEPeripheralServer","createBufferURL","createCameraContext","createCanvasContext","createInnerAudioContext","createIntersectionObserver","createInterstitialAd","createLivePlayerContext","createLivePusherContext","createMapContext","createMediaAudioPlayer","createMediaContainer","createMediaRecorder","createOffscreenCanvas","createRewardedVideoAd","createSelectorQuery","createTCPSocket","createUDPSocket","createVKSession","createVideoContext","createVideoDecoder","createWebAudioContext","createWorker","disableAlertBeforeUnload","dishClassify","downloadFile","enableAlertBeforeUnload","exitMiniProgram","exitVoIPChat","faceDetect","faceVerifyForPay","getAccountInfoSync","getApp","getAppAuthorizeSetting","getAppBaseInfo","getAvailableAudioSources","getBLEDeviceCharacteristics","getBLEDeviceRSSI","getBLEDeviceServices","getBLEMTU","getBackgroundAudioManager","getBackgroundAudioPlayerState","getBackgroundFetchData","getBackgroundFetchToken","getBatteryInfo","getBatteryInfoSync","getBeacons","getBluetoothAdapterState","getBluetoothDevices","getChannelsLiveInfo","getChannelsLiveNoticeInfo","getClipboardData","getConnectedBluetoothDevices","getConnectedWifi","getCurrentInstance","getCurrentPages","getDeviceInfo","getEnterOptionsSync","getExptInfoSync","getExtConfig","getExtConfigSync","getFileInfo","getFileSystemManager","getFuzzyLocation","getGroupEnterInfo","getHCEState","getImageInfo","getLaunchOptionsSync","getLocalIPAddress","getLocation","getLogManager","getMenuButtonBoundingClientRect","getNFCAdapter","getNetworkType","getOpenUserInfo","getPerformance","getRandomValues","getRealtimeLogManager","getRecorderManager","getSavedFileInfo","getSavedFileList","getScreenBrightness","getSelectedTextRange","getSetting","getShareInfo","getStorage","getStorageInfo","getStorageInfoSync","getStorageSync","getSwanId","getSystemInfo","getSystemInfoAsync","getSystemInfoSync","getSystemSetting","getUpdateManager","getUserCryptoManager","getUserInfo","getUserProfile","getVideoInfo","getWeRunData","getWifiList","getWindowInfo","hideHomeButton","hideKeyboard","hideLoading","hideNavigationBarLoading","hideShareMenu","hideTabBar","hideTabBarRedDot","hideToast","imageAudit","initFaceDetect","initTabBarApis","isBluetoothDevicePaired","isVKSupport","joinVoIPChat","loadFontFace","login","logoClassify","makeBluetoothPair","makePhoneCall","navigateBack","navigateBackMiniProgram","navigateBackSmartProgram","navigateTo","navigateToMiniProgram","navigateToSmartGameProgram","navigateToSmartProgram","nextTick","notifyBLECharacteristicValueChange","objectDetectIdentify","ocrBankCard","ocrDrivingLicense","ocrIdCard","ocrVehicleLicense","offAccelerometerChange","offAppHide","offAppShow","offAudioInterruptionBegin","offAudioInterruptionEnd","offBLECharacteristicValueChange","offBLEConnectionStateChange","offBLEMTUChange","offBLEPeripheralConnectionStateChanged","offBeaconServiceChange","offBeaconUpdate","offBluetoothAdapterStateChange","offBluetoothDeviceFound","offCompassChange","offCopyUrl","offDeviceMotionChange","offError","offGetWifiList","offGyroscopeChange","offHCEMessage","offKeyboardHeightChange","offLocalServiceDiscoveryStop","offLocalServiceFound","offLocalServiceLost","offLocalServiceResolveFail","offLocationChange","offLocationChangeError","offMemoryWarning","offNetworkStatusChange","offNetworkWeakChange","offPageNotFound","offThemeChange","offUnhandledRejection","offUserCaptureScreen","offVoIPChatInterrupted","offVoIPChatMembersChanged","offVoIPChatStateChanged","offVoIPVideoMembersChanged","offWifiConnected","offWindowResize","onAccelerometerChange","onAppHide","onAppShow","onAudioInterruptionBegin","onAudioInterruptionEnd","onBLECharacteristicValueChange","onBLEConnectionStateChange","onBLEMTUChange","onBLEPeripheralConnectionStateChanged","onBackgroundAudioPause","onBackgroundAudioPlay","onBackgroundAudioStop","onBackgroundFetchData","onBeaconServiceChange","onBeaconUpdate","onBluetoothAdapterStateChange","onBluetoothDeviceFound","onCompassChange","onCopyUrl","onDeviceMotionChange","onError","onGetWifiList","onGyroscopeChange","onHCEMessage","onKeyboardHeightChange","onLocalServiceDiscoveryStop","onLocalServiceFound","onLocalServiceLost","onLocalServiceResolveFail","onLocationChange","onLocationChangeError","onMemoryWarning","onNetworkStatusChange","onNetworkWeakChange","onPageNotFound","onSocketClose","onSocketError","onSocketMessage","onSocketOpen","onThemeChange","onUnhandledRejection","onUserCaptureScreen","onVoIPChatInterrupted","onVoIPChatMembersChanged","onVoIPChatSpeakersChanged","onVoIPChatStateChanged","onVoIPVideoMembersChanged","onWifiConnected","onWifiConnectedWithPartialInfo","onWindowResize","openAppAuthorizeSetting","openBluetoothAdapter","openCard","openChannelsActivity","openChannelsEvent","openChannelsLive","openCustomerServiceChat","openDocument","openEmbeddedMiniProgram","openLocation","openSetting","openSystemBluetoothSetting","openVideoEditor","pageScrollTo","pauseBackgroundAudio","pauseVoice","plantClassify","playBackgroundAudio","playVoice","pluginLogin","preloadSubPackage","previewImage","previewMedia","reLaunch","readBLECharacteristicValue","redirectTo","removeSavedFile","removeStorage","removeStorageSync","removeTabBarBadge","reportAnalytics","reportEvent","reportMonitor","reportPerformance","request","requestOrderPayment","requestPayment","requestPolymerPayment","requestSubscribeMessage","reserveChannelsLive","revokeBufferURL","saveFile","saveFileToDisk","saveImageToPhotosAlbum","saveVideoToPhotosAlbum","scanCode","seekBackgroundAudio","sendHCEMessage","sendSocketMessage","setBLEMTU","setBackgroundColor","setBackgroundFetchToken","setBackgroundTextStyle","setClipboardData","setEnable1v1Chat","setEnableDebug","setInnerAudioOption","setKeepScreenOn","setNavigationBarColor","setNavigationBarTitle","setPageInfo","setScreenBrightness","setStorage","setStorageSync","setTabBarBadge","setTabBarItem","setTabBarStyle","setTopBarText","setVisualEffectOnCapture","setWifiList","setWindowSize","shareFileMessage","shareToWeRun","shareVideoMessage","showActionSheet","showLoading","showModal","showNavigationBarLoading","showRedPackage","showShareImageMenu","showShareMenu","showTabBar","showTabBarRedDot","showToast","startAccelerometer","startBeaconDiscovery","startBluetoothDevicesDiscovery","startCompass","startDeviceMotionListening","startFacialRecognitionVerify","startFacialRecognitionVerifyAndUploadVideo","startGyroscope","startHCE","startLocalServiceDiscovery","startLocationUpdate","startLocationUpdateBackground","startPullDownRefresh","startRecord","startSoterAuthentication","startWifi","stopAccelerometer","stopBackgroundAudio","stopBeaconDiscovery","stopBluetoothDevicesDiscovery","stopCompass","stopDeviceMotionListening","stopFaceDetect","stopGyroscope","stopHCE","stopLocalServiceDiscovery","stopLocationUpdate","stopPullDownRefresh","stopRecord","stopVoice","stopWifi","subscribeVoIPVideoMembers","switchTab","textReview","textToAudio","updateShareMenu","updateVoIPChatMuteConfig","updateWeChatApp","uploadFile","vibrateLong","vibrateShort","writeBLECharacteristicValue"])
|
|
2
2
|
//# sourceMappingURL=taroApis.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
declare type TCallback<T = Partial<TaroGeneral.CallbackResult>> = (res: T) => Promise<void> | void;
|
|
2
|
+
interface IMethodParam<T = Partial<TaroGeneral.CallbackResult>> {
|
|
3
|
+
name: string;
|
|
4
|
+
success?: TCallback<T>;
|
|
5
|
+
fail?: TCallback;
|
|
6
|
+
complete?: TCallback;
|
|
7
|
+
}
|
|
8
|
+
export declare class MethodHandler<T = Partial<TaroGeneral.CallbackResult>> {
|
|
9
|
+
methodName: string;
|
|
10
|
+
protected __success?: TCallback<T>;
|
|
11
|
+
protected __fail?: TCallback;
|
|
12
|
+
protected __complete?: TCallback;
|
|
13
|
+
constructor({ name, success, fail, complete }: IMethodParam<T>);
|
|
14
|
+
success<U = Record<string, unknown>>(res?: Partial<T> & Partial<TaroGeneral.CallbackResult>, resolve?: any): Promise<T & U & TaroGeneral.CallbackResult>;
|
|
15
|
+
fail<U = Record<string, unknown>>(res?: Partial<T> & Partial<TaroGeneral.CallbackResult>, reject?: any): Promise<T & U & TaroGeneral.CallbackResult>;
|
|
16
|
+
}
|
|
17
|
+
declare type TCallbackManagerParam = (...arr: unknown[]) => void;
|
|
18
|
+
interface ICallbackManagerOption {
|
|
19
|
+
callback?: TCallbackManagerParam;
|
|
20
|
+
ctx?: any;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
declare type TCallbackManagerListItem = (TCallbackManagerParam | ICallbackManagerOption);
|
|
24
|
+
declare type TCallbackManagerList = TCallbackManagerListItem[];
|
|
25
|
+
export declare class CallbackManager {
|
|
26
|
+
callbacks: TCallbackManagerList;
|
|
27
|
+
/**
|
|
28
|
+
* 添加回调
|
|
29
|
+
* @param {{ callback: function, ctx: any } | function} opt
|
|
30
|
+
*/
|
|
31
|
+
add: (opt?: TCallbackManagerListItem) => void;
|
|
32
|
+
/**
|
|
33
|
+
* 移除回调
|
|
34
|
+
* @param {{ callback: function, ctx: any } | function} opt
|
|
35
|
+
*/
|
|
36
|
+
remove: (opt?: TCallbackManagerListItem) => void;
|
|
37
|
+
/**
|
|
38
|
+
* 获取回调函数数量
|
|
39
|
+
* @return {number}
|
|
40
|
+
*/
|
|
41
|
+
count: () => number;
|
|
42
|
+
/**
|
|
43
|
+
* 触发回调
|
|
44
|
+
* @param {...any} args 回调的调用参数
|
|
45
|
+
*/
|
|
46
|
+
trigger: (...args: TCallbackManagerList) => void;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TaroElement } from '@tarojs/runtime';
|
|
2
|
+
export declare function shouldBeObject(target: unknown): {
|
|
3
|
+
flag: boolean;
|
|
4
|
+
msg?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
flag: boolean;
|
|
7
|
+
msg: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function findDOM(inst?: any): TaroElement | HTMLElement | undefined;
|
|
10
|
+
interface IParameterErrorParam {
|
|
11
|
+
name?: string;
|
|
12
|
+
para?: string;
|
|
13
|
+
correct?: string;
|
|
14
|
+
wrong?: unknown;
|
|
15
|
+
}
|
|
16
|
+
export declare function getParameterError({ name, para, correct, wrong }: IParameterErrorParam): string;
|
|
17
|
+
export declare function inlineStyle(style: any): string;
|
|
18
|
+
export declare function setTransform(el: any, val: any): void;
|
|
19
|
+
export declare function serializeParams(params: any): string;
|
|
20
|
+
export declare function temporarilyNotSupport(apiName: any): () => Promise<{
|
|
21
|
+
errMsg: string;
|
|
22
|
+
}>;
|
|
23
|
+
export declare function weixinCorpSupport(apiName: any): () => Promise<{
|
|
24
|
+
errMsg: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function permanentlyNotSupport(apiName: any): () => Promise<{
|
|
27
|
+
errMsg: string;
|
|
28
|
+
}>;
|
|
29
|
+
interface IProcessOpenApi<TOptions = Record<string, unknown>, TResult extends TaroGeneral.CallbackResult = any> {
|
|
30
|
+
name: string;
|
|
31
|
+
defaultOptions?: TOptions;
|
|
32
|
+
standardMethod?: (opts: TOptions) => Promise<TResult>;
|
|
33
|
+
formatOptions?: (opts: TOptions) => TOptions;
|
|
34
|
+
formatResult?: (res: TResult) => TResult;
|
|
35
|
+
}
|
|
36
|
+
export declare function processOpenApi<TOptions = Record<string, unknown>, TResult extends TaroGeneral.CallbackResult = any>({ name, defaultOptions, standardMethod, formatOptions, formatResult }: IProcessOpenApi<TOptions, TResult>): (options?: Partial<TOptions>) => Promise<TResult>;
|
|
37
|
+
export * from './animation';
|
|
38
|
+
export * from './lodash';
|
|
39
|
+
export * from './valid';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable prefer-promise-reject-errors */
|
|
2
|
-
import {
|
|
2
|
+
import { Current, hooks } from '@tarojs/runtime';
|
|
3
3
|
export function shouldBeObject(target) {
|
|
4
4
|
if (target && typeof target === 'object')
|
|
5
5
|
return { flag: true };
|
|
@@ -12,12 +12,8 @@ export function shouldBeObject(target) {
|
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
export function findDOM(inst) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const find = runtimeHooks.getDOMNode;
|
|
18
|
-
if (typeof find === 'function') {
|
|
19
|
-
return find(inst);
|
|
20
|
-
}
|
|
15
|
+
if (inst && hooks.isExist('getDOMNode')) {
|
|
16
|
+
return hooks.call('getDOMNode', inst);
|
|
21
17
|
}
|
|
22
18
|
const page = Current.page;
|
|
23
19
|
const path = page === null || page === void 0 ? void 0 : page.path;
|
package/package.json
CHANGED
|
@@ -1,28 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro-h5",
|
|
3
|
-
"version": "3.5.0-alpha.
|
|
3
|
+
"version": "3.5.0-alpha.16",
|
|
4
4
|
"description": "Taro h5 framework",
|
|
5
5
|
"browser": "dist/index.esm.js",
|
|
6
6
|
"main:h5": "dist/index.js",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.cjs.js",
|
|
9
|
-
"typings": "
|
|
9
|
+
"typings": "dist/index.d.ts",
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"
|
|
12
|
+
"types",
|
|
13
13
|
"index.js"
|
|
14
14
|
],
|
|
15
15
|
"sideEffects": false,
|
|
16
|
-
"scripts": {
|
|
17
|
-
"assets": "cpy 'src/**/*.css' dist",
|
|
18
|
-
"build": "rimraf ./dist && tsc && npm run assets && rollup -c",
|
|
19
|
-
"predev": "npm run assets",
|
|
20
|
-
"dev": "tsc -w",
|
|
21
|
-
"test": "jest",
|
|
22
|
-
"test:ci": "jest -i --coverage false",
|
|
23
|
-
"test:dev": "jest --watch",
|
|
24
|
-
"test:coverage": "jest --coverage"
|
|
25
|
-
},
|
|
26
16
|
"repository": {
|
|
27
17
|
"type": "git",
|
|
28
18
|
"url": "git+https://github.com/NervJS/taro.git"
|
|
@@ -33,14 +23,22 @@
|
|
|
33
23
|
"author": "O2Team",
|
|
34
24
|
"license": "MIT",
|
|
35
25
|
"dependencies": {
|
|
36
|
-
"@tarojs/api": "3.5.0-alpha.
|
|
37
|
-
"@tarojs/router": "3.5.0-alpha.
|
|
38
|
-
"@tarojs/runtime": "3.5.0-alpha.
|
|
26
|
+
"@tarojs/api": "3.5.0-alpha.16",
|
|
27
|
+
"@tarojs/router": "3.5.0-alpha.16",
|
|
28
|
+
"@tarojs/runtime": "3.5.0-alpha.16",
|
|
39
29
|
"base64-js": "^1.3.0",
|
|
40
30
|
"jsonp-retry": "^1.0.3",
|
|
41
|
-
"mobile-detect": "^1.4.2",
|
|
42
31
|
"query-string": "^7.1.1",
|
|
43
32
|
"whatwg-fetch": "^3.4.0"
|
|
44
33
|
},
|
|
45
|
-
"
|
|
46
|
-
|
|
34
|
+
"scripts": {
|
|
35
|
+
"assets": "cpy 'src/**/*.css' dist",
|
|
36
|
+
"build": "rimraf ./dist && tsc && pnpm run assets && rollup -c",
|
|
37
|
+
"predev": "pnpm run assets",
|
|
38
|
+
"dev": "tsc -w",
|
|
39
|
+
"test": "jest",
|
|
40
|
+
"test:ci": "jest -i --coverage false",
|
|
41
|
+
"test:dev": "jest --watch",
|
|
42
|
+
"test:coverage": "jest --coverage"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/types/api.d.ts
ADDED
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Taro from '@tarojs/api'
|
|
2
|
+
|
|
3
|
+
namespace Router {
|
|
4
|
+
export interface Location {
|
|
5
|
+
path: string
|
|
6
|
+
search: string
|
|
7
|
+
hash: string
|
|
8
|
+
state: {
|
|
9
|
+
key: string
|
|
10
|
+
}
|
|
11
|
+
params: {
|
|
12
|
+
[key: string]: string
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export interface RouterParams {
|
|
16
|
+
path: string
|
|
17
|
+
scene: number
|
|
18
|
+
params: {
|
|
19
|
+
[key: string]: string
|
|
20
|
+
}
|
|
21
|
+
shareTicket: string
|
|
22
|
+
referrerInfo: Record<string, any>
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface TaroH5 {
|
|
27
|
+
_$router: Router.Location
|
|
28
|
+
$router: Router.RouterParams
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const TaroH5: TaroH5 & typeof Taro = {} as any
|
|
32
|
+
|
|
33
|
+
export = TaroH5
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/src/api/ad/index.ts
DELETED
package/src/api/ai/facial.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { temporarilyNotSupport } from '../../utils'
|
|
2
|
-
|
|
3
|
-
// 人脸识别
|
|
4
|
-
export const stopFaceDetect = temporarilyNotSupport('stopFaceDetect')
|
|
5
|
-
export const initFaceDetect = temporarilyNotSupport('initFaceDetect')
|
|
6
|
-
export const faceDetect = temporarilyNotSupport('faceDetect')
|
package/src/api/ai/index.ts
DELETED
package/src/api/ai/visual.ts
DELETED
package/src/api/alipay/index.ts
DELETED
package/src/api/base/crypto.ts
DELETED
package/src/api/base/debug.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { temporarilyNotSupport } from '../../utils'
|
|
2
|
-
|
|
3
|
-
export const setEnableDebug = temporarilyNotSupport('setEnableDebug')
|
|
4
|
-
export const getRealtimeLogManager = temporarilyNotSupport('getRealtimeLogManager')
|
|
5
|
-
export const getLogManager = temporarilyNotSupport('getLogManager')
|
package/src/api/base/index.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { fromByteArray, toByteArray } from 'base64-js'
|
|
2
|
-
|
|
3
|
-
import { temporarilyNotSupport } from '../../utils'
|
|
4
|
-
|
|
5
|
-
// TODO env 环境变量
|
|
6
|
-
|
|
7
|
-
export const canIUse = temporarilyNotSupport('canIUse')
|
|
8
|
-
|
|
9
|
-
export function arrayBufferToBase64 (arrayBuffer) {
|
|
10
|
-
return fromByteArray(arrayBuffer)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function base64ToArrayBuffer (base64) {
|
|
14
|
-
return toByteArray(base64)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export * from './crypto'
|
|
18
|
-
export * from './debug'
|
|
19
|
-
export * from './performance'
|
|
20
|
-
export * from './system'
|
|
21
|
-
export * from './update'
|
|
22
|
-
export * from './weapp/app-event'
|
|
23
|
-
export * from './weapp/life-cycle'
|
package/src/api/base/system.ts
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import Taro from '@tarojs/api'
|
|
2
|
-
import MobileDetect from 'mobile-detect'
|
|
3
|
-
|
|
4
|
-
import { temporarilyNotSupport } from '../../utils'
|
|
5
|
-
import { MethodHandler } from '../../utils/handler'
|
|
6
|
-
|
|
7
|
-
/** 跳转系统蓝牙设置页 */
|
|
8
|
-
export const openSystemBluetoothSetting = temporarilyNotSupport('openSystemBluetoothSetting')
|
|
9
|
-
|
|
10
|
-
/** 跳转系统微信授权管理页 */
|
|
11
|
-
export const openAppAuthorizeSetting = temporarilyNotSupport('openAppAuthorizeSetting')
|
|
12
|
-
|
|
13
|
-
/** 获取窗口信息 */
|
|
14
|
-
export const getWindowInfo: typeof Taro.getWindowInfo = () => {
|
|
15
|
-
const info: ReturnType<typeof Taro.getWindowInfo> = {
|
|
16
|
-
/** 设备像素比 */
|
|
17
|
-
pixelRatio: window.devicePixelRatio,
|
|
18
|
-
/** 屏幕宽度,单位px */
|
|
19
|
-
screenWidth: window.screen.width,
|
|
20
|
-
/** 屏幕高度,单位px */
|
|
21
|
-
screenHeight: window.screen.height,
|
|
22
|
-
/** 可使用窗口宽度,单位px */
|
|
23
|
-
windowWidth: document.documentElement.clientWidth,
|
|
24
|
-
/** 可使用窗口高度,单位px */
|
|
25
|
-
windowHeight: document.documentElement.clientHeight,
|
|
26
|
-
/** 状态栏的高度,单位px */
|
|
27
|
-
statusBarHeight: NaN,
|
|
28
|
-
/** 在竖屏正方向下的安全区域 */
|
|
29
|
-
safeArea: {
|
|
30
|
-
bottom: 0,
|
|
31
|
-
height: 0,
|
|
32
|
-
left: 0,
|
|
33
|
-
right: 0,
|
|
34
|
-
top: 0,
|
|
35
|
-
width: 0
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return info
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/** 获取设备设置 */
|
|
43
|
-
export const getSystemSetting: typeof Taro.getSystemSetting = () => {
|
|
44
|
-
const isLandscape = window.screen.width >= window.screen.height
|
|
45
|
-
const info: ReturnType<typeof Taro.getSystemSetting> = {
|
|
46
|
-
/** 蓝牙的系统开关 */
|
|
47
|
-
bluetoothEnabled: false,
|
|
48
|
-
/** 地理位置的系统开关 */
|
|
49
|
-
locationEnabled: false,
|
|
50
|
-
/** Wi-Fi 的系统开关 */
|
|
51
|
-
wifiEnabled: false,
|
|
52
|
-
/** 设备方向 */
|
|
53
|
-
deviceOrientation: isLandscape ? 'landscape' : 'portrait'
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return info
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/** 获取设备设置 */
|
|
60
|
-
export const getDeviceInfo: typeof Taro.getDeviceInfo = () => {
|
|
61
|
-
const md = new MobileDetect(navigator.userAgent)
|
|
62
|
-
|
|
63
|
-
const info: ReturnType<typeof Taro.getDeviceInfo> = {
|
|
64
|
-
/** 应用二进制接口类型(仅 Android 支持) */
|
|
65
|
-
abi: '',
|
|
66
|
-
/** 设备性能等级(仅Android小游戏)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */
|
|
67
|
-
benchmarkLevel: -1,
|
|
68
|
-
/** 设备品牌 */
|
|
69
|
-
brand: md.mobile() || '',
|
|
70
|
-
/** 设备型号 */
|
|
71
|
-
model: md.mobile() || '',
|
|
72
|
-
/** 操作系统及版本 */
|
|
73
|
-
system: md.os(),
|
|
74
|
-
/** 客户端平台 */
|
|
75
|
-
platform: navigator.platform
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return info
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** 获取微信APP基础信息 */
|
|
82
|
-
export const getAppBaseInfo: typeof Taro.getAppBaseInfo = () => {
|
|
83
|
-
let isDarkMode = false
|
|
84
|
-
if (window.matchMedia?.('(prefers-color-scheme: dark)').matches) {
|
|
85
|
-
isDarkMode = true
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const info: ReturnType<typeof Taro.getAppBaseInfo> = {
|
|
89
|
-
/** 客户端基础库版本 */
|
|
90
|
-
SDKVersion: '',
|
|
91
|
-
/** 是否已打开调试。可通过右上角菜单或 [Taro.setEnableDebug](/docs/apis/base/debug/setEnableDebug) 打开调试。 */
|
|
92
|
-
enableDebug: process.env.NODE_ENV === 'development',
|
|
93
|
-
/** 当前小程序运行的宿主环境 */
|
|
94
|
-
// host: { appId: '' },
|
|
95
|
-
/** 微信设置的语言 */
|
|
96
|
-
language: navigator.language,
|
|
97
|
-
/** 微信版本号 */
|
|
98
|
-
version: '',
|
|
99
|
-
/** 系统当前主题,取值为light或dark,全局配置"darkmode":true时才能获取,否则为 undefined (不支持小游戏) */
|
|
100
|
-
theme: isDarkMode ? 'dark' : 'light'
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return info
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/** 获取微信APP授权设置 */
|
|
107
|
-
export const getAppAuthorizeSetting: typeof Taro.getAppAuthorizeSetting = () => {
|
|
108
|
-
const info: ReturnType<typeof Taro.getAppAuthorizeSetting> = {
|
|
109
|
-
/** 允许微信使用相册的开关(仅 iOS 有效) */
|
|
110
|
-
albumAuthorized: 'not determined',
|
|
111
|
-
/** 允许微信使用蓝牙的开关(仅 iOS 有效) */
|
|
112
|
-
bluetoothAuthorized: 'not determined',
|
|
113
|
-
/** 允许微信使用摄像头的开关 */
|
|
114
|
-
cameraAuthorized: 'not determined',
|
|
115
|
-
/** 允许微信使用定位的开关 */
|
|
116
|
-
locationAuthorized: 'not determined',
|
|
117
|
-
/** 定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 有效) */
|
|
118
|
-
locationReducedAccuracy: false,
|
|
119
|
-
/** 允许微信使用麦克风的开关 */
|
|
120
|
-
microphoneAuthorized: 'not determined',
|
|
121
|
-
/** 允许微信通知的开关 */
|
|
122
|
-
notificationAuthorized: 'not determined',
|
|
123
|
-
/** 允许微信通知带有提醒的开关(仅 iOS 有效) */
|
|
124
|
-
notificationAlertAuthorized: 'not determined',
|
|
125
|
-
/** 允许微信通知带有标记的开关(仅 iOS 有效) */
|
|
126
|
-
notificationBadgeAuthorized: 'not determined',
|
|
127
|
-
/** 允许微信通知带有声音的开关(仅 iOS 有效) */
|
|
128
|
-
notificationSoundAuthorized: 'not determined',
|
|
129
|
-
/** 允许微信使用日历的开关 */
|
|
130
|
-
phoneCalendarAuthorized: 'not determined'
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return info
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/** 获取设备设置 */
|
|
137
|
-
export const getSystemInfoSync: typeof Taro.getSystemInfoSync = () => {
|
|
138
|
-
const windowInfo = getWindowInfo()
|
|
139
|
-
const systemSetting = getSystemSetting()
|
|
140
|
-
const deviceInfo: Taro.getDeviceInfo.Result = getDeviceInfo()
|
|
141
|
-
const appBaseInfo = getAppBaseInfo()
|
|
142
|
-
const appAuthorizeSetting = getAppAuthorizeSetting()
|
|
143
|
-
delete deviceInfo.abi
|
|
144
|
-
|
|
145
|
-
const info: ReturnType<typeof Taro.getSystemInfoSync> = {
|
|
146
|
-
...windowInfo,
|
|
147
|
-
...systemSetting,
|
|
148
|
-
...deviceInfo,
|
|
149
|
-
...appBaseInfo,
|
|
150
|
-
/** 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 */
|
|
151
|
-
fontSizeSetting: NaN,
|
|
152
|
-
/** 允许微信使用相册的开关(仅 iOS 有效) */
|
|
153
|
-
albumAuthorized: appAuthorizeSetting.albumAuthorized === 'authorized',
|
|
154
|
-
/** 允许微信使用摄像头的开关 */
|
|
155
|
-
cameraAuthorized: appAuthorizeSetting.cameraAuthorized === 'authorized',
|
|
156
|
-
/** 允许微信使用定位的开关 */
|
|
157
|
-
locationAuthorized: appAuthorizeSetting.locationAuthorized === 'authorized',
|
|
158
|
-
/** 允许微信使用麦克风的开关 */
|
|
159
|
-
microphoneAuthorized: appAuthorizeSetting.microphoneAuthorized === 'authorized',
|
|
160
|
-
/** 允许微信通知的开关 */
|
|
161
|
-
notificationAuthorized: appAuthorizeSetting.notificationAuthorized === 'authorized',
|
|
162
|
-
/** 允许微信通知带有提醒的开关(仅 iOS 有效) */
|
|
163
|
-
notificationAlertAuthorized: appAuthorizeSetting.notificationAlertAuthorized === 'authorized',
|
|
164
|
-
/** 允许微信通知带有标记的开关(仅 iOS 有效) */
|
|
165
|
-
notificationBadgeAuthorized: appAuthorizeSetting.notificationBadgeAuthorized === 'authorized',
|
|
166
|
-
/** 允许微信通知带有声音的开关(仅 iOS 有效) */
|
|
167
|
-
notificationSoundAuthorized: appAuthorizeSetting.notificationSoundAuthorized === 'authorized',
|
|
168
|
-
/** 允许微信使用日历的开关 */
|
|
169
|
-
phoneCalendarAuthorized: appAuthorizeSetting.phoneCalendarAuthorized === 'authorized',
|
|
170
|
-
/** `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 */
|
|
171
|
-
locationReducedAccuracy: appAuthorizeSetting.locationReducedAccuracy,
|
|
172
|
-
/** 小程序当前运行环境 */
|
|
173
|
-
environment: ''
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return info
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/** 获取系统信息 */
|
|
180
|
-
export const getSystemInfoAsync: typeof Taro.getSystemInfoAsync = async (options = {}) => {
|
|
181
|
-
const { success, fail, complete } = options
|
|
182
|
-
const handle = new MethodHandler({ name: 'getSystemInfoAsync', success, fail, complete })
|
|
183
|
-
|
|
184
|
-
try {
|
|
185
|
-
const info = await getSystemInfoSync()
|
|
186
|
-
return handle.success(info)
|
|
187
|
-
} catch (error) {
|
|
188
|
-
return handle.fail({
|
|
189
|
-
errMsg: error
|
|
190
|
-
})
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/** 获取系统信息 */
|
|
195
|
-
export const getSystemInfo: typeof Taro.getSystemInfo = async (options = {}) => {
|
|
196
|
-
const { success, fail, complete } = options
|
|
197
|
-
const handle = new MethodHandler({ name: 'getSystemInfo', success, fail, complete })
|
|
198
|
-
|
|
199
|
-
try {
|
|
200
|
-
const info = await getSystemInfoSync()
|
|
201
|
-
return handle.success(info)
|
|
202
|
-
} catch (error) {
|
|
203
|
-
return handle.fail({
|
|
204
|
-
errMsg: error
|
|
205
|
-
})
|
|
206
|
-
}
|
|
207
|
-
}
|
package/src/api/base/update.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { temporarilyNotSupport } from '../../../utils'
|
|
2
|
-
|
|
3
|
-
// 应用级事件
|
|
4
|
-
export const onUnhandledRejection = temporarilyNotSupport('onUnhandledRejection')
|
|
5
|
-
export const onThemeChange = temporarilyNotSupport('onThemeChange')
|
|
6
|
-
export const onPageNotFound = temporarilyNotSupport('onPageNotFound')
|
|
7
|
-
export const onError = temporarilyNotSupport('onError')
|
|
8
|
-
export const onAudioInterruptionEnd = temporarilyNotSupport('onAudioInterruptionEnd')
|
|
9
|
-
export const onAudioInterruptionBegin = temporarilyNotSupport('onAudioInterruptionBegin')
|
|
10
|
-
export const onAppShow = temporarilyNotSupport('onAppShow')
|
|
11
|
-
export const onAppHide = temporarilyNotSupport('onAppHide')
|
|
12
|
-
export const offUnhandledRejection = temporarilyNotSupport('offUnhandledRejection')
|
|
13
|
-
export const offThemeChange = temporarilyNotSupport('offThemeChange')
|
|
14
|
-
export const offPageNotFound = temporarilyNotSupport('offPageNotFound')
|
|
15
|
-
export const offError = temporarilyNotSupport('offError')
|
|
16
|
-
export const offAudioInterruptionEnd = temporarilyNotSupport('offAudioInterruptionEnd')
|
|
17
|
-
export const offAudioInterruptionBegin = temporarilyNotSupport('offAudioInterruptionBegin')
|
|
18
|
-
export const offAppShow = temporarilyNotSupport('offAppShow')
|
|
19
|
-
export const offAppHide = temporarilyNotSupport('offAppHide')
|