@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.
Files changed (295) hide show
  1. package/dist/api/ad/index.d.ts +6 -0
  2. package/dist/api/ai/facial.d.ts +9 -0
  3. package/dist/api/ai/index.d.ts +2 -0
  4. package/dist/api/ai/visual.d.ts +6 -0
  5. package/dist/api/alipay/index.d.ts +3 -0
  6. package/dist/api/base/crypto.d.ts +3 -0
  7. package/dist/api/base/debug.d.ts +9 -0
  8. package/dist/api/base/index.d.ts +12 -0
  9. package/dist/api/base/performance.d.ts +6 -0
  10. package/dist/api/base/system.d.ts +27 -0
  11. package/dist/api/base/system.js +2 -2
  12. package/dist/api/base/update.d.ts +6 -0
  13. package/dist/api/base/weapp/app-event.d.ts +41 -0
  14. package/dist/api/base/weapp/app-event.js +55 -4
  15. package/dist/api/base/weapp/life-cycle.d.ts +6 -0
  16. package/dist/api/canvas/CanvasContext.d.ts +104 -0
  17. package/dist/api/canvas/canvasGetImageData.d.ts +5 -0
  18. package/dist/api/canvas/canvasPutImageData.d.ts +6 -0
  19. package/dist/api/canvas/canvasToTempFilePath.d.ts +6 -0
  20. package/dist/api/canvas/canvasToTempFilePath.js +1 -1
  21. package/dist/api/canvas/createCanvasContext.d.ts +5 -0
  22. package/dist/api/canvas/index.d.ts +12 -0
  23. package/dist/api/cloud/index.d.ts +31 -0
  24. package/dist/api/data-analysis/index.d.ts +12 -0
  25. package/dist/api/device/accelerometer.d.ts +17 -0
  26. package/dist/api/device/accessibility.d.ts +3 -0
  27. package/dist/api/device/battery.d.ts +5 -0
  28. package/dist/api/device/bluetooth-ble.d.ts +48 -0
  29. package/dist/api/device/bluetooth-peripheral.d.ts +9 -0
  30. package/dist/api/device/bluetooth.d.ts +39 -0
  31. package/dist/api/device/calendar.d.ts +6 -0
  32. package/dist/api/device/clipboard.d.ts +15 -0
  33. package/dist/api/device/compass.d.ts +17 -0
  34. package/dist/api/device/contact.d.ts +6 -0
  35. package/dist/api/device/crypto.d.ts +3 -0
  36. package/dist/api/device/gyroscope.d.ts +12 -0
  37. package/dist/api/device/iBeacon.d.ts +21 -0
  38. package/dist/api/device/index.d.ts +23 -0
  39. package/dist/api/device/keyboard.d.ts +12 -0
  40. package/dist/api/device/memory.d.ts +6 -0
  41. package/dist/api/device/motion.d.ts +17 -0
  42. package/dist/api/device/network.d.ts +20 -0
  43. package/dist/api/device/nfc.d.ts +21 -0
  44. package/dist/api/device/phone.d.ts +2 -0
  45. package/dist/api/device/scan.d.ts +3 -0
  46. package/dist/api/device/screen.d.ts +18 -0
  47. package/dist/api/device/vibrate.d.ts +9 -0
  48. package/dist/api/device/vibrate.js +5 -7
  49. package/dist/api/device/wifi.d.ts +33 -0
  50. package/dist/api/ext/index.d.ts +6 -0
  51. package/dist/api/files/index.d.ts +24 -0
  52. package/dist/api/framework/index.d.ts +4 -0
  53. package/dist/api/index.d.ts +24 -0
  54. package/dist/api/location/chooseLocation.d.ts +6 -0
  55. package/dist/api/location/getLocation.d.ts +2 -0
  56. package/dist/api/location/index.d.ts +32 -0
  57. package/dist/api/location/index.js +1 -0
  58. package/dist/api/media/EditorContext.d.ts +42 -0
  59. package/dist/api/media/audio/InnerAudioContext.d.ts +58 -0
  60. package/dist/api/media/audio/InnerAudioContext.js +1 -1
  61. package/dist/api/media/audio/index.d.ts +29 -0
  62. package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +71 -0
  63. package/dist/api/media/background-audio/index.d.ts +29 -0
  64. package/dist/api/media/camera.d.ts +3 -0
  65. package/dist/api/media/image/chooseImage.d.ts +5 -0
  66. package/dist/api/media/image/getImageInfo.d.ts +5 -0
  67. package/dist/api/media/image/index.d.ts +15 -0
  68. package/dist/api/media/image/previewImage.d.ts +8 -0
  69. package/dist/api/media/index.d.ts +12 -0
  70. package/dist/api/media/live.d.ts +6 -0
  71. package/dist/api/media/map.d.ts +3 -0
  72. package/dist/api/media/media-recorder.d.ts +3 -0
  73. package/dist/api/media/recorder.d.ts +9 -0
  74. package/dist/api/media/video/index.d.ts +24 -0
  75. package/dist/api/media/video-decoder.d.ts +3 -0
  76. package/dist/api/media/video-processing.d.ts +3 -0
  77. package/dist/api/media/voip.d.ts +42 -0
  78. package/dist/api/navigate/index.d.ts +12 -0
  79. package/dist/api/network/download.d.ts +6 -0
  80. package/dist/api/network/download.js +1 -0
  81. package/dist/api/network/index.d.ts +7 -0
  82. package/dist/api/network/mdns.d.ts +30 -0
  83. package/dist/api/network/request/index.d.ts +4 -0
  84. package/dist/api/network/tcp.d.ts +3 -0
  85. package/dist/api/network/udp.d.ts +3 -0
  86. package/dist/api/network/upload.d.ts +5 -0
  87. package/dist/api/network/upload.js +2 -1
  88. package/{src/api/network/utils.ts → dist/api/network/utils.d.ts} +44 -71
  89. package/dist/api/network/utils.js +1 -0
  90. package/dist/api/network/websocket/index.d.ts +7 -0
  91. package/dist/api/network/websocket/socketTask.d.ts +25 -0
  92. package/dist/api/open-api/account.d.ts +3 -0
  93. package/dist/api/open-api/address.d.ts +3 -0
  94. package/dist/api/open-api/authorize.d.ts +6 -0
  95. package/dist/api/open-api/card.d.ts +6 -0
  96. package/dist/api/open-api/channels-live.d.ts +18 -0
  97. package/dist/api/open-api/customer-service.d.ts +3 -0
  98. package/dist/api/open-api/facial.d.ts +12 -0
  99. package/dist/api/open-api/favorites.d.ts +6 -0
  100. package/dist/api/open-api/group.d.ts +3 -0
  101. package/dist/api/open-api/index.d.ts +18 -0
  102. package/dist/api/open-api/invoice.d.ts +6 -0
  103. package/dist/api/open-api/license-plate.d.ts +3 -0
  104. package/dist/api/open-api/login.d.ts +9 -0
  105. package/dist/api/open-api/red-package.d.ts +3 -0
  106. package/dist/api/open-api/settings.d.ts +6 -0
  107. package/dist/api/open-api/soter.d.ts +9 -0
  108. package/dist/api/open-api/subscribe-message.d.ts +3 -0
  109. package/dist/api/open-api/user-info.d.ts +6 -0
  110. package/dist/api/open-api/werun.d.ts +6 -0
  111. package/dist/api/payment/index.d.ts +6 -0
  112. package/dist/api/route/index.d.ts +1 -0
  113. package/dist/api/share/index.d.ts +30 -0
  114. package/dist/api/storage/background-fetch.d.ts +12 -0
  115. package/dist/api/storage/index.d.ts +18 -0
  116. package/dist/api/swan/index.d.ts +63 -0
  117. package/dist/api/taro.d.ts +12 -0
  118. package/dist/api/ui/animation/index.d.ts +2 -0
  119. package/dist/api/ui/background.d.ts +6 -0
  120. package/dist/api/ui/custom-component.d.ts +1 -0
  121. package/dist/api/ui/fonts.d.ts +2 -0
  122. package/dist/api/ui/index.d.ts +12 -0
  123. package/dist/api/ui/interaction/actionSheet.d.ts +61 -0
  124. package/dist/api/ui/interaction/index.d.ts +14 -0
  125. package/dist/api/ui/interaction/modal.d.ts +69 -0
  126. package/dist/api/ui/interaction/modal.js +1 -0
  127. package/dist/api/ui/interaction/toast.d.ts +85 -0
  128. package/dist/api/ui/menu.d.ts +3 -0
  129. package/dist/api/ui/navigation-bar/index.d.ts +15 -0
  130. package/dist/api/ui/navigation-bar/index.js +2 -3
  131. package/dist/api/ui/pull-down-refresh.d.ts +9 -0
  132. package/dist/api/ui/scroll/index.d.ts +5 -0
  133. package/dist/api/ui/sticky.d.ts +3 -0
  134. package/dist/api/ui/tab-bar.d.ts +34 -0
  135. package/dist/api/ui/window.d.ts +15 -0
  136. package/dist/api/worker/index.d.ts +3 -0
  137. package/dist/api/wxml/index.d.ts +5 -0
  138. package/dist/api/wxml/nodesRef.d.ts +13 -0
  139. package/dist/api/wxml/selectorQuery.d.ts +24 -0
  140. package/dist/api/wxml/selectorQuery.js +1 -1
  141. package/dist/index.cjs.d.ts +1373 -0
  142. package/dist/index.cjs.js +105 -81
  143. package/dist/index.cjs.js.map +1 -1
  144. package/dist/index.d.ts +4 -0
  145. package/dist/index.esm.d.ts +1373 -0
  146. package/dist/index.esm.js +93 -69
  147. package/dist/index.esm.js.map +1 -1
  148. package/dist/taroApis.d.ts +1364 -0
  149. package/dist/taroApis.js +1 -1
  150. package/dist/utils/animation.d.ts +6 -0
  151. package/dist/utils/handler.d.ts +48 -0
  152. package/dist/utils/index.d.ts +39 -0
  153. package/dist/utils/index.js +3 -7
  154. package/dist/utils/lodash.d.ts +2 -0
  155. package/dist/utils/valid.d.ts +2 -0
  156. package/package.json +17 -19
  157. package/types/api.d.ts +4 -0
  158. package/types/define.d.ts +2 -0
  159. package/types/index.d.ts +33 -0
  160. package/types/overlay.d.ts +9 -0
  161. package/LICENSE +0 -21
  162. package/src/api/ad/index.ts +0 -5
  163. package/src/api/ai/facial.ts +0 -6
  164. package/src/api/ai/index.ts +0 -2
  165. package/src/api/ai/visual.ts +0 -7
  166. package/src/api/alipay/index.ts +0 -4
  167. package/src/api/base/crypto.ts +0 -4
  168. package/src/api/base/debug.ts +0 -5
  169. package/src/api/base/index.ts +0 -23
  170. package/src/api/base/performance.ts +0 -5
  171. package/src/api/base/system.ts +0 -207
  172. package/src/api/base/update.ts +0 -5
  173. package/src/api/base/weapp/app-event.ts +0 -19
  174. package/src/api/base/weapp/life-cycle.ts +0 -5
  175. package/src/api/canvas/CanvasContext.ts +0 -233
  176. package/src/api/canvas/canvasGetImageData.ts +0 -28
  177. package/src/api/canvas/canvasPutImageData.ts +0 -25
  178. package/src/api/canvas/canvasToTempFilePath.ts +0 -25
  179. package/src/api/canvas/createCanvasContext.ts +0 -19
  180. package/src/api/canvas/index.ts +0 -18
  181. package/src/api/cloud/index.ts +0 -32
  182. package/src/api/data-analysis/index.ts +0 -6
  183. package/src/api/device/accelerometer.ts +0 -79
  184. package/src/api/device/accessibility.ts +0 -4
  185. package/src/api/device/battery.ts +0 -23
  186. package/src/api/device/bluetooth-ble.ts +0 -19
  187. package/src/api/device/bluetooth-peripheral.ts +0 -6
  188. package/src/api/device/bluetooth.ts +0 -16
  189. package/src/api/device/calendar.ts +0 -5
  190. package/src/api/device/clipboard.ts +0 -68
  191. package/src/api/device/compass.ts +0 -83
  192. package/src/api/device/contact.ts +0 -5
  193. package/src/api/device/crypto.ts +0 -4
  194. package/src/api/device/gyroscope.ts +0 -7
  195. package/src/api/device/iBeacon.ts +0 -10
  196. package/src/api/device/index.ts +0 -23
  197. package/src/api/device/keyboard.ts +0 -7
  198. package/src/api/device/memory.ts +0 -5
  199. package/src/api/device/motion.ts +0 -77
  200. package/src/api/device/network.ts +0 -90
  201. package/src/api/device/nfc.ts +0 -10
  202. package/src/api/device/phone.ts +0 -31
  203. package/src/api/device/scan.ts +0 -11
  204. package/src/api/device/screen.ts +0 -9
  205. package/src/api/device/vibrate.ts +0 -37
  206. package/src/api/device/wifi.ts +0 -14
  207. package/src/api/ext/index.ts +0 -5
  208. package/src/api/files/index.ts +0 -11
  209. package/src/api/framework/index.ts +0 -10
  210. package/src/api/index.ts +0 -24
  211. package/src/api/location/chooseLocation.ts +0 -117
  212. package/src/api/location/getLocation.ts +0 -81
  213. package/src/api/location/index.ts +0 -22
  214. package/src/api/location/style.css +0 -79
  215. package/src/api/media/EditorContext.ts +0 -32
  216. package/src/api/media/audio/InnerAudioContext.ts +0 -99
  217. package/src/api/media/audio/index.ts +0 -21
  218. package/src/api/media/background-audio/BackgroundAudioManager.ts +0 -104
  219. package/src/api/media/background-audio/index.ts +0 -17
  220. package/src/api/media/camera.ts +0 -4
  221. package/src/api/media/image/chooseImage.ts +0 -95
  222. package/src/api/media/image/getImageInfo.ts +0 -50
  223. package/src/api/media/image/index.ts +0 -13
  224. package/src/api/media/image/previewImage.ts +0 -80
  225. package/src/api/media/index.ts +0 -12
  226. package/src/api/media/live.ts +0 -5
  227. package/src/api/media/map.ts +0 -4
  228. package/src/api/media/media-recorder.ts +0 -4
  229. package/src/api/media/recorder.ts +0 -6
  230. package/src/api/media/video/index.ts +0 -82
  231. package/src/api/media/video-decoder.ts +0 -4
  232. package/src/api/media/video-processing.ts +0 -4
  233. package/src/api/media/voip.ts +0 -17
  234. package/src/api/navigate/index.ts +0 -7
  235. package/src/api/network/download.ts +0 -141
  236. package/src/api/network/index.ts +0 -7
  237. package/src/api/network/mdns.ts +0 -13
  238. package/src/api/network/request/index.ts +0 -135
  239. package/src/api/network/tcp.ts +0 -4
  240. package/src/api/network/udp.ts +0 -4
  241. package/src/api/network/upload.ts +0 -169
  242. package/src/api/network/websocket/index.ts +0 -88
  243. package/src/api/network/websocket/socketTask.ts +0 -89
  244. package/src/api/open-api/account.ts +0 -4
  245. package/src/api/open-api/address.ts +0 -4
  246. package/src/api/open-api/authorize.ts +0 -5
  247. package/src/api/open-api/card.ts +0 -5
  248. package/src/api/open-api/channels-live.ts +0 -9
  249. package/src/api/open-api/customer-service.ts +0 -4
  250. package/src/api/open-api/facial.ts +0 -7
  251. package/src/api/open-api/favorites.ts +0 -5
  252. package/src/api/open-api/group.ts +0 -4
  253. package/src/api/open-api/index.ts +0 -18
  254. package/src/api/open-api/invoice.ts +0 -5
  255. package/src/api/open-api/license-plate.ts +0 -4
  256. package/src/api/open-api/login.ts +0 -6
  257. package/src/api/open-api/red-package.ts +0 -4
  258. package/src/api/open-api/settings.ts +0 -5
  259. package/src/api/open-api/soter.ts +0 -6
  260. package/src/api/open-api/subscribe-message.ts +0 -4
  261. package/src/api/open-api/user-info.ts +0 -5
  262. package/src/api/open-api/werun.ts +0 -5
  263. package/src/api/payment/index.ts +0 -5
  264. package/src/api/route/index.ts +0 -10
  265. package/src/api/share/index.ts +0 -13
  266. package/src/api/storage/background-fetch.ts +0 -7
  267. package/src/api/storage/index.ts +0 -182
  268. package/src/api/swan/index.ts +0 -31
  269. package/src/api/taro.ts +0 -84
  270. package/src/api/ui/animation/index.ts +0 -356
  271. package/src/api/ui/background.ts +0 -5
  272. package/src/api/ui/custom-component.ts +0 -4
  273. package/src/api/ui/fonts.ts +0 -64
  274. package/src/api/ui/index.ts +0 -12
  275. package/src/api/ui/interaction/actionSheet.ts +0 -212
  276. package/src/api/ui/interaction/index.ts +0 -302
  277. package/src/api/ui/interaction/modal.ts +0 -237
  278. package/src/api/ui/interaction/toast.ts +0 -220
  279. package/src/api/ui/menu.ts +0 -4
  280. package/src/api/ui/navigation-bar/index.ts +0 -52
  281. package/src/api/ui/pull-down-refresh.ts +0 -28
  282. package/src/api/ui/scroll/index.ts +0 -85
  283. package/src/api/ui/sticky.ts +0 -4
  284. package/src/api/ui/tab-bar.ts +0 -327
  285. package/src/api/ui/window.ts +0 -38
  286. package/src/api/worker/index.ts +0 -4
  287. package/src/api/wxml/index.ts +0 -10
  288. package/src/api/wxml/nodesRef.ts +0 -56
  289. package/src/api/wxml/selectorQuery.ts +0 -220
  290. package/src/index.ts +0 -6
  291. package/src/utils/animation.ts +0 -15
  292. package/src/utils/handler.ts +0 -105
  293. package/src/utils/index.ts +0 -184
  294. package/src/utils/lodash.ts +0 -30
  295. 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,6 @@
