@tarojs/taro-h5 3.7.0-alpha.2 → 3.7.0-alpha.22

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 (308) hide show
  1. package/dist/api/ad/index.js +2 -2
  2. package/dist/api/ad/index.js.map +1 -1
  3. package/dist/api/ai/facial.js +3 -3
  4. package/dist/api/ai/facial.js.map +1 -1
  5. package/dist/api/ai/index.d.ts +3 -2
  6. package/dist/api/ai/index.js +1 -0
  7. package/dist/api/ai/index.js.map +1 -1
  8. package/dist/api/ai/inference.d.ts +3 -0
  9. package/dist/api/ai/inference.js +8 -0
  10. package/dist/api/ai/inference.js.map +1 -0
  11. package/dist/api/ai/visual.js +2 -2
  12. package/dist/api/ai/visual.js.map +1 -1
  13. package/dist/api/alipay/index.d.ts +2 -1
  14. package/dist/api/alipay/index.js +3 -2
  15. package/dist/api/alipay/index.js.map +1 -1
  16. package/dist/api/base/crypto.js +1 -1
  17. package/dist/api/base/crypto.js.map +1 -1
  18. package/dist/api/base/debug.js +3 -3
  19. package/dist/api/base/debug.js.map +1 -1
  20. package/dist/api/base/index.d.ts +8 -9
  21. package/dist/api/base/index.js +6 -6
  22. package/dist/api/base/index.js.map +1 -1
  23. package/dist/api/base/performance.d.ts +4 -1
  24. package/dist/api/base/performance.js +6 -3
  25. package/dist/api/base/performance.js.map +1 -1
  26. package/dist/api/base/system.d.ts +4 -1
  27. package/dist/api/base/system.js +6 -3
  28. package/dist/api/base/system.js.map +1 -1
  29. package/dist/api/base/update.js +2 -2
  30. package/dist/api/base/update.js.map +1 -1
  31. package/dist/api/base/weapp/app-event.d.ts +13 -11
  32. package/dist/api/base/weapp/app-event.js +84 -14
  33. package/dist/api/base/weapp/app-event.js.map +1 -1
  34. package/dist/api/canvas/CanvasContext.d.ts +7 -4
  35. package/dist/api/canvas/CanvasContext.js +23 -5
  36. package/dist/api/canvas/CanvasContext.js.map +1 -1
  37. package/dist/api/canvas/index.d.ts +4 -4
  38. package/dist/api/canvas/index.js +1 -1
  39. package/dist/api/canvas/index.js.map +1 -1
  40. package/dist/api/data-analysis/index.js +4 -4
  41. package/dist/api/data-analysis/index.js.map +1 -1
  42. package/dist/api/device/accelerometer.js +1 -2
  43. package/dist/api/device/accelerometer.js.map +1 -1
  44. package/dist/api/device/accessibility.js +1 -1
  45. package/dist/api/device/accessibility.js.map +1 -1
  46. package/dist/api/device/battery.js +1 -1
  47. package/dist/api/device/battery.js.map +1 -1
  48. package/dist/api/device/bluetooth-ble.js +16 -16
  49. package/dist/api/device/bluetooth-ble.js.map +1 -1
  50. package/dist/api/device/bluetooth-peripheral.js +3 -3
  51. package/dist/api/device/bluetooth-peripheral.js.map +1 -1
  52. package/dist/api/device/bluetooth.js +13 -13
  53. package/dist/api/device/bluetooth.js.map +1 -1
  54. package/dist/api/device/calendar.d.ts +3 -2
  55. package/dist/api/device/calendar.js +142 -3
  56. package/dist/api/device/calendar.js.map +1 -1
  57. package/dist/api/device/compass.js +1 -2
  58. package/dist/api/device/compass.js.map +1 -1
  59. package/dist/api/device/contact.js +2 -2
  60. package/dist/api/device/contact.js.map +1 -1
  61. package/dist/api/device/crypto.js +1 -1
  62. package/dist/api/device/crypto.js.map +1 -1
  63. package/dist/api/device/gyroscope.js +4 -4
  64. package/dist/api/device/gyroscope.js.map +1 -1
  65. package/dist/api/device/iBeacon.js +7 -7
  66. package/dist/api/device/iBeacon.js.map +1 -1
  67. package/dist/api/device/index.d.ts +24 -23
  68. package/dist/api/device/index.js +3 -2
  69. package/dist/api/device/index.js.map +1 -1
  70. package/dist/api/device/keyboard.js +4 -4
  71. package/dist/api/device/keyboard.js.map +1 -1
  72. package/dist/api/device/memory.js +2 -2
  73. package/dist/api/device/memory.js.map +1 -1
  74. package/dist/api/device/motion.js +1 -2
  75. package/dist/api/device/motion.js.map +1 -1
  76. package/dist/api/device/network.js +3 -3
  77. package/dist/api/device/network.js.map +1 -1
  78. package/dist/api/device/nfc.js +7 -7
  79. package/dist/api/device/nfc.js.map +1 -1
  80. package/dist/api/device/scan.js +1 -1
  81. package/dist/api/device/scan.js.map +1 -1
  82. package/dist/api/device/screen.d.ts +4 -1
  83. package/dist/api/device/screen.js +10 -7
  84. package/dist/api/device/screen.js.map +1 -1
  85. package/dist/api/device/sms.d.ts +2 -0
  86. package/dist/api/device/sms.js +7 -0
  87. package/dist/api/device/sms.js.map +1 -0
  88. package/dist/api/device/wifi.d.ts +2 -1
  89. package/dist/api/device/wifi.js +13 -12
  90. package/dist/api/device/wifi.js.map +1 -1
  91. package/dist/api/ext/index.js +2 -2
  92. package/dist/api/ext/index.js.map +1 -1
  93. package/dist/api/files/index.js +8 -8
  94. package/dist/api/files/index.js.map +1 -1
  95. package/dist/api/framework/index.d.ts +1 -1
  96. package/dist/api/index.d.ts +25 -24
  97. package/dist/api/index.js +28 -16
  98. package/dist/api/index.js.map +1 -1
  99. package/dist/api/location/chooseLocation.js +9 -5
  100. package/dist/api/location/chooseLocation.js.map +1 -1
  101. package/dist/api/location/getLocation.js +1 -1
  102. package/dist/api/location/getLocation.js.map +1 -1
  103. package/dist/api/location/index.d.ts +2 -2
  104. package/dist/api/location/index.js +10 -10
  105. package/dist/api/location/index.js.map +1 -1
  106. package/dist/api/media/audio/InnerAudioContext.d.ts +23 -21
  107. package/dist/api/media/audio/InnerAudioContext.js +16 -3
  108. package/dist/api/media/audio/InnerAudioContext.js.map +1 -1
  109. package/dist/api/media/audio/index.js +8 -8
  110. package/dist/api/media/audio/index.js.map +1 -1
  111. package/dist/api/media/background-audio/BackgroundAudioManager.d.ts +1 -1
  112. package/dist/api/media/background-audio/BackgroundAudioManager.js +12 -1
  113. package/dist/api/media/background-audio/BackgroundAudioManager.js.map +1 -1
  114. package/dist/api/media/background-audio/index.d.ts +1 -1
  115. package/dist/api/media/background-audio/index.js +8 -8
  116. package/dist/api/media/background-audio/index.js.map +1 -1
  117. package/dist/api/media/camera.js +1 -1
  118. package/dist/api/media/camera.js.map +1 -1
  119. package/dist/api/media/image/chooseImage.d.ts +1 -0
  120. package/dist/api/media/image/chooseImage.js +28 -71
  121. package/dist/api/media/image/chooseImage.js.map +1 -1
  122. package/dist/api/media/image/index.d.ts +9 -6
  123. package/dist/api/media/image/index.js +8 -7
  124. package/dist/api/media/image/index.js.map +1 -1
  125. package/dist/api/media/image/previewImage.js +13 -8
  126. package/dist/api/media/image/previewImage.js.map +1 -1
  127. package/dist/api/media/image/saveImageToPhotosAlbum.d.ts +3 -0
  128. package/dist/api/media/image/saveImageToPhotosAlbum.js +30 -0
  129. package/dist/api/media/image/saveImageToPhotosAlbum.js.map +1 -0
  130. package/dist/api/media/index.d.ts +12 -12
  131. package/dist/api/media/index.js +3 -3
  132. package/dist/api/media/live.js +2 -2
  133. package/dist/api/media/live.js.map +1 -1
  134. package/dist/api/media/map.js +1 -1
  135. package/dist/api/media/map.js.map +1 -1
  136. package/dist/api/media/media-recorder.js +1 -1
  137. package/dist/api/media/media-recorder.js.map +1 -1
  138. package/dist/api/media/recorder.js +3 -3
  139. package/dist/api/media/recorder.js.map +1 -1
  140. package/dist/api/media/video/chooseMedia.d.ts +6 -0
  141. package/dist/api/media/video/chooseMedia.js +208 -0
  142. package/dist/api/media/video/chooseMedia.js.map +1 -0
  143. package/dist/api/media/video/chooseVideo.d.ts +7 -0
  144. package/dist/api/media/video/chooseVideo.js +44 -0
  145. package/dist/api/media/video/chooseVideo.js.map +1 -0
  146. package/dist/api/media/video/getVideoInfo.d.ts +3 -0
  147. package/dist/api/media/video/getVideoInfo.js +63 -0
  148. package/dist/api/media/video/getVideoInfo.js.map +1 -0
  149. package/dist/api/media/video/index.d.ts +5 -8
  150. package/dist/api/media/video/index.js +8 -67
  151. package/dist/api/media/video/index.js.map +1 -1
  152. package/dist/api/media/video/saveVideoToPhotosAlbum.d.ts +3 -0
  153. package/dist/api/media/video/saveVideoToPhotosAlbum.js +30 -0
  154. package/dist/api/media/video/saveVideoToPhotosAlbum.js.map +1 -0
  155. package/dist/api/media/video-decoder.js +1 -1
  156. package/dist/api/media/video-decoder.js.map +1 -1
  157. package/dist/api/media/video-processing.js +1 -1
  158. package/dist/api/media/video-processing.js.map +1 -1
  159. package/dist/api/media/voip.d.ts +3 -1
  160. package/dist/api/media/voip.js +17 -15
  161. package/dist/api/media/voip.js.map +1 -1
  162. package/dist/api/navigate/index.js +5 -5
  163. package/dist/api/navigate/index.js.map +1 -1
  164. package/dist/api/network/download.js +10 -8
  165. package/dist/api/network/download.js.map +1 -1
  166. package/dist/api/network/index.d.ts +7 -7
  167. package/dist/api/network/mdns.js +10 -10
  168. package/dist/api/network/mdns.js.map +1 -1
  169. package/dist/api/network/request/index.d.ts +1 -1
  170. package/dist/api/network/request/index.js +48 -42
  171. package/dist/api/network/request/index.js.map +1 -1
  172. package/dist/api/network/tcp.js +1 -1
  173. package/dist/api/network/tcp.js.map +1 -1
  174. package/dist/api/network/udp.js +1 -1
  175. package/dist/api/network/udp.js.map +1 -1
  176. package/dist/api/network/upload.js +10 -8
  177. package/dist/api/network/upload.js.map +1 -1
  178. package/dist/api/network/websocket/index.js +2 -2
  179. package/dist/api/network/websocket/index.js.map +1 -1
  180. package/dist/api/open-api/account.js +1 -1
  181. package/dist/api/open-api/account.js.map +1 -1
  182. package/dist/api/open-api/address.js +1 -1
  183. package/dist/api/open-api/address.js.map +1 -1
  184. package/dist/api/open-api/authorize.js +2 -2
  185. package/dist/api/open-api/authorize.js.map +1 -1
  186. package/dist/api/open-api/card.js +2 -2
  187. package/dist/api/open-api/card.js.map +1 -1
  188. package/dist/api/open-api/channels-live.d.ts +3 -1
  189. package/dist/api/open-api/channels-live.js +9 -7
  190. package/dist/api/open-api/channels-live.js.map +1 -1
  191. package/dist/api/open-api/customer-service.js +1 -1
  192. package/dist/api/open-api/customer-service.js.map +1 -1
  193. package/dist/api/open-api/device-voip.d.ts +3 -0
  194. package/dist/api/open-api/device-voip.js +8 -0
  195. package/dist/api/open-api/device-voip.js.map +1 -0
  196. package/dist/api/open-api/facial.js +4 -4
  197. package/dist/api/open-api/facial.js.map +1 -1
  198. package/dist/api/open-api/favorites.d.ts +1 -2
  199. package/dist/api/open-api/favorites.js +3 -4
  200. package/dist/api/open-api/favorites.js.map +1 -1
  201. package/dist/api/open-api/group.js +1 -1
  202. package/dist/api/open-api/group.js.map +1 -1
  203. package/dist/api/open-api/index.d.ts +21 -18
  204. package/dist/api/open-api/index.js +6 -3
  205. package/dist/api/open-api/index.js.map +1 -1
  206. package/dist/api/open-api/invoice.js +2 -2
  207. package/dist/api/open-api/invoice.js.map +1 -1
  208. package/dist/api/open-api/license-plate.js +1 -1
  209. package/dist/api/open-api/license-plate.js.map +1 -1
  210. package/dist/api/open-api/login.js +3 -3
  211. package/dist/api/open-api/login.js.map +1 -1
  212. package/dist/api/open-api/my-miniprogram.d.ts +2 -0
  213. package/dist/api/open-api/my-miniprogram.js +7 -0
  214. package/dist/api/open-api/my-miniprogram.js.map +1 -0
  215. package/dist/api/open-api/privacy.d.ts +5 -0
  216. package/dist/api/open-api/privacy.js +10 -0
  217. package/dist/api/open-api/privacy.js.map +1 -0
  218. package/dist/api/open-api/red-package.js +1 -1
  219. package/dist/api/open-api/red-package.js.map +1 -1
  220. package/dist/api/open-api/settings.js +2 -2
  221. package/dist/api/open-api/settings.js.map +1 -1
  222. package/dist/api/open-api/soter.js +3 -3
  223. package/dist/api/open-api/soter.js.map +1 -1
  224. package/dist/api/open-api/subscribe-message.d.ts +2 -1
  225. package/dist/api/open-api/subscribe-message.js +4 -2
  226. package/dist/api/open-api/subscribe-message.js.map +1 -1
  227. package/dist/api/open-api/user-info.js +2 -2
  228. package/dist/api/open-api/user-info.js.map +1 -1
  229. package/dist/api/open-api/werun.js +2 -2
  230. package/dist/api/open-api/werun.js.map +1 -1
  231. package/dist/api/payment/index.d.ts +2 -1
  232. package/dist/api/payment/index.js +4 -3
  233. package/dist/api/payment/index.js.map +1 -1
  234. package/dist/api/qq/index.d.ts +2 -0
  235. package/dist/api/qq/index.js +7 -0
  236. package/dist/api/qq/index.js.map +1 -0
  237. package/dist/api/share/index.d.ts +10 -0
  238. package/dist/api/share/index.js +21 -11
  239. package/dist/api/share/index.js.map +1 -1
  240. package/dist/api/storage/background-fetch.js +4 -4
  241. package/dist/api/storage/background-fetch.js.map +1 -1
  242. package/dist/api/storage/cache-manager.d.ts +2 -0
  243. package/dist/api/storage/cache-manager.js +7 -0
  244. package/dist/api/storage/cache-manager.js.map +1 -0
  245. package/dist/api/storage/index.d.ts +7 -2
  246. package/dist/api/storage/index.js +8 -3
  247. package/dist/api/storage/index.js.map +1 -1
  248. package/dist/api/swan/index.js +21 -21
  249. package/dist/api/swan/index.js.map +1 -1
  250. package/dist/api/taro.d.ts +7 -2
  251. package/dist/api/taro.js +29 -12
  252. package/dist/api/taro.js.map +1 -1
  253. package/dist/api/ui/background.js +2 -2
  254. package/dist/api/ui/background.js.map +1 -1
  255. package/dist/api/ui/index.d.ts +12 -12
  256. package/dist/api/ui/index.js +1 -1
  257. package/dist/api/ui/interaction/index.d.ts +1 -1
  258. package/dist/api/ui/interaction/index.js +4 -4
  259. package/dist/api/ui/interaction/index.js.map +1 -1
  260. package/dist/api/ui/interaction/modal.js +6 -0
  261. package/dist/api/ui/interaction/modal.js.map +1 -1
  262. package/dist/api/ui/interaction/toast.js +4 -0
  263. package/dist/api/ui/interaction/toast.js.map +1 -1
  264. package/dist/api/ui/menu.js +1 -1
  265. package/dist/api/ui/menu.js.map +1 -1
  266. package/dist/api/ui/navigation-bar/index.js +3 -3
  267. package/dist/api/ui/navigation-bar/index.js.map +1 -1
  268. package/dist/api/ui/scroll/index.js +4 -3
  269. package/dist/api/ui/scroll/index.js.map +1 -1
  270. package/dist/api/ui/sticky.js +1 -1
  271. package/dist/api/ui/sticky.js.map +1 -1
  272. package/dist/api/ui/window.d.ts +2 -1
  273. package/dist/api/ui/window.js +3 -2
  274. package/dist/api/ui/window.js.map +1 -1
  275. package/dist/api/worker/index.js +1 -1
  276. package/dist/api/worker/index.js.map +1 -1
  277. package/dist/api/wxml/IntersectionObserver.d.ts +1 -1
  278. package/dist/api/wxml/IntersectionObserver.js +15 -13
  279. package/dist/api/wxml/IntersectionObserver.js.map +1 -1
  280. package/dist/api/wxml/MediaQueryObserver.d.ts +1 -1
  281. package/dist/api/wxml/MediaQueryObserver.js +1 -2
  282. package/dist/api/wxml/MediaQueryObserver.js.map +1 -1
  283. package/dist/api/wxml/nodesRef.d.ts +1 -1
  284. package/dist/api/wxml/selectorQuery.d.ts +1 -1
  285. package/dist/api/wxml/selectorQuery.js +9 -6
  286. package/dist/api/wxml/selectorQuery.js.map +1 -1
  287. package/dist/index.cjs.d.ts +103 -52
  288. package/dist/index.cjs.js +2556 -1970
  289. package/dist/index.cjs.js.map +1 -1
  290. package/dist/index.d.ts +3 -3
  291. package/dist/index.esm.d.ts +103 -52
  292. package/dist/index.esm.js +2496 -1944
  293. package/dist/index.esm.js.map +1 -1
  294. package/dist/index.js +33 -17
  295. package/dist/index.js.map +1 -1
  296. package/dist/utils/handler.d.ts +13 -26
  297. package/dist/utils/handler.js +4 -16
  298. package/dist/utils/handler.js.map +1 -1
  299. package/dist/utils/helper.d.ts +2 -0
  300. package/dist/utils/helper.js +11 -0
  301. package/dist/utils/helper.js.map +1 -0
  302. package/dist/utils/index.d.ts +7 -6
  303. package/dist/utils/index.js +4 -12
  304. package/dist/utils/index.js.map +1 -1
  305. package/package.json +21 -15
  306. package/dist/utils/lodash.d.ts +0 -3
  307. package/dist/utils/lodash.js +0 -32
  308. package/dist/utils/lodash.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ import { temporarilyNotSupport } from '../../utils/index.js';
