@tarojs/taro-h5 3.5.0-alpha.15 → 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 (293) 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/index.d.ts +7 -0
  81. package/dist/api/network/mdns.d.ts +30 -0
  82. package/dist/api/network/request/index.d.ts +4 -0
  83. package/dist/api/network/tcp.d.ts +3 -0
  84. package/dist/api/network/udp.d.ts +3 -0
  85. package/dist/api/network/upload.d.ts +5 -0
  86. package/dist/api/network/upload.js +1 -1
  87. package/{src/api/network/utils.ts → dist/api/network/utils.d.ts} +44 -72
  88. package/dist/api/network/websocket/index.d.ts +7 -0
  89. package/dist/api/network/websocket/socketTask.d.ts +25 -0
  90. package/dist/api/open-api/account.d.ts +3 -0
  91. package/dist/api/open-api/address.d.ts +3 -0
  92. package/dist/api/open-api/authorize.d.ts +6 -0
  93. package/dist/api/open-api/card.d.ts +6 -0
  94. package/dist/api/open-api/channels-live.d.ts +18 -0
  95. package/dist/api/open-api/customer-service.d.ts +3 -0
  96. package/dist/api/open-api/facial.d.ts +12 -0
  97. package/dist/api/open-api/favorites.d.ts +6 -0
  98. package/dist/api/open-api/group.d.ts +3 -0
  99. package/dist/api/open-api/index.d.ts +18 -0
  100. package/dist/api/open-api/invoice.d.ts +6 -0
  101. package/dist/api/open-api/license-plate.d.ts +3 -0
  102. package/dist/api/open-api/login.d.ts +9 -0
  103. package/dist/api/open-api/red-package.d.ts +3 -0
  104. package/dist/api/open-api/settings.d.ts +6 -0
  105. package/dist/api/open-api/soter.d.ts +9 -0
  106. package/dist/api/open-api/subscribe-message.d.ts +3 -0
  107. package/dist/api/open-api/user-info.d.ts +6 -0
  108. package/dist/api/open-api/werun.d.ts +6 -0
  109. package/dist/api/payment/index.d.ts +6 -0
  110. package/dist/api/route/index.d.ts +1 -0
  111. package/dist/api/share/index.d.ts +30 -0
  112. package/dist/api/storage/background-fetch.d.ts +12 -0
  113. package/dist/api/storage/index.d.ts +18 -0
  114. package/dist/api/swan/index.d.ts +63 -0
  115. package/dist/api/taro.d.ts +12 -0
  116. package/dist/api/ui/animation/index.d.ts +2 -0
  117. package/dist/api/ui/background.d.ts +6 -0
  118. package/dist/api/ui/custom-component.d.ts +1 -0
  119. package/dist/api/ui/fonts.d.ts +2 -0
  120. package/dist/api/ui/index.d.ts +12 -0
  121. package/dist/api/ui/interaction/actionSheet.d.ts +61 -0
  122. package/dist/api/ui/interaction/index.d.ts +14 -0
  123. package/dist/api/ui/interaction/modal.d.ts +69 -0
  124. package/dist/api/ui/interaction/modal.js +1 -0
  125. package/dist/api/ui/interaction/toast.d.ts +85 -0
  126. package/dist/api/ui/menu.d.ts +3 -0
  127. package/dist/api/ui/navigation-bar/index.d.ts +15 -0
  128. package/dist/api/ui/navigation-bar/index.js +2 -3
  129. package/dist/api/ui/pull-down-refresh.d.ts +9 -0
  130. package/dist/api/ui/scroll/index.d.ts +5 -0
  131. package/dist/api/ui/sticky.d.ts +3 -0
  132. package/dist/api/ui/tab-bar.d.ts +34 -0
  133. package/dist/api/ui/window.d.ts +15 -0
  134. package/dist/api/worker/index.d.ts +3 -0
  135. package/dist/api/wxml/index.d.ts +5 -0
  136. package/dist/api/wxml/nodesRef.d.ts +13 -0
  137. package/dist/api/wxml/selectorQuery.d.ts +24 -0
  138. package/dist/api/wxml/selectorQuery.js +1 -1
  139. package/dist/index.cjs.d.ts +1373 -0
  140. package/dist/index.cjs.js +102 -81
  141. package/dist/index.cjs.js.map +1 -1
  142. package/dist/index.d.ts +4 -0
  143. package/dist/index.esm.d.ts +1373 -0
  144. package/dist/index.esm.js +90 -69
  145. package/dist/index.esm.js.map +1 -1
  146. package/dist/taroApis.d.ts +1364 -0
  147. package/dist/taroApis.js +1 -1
  148. package/dist/utils/animation.d.ts +6 -0
  149. package/dist/utils/handler.d.ts +48 -0
  150. package/dist/utils/index.d.ts +39 -0
  151. package/dist/utils/index.js +3 -7
  152. package/dist/utils/lodash.d.ts +2 -0
  153. package/dist/utils/valid.d.ts +2 -0
  154. package/package.json +17 -19
  155. package/types/api.d.ts +4 -0
  156. package/types/define.d.ts +2 -0
  157. package/types/index.d.ts +33 -0
  158. package/types/overlay.d.ts +9 -0
  159. package/LICENSE +0 -21
  160. package/src/api/ad/index.ts +0 -5
  161. package/src/api/ai/facial.ts +0 -6
  162. package/src/api/ai/index.ts +0 -2
  163. package/src/api/ai/visual.ts +0 -7
  164. package/src/api/alipay/index.ts +0 -4
  165. package/src/api/base/crypto.ts +0 -4
  166. package/src/api/base/debug.ts +0 -5
  167. package/src/api/base/index.ts +0 -23
  168. package/src/api/base/performance.ts +0 -5
  169. package/src/api/base/system.ts +0 -207
  170. package/src/api/base/update.ts +0 -5
  171. package/src/api/base/weapp/app-event.ts +0 -19
  172. package/src/api/base/weapp/life-cycle.ts +0 -5
  173. package/src/api/canvas/CanvasContext.ts +0 -233
  174. package/src/api/canvas/canvasGetImageData.ts +0 -28
  175. package/src/api/canvas/canvasPutImageData.ts +0 -25
  176. package/src/api/canvas/canvasToTempFilePath.ts +0 -25
  177. package/src/api/canvas/createCanvasContext.ts +0 -19
  178. package/src/api/canvas/index.ts +0 -18
  179. package/src/api/cloud/index.ts +0 -32
  180. package/src/api/data-analysis/index.ts +0 -6
  181. package/src/api/device/accelerometer.ts +0 -79
  182. package/src/api/device/accessibility.ts +0 -4
  183. package/src/api/device/battery.ts +0 -23
  184. package/src/api/device/bluetooth-ble.ts +0 -19
  185. package/src/api/device/bluetooth-peripheral.ts +0 -6
  186. package/src/api/device/bluetooth.ts +0 -16
  187. package/src/api/device/calendar.ts +0 -5
  188. package/src/api/device/clipboard.ts +0 -68
  189. package/src/api/device/compass.ts +0 -83
  190. package/src/api/device/contact.ts +0 -5
  191. package/src/api/device/crypto.ts +0 -4
  192. package/src/api/device/gyroscope.ts +0 -7
  193. package/src/api/device/iBeacon.ts +0 -10
  194. package/src/api/device/index.ts +0 -23
  195. package/src/api/device/keyboard.ts +0 -7
  196. package/src/api/device/memory.ts +0 -5
  197. package/src/api/device/motion.ts +0 -77
  198. package/src/api/device/network.ts +0 -90
  199. package/src/api/device/nfc.ts +0 -10
  200. package/src/api/device/phone.ts +0 -31
  201. package/src/api/device/scan.ts +0 -11
  202. package/src/api/device/screen.ts +0 -9
  203. package/src/api/device/vibrate.ts +0 -37
  204. package/src/api/device/wifi.ts +0 -14
  205. package/src/api/ext/index.ts +0 -5
  206. package/src/api/files/index.ts +0 -11
  207. package/src/api/framework/index.ts +0 -10
  208. package/src/api/index.ts +0 -24
  209. package/src/api/location/chooseLocation.ts +0 -117
  210. package/src/api/location/getLocation.ts +0 -81
  211. package/src/api/location/index.ts +0 -22
  212. package/src/api/location/style.css +0 -79
  213. package/src/api/media/EditorContext.ts +0 -32
  214. package/src/api/media/audio/InnerAudioContext.ts +0 -99
  215. package/src/api/media/audio/index.ts +0 -21
  216. package/src/api/media/background-audio/BackgroundAudioManager.ts +0 -104
  217. package/src/api/media/background-audio/index.ts +0 -17
  218. package/src/api/media/camera.ts +0 -4
  219. package/src/api/media/image/chooseImage.ts +0 -95
  220. package/src/api/media/image/getImageInfo.ts +0 -50
  221. package/src/api/media/image/index.ts +0 -13
  222. package/src/api/media/image/previewImage.ts +0 -80
  223. package/src/api/media/index.ts +0 -12
  224. package/src/api/media/live.ts +0 -5
  225. package/src/api/media/map.ts +0 -4
  226. package/src/api/media/media-recorder.ts +0 -4
  227. package/src/api/media/recorder.ts +0 -6
  228. package/src/api/media/video/index.ts +0 -82
  229. package/src/api/media/video-decoder.ts +0 -4
  230. package/src/api/media/video-processing.ts +0 -4
  231. package/src/api/media/voip.ts +0 -17
  232. package/src/api/navigate/index.ts +0 -7
  233. package/src/api/network/download.ts +0 -142
  234. package/src/api/network/index.ts +0 -7
  235. package/src/api/network/mdns.ts +0 -13
  236. package/src/api/network/request/index.ts +0 -135
  237. package/src/api/network/tcp.ts +0 -4
  238. package/src/api/network/udp.ts +0 -4
  239. package/src/api/network/upload.ts +0 -170
  240. package/src/api/network/websocket/index.ts +0 -88
  241. package/src/api/network/websocket/socketTask.ts +0 -89
  242. package/src/api/open-api/account.ts +0 -4
  243. package/src/api/open-api/address.ts +0 -4
  244. package/src/api/open-api/authorize.ts +0 -5
  245. package/src/api/open-api/card.ts +0 -5
  246. package/src/api/open-api/channels-live.ts +0 -9
  247. package/src/api/open-api/customer-service.ts +0 -4
  248. package/src/api/open-api/facial.ts +0 -7
  249. package/src/api/open-api/favorites.ts +0 -5
  250. package/src/api/open-api/group.ts +0 -4
  251. package/src/api/open-api/index.ts +0 -18
  252. package/src/api/open-api/invoice.ts +0 -5
  253. package/src/api/open-api/license-plate.ts +0 -4
  254. package/src/api/open-api/login.ts +0 -6
  255. package/src/api/open-api/red-package.ts +0 -4
  256. package/src/api/open-api/settings.ts +0 -5
  257. package/src/api/open-api/soter.ts +0 -6
  258. package/src/api/open-api/subscribe-message.ts +0 -4
  259. package/src/api/open-api/user-info.ts +0 -5
  260. package/src/api/open-api/werun.ts +0 -5
  261. package/src/api/payment/index.ts +0 -5
  262. package/src/api/route/index.ts +0 -10
  263. package/src/api/share/index.ts +0 -13
  264. package/src/api/storage/background-fetch.ts +0 -7
  265. package/src/api/storage/index.ts +0 -182
  266. package/src/api/swan/index.ts +0 -31
  267. package/src/api/taro.ts +0 -84
  268. package/src/api/ui/animation/index.ts +0 -356
  269. package/src/api/ui/background.ts +0 -5
  270. package/src/api/ui/custom-component.ts +0 -4
  271. package/src/api/ui/fonts.ts +0 -64
  272. package/src/api/ui/index.ts +0 -12
  273. package/src/api/ui/interaction/actionSheet.ts +0 -212
  274. package/src/api/ui/interaction/index.ts +0 -302
  275. package/src/api/ui/interaction/modal.ts +0 -237
  276. package/src/api/ui/interaction/toast.ts +0 -220
  277. package/src/api/ui/menu.ts +0 -4
  278. package/src/api/ui/navigation-bar/index.ts +0 -52
  279. package/src/api/ui/pull-down-refresh.ts +0 -28
  280. package/src/api/ui/scroll/index.ts +0 -85
  281. package/src/api/ui/sticky.ts +0 -4
  282. package/src/api/ui/tab-bar.ts +0 -327
  283. package/src/api/ui/window.ts +0 -38
  284. package/src/api/worker/index.ts +0 -4
  285. package/src/api/wxml/index.ts +0 -10
  286. package/src/api/wxml/nodesRef.ts +0 -56
  287. package/src/api/wxml/selectorQuery.ts +0 -220
  288. package/src/index.ts +0 -6
  289. package/src/utils/animation.ts +0 -15
  290. package/src/utils/handler.ts +0 -105
  291. package/src/utils/index.ts +0 -184
  292. package/src/utils/lodash.ts +0 -30
  293. package/src/utils/valid.ts +0 -8