1
+ /**
2
+ * ease-in-out的函数
3
+ * @param t 0-1的数字
4
+ */
5
+ export declare const easeInOut: (t: number) => number;
6
+ export declare const getTimingFunc: (easeFunc: any, frameCnt: any) => (x: any) => any;
@@ -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';
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable prefer-promise-reject-errors */
2
- import { container, Current, SERVICE_IDENTIFIER } from '@tarojs/runtime';
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
- const runtimeHooks = container.get(SERVICE_IDENTIFIER.Hooks);
16
- if (inst) {
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;
@@ -0,0 +1,2 @@
1
+ export declare function throttle(fn: any, threshold?: number, scope?: any): (...args: any[]) => void;
2
+ export declare function debounce(fn: any, ms?: number, scope?: any): (...args: any[]) => void;
@@ -0,0 +1,2 @@
1
+ export declare function isFunction(obj: any): boolean;
2
+ export declare const isValidColor: (color: any) => boolean;
package/package.json CHANGED
@@ -1,28 +1,18 @@
1
1
  {
2
2
  "name": "@tarojs/taro-h5",
3
- "version": "3.5.0-alpha.13",
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": "src/index.ts",
9
+ "typings": "dist/index.d.ts",
10
10
  "files": [
11
11
  "dist",
12
- "src",
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.13",
37
- "@tarojs/router": "3.5.0-alpha.13",
38
- "@tarojs/runtime": "3.5.0-alpha.13",
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
- "gitHead": "1e201315913fbeb3a71f14c93a5e7a2fa490e4c4"
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
@@ -0,0 +1,4 @@
1
+ declare module '@tarojs/api' {
2
+ import Taro from '@tarojs/taro'
3
+ export = Taro
4
+ }
@@ -0,0 +1,2 @@
1
+ // NOTE: 允许用户自定义的常量
2
+ declare const LOCATION_APIKEY: string | undefined
@@ -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
@@ -0,0 +1,9 @@
1
+ import Taro from '@tarojs/taro'
2
+
3
+ declare module '@tarojs/taro' {
4
+ namespace vibrateShort {
5
+ interface Option {
6
+ type?: 'heavy' | 'medium' | 'light'
7
+ }
8
+ }
9
+ }
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.
@@ -1,5 +0,0 @@
1
- import { temporarilyNotSupport } from '../../utils'
2
-
3
- // 广告
4
- export const createRewardedVideoAd = temporarilyNotSupport('createRewardedVideoAd')
5
- export const createInterstitialAd = temporarilyNotSupport('createInterstitialAd')
@@ -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')
@@ -1,2 +0,0 @@
1
- export * from './facial'
2
- export * from './visual'
@@ -1,7 +0,0 @@
1
- import { temporarilyNotSupport } from '../../utils'
2
-
3
- // 判断支持版本
4
- export const isVKSupport = temporarilyNotSupport('isVKSupport')
5
-
6
- // 视觉算法
7
- export const createVKSession = temporarilyNotSupport('createVKSession')
@@ -1,4 +0,0 @@
1
- import { temporarilyNotSupport } from '../../utils'
2
-
3
- // AliPay
4
- export const getOpenUserInfo = temporarilyNotSupport('getOpenUserInfo')
@@ -1,4 +0,0 @@
1
- import { temporarilyNotSupport } from '../../utils'
2
-
3
- // 加密
4
- export const getUserCryptoManager = temporarilyNotSupport('getUserCryptoManager')
@@ -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')
@@ -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'
@@ -1,5 +0,0 @@
1
- import { temporarilyNotSupport } from '../../utils'
2
-
3
- // 性能
4
- export const reportPerformance = temporarilyNotSupport('reportPerformance')
5
- export const getPerformance = temporarilyNotSupport('getPerformance')
@@ -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
- }
@@ -1,5 +0,0 @@
1
- import { temporarilyNotSupport } from '../../utils'
2
-
3
- // 更新
4
- export const updateWeChatApp = temporarilyNotSupport('updateWeChatApp')
5
- export const getUpdateManager = temporarilyNotSupport('getUpdateManager')
@@ -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')
@@ -1,5 +0,0 @@
1
- import { temporarilyNotSupport } from '../../../utils'
2
-
3
- // 生命周期
4
- export const getLaunchOptionsSync = temporarilyNotSupport('getLaunchOptionsSync')
5
- export const getEnterOptionsSync = temporarilyNotSupport('getEnterOptionsSync')