2
+
3
+ // 打开手Q说说发表界面
4
+ const openQzonePublish = /* @__PURE__ */ temporarilyNotSupport('openQzonePublish');
5
+
6
+ export { openQzonePublish };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/api/qq/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 打开手Q说说发表界面\nexport const openQzonePublish = /* @__PURE__ */ temporarilyNotSupport('openQzonePublish')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,gBAAgB,mBAAmB,qBAAqB,CAAC,kBAAkB;;;;"}
@@ -1,11 +1,21 @@
1
+ /** 更新转发属性 */
1
2
  declare const updateShareMenu: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
3
+ /** 显示当前页面的转发按钮 */
2
4
  declare const showShareMenu: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
+ /** 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 */
3
6
  declare const showShareImageMenu: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ /** 转发视频到聊天 */
4
8
  declare const shareVideoMessage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
9
+ /** 转发文件到聊天 */
5
10
  declare const shareFileMessage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
11
+ /** 监听用户点击右上角菜单的「复制链接」按钮时触发的事件 */
6
12
  declare const onCopyUrl: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
13
+ /** 移除用户点击右上角菜单的「复制链接」按钮时触发的事件的监听函数 */
7
14
  declare const offCopyUrl: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
15
+ /** 隐藏当前页面的转发按钮 */
8
16
  declare const hideShareMenu: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
17
+ /** 获取转发详细信息 */
9
18
  declare const getShareInfo: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
19
+ /** 验证私密消息。 */
10
20
  declare const authPrivateMessage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
11
21
  export { updateShareMenu, showShareMenu, showShareImageMenu, shareVideoMessage, shareFileMessage, onCopyUrl, offCopyUrl, hideShareMenu, getShareInfo, authPrivateMessage };
@@ -1,16 +1,26 @@
1
- import { temporarilyNotSupport } from '../../utils/index.js';
1
+ import { temporarilyNotSupport, permanentlyNotSupport } from '../../utils/index.js';
2
2
 
3
3
  // 转发