@@ -0,0 +1,21 @@
1
+ export declare const stopBeaconDiscovery: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const startBeaconDiscovery: () => Promise<{
5
+ errMsg: string;
6
+ }>;
7
+ export declare const onBeaconUpdate: () => Promise<{
8
+ errMsg: string;
9
+ }>;
10
+ export declare const onBeaconServiceChange: () => Promise<{
11
+ errMsg: string;
12
+ }>;
13
+ export declare const offBeaconUpdate: () => Promise<{
14
+ errMsg: string;
15
+ }>;
16
+ export declare const offBeaconServiceChange: () => Promise<{
17
+ errMsg: string;
18
+ }>;
19
+ export declare const getBeacons: () => Promise<{
20
+ errMsg: string;
21
+ }>;
@@ -0,0 +1,23 @@
1
+ export * from './accelerometer';
2
+ export * from './accessibility';
3
+ export * from './battery';
4
+ export * from './bluetooth';
5
+ export * from './bluetooth-ble';
6
+ export * from './bluetooth-peripheral';
7
+ export * from './calendar';
8
+ export * from './clipboard';
9
+ export * from './compass';
10
+ export * from './contact';
11
+ export * from './crypto';
12
+ export * from './gyroscope';
13
+ export * from './iBeacon';
14
+ export * from './keyboard';
15
+ export * from './memory';
16
+ export * from './motion';
17
+ export * from './network';
18
+ export * from './nfc';
19
+ export * from './phone';
20
+ export * from './scan';
21
+ export * from './screen';
22
+ export * from './vibrate';
23
+ export * from './wifi';
@@ -0,0 +1,12 @@
1
+ export declare const onKeyboardHeightChange: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const offKeyboardHeightChange: () => Promise<{
5
+ errMsg: string;
6
+ }>;
7
+ export declare const hideKeyboard: () => Promise<{
8
+ errMsg: string;
9
+ }>;
10
+ export declare const getSelectedTextRange: () => Promise<{
11
+ errMsg: string;
12
+ }>;
@@ -0,0 +1,6 @@
1
+ export declare const onMemoryWarning: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const offMemoryWarning: () => Promise<{
5
+ errMsg: string;
6
+ }>;
@@ -0,0 +1,17 @@
1
+ import Taro from '@tarojs/api';
2
+ /**
3
+ * 停止监听设备方向的变化。
4
+ */
5
+ export declare const stopDeviceMotionListening: typeof Taro.stopDeviceMotionListening;
6
+ /**
7
+ * 开始监听设备方向的变化。
8
+ */
9
+ export declare const startDeviceMotionListening: typeof Taro.startDeviceMotionListening;
10
+ /**
11
+ * 监听设备方向变化事件。
12
+ */
13
+ export declare const onDeviceMotionChange: typeof Taro.onDeviceMotionChange;
14
+ /**
15
+ * 取消监听设备方向变化事件,参数为空,则取消所有的事件监听。
16
+ */
17
+ export declare const offDeviceMotionChange: typeof Taro.offDeviceMotionChange;
@@ -0,0 +1,20 @@
1
+ import Taro from '@tarojs/api';
2
+ export declare const getNetworkType: typeof Taro.getNetworkType;
3
+ /**
4
+ * 在最近的八次网络请求中, 出现下列三个现象之一则判定弱网。
5
+ * - 出现三次以上连接超时
6
+ * - 出现三次 rtt 超过 400
7
+ * - 出现三次以上的丢包
8
+ * > 弱网事件通知规则是: 弱网状态变化时立即通知, 状态不变时 30s 内最多通知一次。
9
+ */
10
+ export declare const onNetworkWeakChange: () => Promise<{
11
+ errMsg: string;
12
+ }>;
13
+ export declare const onNetworkStatusChange: typeof Taro.onNetworkStatusChange;
14
+ export declare const offNetworkWeakChange: () => Promise<{
15
+ errMsg: string;
16
+ }>;
17
+ export declare const offNetworkStatusChange: typeof Taro.offNetworkStatusChange;
18
+ export declare const getLocalIPAddress: () => Promise<{
19
+ errMsg: string;
20
+ }>;
@@ -0,0 +1,21 @@
1
+ export declare const stopHCE: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const startHCE: () => Promise<{
5
+ errMsg: string;
6
+ }>;
7
+ export declare const sendHCEMessage: () => Promise<{
8
+ errMsg: string;
9
+ }>;
10
+ export declare const onHCEMessage: () => Promise<{
11
+ errMsg: string;
12
+ }>;
13
+ export declare const offHCEMessage: () => Promise<{
14
+ errMsg: string;
15
+ }>;
16
+ export declare const getNFCAdapter: () => Promise<{
17
+ errMsg: string;
18
+ }>;
19
+ export declare const getHCEState: () => Promise<{
20
+ errMsg: string;
21
+ }>;
@@ -0,0 +1,2 @@
1
+ import Taro from '@tarojs/api';
2
+ export declare const makePhoneCall: typeof Taro.makePhoneCall;
@@ -0,0 +1,3 @@
1
+ export declare const scanCode: (options?: Partial<{
2
+ needResult: number;
3
+ }>) => Promise<any>;
@@ -0,0 +1,18 @@
1
+ export declare const setVisualEffectOnCapture: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const setScreenBrightness: () => Promise<{
5
+ errMsg: string;
6
+ }>;
7
+ export declare const setKeepScreenOn: () => Promise<{
8
+ errMsg: string;
9
+ }>;
10
+ export declare const onUserCaptureScreen: () => Promise<{
11
+ errMsg: string;
12
+ }>;
13
+ export declare const offUserCaptureScreen: () => Promise<{
14
+ errMsg: string;
15
+ }>;
16
+ export declare const getScreenBrightness: () => Promise<{
17
+ errMsg: string;
18
+ }>;
@@ -0,0 +1,9 @@
1
+ import Taro from '@tarojs/api';
2
+ /**
3
+ * 使手机发生较短时间的振动(15 ms)。仅在 iPhone 7 / 7 Plus 以上及 Android 机型生效
4
+ */
5
+ export declare const vibrateShort: typeof Taro.vibrateShort;
6
+ /**
7
+ * 使手机发生较长时间的振动(400 ms)
8
+ */
9
+ export declare const vibrateLong: typeof Taro.vibrateLong;
@@ -4,7 +4,7 @@ const vibrator = function vibrator(mm) {
4
4
  return window.navigator.vibrate(mm);
5
5
  }