4
- const updateShareMenu = temporarilyNotSupport('updateShareMenu');
5
- const showShareMenu = temporarilyNotSupport('showShareMenu');
6
- const showShareImageMenu = temporarilyNotSupport('showShareImageMenu');
7
- const shareVideoMessage = temporarilyNotSupport('shareVideoMessage');
8
- const shareFileMessage = temporarilyNotSupport('shareFileMessage');
9
- const onCopyUrl = temporarilyNotSupport('onCopyUrl');
10
- const offCopyUrl = temporarilyNotSupport('offCopyUrl');
11
- const hideShareMenu = temporarilyNotSupport('hideShareMenu');
12
- const getShareInfo = temporarilyNotSupport('getShareInfo');
13
- const authPrivateMessage = temporarilyNotSupport('authPrivateMessage');
4
+ /** 更新转发属性 */
5
+ const updateShareMenu = /* @__PURE__ */ temporarilyNotSupport('updateShareMenu');
6
+ /** 显示当前页面的转发按钮 */
7
+ const showShareMenu = /* @__PURE__ */ temporarilyNotSupport('showShareMenu');
8
+ /** 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 */
9
+ const showShareImageMenu = /* @__PURE__ */ temporarilyNotSupport('showShareImageMenu');
10
+ /** 转发视频到聊天 */
11
+ const shareVideoMessage = /* @__PURE__ */ temporarilyNotSupport('shareVideoMessage');
12
+ /** 转发文件到聊天 */
13
+ const shareFileMessage = /* @__PURE__ */ temporarilyNotSupport('shareFileMessage');
14
+ /** 监听用户点击右上角菜单的「复制链接」按钮时触发的事件 */
15
+ const onCopyUrl = /* @__PURE__ */ temporarilyNotSupport('onCopyUrl');
16
+ /** 移除用户点击右上角菜单的「复制链接」按钮时触发的事件的监听函数 */
17
+ const offCopyUrl = /* @__PURE__ */ temporarilyNotSupport('offCopyUrl');
18
+ /** 隐藏当前页面的转发按钮 */
19
+ const hideShareMenu = /* @__PURE__ */ temporarilyNotSupport('hideShareMenu');
20
+ /** 获取转发详细信息 */
21
+ const getShareInfo = /* @__PURE__ */ temporarilyNotSupport('getShareInfo');
22
+ /** 验证私密消息。 */
23
+ const authPrivateMessage = /* @__PURE__ */ permanentlyNotSupport('authPrivateMessage');
14
24
 
15
25
  export { authPrivateMessage, getShareInfo, hideShareMenu, offCopyUrl, onCopyUrl, shareFileMessage, shareVideoMessage, showShareImageMenu, showShareMenu, updateShareMenu };
16
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/api/share/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 转发\nexport const updateShareMenu = temporarilyNotSupport('updateShareMenu')\nexport const showShareMenu = temporarilyNotSupport('showShareMenu')\nexport const showShareImageMenu = temporarilyNotSupport('showShareImageMenu')\nexport const shareVideoMessage = temporarilyNotSupport('shareVideoMessage')\nexport const shareFileMessage = temporarilyNotSupport('shareFileMessage')\nexport const onCopyUrl = temporarilyNotSupport('onCopyUrl')\nexport const offCopyUrl = temporarilyNotSupport('offCopyUrl')\nexport const hideShareMenu = temporarilyNotSupport('hideShareMenu')\nexport const getShareInfo = temporarilyNotSupport('getShareInfo')\nexport const authPrivateMessage = temporarilyNotSupport('authPrivateMessage')\n"],"names":[],"mappings":";;AAEA;MACa,eAAe,GAAG,qBAAqB,CAAC,iBAAiB,EAAC;MAC1D,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;MACtD,kBAAkB,GAAG,qBAAqB,CAAC,oBAAoB,EAAC;MAChE,iBAAiB,GAAG,qBAAqB,CAAC,mBAAmB,EAAC;MAC9D,gBAAgB,GAAG,qBAAqB,CAAC,kBAAkB,EAAC;MAC5D,SAAS,GAAG,qBAAqB,CAAC,WAAW,EAAC;MAC9C,UAAU,GAAG,qBAAqB,CAAC,YAAY,EAAC;MAChD,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;MACtD,YAAY,GAAG,qBAAqB,CAAC,cAAc,EAAC;MACpD,kBAAkB,GAAG,qBAAqB,CAAC,oBAAoB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/api/share/index.ts"],"sourcesContent":["import { permanentlyNotSupport, temporarilyNotSupport } from '../../utils'\n\n// 转发\n\n/** 更新转发属性 */\nexport const updateShareMenu = /* @__PURE__ */ temporarilyNotSupport('updateShareMenu')\n\n/** 显示当前页面的转发按钮 */\nexport const showShareMenu = /* @__PURE__ */ temporarilyNotSupport('showShareMenu')\n\n/** 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 */\nexport const showShareImageMenu = /* @__PURE__ */ temporarilyNotSupport('showShareImageMenu')\n\n/** 转发视频到聊天 */\nexport const shareVideoMessage = /* @__PURE__ */ temporarilyNotSupport('shareVideoMessage')\n\n/** 转发文件到聊天 */\nexport const shareFileMessage = /* @__PURE__ */ temporarilyNotSupport('shareFileMessage')\n\n/** 监听用户点击右上角菜单的「复制链接」按钮时触发的事件 */\nexport const onCopyUrl = /* @__PURE__ */ temporarilyNotSupport('onCopyUrl')\n\n/** 移除用户点击右上角菜单的「复制链接」按钮时触发的事件的监听函数 */\nexport const offCopyUrl = /* @__PURE__ */ temporarilyNotSupport('offCopyUrl')\n\n/** 隐藏当前页面的转发按钮 */\nexport const hideShareMenu = /* @__PURE__ */ temporarilyNotSupport('hideShareMenu')\n\n/** 获取转发详细信息 */\nexport const getShareInfo = /* @__PURE__ */ temporarilyNotSupport('getShareInfo')\n\n/** 验证私密消息。 */\nexport const authPrivateMessage = /* @__PURE__ */ permanentlyNotSupport('authPrivateMessage')\n"],"names":[],"mappings":";;AAEA;AAEA;AACa,MAAA,eAAe,mBAAmB,qBAAqB,CAAC,iBAAiB,EAAC;AAEvF;AACa,MAAA,aAAa,mBAAmB,qBAAqB,CAAC,eAAe,EAAC;AAEnF;AACa,MAAA,kBAAkB,mBAAmB,qBAAqB,CAAC,oBAAoB,EAAC;AAE7F;AACa,MAAA,iBAAiB,mBAAmB,qBAAqB,CAAC,mBAAmB,EAAC;AAE3F;AACa,MAAA,gBAAgB,mBAAmB,qBAAqB,CAAC,kBAAkB,EAAC;AAEzF;AACa,MAAA,SAAS,mBAAmB,qBAAqB,CAAC,WAAW,EAAC;AAE3E;AACa,MAAA,UAAU,mBAAmB,qBAAqB,CAAC,YAAY,EAAC;AAE7E;AACa,MAAA,aAAa,mBAAmB,qBAAqB,CAAC,eAAe,EAAC;AAEnF;AACa,MAAA,YAAY,mBAAmB,qBAAqB,CAAC,cAAc,EAAC;AAEjF;AACa,MAAA,kBAAkB,mBAAmB,qBAAqB,CAAC,oBAAoB;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { temporarilyNotSupport } from '../../utils/index.js';
2
2
 
3
3
  // 周期性更新
4
- const setBackgroundFetchToken = temporarilyNotSupport('setBackgroundFetchToken');
5
- const onBackgroundFetchData = temporarilyNotSupport('onBackgroundFetchData');
6
- const getBackgroundFetchToken = temporarilyNotSupport('getBackgroundFetchToken');
7
- const getBackgroundFetchData = temporarilyNotSupport('getBackgroundFetchData');
4
+ const setBackgroundFetchToken = /* @__PURE__ */ temporarilyNotSupport('setBackgroundFetchToken');
5
+ const onBackgroundFetchData = /* @__PURE__ */ temporarilyNotSupport('onBackgroundFetchData');
6
+ const getBackgroundFetchToken = /* @__PURE__ */ temporarilyNotSupport('getBackgroundFetchToken');
7
+ const getBackgroundFetchData = /* @__PURE__ */ temporarilyNotSupport('getBackgroundFetchData');
8
8
 
9
9
  export { getBackgroundFetchData, getBackgroundFetchToken, onBackgroundFetchData, setBackgroundFetchToken };
10
10
  //# sourceMappingURL=background-fetch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"background-fetch.js","sources":["../../../src/api/storage/background-fetch.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 周期性更新\nexport const setBackgroundFetchToken = temporarilyNotSupport('setBackgroundFetchToken')\nexport const onBackgroundFetchData = temporarilyNotSupport('onBackgroundFetchData')\nexport const getBackgroundFetchToken = temporarilyNotSupport('getBackgroundFetchToken')\nexport const getBackgroundFetchData = temporarilyNotSupport('getBackgroundFetchData')\n"],"names":[],"mappings":";;AAEA;MACa,uBAAuB,GAAG,qBAAqB,CAAC,yBAAyB,EAAC;MAC1E,qBAAqB,GAAG,qBAAqB,CAAC,uBAAuB,EAAC;MACtE,uBAAuB,GAAG,qBAAqB,CAAC,yBAAyB,EAAC;MAC1E,sBAAsB,GAAG,qBAAqB,CAAC,wBAAwB;;;;"}
1
+ {"version":3,"file":"background-fetch.js","sources":["../../../src/api/storage/background-fetch.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 周期性更新\nexport const setBackgroundFetchToken = /* @__PURE__ */ temporarilyNotSupport('setBackgroundFetchToken')\nexport const onBackgroundFetchData = /* @__PURE__ */ temporarilyNotSupport('onBackgroundFetchData')\nexport const getBackgroundFetchToken = /* @__PURE__ */ temporarilyNotSupport('getBackgroundFetchToken')\nexport const getBackgroundFetchData = /* @__PURE__ */ temporarilyNotSupport('getBackgroundFetchData')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,uBAAuB,mBAAmB,qBAAqB,CAAC,yBAAyB,EAAC;AAC1F,MAAA,qBAAqB,mBAAmB,qBAAqB,CAAC,uBAAuB,EAAC;AACtF,MAAA,uBAAuB,mBAAmB,qBAAqB,CAAC,yBAAyB,EAAC;AAC1F,MAAA,sBAAsB,mBAAmB,qBAAqB,CAAC,wBAAwB;;;;"}
@@ -0,0 +1,2 @@
1
+ declare const createCacheManager: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
+ export { createCacheManager };
@@ -0,0 +1,7 @@
1
+ import { temporarilyNotSupport } from '../../utils/index.js';
2
+
3
+ // 周期性更新
4
+ const createCacheManager = /* @__PURE__ */ temporarilyNotSupport('createCacheManager');
5
+
6
+ export { createCacheManager };
7
+ //# sourceMappingURL=cache-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-manager.js","sources":["../../../src/api/storage/cache-manager.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 周期性更新\nexport const createCacheManager = /* @__PURE__ */ temporarilyNotSupport('createCacheManager')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,kBAAkB,mBAAmB,qBAAqB,CAAC,oBAAoB;;;;"}
@@ -11,5 +11,10 @@ declare const getStorage: typeof Taro.getStorage;
11
11
  declare const createBufferURL: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
12
12
  declare const clearStorageSync: typeof Taro.clearStorageSync;
13
13
  declare const clearStorage: typeof Taro.clearStorage;
14
- export { setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage };
15
- export * from "./background-fetch";
14
+ declare const batchSetStorageSync: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
15
+ declare const batchSetStorage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
16
+ declare const batchGetStorageSync: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
17
+ declare const batchGetStorage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
18
+ export { setStorageSync, setStorage, revokeBufferURL, removeStorageSync, removeStorage, getStorageSync, getStorageInfoSync, getStorageInfo, getStorage, createBufferURL, clearStorageSync, clearStorage, batchSetStorageSync, batchSetStorage, batchGetStorageSync, batchGetStorage };
19
+ export * from "./background-fetch.js";
20
+ export * from "./cache-manager.js";
@@ -1,6 +1,7 @@
1
1
  import { getParameterError, shouldBeObject, temporarilyNotSupport } from '../../utils/index.js';
2
2
  import { MethodHandler } from '../../utils/handler.js';
3
3
  export { getBackgroundFetchData, getBackgroundFetchToken, onBackgroundFetchData, setBackgroundFetchToken } from './background-fetch.js';
4
+ export { createCacheManager } from './cache-manager.js';
4
5
 
5
6
  function getItem(key) {
6
7
  let item;
@@ -58,7 +59,7 @@ const setStorage = (options) => {
58
59
  setStorageSync(key, data);
59
60
  return handle.success();
60
61
  };
61
- const revokeBufferURL = temporarilyNotSupport('revokeBufferURL');
62
+ const revokeBufferURL = /* @__PURE__ */ temporarilyNotSupport('revokeBufferURL');
62
63
  const removeStorageSync = (key) => {
63
64
  if (typeof key !== 'string') {
64
65
  console.error(getParameterError({
@@ -147,7 +148,7 @@ const getStorage = (options) => {
147
148
  });
148
149
  }
149
150
  };
150
- const createBufferURL = temporarilyNotSupport('createBufferURL');
151
+ const createBufferURL = /* @__PURE__ */ temporarilyNotSupport('createBufferURL');
151
152
  const clearStorageSync = () => {
152
153
  localStorage.clear();
153
154
  };
@@ -156,6 +157,10 @@ const clearStorage = ({ success, fail, complete } = {}) => {
156
157
  clearStorageSync();
157
158
  return handle.success();
158
159
  };
160
+ const batchSetStorageSync = /* @__PURE__ */ temporarilyNotSupport('batchSetStorageSync');
161
+ const batchSetStorage = /* @__PURE__ */ temporarilyNotSupport('batchSetStorage');
162
+ const batchGetStorageSync = /* @__PURE__ */ temporarilyNotSupport('batchGetStorageSync');
163
+ const batchGetStorage = /* @__PURE__ */ temporarilyNotSupport('batchGetStorage');
159
164
 
160
- export { clearStorage, clearStorageSync, createBufferURL, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, removeStorage, removeStorageSync, revokeBufferURL, setStorage, setStorageSync };
165
+ export { batchGetStorage, batchGetStorageSync, batchSetStorage, batchSetStorageSync, clearStorage, clearStorageSync, createBufferURL, getStorage, getStorageInfo, getStorageInfoSync, getStorageSync, removeStorage, removeStorageSync, revokeBufferURL, setStorage, setStorageSync };
161
166
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/api/storage/index.ts"],"sourcesContent":["import Taro from '@tarojs/api'\n\nimport { getParameterError, shouldBeObject, temporarilyNotSupport } from '../../utils'\nimport { MethodHandler } from '../../utils/handler'\n\nfunction getItem (key) {\n let item\n try {\n item = JSON.parse(localStorage.getItem(key) || '')\n } catch (e) {} // eslint-disable-line no-empty\n\n // 只返回使用 Taro.setStorage API 存储的数据\n if (item && typeof item === 'object' && item.hasOwnProperty('data')) {\n return { result: true, data: item.data }\n } else {\n return { result: false }\n }\n}\n\n// 数据缓存\nexport const setStorageSync: typeof Taro.setStorageSync = (key, data = '') => {\n if (typeof key !== 'string') {\n console.error(getParameterError({\n name: 'setStorage',\n correct: 'String',\n wrong: key\n }))\n return\n }\n\n const type = typeof data\n let obj = {}\n\n if (type === 'symbol') {\n obj = { data: '' }\n } else {\n obj = { data }\n }\n localStorage.setItem(key, JSON.stringify(obj))\n}\n\nexport const setStorage: typeof Taro.setStorage = (options) => {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `setStorage:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n const { key, data, success, fail, complete } = options\n const handle = new MethodHandler({ name: 'setStorage', success, fail, complete })\n\n if (typeof key !== 'string') {\n return handle.fail({\n errMsg: getParameterError({\n para: 'key',\n correct: 'String',\n wrong: key\n })\n })\n }\n\n setStorageSync(key, data)\n return handle.success()\n}\n\nexport const revokeBufferURL = temporarilyNotSupport('revokeBufferURL')\n\nexport const removeStorageSync: typeof Taro.removeStorageSync = (key: string) => {\n if (typeof key !== 'string') {\n console.error(getParameterError({\n name: 'removeStorage',\n correct: 'String',\n wrong: key\n }))\n return\n }\n\n localStorage.removeItem(key)\n}\n\nexport const removeStorage: typeof Taro.removeStorage = (options: Taro.removeStorage.Option) => {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `removeStorage:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n const { key, success, fail, complete } = options\n const handle = new MethodHandler({ name: 'removeStorage', success, fail, complete })\n\n if (typeof key !== 'string') {\n return handle.fail({\n errMsg: getParameterError({\n para: 'key',\n correct: 'String',\n wrong: key\n })\n })\n }\n\n removeStorageSync(key)\n return handle.success()\n}\n\nexport const getStorageSync: typeof Taro.getStorageSync = (key) => {\n if (typeof key !== 'string') {\n console.error(getParameterError({\n name: 'getStorageSync',\n correct: 'String',\n wrong: key\n }))\n return\n }\n\n const res = getItem(key)\n if (res.result) return res.data\n\n return ''\n}\n\nexport const getStorageInfoSync: typeof Taro.getStorageInfoSync = () => {\n const res: Taro.getStorageInfoSync.Option = {\n keys: Object.keys(localStorage),\n limitSize: NaN,\n currentSize: NaN\n }\n return res\n}\n\nexport const getStorageInfo: typeof Taro.getStorageInfo = ({ success, fail, complete } = {}) => {\n const handle = new MethodHandler<Taro.getStorageInfo.SuccessCallbackOption>({ name: 'getStorageInfo', success, fail, complete })\n return handle.success(getStorageInfoSync())\n}\n\nexport const getStorage: typeof Taro.getStorage = <T>(options) => {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `getStorage:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n const { key, success, fail, complete } = options\n const handle = new MethodHandler<Taro.getStorage.SuccessCallbackResult<T>>({ name: 'getStorage', success, fail, complete })\n\n if (typeof key !== 'string') {\n return handle.fail({\n errMsg: getParameterError({\n para: 'key',\n correct: 'String',\n wrong: key\n })\n })\n }\n\n const { result, data } = getItem(key)\n if (result) {\n return handle.success({ data })\n } else {\n return handle.fail({\n errMsg: 'data not found'\n })\n }\n}\n\nexport const createBufferURL = temporarilyNotSupport('createBufferURL')\n\nexport const clearStorageSync: typeof Taro.clearStorageSync = () => {\n localStorage.clear()\n}\n\nexport const clearStorage: typeof Taro.clearStorage = ({ success, fail, complete } = {}) => {\n const handle = new MethodHandler({ name: 'clearStorage', success, fail, complete })\n clearStorageSync()\n return handle.success()\n}\n\nexport * from './background-fetch'\n"],"names":[],"mappings":";;;;AAKA,SAAS,OAAO,CAAE,GAAG,EAAA;AACnB,IAAA,IAAI,IAAI,CAAA;IACR,IAAI;AACF,QAAA,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;AACnD,KAAA;AAAC,IAAA,OAAO,CAAC,EAAE,GAAE;;AAGd,IAAA,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;QACnE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAA;AACzC,KAAA;AAAM,SAAA;AACL,QAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AACzB,KAAA;AACH,CAAC;AAED;AACa,MAAA,cAAc,GAA+B,CAAC,GAAG,EAAE,IAAI,GAAG,EAAE,KAAI;AAC3E,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC;AAC9B,YAAA,IAAI,EAAE,YAAY;AAClB,YAAA,OAAO,EAAE,QAAQ;AACjB,YAAA,KAAK,EAAE,GAAG;AACX,SAAA,CAAC,CAAC,CAAA;QACH,OAAM;AACP,KAAA;AAED,IA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C;MAEY,eAAe,GAAG,qBAAqB,CAAC,iBAAiB,EAAC;AAEhE,MAAM,gBAAgB,GAAiC,MAAK;IACjE,YAAY,CAAC,KAAK,EAAE,CAAA;AACtB,EAAC;AAEM,MAAM,YAAY,GAA6B,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAI;AACzF,IAAA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;AACnF,IAAA,gBAAgB,EAAE,CAAA;AAClB,IAAA,OAAO,MAAM,CAAC,OAAO,EAAE,CAAA;AACzB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/api/storage/index.ts"],"sourcesContent":["import Taro from '@tarojs/api'\n\nimport { getParameterError, shouldBeObject, temporarilyNotSupport } from '../../utils'\nimport { MethodHandler } from '../../utils/handler'\n\nfunction getItem (key) {\n let item\n try {\n item = JSON.parse(localStorage.getItem(key) || '')\n } catch (e) {} // eslint-disable-line no-empty\n\n // 只返回使用 Taro.setStorage API 存储的数据\n if (item && typeof item === 'object' && item.hasOwnProperty('data')) {\n return { result: true, data: item.data }\n } else {\n return { result: false }\n }\n}\n\n// 数据缓存\nexport const setStorageSync: typeof Taro.setStorageSync = (key, data = '') => {\n if (typeof key !== 'string') {\n console.error(getParameterError({\n name: 'setStorage',\n correct: 'String',\n wrong: key\n }))\n return\n }\n\n const type = typeof data\n let obj = {}\n\n if (type === 'symbol') {\n obj = { data: '' }\n } else {\n obj = { data }\n }\n localStorage.setItem(key, JSON.stringify(obj))\n}\n\nexport const setStorage: typeof Taro.setStorage = (options) => {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `setStorage:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n const { key, data, success, fail, complete } = options\n const handle = new MethodHandler({ name: 'setStorage', success, fail, complete })\n\n if (typeof key !== 'string') {\n return handle.fail({\n errMsg: getParameterError({\n para: 'key',\n correct: 'String',\n wrong: key\n })\n })\n }\n\n setStorageSync(key, data)\n return handle.success()\n}\n\nexport const revokeBufferURL = /* @__PURE__ */ temporarilyNotSupport('revokeBufferURL')\n\nexport const removeStorageSync: typeof Taro.removeStorageSync = (key: string) => {\n if (typeof key !== 'string') {\n console.error(getParameterError({\n name: 'removeStorage',\n correct: 'String',\n wrong: key\n }))\n return\n }\n\n localStorage.removeItem(key)\n}\n\nexport const removeStorage: typeof Taro.removeStorage = (options: Taro.removeStorage.Option) => {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `removeStorage:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n const { key, success, fail, complete } = options\n const handle = new MethodHandler({ name: 'removeStorage', success, fail, complete })\n\n if (typeof key !== 'string') {\n return handle.fail({\n errMsg: getParameterError({\n para: 'key',\n correct: 'String',\n wrong: key\n })\n })\n }\n\n removeStorageSync(key)\n return handle.success()\n}\n\nexport const getStorageSync: typeof Taro.getStorageSync = (key) => {\n if (typeof key !== 'string') {\n console.error(getParameterError({\n name: 'getStorageSync',\n correct: 'String',\n wrong: key\n }))\n return\n }\n\n const res = getItem(key)\n if (res.result) return res.data\n\n return ''\n}\n\nexport const getStorageInfoSync: typeof Taro.getStorageInfoSync = () => {\n const res: Taro.getStorageInfoSync.Option = {\n keys: Object.keys(localStorage),\n limitSize: NaN,\n currentSize: NaN\n }\n return res\n}\n\nexport const getStorageInfo: typeof Taro.getStorageInfo = ({ success, fail, complete } = {}) => {\n const handle = new MethodHandler<Taro.getStorageInfo.SuccessCallbackOption>({ name: 'getStorageInfo', success, fail, complete })\n return handle.success(getStorageInfoSync())\n}\n\nexport const getStorage: typeof Taro.getStorage = <T>(options) => {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `getStorage:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n const { key, success, fail, complete } = options\n const handle = new MethodHandler<Taro.getStorage.SuccessCallbackResult<T>>({ name: 'getStorage', success, fail, complete })\n\n if (typeof key !== 'string') {\n return handle.fail({\n errMsg: getParameterError({\n para: 'key',\n correct: 'String',\n wrong: key\n })\n })\n }\n\n const { result, data } = getItem(key)\n if (result) {\n return handle.success({ data })\n } else {\n return handle.fail({\n errMsg: 'data not found'\n })\n }\n}\n\nexport const createBufferURL = /* @__PURE__ */ temporarilyNotSupport('createBufferURL')\n\nexport const clearStorageSync: typeof Taro.clearStorageSync = () => {\n localStorage.clear()\n}\n\nexport const clearStorage: typeof Taro.clearStorage = ({ success, fail, complete } = {}) => {\n const handle = new MethodHandler({ name: 'clearStorage', success, fail, complete })\n clearStorageSync()\n return handle.success()\n}\n\nexport const batchSetStorageSync = /* @__PURE__ */ temporarilyNotSupport('batchSetStorageSync')\nexport const batchSetStorage = /* @__PURE__ */ temporarilyNotSupport('batchSetStorage')\nexport const batchGetStorageSync = /* @__PURE__ */ temporarilyNotSupport('batchGetStorageSync')\nexport const batchGetStorage = /* @__PURE__ */ temporarilyNotSupport('batchGetStorage')\n\nexport * from './background-fetch'\nexport * from './cache-manager'"],"names":[],"mappings":";;;;;AAKA,SAAS,OAAO,CAAE,GAAG,EAAA;AACnB,IAAA,IAAI,IAAI,CAAA;IACR,IAAI;AACF,QAAA,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;AACnD,KAAA;AAAC,IAAA,OAAO,CAAC,EAAE,GAAE;;AAGd,IAAA,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE;QACnE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAA;AACzC,KAAA;A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AAK;AACX,gBAAA,OAAO,EAAE,QAAQ;AACjB,gBAAA,KAAK,EAAE,GAAG;aACX,CAAC;AACH,SAAA,CAAC,CAAA;AACH,KAAA;IAED,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;AACrC,IAAA,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;AAChC,KAAA;AAAM,SAAA;QACL,OAAO,MAAM,CAAC,IAAI,CAAC;AACjB,YAAA,MAAM,EAAE,gBAAgB;AACzB,SAAA,CAAC,CAAA;AACH,KAAA;AACH,EAAC;AAEY,MAAA,eAAe,mBAAmB,qBAAqB,CAAC,iBAAiB,EAAC;AAEhF,MAAM,gBAAgB,GAAiC,MAAK;IACjE,YAAY,CAAC,KAAK,EAAE,CAAA;AACtB,EAAC;AAEM,MAAM,YAAY,GAA6B,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAI;AACzF,IAAA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;AACnF,IAAA,gBAAgB,EAAE,CAAA;AAClB,IAAA,OAAO,MAAM,CAAC,OAAO,EAAE,CAAA;AACzB,EAAC;AAEY,MAAA,mBAAmB,mBAAmB,qBAAqB,CAAC,qBAAqB,EAAC;AAClF,MAAA,eAAe,mBAAmB,qBAAqB,CAAC,iBAAiB,EAAC;AAC1E,MAAA,mBAAmB,mBAAmB,qBAAqB,CAAC,qBAAqB,EAAC;AAClF,MAAA,eAAe,mBAAmB,qBAAqB,CAAC,iBAAiB;;;;"}
@@ -1,30 +1,30 @@
1
1
  import { temporarilyNotSupport } from '../../utils/index.js';
2
2
 
3
- const setPageInfo = temporarilyNotSupport('setPageInfo');
3
+ const setPageInfo = /* @__PURE__ */ temporarilyNotSupport('setPageInfo');
4
4
  // 百度小程序 AI 相关
5
- const ocrIdCard = temporarilyNotSupport('ocrIdCard');
6
- const ocrBankCard = temporarilyNotSupport('ocrBankCard');
7
- const ocrDrivingLicense = temporarilyNotSupport('ocrDrivingLicense');
8
- const ocrVehicleLicense = temporarilyNotSupport('ocrVehicleLicense');
9
- const textReview = temporarilyNotSupport('textReview');
10
- const textToAudio = temporarilyNotSupport('textToAudio');
11
- const imageAudit = temporarilyNotSupport('imageAudit');
12
- const advancedGeneralIdentify = temporarilyNotSupport('advancedGeneralIdentify');
13
- const objectDetectIdentify = temporarilyNotSupport('objectDetectIdentify');
14
- const carClassify = temporarilyNotSupport('carClassify');
15
- const dishClassify = temporarilyNotSupport('dishClassify');
16
- const logoClassify = temporarilyNotSupport('logoClassify');
17
- const animalClassify = temporarilyNotSupport('animalClassify');
18
- const plantClassify = temporarilyNotSupport('plantClassify');
5
+ const ocrIdCard = /* @__PURE__ */ temporarilyNotSupport('ocrIdCard');
6
+ const ocrBankCard = /* @__PURE__ */ temporarilyNotSupport('ocrBankCard');
7
+ const ocrDrivingLicense = /* @__PURE__ */ temporarilyNotSupport('ocrDrivingLicense');
8
+ const ocrVehicleLicense = /* @__PURE__ */ temporarilyNotSupport('ocrVehicleLicense');
9
+ const textReview = /* @__PURE__ */ temporarilyNotSupport('textReview');
10
+ const textToAudio = /* @__PURE__ */ temporarilyNotSupport('textToAudio');
11
+ const imageAudit = /* @__PURE__ */ temporarilyNotSupport('imageAudit');
12
+ const advancedGeneralIdentify = /* @__PURE__ */ temporarilyNotSupport('advancedGeneralIdentify');
13
+ const objectDetectIdentify = /* @__PURE__ */ temporarilyNotSupport('objectDetectIdentify');
14
+ const carClassify = /* @__PURE__ */ temporarilyNotSupport('carClassify');
15
+ const dishClassify = /* @__PURE__ */ temporarilyNotSupport('dishClassify');
16
+ const logoClassify = /* @__PURE__ */ temporarilyNotSupport('logoClassify');
17
+ const animalClassify = /* @__PURE__ */ temporarilyNotSupport('animalClassify');
18
+ const plantClassify = /* @__PURE__ */ temporarilyNotSupport('plantClassify');
19
19
  // 用户信息
20
- const getSwanId = temporarilyNotSupport('getSwanId');
20
+ const getSwanId = /* @__PURE__ */ temporarilyNotSupport('getSwanId');
21
21
  // 百度收银台支付
22
- const requestPolymerPayment = temporarilyNotSupport('requestPolymerPayment');
22
+ const requestPolymerPayment = /* @__PURE__ */ temporarilyNotSupport('requestPolymerPayment');
23
23
  // 打开小程序
24
- const navigateToSmartGameProgram = temporarilyNotSupport('navigateToSmartGameProgram');
25
- const navigateToSmartProgram = temporarilyNotSupport('navigateToSmartProgram');
26
- const navigateBackSmartProgram = temporarilyNotSupport('navigateBackSmartProgram');
27
- const preloadSubPackage = temporarilyNotSupport('preloadSubPackage');
24
+ const navigateToSmartGameProgram = /* @__PURE__ */ temporarilyNotSupport('navigateToSmartGameProgram');
25
+ const navigateToSmartProgram = /* @__PURE__ */ temporarilyNotSupport('navigateToSmartProgram');
26
+ const navigateBackSmartProgram = /* @__PURE__ */ temporarilyNotSupport('navigateBackSmartProgram');
27
+ const preloadSubPackage = /* @__PURE__ */ temporarilyNotSupport('preloadSubPackage');
28
28
 
29
29
  export { advancedGeneralIdentify, animalClassify, carClassify, dishClassify, getSwanId, imageAudit, logoClassify, navigateBackSmartProgram, navigateToSmartGameProgram, navigateToSmartProgram, objectDetectIdentify, ocrBankCard, ocrDrivingLicense, ocrIdCard, ocrVehicleLicense, plantClassify, preloadSubPackage, requestPolymerPayment, setPageInfo, textReview, textToAudio };
30
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/api/swan/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\nexport const setPageInfo = temporarilyNotSupport('setPageInfo')\n\n// 百度小程序 AI 相关\nexport const ocrIdCard = temporarilyNotSupport('ocrIdCard')\nexport const ocrBankCard = temporarilyNotSupport('ocrBankCard')\nexport const ocrDrivingLicense = temporarilyNotSupport('ocrDrivingLicense')\nexport const ocrVehicleLicense = temporarilyNotSupport('ocrVehicleLicense')\nexport const textReview = temporarilyNotSupport('textReview')\nexport const textToAudio = temporarilyNotSupport('textToAudio')\nexport const imageAudit = temporarilyNotSupport('imageAudit')\nexport const advancedGeneralIdentify = temporarilyNotSupport('advancedGeneralIdentify')\nexport const objectDetectIdentify = temporarilyNotSupport('objectDetectIdentify')\nexport const carClassify = temporarilyNotSupport('carClassify')\nexport const dishClassify = temporarilyNotSupport('dishClassify')\nexport const logoClassify = temporarilyNotSupport('logoClassify')\nexport const animalClassify = temporarilyNotSupport('animalClassify')\nexport const plantClassify = temporarilyNotSupport('plantClassify')\n\n// 用户信息\nexport const getSwanId = temporarilyNotSupport('getSwanId')\n\n// 百度收银台支付\nexport const requestPolymerPayment = temporarilyNotSupport('requestPolymerPayment')\n\n// 打开小程序\nexport const navigateToSmartGameProgram = temporarilyNotSupport('navigateToSmartGameProgram')\nexport const navigateToSmartProgram = temporarilyNotSupport('navigateToSmartProgram')\nexport const navigateBackSmartProgram = temporarilyNotSupport('navigateBackSmartProgram')\nexport const preloadSubPackage = temporarilyNotSupport('preloadSubPackage')\n"],"names":[],"mappings":";;MAEa,WAAW,GAAG,qBAAqB,CAAC,aAAa,EAAC;AAE/D;MACa,SAAS,GAAG,qBAAqB,CAAC,WAAW,EAAC;MAC9C,WAAW,GAAG,qBAAqB,CAAC,aAAa,EAAC;MAClD,iBAAiB,GAAG,qBAAqB,CAAC,mBAAmB,EAAC;MAC9D,iBAAiB,GAAG,qBAAqB,CAAC,mBAAmB,EAAC;MAC9D,UAAU,GAAG,qBAAqB,CAAC,YAAY,EAAC;MAChD,WAAW,GAAG,qBAAqB,CAAC,aAAa,EAAC;MAClD,UAAU,GAAG,qBAAqB,CAAC,YAAY,EAAC;MAChD,uBAAuB,GAAG,qBAAqB,CAAC,yBAAyB,EAAC;MAC1E,oBAAoB,GAAG,qBAAqB,CAAC,sBAAsB,EAAC;MACpE,WAAW,GAAG,qBAAqB,CAAC,aAAa,EAAC;MAClD,YAAY,GAAG,qBAAqB,CAAC,cAAc,EAAC;MACpD,YAAY,GAAG,qBAAqB,CAAC,cAAc,EAAC;MACpD,cAAc,GAAG,qBAAqB,CAAC,gBAAgB,EAAC;MACxD,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;AAEnE;MACa,SAAS,GAAG,qBAAqB,CAAC,WAAW,EAAC;AAE3D;MACa,qBAAqB,GAAG,qBAAqB,CAAC,uBAAuB,EAAC;AAEnF;MACa,0BAA0B,GAAG,qBAAqB,CAAC,4BAA4B,EAAC;MAChF,sBAAsB,GAAG,qBAAqB,CAAC,wBAAwB,EAAC;MACxE,wBAAwB,GAAG,qBAAqB,CAAC,0BAA0B,EAAC;MAC5E,iBAAiB,GAAG,qBAAqB,CAAC,mBAAmB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/api/swan/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\nexport const setPageInfo = /* @__PURE__ */ temporarilyNotSupport('setPageInfo')\n\n// 百度小程序 AI 相关\nexport const ocrIdCard = /* @__PURE__ */ temporarilyNotSupport('ocrIdCard')\nexport const ocrBankCard = /* @__PURE__ */ temporarilyNotSupport('ocrBankCard')\nexport const ocrDrivingLicense = /* @__PURE__ */ temporarilyNotSupport('ocrDrivingLicense')\nexport const ocrVehicleLicense = /* @__PURE__ */ temporarilyNotSupport('ocrVehicleLicense')\nexport const textReview = /* @__PURE__ */ temporarilyNotSupport('textReview')\nexport const textToAudio = /* @__PURE__ */ temporarilyNotSupport('textToAudio')\nexport const imageAudit = /* @__PURE__ */ temporarilyNotSupport('imageAudit')\nexport const advancedGeneralIdentify = /* @__PURE__ */ temporarilyNotSupport('advancedGeneralIdentify')\nexport const objectDetectIdentify = /* @__PURE__ */ temporarilyNotSupport('objectDetectIdentify')\nexport const carClassify = /* @__PURE__ */ temporarilyNotSupport('carClassify')\nexport const dishClassify = /* @__PURE__ */ temporarilyNotSupport('dishClassify')\nexport const logoClassify = /* @__PURE__ */ temporarilyNotSupport('logoClassify')\nexport const animalClassify = /* @__PURE__ */ temporarilyNotSupport('animalClassify')\nexport const plantClassify = /* @__PURE__ */ temporarilyNotSupport('plantClassify')\n\n// 用户信息\nexport const getSwanId = /* @__PURE__ */ temporarilyNotSupport('getSwanId')\n\n// 百度收银台支付\nexport const requestPolymerPayment = /* @__PURE__ */ temporarilyNotSupport('requestPolymerPayment')\n\n// 打开小程序\nexport const navigateToSmartGameProgram = /* @__PURE__ */ temporarilyNotSupport('navigateToSmartGameProgram')\nexport const navigateToSmartProgram = /* @__PURE__ */ temporarilyNotSupport('navigateToSmartProgram')\nexport const navigateBackSmartProgram = /* @__PURE__ */ temporarilyNotSupport('navigateBackSmartProgram')\nexport const preloadSubPackage = /* @__PURE__ */ temporarilyNotSupport('preloadSubPackage')\n"],"names":[],"mappings":";;AAEa,MAAA,WAAW,mBAAmB,qBAAqB,CAAC,aAAa,EAAC;AAE/E;AACa,MAAA,SAAS,mBAAmB,qBAAqB,CAAC,WAAW,EAAC;AAC9D,MAAA,WAAW,mBAAmB,qBAAqB,CAAC,aAAa,EAAC;AAClE,MAAA,iBAAiB,mBAAmB,qBAAqB,CAAC,mBAAmB,EAAC;AAC9E,MAAA,iBAAiB,mBAAmB,qBAAqB,CAAC,mBAAmB,EAAC;AAC9E,MAAA,UAAU,mBAAmB,qBAAqB,CAAC,YAAY,EAAC;AAChE,MAAA,WAAW,mBAAmB,qBAAqB,CAAC,aAAa,EAAC;AAClE,MAAA,UAAU,mBAAmB,qBAAqB,CAAC,YAAY,EAAC;AAChE,MAAA,uBAAuB,mBAAmB,qBAAqB,CAAC,yBAAyB,EAAC;AAC1F,MAAA,oBAAoB,mBAAmB,qBAAqB,CAAC,sBAAsB,EAAC;AACpF,MAAA,WAAW,mBAAmB,qBAAqB,CAAC,aAAa,EAAC;AAClE,MAAA,YAAY,mBAAmB,qBAAqB,CAAC,cAAc,EAAC;AACpE,MAAA,YAAY,mBAAmB,qBAAqB,CAAC,cAAc,EAAC;AACpE,MAAA,cAAc,mBAAmB,qBAAqB,CAAC,gBAAgB,EAAC;AACxE,MAAA,aAAa,mBAAmB,qBAAqB,CAAC,eAAe,EAAC;AAEnF;AACa,MAAA,SAAS,mBAAmB,qBAAqB,CAAC,WAAW,EAAC;AAE3E;AACa,MAAA,qBAAqB,mBAAmB,qBAAqB,CAAC,uBAAuB,EAAC;AAEnG;AACa,MAAA,0BAA0B,mBAAmB,qBAAqB,CAAC,4BAA4B,EAAC;AAChG,MAAA,sBAAsB,mBAAmB,qBAAqB,CAAC,wBAAwB,EAAC;AACxF,MAAA,wBAAwB,mBAAmB,qBAAqB,CAAC,0BAA0B,EAAC;AAC5F,MAAA,iBAAiB,mBAAmB,qBAAqB,CAAC,mBAAmB;;;;"}
@@ -1,6 +1,6 @@
1
1
  import Taro from '@tarojs/api';
2
2
  import { history } from '@tarojs/router';
3
- declare const Behavior: any, getEnv: any, ENV_TYPE: any, Link: any, interceptors: any, Current: any, options: any, eventCenter: any, Events: any, preload: any;
3
+ declare const Behavior: any, getEnv: any, ENV_TYPE: any, Link: any, interceptors: any, interceptorify: any, Current: any, options: any, eventCenter: any, Events: any, preload: any;
4
4
  declare const taro: typeof Taro;
5
5
  declare const requirePlugin: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
6
  declare const initPxTransform: ({ designWidth, deviceRatio, baseFontSize, unitPrecision, targetUnit }: {
@@ -12,4 +12,9 @@ declare const initPxTransform: ({ designWidth, deviceRatio, baseFontSize, unitPr
12
12
  }) => void;
13
13
  declare const pxTransform: (size?: number) => any;
14
14
  declare const canIUseWebp: () => boolean;
15
- export { taro as default, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getEnv, history, initPxTransform, interceptors, Link, options, preload, pxTransform, requirePlugin };
15
+ declare const getAppInfo: () => {
16
+ platform: string;
17
+ taroVersion: string;
18
+ designWidth: any;
19
+ };
20
+ export { taro as default, Behavior, canIUseWebp, Current, ENV_TYPE, eventCenter, Events, getAppInfo, getEnv, history, initPxTransform, interceptorify, interceptors, Link, options, preload, pxTransform, requirePlugin };
package/dist/api/taro.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import Taro from '@tarojs/api';
2
2
  import { history, navigateBack, navigateTo, reLaunch, redirectTo, getCurrentPages, switchTab } from '@tarojs/router';
3
3
  export { history } from '@tarojs/router';
4
- import { isFunction } from '@tarojs/shared';
4
+ import { isFunction, PLATFORM_TYPE } from '@tarojs/shared';
5
5
  import './index.js';
6
6
  import { permanentlyNotSupport } from '../utils/index.js';
7
7
  import { getCurrentInstance, getApp } from './framework/index.js';
8
8
  import { nextTick } from './ui/custom-component.js';
9
9
 
10
- const { Behavior, getEnv, ENV_TYPE, Link, interceptors, Current, options, eventCenter, Events, preload } = Taro;
10
+ const { Behavior, getEnv, ENV_TYPE, Link, interceptors, interceptorify, Current, options, eventCenter, Events, preload } = Taro;
11
11
  const taro = {
12
12
  // @ts-ignore
13
13
  Behavior,
@@ -15,6 +15,7 @@ const taro = {
15
15
  ENV_TYPE,
16
16
  Link,
17
17
  interceptors,
18
+ interceptorify,
18
19
  Current,
19
20
  getCurrentInstance,
20
21
  options,
@@ -30,18 +31,23 @@ const taro = {
30
31
  getCurrentPages,
31
32
  switchTab
32
33
  };
33
- const requirePlugin = permanentlyNotSupport('requirePlugin');
34
+ const requirePlugin = /* @__PURE__ */ permanentlyNotSupport('requirePlugin');
34
35
  function getConfig() {
35
36
  var _a;
36
37
  if (this === null || this === void 0 ? void 0 : this.pxTransformConfig)
37
38
  return this.pxTransformConfig;
38
39
  return ((_a = taro).config || (_a.config = {}));
39
40
  }
40
- const initPxTransform = function ({ designWidth = 750, deviceRatio = {
41
+ const defaultDesignWidth = 750;
42
+ const defaultDesignRatio = {
41
43
  640: 2.34 / 2,
42
44
  750: 1,
43
45
  828: 1.81 / 2
44
- }, baseFontSize = 20, unitPrecision = 5, targetUnit = 'rem' }) {
46
+ };
47
+ const defaultBaseFontSize = 20;
48
+ const defaultUnitPrecision = 5;
49
+ const defaultTargetUnit = 'rem';
50
+ const initPxTransform = function ({ designWidth = defaultDesignWidth, deviceRatio = defaultDesignRatio, baseFontSize = defaultBaseFontSize, unitPrecision = defaultUnitPrecision, targetUnit = defaultTargetUnit }) {
45
51
  const config = getConfig.call(this);
46
52
  config.designWidth = designWidth;
47
53
  config.deviceRatio = deviceRatio;
@@ -51,16 +57,19 @@ const initPxTransform = function ({ designWidth = 750, deviceRatio = {
51
57
  };
52
58
  const pxTransform = function (size = 0) {
53
59
  const config = getConfig.call(this);
54
- const baseFontSize = config.baseFontSize || 20;
60
+ const baseFontSize = config.baseFontSize || defaultBaseFontSize;
61
+ const deviceRatio = config.deviceRatio || defaultDesignRatio;
55
62
  const designWidth = (((input = 0) => isFunction(config.designWidth)
56
63
  ? config.designWidth(input)
57
64
  : config.designWidth))(size);
58
65
  if (!(designWidth in config.deviceRatio)) {
59
66
  throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`);
60
67
  }
68
+ const targetUnit = config.targetUnit || defaultTargetUnit;
69
+ const unitPrecision = config.unitPrecision || defaultUnitPrecision;
61
70
  const formatSize = ~~size;
62
- let rootValue = 1 / config.deviceRatio[designWidth];
63
- switch (config === null || config === void 0 ? void 0 : config.targetUnit) {
71
+ let rootValue = 1 / deviceRatio[designWidth];
72
+ switch (targetUnit) {
64
73
  case 'vw':
65
74
  rootValue = designWidth / 100;
66
75
  break;
@@ -72,21 +81,29 @@ const pxTransform = function (size = 0) {
72
81
  rootValue *= baseFontSize * 2;
73
82
  }
74
83
  let val = formatSize / rootValue;
75
- if (config.unitPrecision >= 0 && config.unitPrecision <= 100) {
84
+ if (unitPrecision >= 0 && unitPrecision <= 100) {
76
85
  // Number(val): 0.50000 => 0.5
77
- val = Number(val.toFixed(config.unitPrecision));
86
+ val = Number(val.toFixed(unitPrecision));
78
87
  }
79
- return val + (config === null || config === void 0 ? void 0 : config.targetUnit);
88
+ return val + targetUnit;
80
89
  };
81
90
  const canIUseWebp = function () {
82
91
  const canvas = document.createElement('canvas');
83
92
  return canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0;
84
93
  };
94
+ const getAppInfo = function () {
95
+ const config = getConfig.call(this);
96
+ return {
97
+ platform: process.env.TARO_PLATFORM || PLATFORM_TYPE.WEB,
98
+ taroVersion: process.env.TARO_VERSION || 'unknown',
99
+ designWidth: config.designWidth,
100
+ };
101
+ };
85
102
  taro.requirePlugin = requirePlugin;
86
103
  taro.getApp = getApp;
87
104
  taro.pxTransform = pxTransform;
88
105
  taro.initPxTransform = initPxTransform;
89
106
  taro.canIUseWebp = canIUseWebp;
90
107
 
91
- export { Behavior, Current, ENV_TYPE, Events, Link, canIUseWebp, taro as default, eventCenter, getEnv, initPxTransform, interceptors, options, preload, pxTransform, requirePlugin };
108
+ export { Behavior, Current, ENV_TYPE, Events, Link, canIUseWebp, taro as default, eventCenter, getAppInfo, getEnv, initPxTransform, interceptorify, interceptors, options, preload, pxTransform, requirePlugin };
92
109
  //# sourceMappingURL=taro.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taro.js","sources":["../../src/api/taro.ts"],"sourcesContent":["import Taro from '@tarojs/api'\nimport { history } from '@tarojs/router'\nimport { isFunction } from '@tarojs/shared'\n\nimport { getApp, getCurrentInstance, getCurrentPages, navigateBack, navigateTo, nextTick, redirectTo, reLaunch, switchTab } from '../api'\nimport { permanentlyNotSupport } from '../utils'\n\nconst {\n Behavior,\n getEnv,\n ENV_TYPE,\n Link,\n interceptors,\n Current,\n options,\n eventCenter,\n Events,\n preload\n} = Taro as any\n\nconst taro: typeof Taro = {\n // @ts-ignore\n Behavior,\n getEnv,\n ENV_TYPE,\n Link,\n interceptors,\n Current,\n getCurrentInstance,\n options,\n nextTick,\n eventCenter,\n Events,\n preload,\n history,\n navigateBack,\n navigateTo,\n reLaunch,\n redirectTo,\n getCurrentPages,\n switchTab\n}\n\nconst requirePlugin = permanentlyNotSupport('requirePlugin')\n\nfunction getConfig (): Record<string, any> {\n if (this?.pxTransformConfig) return this.pxTransformConfig\n return ((taro as any).config ||= {})\n}\n\nconst initPxTransform = function ({\n designWidth = 750,\n deviceRatio = {\n 640: 2.34 / 2,\n 750: 1,\n 828: 1.81 / 2\n } as TaroGeneral.TDeviceRatio,\n baseFontSize = 20,\n unitPrecision = 5,\n targetUnit = 'rem'\n}) {\n const config = getConfig.call(this)\n config.designWidth = designWidth\n config.deviceRatio = deviceRatio\n config.baseFontSize = baseFontSize\n config.targetUnit = targetUnit\n config.unitPrecision = unitPrecision\n}\n\nconst pxTransform = function (size = 0) {\n const config = getConfig.call(this)\n const baseFontSize = config.baseFontSize || 20\n const designWidth = (((input = 0) => isFunction(config.designWidth)\n ? config.designWidth(input)\n : config.designWidth))(size)\n if (!(designWidth in config.deviceRatio)) {\n throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`)\n }\n const formatSize = ~~size\n let rootValue = 1 / config.deviceRatio[designWidth]\n switch (config?.targetUnit) {\n case 'vw':\n rootValue = designWidth / 100\n break\n case 'px':\n rootValue *= 2\n break\n default:\n // rem\n rootValue *= baseFontSize * 2\n }\n let val: number | string = formatSize / rootValue\n if (config.unitPrecision >= 0 && config.unitPrecision <= 100) {\n // Number(val): 0.50000 => 0.5\n val = Number(val.toFixed(config.unitPrecision))\n }\n return val + config?.targetUnit\n}\n\nconst canIUseWebp = function () {\n const canvas = document.createElement('canvas')\n return canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0\n}\n\ntaro.requirePlugin = requirePlugin\ntaro.getApp = getApp\ntaro.pxTransform = pxTransform\ntaro.initPxTransform = initPxTransform\ntaro.canIUseWebp = canIUseWebp\n\nexport default taro\n\nexport {\n Behavior,\n canIUseWebp,\n Current,\n ENV_TYPE,\n eventCenter,\n Events,\n getEnv,\n history,\n initPxTransform,\n interceptors,\n Link,\n options,\n preload,\n pxTransform,\n requirePlugin\n}\n"],"names":[],"mappings":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OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAA;AAChD,KAAA;IACD,OAAO,GAAG,IAAG,MAAM,KAAN,IAAA,IAAA,MAAM,uBAAN,MAAM,CAAE,UAAU,CAAA,CAAA;AACjC,EAAC;AAED,MAAM,WAAW,GAAG,YAAA;IAClB,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;AAC/C,IAAA,OAAO,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;AACxE,EAAC;AAED,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;AAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;AACpB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;AAC9B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;AACtC,IAAI,CAAC,WAAW,GAAG,WAAW;;;;"}
1
+ {"version":3,"file":"taro.js","sources":["../../src/api/taro.ts"],"sourcesContent":["import Taro from '@tarojs/api'\nimport { history } from '@tarojs/router'\nimport { isFunction, PLATFORM_TYPE } from '@tarojs/shared'\n\nimport { getApp, getCurrentInstance, getCurrentPages, navigateBack, navigateTo, nextTick, redirectTo, reLaunch, switchTab } from '../api'\nimport { permanentlyNotSupport } from '../utils'\n\nconst {\n Behavior,\n getEnv,\n ENV_TYPE,\n Link,\n interceptors,\n interceptorify,\n Current,\n options,\n eventCenter,\n Events,\n preload\n} = Taro as any\n\nconst taro: typeof Taro = {\n // @ts-ignore\n Behavior,\n getEnv,\n ENV_TYPE,\n Link,\n interceptors,\n interceptorify,\n Current,\n getCurrentInstance,\n options,\n nextTick,\n eventCenter,\n Events,\n preload,\n history,\n navigateBack,\n navigateTo,\n reLaunch,\n redirectTo,\n getCurrentPages,\n switchTab\n}\n\nconst requirePlugin = /* @__PURE__ */ permanentlyNotSupport('requirePlugin')\n\nfunction getConfig (): Record<string, any> {\n if (this?.pxTransformConfig) return this.pxTransformConfig\n return ((taro as any).config ||= {})\n}\n\nconst defaultDesignWidth = 750\nconst defaultDesignRatio: TaroGeneral.TDeviceRatio = {\n 640: 2.34 / 2,\n 750: 1,\n 828: 1.81 / 2\n}\nconst defaultBaseFontSize = 20\nconst defaultUnitPrecision = 5\nconst defaultTargetUnit = 'rem'\n\nconst initPxTransform = function ({\n designWidth = defaultDesignWidth,\n deviceRatio = defaultDesignRatio,\n baseFontSize = defaultBaseFontSize,\n unitPrecision = defaultUnitPrecision,\n targetUnit = defaultTargetUnit\n}) {\n const config = getConfig.call(this)\n config.designWidth = designWidth\n config.deviceRatio = deviceRatio\n config.baseFontSize = baseFontSize\n config.targetUnit = targetUnit\n config.unitPrecision = unitPrecision\n}\n\nconst pxTransform = function (size = 0) {\n const config = getConfig.call(this)\n const baseFontSize = config.baseFontSize || defaultBaseFontSize\n const deviceRatio = config.deviceRatio || defaultDesignRatio\n const designWidth = (((input = 0) => isFunction(config.designWidth)\n ? config.designWidth(input)\n : config.designWidth))(size)\n if (!(designWidth in config.deviceRatio)) {\n throw new Error(`deviceRatio 配置中不存在 ${designWidth} 的设置!`)\n }\n const targetUnit = config.targetUnit || defaultTargetUnit\n const unitPrecision = config.unitPrecision || defaultUnitPrecision\n const formatSize = ~~size\n let rootValue = 1 / deviceRatio[designWidth]\n switch (targetUnit) {\n case 'vw':\n rootValue = designWidth / 100\n break\n case 'px':\n rootValue *= 2\n break\n default:\n // rem\n rootValue *= baseFontSize * 2\n }\n let val: number | string = formatSize / rootValue\n if (unitPrecision >= 0 && unitPrecision <= 100) {\n // Number(val): 0.50000 => 0.5\n val = Number(val.toFixed(unitPrecision))\n }\n return val + targetUnit\n}\n\nconst canIUseWebp = function () {\n const canvas = document.createElement('canvas')\n return canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0\n}\n\nconst getAppInfo = function () {\n const config = getConfig.call(this)\n return {\n platform: process.env.TARO_PLATFORM || PLATFORM_TYPE.WEB,\n taroVersion: process.env.TARO_VERSION || 'unknown',\n designWidth: config.designWidth,\n }\n}\n\ntaro.requirePlugin = requirePlugin\ntaro.getApp = getApp\ntaro.pxTransform = pxTransform\ntaro.initPxTransform = initPxTransform\ntaro.canIUseWebp = canIUseWebp\n\nexport default taro\n\nexport {\n Behavior,\n canIUseWebp,\n Current,\n ENV_TYPE,\n eventCenter,\n Events,\n getAppInfo,\n getEnv,\n history,\n initPxTransform,\n interceptorify,\n interceptors,\n Link,\n options,\n preload,\n pxTransform,\n requirePlugin\n}\n"],"names":[],"mappings":";;;;;;;;;AAOM,MAAA,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,YAAY,EACZ,cAAc,EACd,OAAO,EACP,OAAO,EACP,WAAW,EACX,MAAM,EACN,OAAO,EACR,GAAG,KAAW;AAEf,MAAM,IAAI,GAAgB;;IAExB,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,YAAY;IACZ,cAAc;IACd,OAAO;IACP,kBAAkB;IAClB,OAAO;IACP,QAAQ;IACR,WAAW;IACX,MAAM;IACN,OAAO;IACP,OAAO;IACP,YAAY;IACZ,UAAU;IACV,QAAQ;IACR,UAAU;IACV,eAAe;IACf,SAAS;EACV;AAEK,MAAA,aAAa,mBAAmB,qBAAqB,CAAC,eAAe,EAAC;AAE5E,SAAS,SAAS,GAAA;;AAChB,IAAA,IAAI,IAAI,KAAJ,IAAA,IAAA,IAAI,KAAJ,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,IAAI,CAAE,iBAAiB;QAAE,OAAO,IAAI,CAAC,iBAAiB,CAAA;IAC1D,QAAO,CAAA,EAAA,GAAE,IAAY,EAAC,MAAM,QAAN,MAAM,GAAK,EAAE,CAAA,EAAC;AACtC,CAAC;AAED,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAC9B,MAAM,kBAAkB,GAA6B;IACnD,GAAG,EAAE,IAAI,GAAG,CAAC;AACb,IAAA,GAAG,EAAE,CAAC;IACN,GAAG,EAA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Y,IAAI,SAAS;QAClD,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAA;AACH,EAAC;AAED,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;AAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;AACpB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;AAC9B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;AACtC,IAAI,CAAC,WAAW,GAAG,WAAW;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { temporarilyNotSupport } from '../../utils/index.js';
2
2
 
3
3
  // 背景
4
- const setBackgroundTextStyle = temporarilyNotSupport('setBackgroundTextStyle');
5
- const setBackgroundColor = temporarilyNotSupport('setBackgroundColor');
4
+ const setBackgroundTextStyle = /* @__PURE__ */ temporarilyNotSupport('setBackgroundTextStyle');
5
+ const setBackgroundColor = /* @__PURE__ */ temporarilyNotSupport('setBackgroundColor');
6
6
 
7
7
  export { setBackgroundColor, setBackgroundTextStyle };
8
8
  //# sourceMappingURL=background.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"background.js","sources":["../../../src/api/ui/background.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 背景\nexport const setBackgroundTextStyle = temporarilyNotSupport('setBackgroundTextStyle')\nexport const setBackgroundColor = temporarilyNotSupport('setBackgroundColor')\n"],"names":[],"mappings":";;AAEA;MACa,sBAAsB,GAAG,qBAAqB,CAAC,wBAAwB,EAAC;MACxE,kBAAkB,GAAG,qBAAqB,CAAC,oBAAoB;;;;"}
1
+ {"version":3,"file":"background.js","sources":["../../../src/api/ui/background.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 背景\nexport const setBackgroundTextStyle = /* @__PURE__ */ temporarilyNotSupport('setBackgroundTextStyle')\nexport const setBackgroundColor = /* @__PURE__ */ temporarilyNotSupport('setBackgroundColor')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,sBAAsB,mBAAmB,qBAAqB,CAAC,wBAAwB,EAAC;AACxF,MAAA,kBAAkB,mBAAmB,qBAAqB,CAAC,oBAAoB;;;;"}
@@ -1,12 +1,12 @@
1
- export * from "./animation/index";
2
- export * from "./background";
3
- export * from "./custom-component";
4
- export * from "./fonts";
5
- export * from "./interaction/index";
6
- export * from "./menu";
7
- export * from "./navigation-bar/index";
8
- export * from "./pull-down-refresh";
9
- export * from "./scroll/index";
10
- export * from "./sticky";
11
- export * from "./tab-bar";
12
- export * from "./window";
1
+ export * from "./animation/index.js";
2
+ export * from "./background.js";
3
+ export * from "./custom-component.js";
4
+ export * from "./fonts.js";
5
+ export * from "./interaction/index.js";
6
+ export * from "./menu.js";
7
+ export * from "./navigation-bar/index.js";
8
+ export * from "./pull-down-refresh.js";
9
+ export * from "./scroll/index.js";
10
+ export * from "./sticky.js";
11
+ export * from "./tab-bar.js";
12
+ export * from "./window.js";
@@ -9,5 +9,5 @@ export { startPullDownRefresh, stopPullDownRefresh } from './pull-down-refresh.j
9
9
  export { pageScrollTo } from './scroll/index.js';
10
10
  export { setTopBarText } from './sticky.js';
11
11
  export { hideTabBar, hideTabBarRedDot, initTabBarApis, removeTabBarBadge, setTabBarBadge, setTabBarItem, setTabBarStyle, showTabBar, showTabBarRedDot } from './tab-bar.js';
12
- export { offWindowResize, onWindowResize, setWindowSize } from './window.js';
12
+ export { checkIsPictureInPictureActive, offWindowResize, onWindowResize, setWindowSize } from './window.js';
13
13
  //# sourceMappingURL=index.js.map
@@ -4,7 +4,7 @@ declare const hideToast: typeof Taro.hideToast;
4
4
  declare const showLoading: typeof Taro.showLoading;
5
5
  declare const hideLoading: typeof Taro.hideLoading;
6
6
  declare const showModal: typeof Taro.showModal;
7
- declare const showActionSheet: typeof Taro.showActionSheet;
7
+ declare const showActionSheet: (options?: Taro.showActionSheet.Option, methodName?: string) => Promise<Taro.showActionSheet.SuccessCallbackResult>;
8
8
  declare const enableAlertBeforeUnload: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
9
9
  declare const disableAlertBeforeUnload: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
10
10
  export { disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast };
@@ -203,14 +203,14 @@ function hideModal() {
203
203
  return;
204
204
  modal.hide();
205
205
  }
206
- const showActionSheet = (options = { itemList: [] }) => __awaiter(void 0, void 0, void 0, function* () {
206
+ const showActionSheet = (options = { itemList: [] }, methodName = 'showActionSheet') => __awaiter(void 0, void 0, void 0, function* () {
207
207
  init(document);
208
208
  options = Object.assign({
209
209
  itemColor: '#000000',
210
210
  itemList: []
211
211
  }, options);
212
212
  const { success, fail, complete } = options;
213
- const handle = new MethodHandler({ name: 'showActionSheet', success, fail, complete });
213
+ const handle = new MethodHandler({ name: methodName, success, fail, complete });
214
214
  // list item String
215
215
  if (!Array.isArray(options.itemList)) {
216
216
  return handle.fail({
@@ -271,8 +271,8 @@ Taro.eventCenter.on('__afterTaroRouterChange', () => {
271
271
  hideModal();
272
272
  }
273
273
  });
274
- const enableAlertBeforeUnload = temporarilyNotSupport('enableAlertBeforeUnload');
275
- const disableAlertBeforeUnload = temporarilyNotSupport('disableAlertBeforeUnload');
274
+ const enableAlertBeforeUnload = /* @__PURE__ */ temporarilyNotSupport('enableAlertBeforeUnload');
275
+ const disableAlertBeforeUnload = /* @__PURE__ */ temporarilyNotSupport('disableAlertBeforeUnload');
276
276
 
277
277
  export { disableAlertBeforeUnload, enableAlertBeforeUnload, hideLoading, hideToast, showActionSheet, showLoading, showModal, showToast };
278
278
  //# sourceMappingURL=index.js.map