6
6
  catch (e) {
7
- console.warn('当前浏览器不支持vibrate');
7
+ console.warn('当前浏览器不支持 vibrate');
8
8
  }
9
9
  };
10
10
  /**
@@ -12,12 +12,11 @@ const vibrator = function vibrator(mm) {
12
12
  */
13
13
  export const vibrateShort = ({ success, fail, complete } = {}) => {
14
14
  const handle = new MethodHandler({ name: 'vibrateShort', success, fail, complete });
15
- if (vibrator) {
16
- vibrator(15);
15
+ if (vibrator(15)) {
17
16
  return handle.success();
18
17
  }
19
18
  else {
20
- return handle.fail();
19
+ return handle.fail({ errMsg: 'style is not support' });
21
20
  }
22
21
  };
23
22
  /**
@@ -25,11 +24,10 @@ export const vibrateShort = ({ success, fail, complete } = {}) => {
25
24
  */
26
25
  export const vibrateLong = ({ success, fail, complete } = {}) => {
27
26
  const handle = new MethodHandler({ name: 'vibrateLong', success, fail, complete });
28
- if (vibrator) {
29
- vibrator(400);
27
+ if (vibrator(400)) {
30
28
  return handle.success();
31
29
  }
32
30
  else {
33
- return handle.fail();
31
+ return handle.fail({ errMsg: 'style is not support' });
34
32
  }
35
33
  };
@@ -0,0 +1,33 @@
1
+ export declare const stopWifi: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const startWifi: () => Promise<{
5
+ errMsg: string;
6
+ }>;
7
+ export declare const setWifiList: () => Promise<{
8
+ errMsg: string;
9
+ }>;
10
+ export declare const onWifiConnectedWithPartialInfo: () => Promise<{
11
+ errMsg: string;
12
+ }>;
13
+ export declare const onWifiConnected: () => Promise<{
14
+ errMsg: string;
15
+ }>;
16
+ export declare const onGetWifiList: () => Promise<{
17
+ errMsg: string;
18
+ }>;
19
+ export declare const offWifiConnected: () => Promise<{
20
+ errMsg: string;
21
+ }>;
22
+ export declare const offGetWifiList: () => Promise<{
23
+ errMsg: string;
24
+ }>;
25
+ export declare const getWifiList: () => Promise<{
26
+ errMsg: string;
27
+ }>;
28
+ export declare const getConnectedWifi: () => Promise<{
29
+ errMsg: string;
30
+ }>;
31
+ export declare const connectWifi: () => Promise<{
32
+ errMsg: string;
33
+ }>;
@@ -0,0 +1,6 @@
1
+ export declare const getExtConfigSync: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const getExtConfig: () => Promise<{
5
+ errMsg: string;
6
+ }>;
@@ -0,0 +1,24 @@
1
+ export declare const saveFileToDisk: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const saveFile: () => Promise<{
5
+ errMsg: string;
6
+ }>;
7
+ export declare const removeSavedFile: () => Promise<{
8
+ errMsg: string;
9
+ }>;
10
+ export declare const openDocument: () => Promise<{
11
+ errMsg: string;
12
+ }>;
13
+ export declare const getSavedFileList: () => Promise<{
14
+ errMsg: string;
15
+ }>;
16
+ export declare const getSavedFileInfo: () => Promise<{
17
+ errMsg: string;
18
+ }>;
19
+ export declare const getFileSystemManager: () => Promise<{
20
+ errMsg: string;
21
+ }>;
22
+ export declare const getFileInfo: () => Promise<{
23
+ errMsg: string;
24
+ }>;
@@ -0,0 +1,4 @@
1
+ import Taro from '@tarojs/api';
2
+ export declare const getApp: typeof Taro.getApp;
3
+ export { getCurrentPages } from '@tarojs/router';
4
+ export declare const getCurrentInstance: () => Taro.Current;
@@ -0,0 +1,24 @@
1
+ export * from './ad';
2
+ export * from './ai';
3
+ export * from './alipay';
4
+ export * from './base';
5
+ export * from './canvas';
6
+ export * from './cloud';
7
+ export * from './data-analysis';
8
+ export * from './device';
9
+ export * from './ext';
10
+ export * from './files';
11
+ export * from './framework';
12
+ export * from './location';
13
+ export * from './media';
14
+ export * from './navigate';
15
+ export * from './network';
16
+ export * from './open-api';
17
+ export * from './payment';
18
+ export * from './route';
19
+ export * from './share';
20
+ export * from './storage';
21
+ export * from './swan';
22
+ export * from './ui';
23
+ export * from './worker';
24
+ export * from './wxml';
@@ -0,0 +1,6 @@
1
+ import './style.css';
2
+ import Taro from '@tarojs/api';
3
+ /**
4
+ * 打开地图选择位置。
5
+ */
6
+ export declare const chooseLocation: typeof Taro.chooseLocation;
@@ -0,0 +1,2 @@
1
+ import Taro from '@tarojs/api';
2
+ export declare const getLocation: (options?: Partial<Taro.getLocation.Option>) => Promise<Taro.getLocation.SuccessCallbackResult>;
@@ -0,0 +1,32 @@
1
+ export declare const stopLocationUpdate: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const startLocationUpdateBackground: () => Promise<{
5
+ errMsg: string;
6
+ }>;
7
+ export declare const startLocationUpdate: () => Promise<{
8
+ errMsg: string;
9
+ }>;
10
+ export declare const openLocation: (options?: Partial<{
11
+ scale: number;
12
+ }>) => Promise<any>;
13
+ export declare const onLocationChangeError: () => Promise<{
14
+ errMsg: string;
15
+ }>;
16
+ export declare const onLocationChange: () => Promise<{
17
+ errMsg: string;
18
+ }>;
19
+ export declare const offLocationChangeError: () => Promise<{
20
+ errMsg: string;
21
+ }>;
22
+ export declare const offLocationChange: () => Promise<{
23
+ errMsg: string;
24
+ }>;
25
+ export { getLocation } from './getLocation';
26
+ export declare const choosePoi: () => Promise<{
27
+ errMsg: string;
28
+ }>;
29
+ export declare const getFuzzyLocation: () => Promise<{
30
+ errMsg: string;
31
+ }>;
32
+ export { chooseLocation } from './chooseLocation';
@@ -13,4 +13,5 @@ export const offLocationChangeError = temporarilyNotSupport('offLocationChangeEr
13
13
  export const offLocationChange = temporarilyNotSupport('offLocationChange');
14
14
  export { getLocation } from './getLocation';
15
15
  export const choosePoi = temporarilyNotSupport('choosePoi');
16
+ export const getFuzzyLocation = temporarilyNotSupport('getFuzzyLocation');
16
17
  export { chooseLocation } from './chooseLocation';
@@ -0,0 +1,42 @@
1
+ import Taro from '@tarojs/api';
2
+ export declare class EditorContext implements Taro.EditorContext {
3
+ blur: () => Promise<{
4
+ errMsg: string;
5
+ }>;
6
+ clear: () => Promise<{
7
+ errMsg: string;
8
+ }>;
9
+ format: () => Promise<{
10
+ errMsg: string;
11
+ }>;
12
+ getContents: () => Promise<{
13
+ errMsg: string;
14
+ }>;
15
+ getSelectionText: () => Promise<{
16
+ errMsg: string;
17
+ }>;
18
+ insertDivider: () => Promise<{
19
+ errMsg: string;
20
+ }>;
21
+ insertImage: () => Promise<{
22
+ errMsg: string;
23
+ }>;
24
+ insertText: () => Promise<{
25
+ errMsg: string;
26
+ }>;
27
+ redo: () => Promise<{
28
+ errMsg: string;
29
+ }>;
30
+ removeFormat: () => Promise<{
31
+ errMsg: string;
32
+ }>;
33
+ scrollIntoView: () => Promise<{
34
+ errMsg: string;
35
+ }>;
36
+ setContents: () => Promise<{
37
+ errMsg: string;
38
+ }>;
39
+ undo: () => Promise<{
40
+ errMsg: string;
41
+ }>;
42
+ }
@@ -0,0 +1,58 @@
1
+ import Taro from '@tarojs/api';
2
+ import { CallbackManager } from '../../../utils/handler';
3
+ export declare class InnerAudioContext implements Taro.InnerAudioContext {
4
+ Instance?: HTMLAudioElement;
5
+ errorStack: CallbackManager;
6
+ stopStack: CallbackManager;
7
+ __startTime: number;
8
+ constructor();
9
+ set autoplay(e: boolean);
10
+ get autoplay(): boolean;
11
+ get buffered(): number;
12
+ get currentTime(): number;
13
+ get duration(): number;
14
+ set loop(e: boolean);
15
+ get loop(): boolean;
16
+ get paused(): boolean;
17
+ set src(e: string);
18
+ get src(): string;
19
+ set volume(e: number);
20
+ get volume(): number;
21
+ set playbackRate(e: number);
22
+ get playbackRate(): number;
23
+ set obeyMuteSwitch(_e: boolean);
24
+ get obeyMuteSwitch(): boolean;
25
+ set startTime(e: number);
26
+ get startTime(): number;
27
+ set referrerPolicy(e: string);
28
+ get referrerPolicy(): string;
29
+ private setProperty;
30
+ play: () => Promise<void> | undefined;
31
+ pause: () => void | undefined;
32
+ stop: () => void;
33
+ seek: (position: number) => void;
34
+ /**
35
+ * @TODO destroy得并不干净
36
+ */
37
+ destroy: () => void;
38
+ onCanplay: (callback?: () => void) => void | undefined;
39
+ onPlay: (callback?: () => void) => void | undefined;
40
+ onPause: (callback?: () => void) => void | undefined;
41
+ onStop: (callback?: () => void) => void;
42
+ onEnded: (callback?: () => void) => void | undefined;
43
+ onTimeUpdate: (callback?: () => void) => void | undefined;
44
+ onError: (callback?: ((res: Taro.InnerAudioContext.onErrorDetail) => void) | undefined) => void;
45
+ onWaiting: (callback?: () => void) => void | undefined;
46
+ onSeeking: (callback?: () => void) => void | undefined;
47
+ onSeeked: (callback?: () => void) => void | undefined;
48
+ offCanplay: (callback?: () => void) => void | undefined;
49
+ offPlay: (callback?: () => void) => void | undefined;
50
+ offPause: (callback?: () => void) => void | undefined;
51
+ offStop: (callback?: () => void) => void;
52
+ offEnded: (callback?: () => void) => void | undefined;
53
+ offTimeUpdate: (callback?: () => void) => void | undefined;
54
+ offError: (callback?: () => void) => void;
55
+ offWaiting: (callback?: () => void) => void | undefined;
56
+ offSeeking: (callback?: () => void) => void | undefined;
57
+ offSeeked: (callback?: () => void) => void | undefined;
58
+ }
@@ -63,7 +63,7 @@ export class InnerAudioContext {
63
63
  get duration() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.duration) || 0; }
64
64
  set loop(e) { this.setProperty('loop', e); }
65
65
  get loop() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.loop) || false; }
66
- get paused() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused) || true; }
66
+ get paused() { var _a, _b; return (_b = (_a = this.Instance) === null || _a === void 0 ? void 0 : _a.paused) !== null && _b !== void 0 ? _b : true; }
67
67
  set src(e) { this.setProperty('src', e); }
68
68
  get src() { var _a; return ((_a = this.Instance) === null || _a === void 0 ? void 0 : _a.src) || ''; }
69
69
  set volume(e) { this.setProperty('volume', e); }
@@ -0,0 +1,29 @@
1
+ import Taro from '@tarojs/api';
2
+ export declare const stopVoice: () => Promise<{
3
+ errMsg: string;
4
+ }>;
5
+ export declare const setInnerAudioOption: () => Promise<{
6
+ errMsg: string;
7
+ }>;
8
+ export declare const playVoice: () => Promise<{
9
+ errMsg: string;
10
+ }>;
11
+ export declare const pauseVoice: () => Promise<{
12
+ errMsg: string;
13
+ }>;
14
+ export declare const getAvailableAudioSources: () => Promise<{
15
+ errMsg: string;
16
+ }>;
17
+ export declare const createWebAudioContext: () => Promise<{
18
+ errMsg: string;
19
+ }>;
20
+ export declare const createMediaAudioPlayer: () => Promise<{
21
+ errMsg: string;
22
+ }>;
23
+ /**
24
+ * 创建内部 audio 上下文 InnerAudioContext 对象。
25
+ */
26
+ export declare const createInnerAudioContext: typeof Taro.createInnerAudioContext;
27
+ export declare const createAudioContext: () => Promise<{
28
+ errMsg: string;
29
+ }>;
@@ -0,0 +1,71 @@
1
+ import Taro from '@tarojs/api';
2
+ import { CallbackManager } from '../../../utils/handler';
3
+ export declare class BackgroundAudioManager implements Taro.BackgroundAudioManager {
4
+ Instance?: HTMLAudioElement;
5
+ errorStack: CallbackManager;
6
+ stopStack: CallbackManager;
7
+ __startTime: number;
8
+ constructor();
9
+ set src(e: string);
10
+ get src(): string;
11
+ set startTime(e: number);
12
+ get startTime(): number;
13
+ set title(e: string);
14
+ get title(): string;
15
+ set epname(e: string);
16
+ get epname(): string;
17
+ set singer(e: string);
18
+ get singer(): string;
19
+ set coverImgUrl(e: string);
20
+ get coverImgUrl(): string;
21
+ set webUrl(e: string);
22
+ get webUrl(): string;
23
+ set protocol(e: string);
24
+ get protocol(): string;
25
+ set playbackRate(e: number);
26
+ get playbackRate(): number;
27
+ get duration(): number;
28
+ get currentTime(): number;
29
+ get paused(): boolean;
30
+ get buffered(): number;
31
+ set referrerPolicy(e: string);
32
+ get referrerPolicy(): string;
33
+ private setProperty;
34
+ private dataset;
35
+ play: () => Promise<void> | undefined;
36
+ pause: () => void | undefined;
37
+ seek: (position: number) => void;
38
+ stop: () => void;
39
+ onCanplay: (callback?: () => void) => void | undefined;
40
+ onWaiting: (callback?: () => void) => void | undefined;
41
+ onError: (callback?: ((res: Taro.InnerAudioContext.onErrorDetail) => void) | undefined) => void;
42
+ onPlay: (callback?: () => void) => void | undefined;
43
+ onPause: (callback?: () => void) => void | undefined;
44
+ onSeeking: (callback?: () => void) => void | undefined;
45
+ onSeeked: (callback?: () => void) => void | undefined;
46
+ onEnded: (callback?: () => void) => void | undefined;
47
+ onStop: (callback?: () => void) => void;
48
+ onTimeUpdate: (callback?: () => void) => void | undefined;
49
+ onPrev: () => Promise<{
50
+ errMsg: string;
51
+ }>;
52
+ onNext: () => Promise<{
53
+ errMsg: string;
54
+ }>;
55
+ offCanplay: (callback?: () => void) => void | undefined;
56
+ offWaiting: (callback?: () => void) => void | undefined;
57
+ offError: (callback?: () => void) => void;
58
+ offPlay: (callback?: () => void) => void | undefined;
59
+ offPause: (callback?: () => void) => void | undefined;
60
+ offSeeking: (callback?: () => void) => void | undefined;
61
+ offSeeked: (callback?: () => void) => void | undefined;
62
+ offEnded: (callback?: () => void) => void | undefined;
63
+ offStop: (callback?: () => void) => void;
64
+ offTimeUpdate: (callback?: () => void) => void | undefined;
65
+ offPrev: () => Promise<{
66
+ errMsg: string;
67
+ }>;
68
+ offNext: () => Promise<{
69
+ errMsg: string;
70
+ }>;
71
+ }
@@ -0,0 +1,29 @@
1
+ import { BackgroundAudioManager } from './BackgroundAudioManager';
2
+ export declare const stopBackgroundAudio: () => Promise<{
3
+ errMsg: string;
4
+ }>;
5
+ export declare const seekBackgroundAudio: () => Promise<{
6
+ errMsg: string;
7
+ }>;
8
+ export declare const playBackgroundAudio: () => Promise<{
9
+ errMsg: string;
10
+ }>;
11
+ export declare const pauseBackgroundAudio: () => Promise<{
12
+ errMsg: string;
13
+ }>;
14
+ export declare const onBackgroundAudioStop: () => Promise<{
15
+ errMsg: string;
16
+ }>;
17
+ export declare const onBackgroundAudioPlay: () => Promise<{
18
+ errMsg: string;
19
+ }>;
20
+ export declare const onBackgroundAudioPause: () => Promise<{
21
+ errMsg: string;
22
+ }>;
23
+ export declare const getBackgroundAudioPlayerState: () => Promise<{
24
+ errMsg: string;
25
+ }>;
26
+ /**
27
+ * 获取全局唯一的背景音频管理器
28
+ */
29
+ export declare const getBackgroundAudioManager: () => BackgroundAudioManager;
@@ -0,0 +1,3 @@
1
+ export declare const createCameraContext: () => Promise<{
2
+ errMsg: string;
3
+ }>;
@@ -0,0 +1,5 @@
1
+ import Taro from '@tarojs/api';
2
+ /**
3
+ * 从本地相册选择图片或使用相机拍照。
4
+ */
5
+ export declare const chooseImage: typeof Taro.chooseImage;
@@ -0,0 +1,5 @@
1
+ import Taro from '@tarojs/api';
2
+ /**
3
+ * 获取图片信息。网络图片需先配置download域名才能生效。
4
+ */
5
+ export declare const getImageInfo: typeof Taro.getImageInfo;
@@ -0,0 +1,15 @@
1
+ export declare const saveImageToPhotosAlbum: () => Promise<{
2
+ errMsg: string;
3
+ }>;
4
+ export declare const previewMedia: () => Promise<{
5
+ errMsg: string;
6
+ }>;
7
+ export * from './getImageInfo';
8
+ export * from './previewImage';
9
+ export declare const compressImage: () => Promise<{
10
+ errMsg: string;
11
+ }>;
12
+ export declare const chooseMessageFile: () => Promise<{
13
+ errMsg: string;
14
+ }>;
15
+ export * from './chooseImage';
@@ -0,0 +1,8 @@
1
+ import Taro from '@tarojs/api';
2
+ /**
3
+ * previewImage api基于开源的React组件[react-wx-images-viewer](https://github.com/react-ld/react-wx-images-viewer)开发,感谢!
4
+ */
5
+ /**
6
+ * 在新页面中全屏预览图片。预览的过程中用户可以进行保存图片、发送给朋友等操作。
7
+ */
8
+ export declare const previewImage: typeof Taro.previewImage;
@@ -0,0 +1,12 @@
1
+ export * from './audio';
2
+ export * from './background-audio';
3
+ export * from './camera';
4
+ export * from './image';
5
+ export * from './live';
6
+ export * from './map';
7
+ export * from './media-recorder';
8
+ export * from './recorder';
9
+ export * from './video';
10
+ export * from './video-decoder';
11
+ export * from './video-processing';
12
+ export * from './voip';