@tarojs/taro-h5 3.6.6 → 3.6.7-alpha.1

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 (246) 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/visual.js +2 -2
  6. package/dist/api/ai/visual.js.map +1 -1
  7. package/dist/api/alipay/index.js +1 -1
  8. package/dist/api/alipay/index.js.map +1 -1
  9. package/dist/api/base/crypto.js +1 -1
  10. package/dist/api/base/crypto.js.map +1 -1
  11. package/dist/api/base/debug.js +3 -3
  12. package/dist/api/base/debug.js.map +1 -1
  13. package/dist/api/base/index.d.ts +1 -2
  14. package/dist/api/base/index.js +3 -3
  15. package/dist/api/base/index.js.map +1 -1
  16. package/dist/api/base/performance.js +2 -2
  17. package/dist/api/base/performance.js.map +1 -1
  18. package/dist/api/base/system.js +2 -2
  19. package/dist/api/base/system.js.map +1 -1
  20. package/dist/api/base/update.js +2 -2
  21. package/dist/api/base/update.js.map +1 -1
  22. package/dist/api/base/weapp/app-event.js +7 -8
  23. package/dist/api/base/weapp/app-event.js.map +1 -1
  24. package/dist/api/canvas/CanvasContext.d.ts +2 -1
  25. package/dist/api/canvas/CanvasContext.js.map +1 -1
  26. package/dist/api/canvas/index.js +1 -1
  27. package/dist/api/canvas/index.js.map +1 -1
  28. package/dist/api/data-analysis/index.js +4 -4
  29. package/dist/api/data-analysis/index.js.map +1 -1
  30. package/dist/api/device/accelerometer.js +1 -2
  31. package/dist/api/device/accelerometer.js.map +1 -1
  32. package/dist/api/device/accessibility.js +1 -1
  33. package/dist/api/device/accessibility.js.map +1 -1
  34. package/dist/api/device/battery.js +1 -1
  35. package/dist/api/device/battery.js.map +1 -1
  36. package/dist/api/device/bluetooth-ble.js +16 -16
  37. package/dist/api/device/bluetooth-ble.js.map +1 -1
  38. package/dist/api/device/bluetooth-peripheral.js +3 -3
  39. package/dist/api/device/bluetooth-peripheral.js.map +1 -1
  40. package/dist/api/device/bluetooth.js +13 -13
  41. package/dist/api/device/bluetooth.js.map +1 -1
  42. package/dist/api/device/calendar.d.ts +3 -2
  43. package/dist/api/device/calendar.js +142 -3
  44. package/dist/api/device/calendar.js.map +1 -1
  45. package/dist/api/device/compass.js +1 -2
  46. package/dist/api/device/compass.js.map +1 -1
  47. package/dist/api/device/contact.js +2 -2
  48. package/dist/api/device/contact.js.map +1 -1
  49. package/dist/api/device/crypto.js +1 -1
  50. package/dist/api/device/crypto.js.map +1 -1
  51. package/dist/api/device/gyroscope.js +4 -4
  52. package/dist/api/device/gyroscope.js.map +1 -1
  53. package/dist/api/device/iBeacon.js +7 -7
  54. package/dist/api/device/iBeacon.js.map +1 -1
  55. package/dist/api/device/index.js +1 -1
  56. package/dist/api/device/keyboard.js +4 -4
  57. package/dist/api/device/keyboard.js.map +1 -1
  58. package/dist/api/device/memory.js +2 -2
  59. package/dist/api/device/memory.js.map +1 -1
  60. package/dist/api/device/motion.js +1 -2
  61. package/dist/api/device/motion.js.map +1 -1
  62. package/dist/api/device/network.js +3 -3
  63. package/dist/api/device/network.js.map +1 -1
  64. package/dist/api/device/nfc.js +7 -7
  65. package/dist/api/device/nfc.js.map +1 -1
  66. package/dist/api/device/scan.js +1 -1
  67. package/dist/api/device/scan.js.map +1 -1
  68. package/dist/api/device/screen.js +6 -6
  69. package/dist/api/device/screen.js.map +1 -1
  70. package/dist/api/device/wifi.d.ts +2 -1
  71. package/dist/api/device/wifi.js +13 -12
  72. package/dist/api/device/wifi.js.map +1 -1
  73. package/dist/api/ext/index.js +2 -2
  74. package/dist/api/ext/index.js.map +1 -1
  75. package/dist/api/files/index.js +8 -8
  76. package/dist/api/files/index.js.map +1 -1
  77. package/dist/api/index.d.ts +1 -0
  78. package/dist/api/index.js +12 -6
  79. package/dist/api/index.js.map +1 -1
  80. package/dist/api/location/chooseLocation.js +9 -5
  81. package/dist/api/location/chooseLocation.js.map +1 -1
  82. package/dist/api/location/getLocation.js +1 -1
  83. package/dist/api/location/getLocation.js.map +1 -1
  84. package/dist/api/location/index.js +10 -10
  85. package/dist/api/location/index.js.map +1 -1
  86. package/dist/api/media/audio/InnerAudioContext.d.ts +2 -0
  87. package/dist/api/media/audio/InnerAudioContext.js +4 -1
  88. package/dist/api/media/audio/InnerAudioContext.js.map +1 -1
  89. package/dist/api/media/audio/index.js +8 -8
  90. package/dist/api/media/audio/index.js.map +1 -1
  91. package/dist/api/media/background-audio/index.js +8 -8
  92. package/dist/api/media/background-audio/index.js.map +1 -1
  93. package/dist/api/media/camera.js +1 -1
  94. package/dist/api/media/camera.js.map +1 -1
  95. package/dist/api/media/image/chooseImage.d.ts +1 -0
  96. package/dist/api/media/image/chooseImage.js +28 -71
  97. package/dist/api/media/image/chooseImage.js.map +1 -1
  98. package/dist/api/media/image/index.d.ts +6 -3
  99. package/dist/api/media/image/index.js +8 -7
  100. package/dist/api/media/image/index.js.map +1 -1
  101. package/dist/api/media/image/saveImageToPhotosAlbum.d.ts +3 -0
  102. package/dist/api/media/image/saveImageToPhotosAlbum.js +30 -0
  103. package/dist/api/media/image/saveImageToPhotosAlbum.js.map +1 -0
  104. package/dist/api/media/index.js +2 -2
  105. package/dist/api/media/live.js +2 -2
  106. package/dist/api/media/live.js.map +1 -1
  107. package/dist/api/media/map.js +1 -1
  108. package/dist/api/media/map.js.map +1 -1
  109. package/dist/api/media/media-recorder.js +1 -1
  110. package/dist/api/media/media-recorder.js.map +1 -1
  111. package/dist/api/media/recorder.js +3 -3
  112. package/dist/api/media/recorder.js.map +1 -1
  113. package/dist/api/media/video/chooseMedia.d.ts +6 -0
  114. package/dist/api/media/video/chooseMedia.js +208 -0
  115. package/dist/api/media/video/chooseMedia.js.map +1 -0
  116. package/dist/api/media/video/chooseVideo.d.ts +7 -0
  117. package/dist/api/media/video/chooseVideo.js +44 -0
  118. package/dist/api/media/video/chooseVideo.js.map +1 -0
  119. package/dist/api/media/video/getVideoInfo.d.ts +3 -0
  120. package/dist/api/media/video/getVideoInfo.js +63 -0
  121. package/dist/api/media/video/getVideoInfo.js.map +1 -0
  122. package/dist/api/media/video/index.d.ts +5 -8
  123. package/dist/api/media/video/index.js +8 -67
  124. package/dist/api/media/video/index.js.map +1 -1
  125. package/dist/api/media/video/saveVideoToPhotosAlbum.d.ts +3 -0
  126. package/dist/api/media/video/saveVideoToPhotosAlbum.js +30 -0
  127. package/dist/api/media/video/saveVideoToPhotosAlbum.js.map +1 -0
  128. package/dist/api/media/video-decoder.js +1 -1
  129. package/dist/api/media/video-decoder.js.map +1 -1
  130. package/dist/api/media/video-processing.js +1 -1
  131. package/dist/api/media/video-processing.js.map +1 -1
  132. package/dist/api/media/voip.js +14 -14
  133. package/dist/api/media/voip.js.map +1 -1
  134. package/dist/api/navigate/index.js +5 -5
  135. package/dist/api/navigate/index.js.map +1 -1
  136. package/dist/api/network/mdns.js +10 -10
  137. package/dist/api/network/mdns.js.map +1 -1
  138. package/dist/api/network/request/index.d.ts +1 -1
  139. package/dist/api/network/request/index.js +23 -18
  140. package/dist/api/network/request/index.js.map +1 -1
  141. package/dist/api/network/tcp.js +1 -1
  142. package/dist/api/network/tcp.js.map +1 -1
  143. package/dist/api/network/udp.js +1 -1
  144. package/dist/api/network/udp.js.map +1 -1
  145. package/dist/api/open-api/account.js +1 -1
  146. package/dist/api/open-api/account.js.map +1 -1
  147. package/dist/api/open-api/address.js +1 -1
  148. package/dist/api/open-api/address.js.map +1 -1
  149. package/dist/api/open-api/authorize.js +2 -2
  150. package/dist/api/open-api/authorize.js.map +1 -1
  151. package/dist/api/open-api/card.js +2 -2
  152. package/dist/api/open-api/card.js.map +1 -1
  153. package/dist/api/open-api/channels-live.js +6 -6
  154. package/dist/api/open-api/channels-live.js.map +1 -1
  155. package/dist/api/open-api/customer-service.js +1 -1
  156. package/dist/api/open-api/customer-service.js.map +1 -1
  157. package/dist/api/open-api/facial.js +4 -4
  158. package/dist/api/open-api/facial.js.map +1 -1
  159. package/dist/api/open-api/favorites.js +3 -3
  160. package/dist/api/open-api/favorites.js.map +1 -1
  161. package/dist/api/open-api/group.js +1 -1
  162. package/dist/api/open-api/group.js.map +1 -1
  163. package/dist/api/open-api/index.js +1 -1
  164. package/dist/api/open-api/invoice.js +2 -2
  165. package/dist/api/open-api/invoice.js.map +1 -1
  166. package/dist/api/open-api/license-plate.js +1 -1
  167. package/dist/api/open-api/license-plate.js.map +1 -1
  168. package/dist/api/open-api/login.js +3 -3
  169. package/dist/api/open-api/login.js.map +1 -1
  170. package/dist/api/open-api/red-package.js +1 -1
  171. package/dist/api/open-api/red-package.js.map +1 -1
  172. package/dist/api/open-api/settings.js +2 -2
  173. package/dist/api/open-api/settings.js.map +1 -1
  174. package/dist/api/open-api/soter.js +3 -3
  175. package/dist/api/open-api/soter.js.map +1 -1
  176. package/dist/api/open-api/subscribe-message.d.ts +2 -1
  177. package/dist/api/open-api/subscribe-message.js +4 -2
  178. package/dist/api/open-api/subscribe-message.js.map +1 -1
  179. package/dist/api/open-api/user-info.js +2 -2
  180. package/dist/api/open-api/user-info.js.map +1 -1
  181. package/dist/api/open-api/werun.js +2 -2
  182. package/dist/api/open-api/werun.js.map +1 -1
  183. package/dist/api/payment/index.js +2 -2
  184. package/dist/api/payment/index.js.map +1 -1
  185. package/dist/api/qq/index.d.ts +2 -0
  186. package/dist/api/qq/index.js +7 -0
  187. package/dist/api/qq/index.js.map +1 -0
  188. package/dist/api/share/index.d.ts +10 -0
  189. package/dist/api/share/index.js +21 -11
  190. package/dist/api/share/index.js.map +1 -1
  191. package/dist/api/storage/background-fetch.js +4 -4
  192. package/dist/api/storage/background-fetch.js.map +1 -1
  193. package/dist/api/storage/index.js +2 -2
  194. package/dist/api/storage/index.js.map +1 -1
  195. package/dist/api/swan/index.js +21 -21
  196. package/dist/api/swan/index.js.map +1 -1
  197. package/dist/api/taro.js +1 -1
  198. package/dist/api/taro.js.map +1 -1
  199. package/dist/api/ui/background.js +2 -2
  200. package/dist/api/ui/background.js.map +1 -1
  201. package/dist/api/ui/index.js +1 -1
  202. package/dist/api/ui/interaction/index.d.ts +1 -1
  203. package/dist/api/ui/interaction/index.js +4 -4
  204. package/dist/api/ui/interaction/index.js.map +1 -1
  205. package/dist/api/ui/interaction/modal.js +6 -0
  206. package/dist/api/ui/interaction/modal.js.map +1 -1
  207. package/dist/api/ui/menu.js +1 -1
  208. package/dist/api/ui/menu.js.map +1 -1
  209. package/dist/api/ui/navigation-bar/index.js +3 -3
  210. package/dist/api/ui/navigation-bar/index.js.map +1 -1
  211. package/dist/api/ui/sticky.js +1 -1
  212. package/dist/api/ui/sticky.js.map +1 -1
  213. package/dist/api/ui/window.d.ts +2 -1
  214. package/dist/api/ui/window.js +3 -2
  215. package/dist/api/ui/window.js.map +1 -1
  216. package/dist/api/worker/index.js +1 -1
  217. package/dist/api/worker/index.js.map +1 -1
  218. package/dist/api/wxml/IntersectionObserver.d.ts +1 -1
  219. package/dist/api/wxml/IntersectionObserver.js +0 -1
  220. package/dist/api/wxml/IntersectionObserver.js.map +1 -1
  221. package/dist/api/wxml/MediaQueryObserver.d.ts +1 -1
  222. package/dist/api/wxml/MediaQueryObserver.js.map +1 -1
  223. package/dist/index.cjs.d.ts +35 -13
  224. package/dist/index.cjs.js +3910 -20776
  225. package/dist/index.cjs.js.map +1 -1
  226. package/dist/index.esm.d.ts +35 -13
  227. package/dist/index.esm.js +4352 -21219
  228. package/dist/index.esm.js.map +1 -1
  229. package/dist/index.js +17 -7
  230. package/dist/index.js.map +1 -1
  231. package/dist/utils/helper.d.ts +2 -0
  232. package/dist/utils/helper.js +11 -0
  233. package/dist/utils/helper.js.map +1 -0
  234. package/dist/utils/index.d.ts +5 -3
  235. package/dist/utils/index.js +4 -9
  236. package/dist/utils/index.js.map +1 -1
  237. package/package.json +16 -10
  238. package/dist/_virtual/_commonjsHelpers.js +0 -35
  239. package/dist/_virtual/_commonjsHelpers.js.map +0 -1
  240. package/dist/_virtual/lodash.js +0 -4
  241. package/dist/_virtual/lodash.js.map +0 -1
  242. package/dist/node_modules/.pnpm/registry.npmjs.org_lodash@4.17.21/node_modules/lodash/lodash.js +0 -17220
  243. package/dist/node_modules/.pnpm/registry.npmjs.org_lodash@4.17.21/node_modules/lodash/lodash.js.map +0 -1
  244. package/dist/utils/lodash.d.ts +0 -3
  245. package/dist/utils/lodash.js +0 -32
  246. package/dist/utils/lodash.js.map +0 -1
@@ -2,18 +2,18 @@ import { temporarilyNotSupport } from '../../../utils/index.js';
2
2
  import { InnerAudioContext } from './InnerAudioContext.js';
3
3
 
4
4
  // 音频
5
- const stopVoice = temporarilyNotSupport('stopVoice');
6
- const setInnerAudioOption = temporarilyNotSupport('setInnerAudioOption');
7
- const playVoice = temporarilyNotSupport('playVoice');
8
- const pauseVoice = temporarilyNotSupport('pauseVoice');
9
- const getAvailableAudioSources = temporarilyNotSupport('getAvailableAudioSources');
10
- const createWebAudioContext = temporarilyNotSupport('createWebAudioContext');
11
- const createMediaAudioPlayer = temporarilyNotSupport('createMediaAudioPlayer');
5
+ const stopVoice = /* @__PURE__ */ temporarilyNotSupport('stopVoice');
6
+ const setInnerAudioOption = /* @__PURE__ */ temporarilyNotSupport('setInnerAudioOption');
7
+ const playVoice = /* @__PURE__ */ temporarilyNotSupport('playVoice');
8
+ const pauseVoice = /* @__PURE__ */ temporarilyNotSupport('pauseVoice');
9
+ const getAvailableAudioSources = /* @__PURE__ */ temporarilyNotSupport('getAvailableAudioSources');
10
+ const createWebAudioContext = /* @__PURE__ */ temporarilyNotSupport('createWebAudioContext');
11
+ const createMediaAudioPlayer = /* @__PURE__ */ temporarilyNotSupport('createMediaAudioPlayer');
12
12
  /**
13
13
  * 创建内部 audio 上下文 InnerAudioContext 对象。
14
14
  */
15
15
  const createInnerAudioContext = () => new InnerAudioContext();
16
- const createAudioContext = temporarilyNotSupport('createAudioContext');
16
+ const createAudioContext = /* @__PURE__ */ temporarilyNotSupport('createAudioContext');
17
17
 
18
18
  export { createAudioContext, createInnerAudioContext, createMediaAudioPlayer, createWebAudioContext, getAvailableAudioSources, pauseVoice, playVoice, setInnerAudioOption, stopVoice };
19
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/api/media/audio/index.ts"],"sourcesContent":["import Taro from '@tarojs/api'\r\n\r\nimport { temporarilyNotSupport } from '../../../utils'\r\nimport { InnerAudioContext } from './InnerAudioContext'\r\n\r\n// 音频\r\n\r\nexport const stopVoice = temporarilyNotSupport('stopVoice')\r\nexport const setInnerAudioOption = temporarilyNotSupport('setInnerAudioOption')\r\nexport const playVoice = temporarilyNotSupport('playVoice')\r\nexport const pauseVoice = temporarilyNotSupport('pauseVoice')\r\nexport const getAvailableAudioSources = temporarilyNotSupport('getAvailableAudioSources')\r\nexport const createWebAudioContext = temporarilyNotSupport('createWebAudioContext')\r\nexport const createMediaAudioPlayer = temporarilyNotSupport('createMediaAudioPlayer')\r\n\r\n/**\r\n * 创建内部 audio 上下文 InnerAudioContext 对象。\r\n */\r\nexport const createInnerAudioContext: typeof Taro.createInnerAudioContext = () => new InnerAudioContext()\r\n\r\nexport const createAudioContext = temporarilyNotSupport('createAudioContext')\r\n"],"names":[],"mappings":";;;AAKA;MAEa,SAAS,GAAG,qBAAqB,CAAC,WAAW,EAAC;MAC9C,mBAAmB,GAAG,qBAAqB,CAAC,qBAAqB,EAAC;MAClE,SAAS,GAAG,qBAAqB,CAAC,WAAW,EAAC;MAC9C,UAAU,GAAG,qBAAqB,CAAC,YAAY,EAAC;MAChD,wBAAwB,GAAG,qBAAqB,CAAC,0BAA0B,EAAC;MAC5E,qBAAqB,GAAG,qBAAqB,CAAC,uBAAuB,EAAC;MACtE,sBAAsB,GAAG,qBAAqB,CAAC,wBAAwB,EAAC;AAErF;;AAEG;AACU,MAAA,uBAAuB,GAAwC,MAAM,IAAI,iBAAiB,GAAE;MAE5F,kBAAkB,GAAG,qBAAqB,CAAC,oBAAoB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/api/media/audio/index.ts"],"sourcesContent":["import Taro from '@tarojs/api'\r\n\r\nimport { temporarilyNotSupport } from '../../../utils'\r\nimport { InnerAudioContext } from './InnerAudioContext'\r\n\r\n// 音频\r\n\r\nexport const stopVoice = /* @__PURE__ */ temporarilyNotSupport('stopVoice')\r\nexport const setInnerAudioOption = /* @__PURE__ */ temporarilyNotSupport('setInnerAudioOption')\r\nexport const playVoice = /* @__PURE__ */ temporarilyNotSupport('playVoice')\r\nexport const pauseVoice = /* @__PURE__ */ temporarilyNotSupport('pauseVoice')\r\nexport const getAvailableAudioSources = /* @__PURE__ */ temporarilyNotSupport('getAvailableAudioSources')\r\nexport const createWebAudioContext = /* @__PURE__ */ temporarilyNotSupport('createWebAudioContext')\r\nexport const createMediaAudioPlayer = /* @__PURE__ */ temporarilyNotSupport('createMediaAudioPlayer')\r\n\r\n/**\r\n * 创建内部 audio 上下文 InnerAudioContext 对象。\r\n */\r\nexport const createInnerAudioContext: typeof Taro.createInnerAudioContext = () => new InnerAudioContext()\r\n\r\nexport const createAudioContext = /* @__PURE__ */ temporarilyNotSupport('createAudioContext')\r\n"],"names":[],"mappings":";;;AAKA;AAEa,MAAA,SAAS,mBAAmB,qBAAqB,CAAC,WAAW,EAAC;AAC9D,MAAA,mBAAmB,mBAAmB,qBAAqB,CAAC,qBAAqB,EAAC;AAClF,MAAA,SAAS,mBAAmB,qBAAqB,CAAC,WAAW,EAAC;AAC9D,MAAA,UAAU,mBAAmB,qBAAqB,CAAC,YAAY,EAAC;AAChE,MAAA,wBAAwB,mBAAmB,qBAAqB,CAAC,0BAA0B,EAAC;AAC5F,MAAA,qBAAqB,mBAAmB,qBAAqB,CAAC,uBAAuB,EAAC;AACtF,MAAA,sBAAsB,mBAAmB,qBAAqB,CAAC,wBAAwB,EAAC;AAErG;;AAEG;AACU,MAAA,uBAAuB,GAAwC,MAAM,IAAI,iBAAiB,GAAE;AAE5F,MAAA,kBAAkB,mBAAmB,qBAAqB,CAAC,oBAAoB;;;;"}
@@ -2,14 +2,14 @@ import { temporarilyNotSupport } from '../../../utils/index.js';
2
2
  import { BackgroundAudioManager } from './BackgroundAudioManager.js';
3
3
 
4
4
  // 背景音频
5
- const stopBackgroundAudio = temporarilyNotSupport('stopBackgroundAudio');
6
- const seekBackgroundAudio = temporarilyNotSupport('seekBackgroundAudio');
7
- const playBackgroundAudio = temporarilyNotSupport('playBackgroundAudio');
8
- const pauseBackgroundAudio = temporarilyNotSupport('pauseBackgroundAudio');
9
- const onBackgroundAudioStop = temporarilyNotSupport('onBackgroundAudioStop');
10
- const onBackgroundAudioPlay = temporarilyNotSupport('onBackgroundAudioPlay');
11
- const onBackgroundAudioPause = temporarilyNotSupport('onBackgroundAudioPause');
12
- const getBackgroundAudioPlayerState = temporarilyNotSupport('getBackgroundAudioPlayerState');
5
+ const stopBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('stopBackgroundAudio');
6
+ const seekBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('seekBackgroundAudio');
7
+ const playBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('playBackgroundAudio');
8
+ const pauseBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('pauseBackgroundAudio');
9
+ const onBackgroundAudioStop = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioStop');
10
+ const onBackgroundAudioPlay = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioPlay');
11
+ const onBackgroundAudioPause = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioPause');
12
+ const getBackgroundAudioPlayerState = /* @__PURE__ */ temporarilyNotSupport('getBackgroundAudioPlayerState');
13
13
  /**
14
14
  * 获取全局唯一的背景音频管理器
15
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/api/media/background-audio/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../../utils'\nimport { BackgroundAudioManager } from './BackgroundAudioManager'\n\n// 背景音频\nexport const stopBackgroundAudio = temporarilyNotSupport('stopBackgroundAudio')\nexport const seekBackgroundAudio = temporarilyNotSupport('seekBackgroundAudio')\nexport const playBackgroundAudio = temporarilyNotSupport('playBackgroundAudio')\nexport const pauseBackgroundAudio = temporarilyNotSupport('pauseBackgroundAudio')\nexport const onBackgroundAudioStop = temporarilyNotSupport('onBackgroundAudioStop')\nexport const onBackgroundAudioPlay = temporarilyNotSupport('onBackgroundAudioPlay')\nexport const onBackgroundAudioPause = temporarilyNotSupport('onBackgroundAudioPause')\nexport const getBackgroundAudioPlayerState = temporarilyNotSupport('getBackgroundAudioPlayerState')\n\n/**\n * 获取全局唯一的背景音频管理器\n */\nexport const getBackgroundAudioManager = () => new BackgroundAudioManager()\n"],"names":[],"mappings":";;;AAGA;MACa,mBAAmB,GAAG,qBAAqB,CAAC,qBAAqB,EAAC;MAClE,mBAAmB,GAAG,qBAAqB,CAAC,qBAAqB,EAAC;MAClE,mBAAmB,GAAG,qBAAqB,CAAC,qBAAqB,EAAC;MAClE,oBAAoB,GAAG,qBAAqB,CAAC,sBAAsB,EAAC;MACpE,qBAAqB,GAAG,qBAAqB,CAAC,uBAAuB,EAAC;MACtE,qBAAqB,GAAG,qBAAqB,CAAC,uBAAuB,EAAC;MACtE,sBAAsB,GAAG,qBAAqB,CAAC,wBAAwB,EAAC;MACxE,6BAA6B,GAAG,qBAAqB,CAAC,+BAA+B,EAAC;AAEnG;;AAEG;AACU,MAAA,yBAAyB,GAAG,MAAM,IAAI,sBAAsB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/api/media/background-audio/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../../utils'\nimport { BackgroundAudioManager } from './BackgroundAudioManager'\n\n// 背景音频\nexport const stopBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('stopBackgroundAudio')\nexport const seekBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('seekBackgroundAudio')\nexport const playBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('playBackgroundAudio')\nexport const pauseBackgroundAudio = /* @__PURE__ */ temporarilyNotSupport('pauseBackgroundAudio')\nexport const onBackgroundAudioStop = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioStop')\nexport const onBackgroundAudioPlay = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioPlay')\nexport const onBackgroundAudioPause = /* @__PURE__ */ temporarilyNotSupport('onBackgroundAudioPause')\nexport const getBackgroundAudioPlayerState = /* @__PURE__ */ temporarilyNotSupport('getBackgroundAudioPlayerState')\n\n/**\n * 获取全局唯一的背景音频管理器\n */\nexport const getBackgroundAudioManager = () => new BackgroundAudioManager()\n"],"names":[],"mappings":";;;AAGA;AACa,MAAA,mBAAmB,mBAAmB,qBAAqB,CAAC,qBAAqB,EAAC;AAClF,MAAA,mBAAmB,mBAAmB,qBAAqB,CAAC,qBAAqB,EAAC;AAClF,MAAA,mBAAmB,mBAAmB,qBAAqB,CAAC,qBAAqB,EAAC;AAClF,MAAA,oBAAoB,mBAAmB,qBAAqB,CAAC,sBAAsB,EAAC;AACpF,MAAA,qBAAqB,mBAAmB,qBAAqB,CAAC,uBAAuB,EAAC;AACtF,MAAA,qBAAqB,mBAAmB,qBAAqB,CAAC,uBAAuB,EAAC;AACtF,MAAA,sBAAsB,mBAAmB,qBAAqB,CAAC,wBAAwB,EAAC;AACxF,MAAA,6BAA6B,mBAAmB,qBAAqB,CAAC,+BAA+B,EAAC;AAEnH;;AAEG;AACU,MAAA,yBAAyB,GAAG,MAAM,IAAI,sBAAsB;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { temporarilyNotSupport } from '../../utils/index.js';
2
2
 
3
3
  // 相机
4
- const createCameraContext = temporarilyNotSupport('createCameraContext');
4
+ const createCameraContext = /* @__PURE__ */ temporarilyNotSupport('createCameraContext');
5
5
 
6
6
  export { createCameraContext };
7
7
  //# sourceMappingURL=camera.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"camera.js","sources":["../../../src/api/media/camera.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 相机\nexport const createCameraContext = temporarilyNotSupport('createCameraContext')\n"],"names":[],"mappings":";;AAEA;MACa,mBAAmB,GAAG,qBAAqB,CAAC,qBAAqB;;;;"}
1
+ {"version":3,"file":"camera.js","sources":["../../../src/api/media/camera.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 相机\nexport const createCameraContext = /* @__PURE__ */ temporarilyNotSupport('createCameraContext')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,mBAAmB,mBAAmB,qBAAqB,CAAC,qBAAqB;;;;"}
@@ -1,6 +1,7 @@
1
1
  import Taro from '@tarojs/api';
2
2
  /**
3
3
  * 从本地相册选择图片或使用相机拍照。
4
+ * @deprecated 请使用 chooseMedia 接口
4
5
  */
5
6
  declare const chooseImage: typeof Taro.chooseImage;
6
7
  export { chooseImage };
@@ -1,8 +1,10 @@
1
- import { shouldBeObject, getParameterError } from '../../../utils/index.js';
2
- import { MethodHandler } from '../../../utils/handler.js';
1
+ import { __rest } from '../../../node_modules/.pnpm/registry.npmjs.org_tslib@2.5.0/node_modules/tslib/tslib.es6.js';
2
+ import { shouldBeObject } from '../../../utils/index.js';
3
+ import { chooseMedia } from '../video/chooseMedia.js';
3
4
 
4
5
  /**
5
6
  * 从本地相册选择图片或使用相机拍照。
7
+ * @deprecated 请使用 chooseMedia 接口
6
8
  */
7
9
  const chooseImage = function (options) {
8
10
  // options must be an Object
@@ -12,77 +14,32 @@ const chooseImage = function (options) {
12
14
  console.error(res.errMsg);
13
15
  return Promise.reject(res);
14
16
  }
15
- const { count = 1, success, fail, complete, imageId = 'taroChooseImage', sourceType = ['album', 'camera'] } = options;
16
- const handle = new MethodHandler({ name: 'chooseImage', success, fail, complete });
17
- const res = {
18
- tempFilePaths: [],
19
- tempFiles: []
20
- };
21
- const sourceTypeString = sourceType && sourceType.toString();
22
- const acceptableSourceType = ['user', 'environment', 'camera'];
23
- if (count && typeof count !== 'number') {
24
- res.errMsg = getParameterError({
25
- para: 'count',
26
- correct: 'Number',
27
- wrong: count
28
- });
29
- return handle.fail(res);
17
+ let camera = 'back';
18
+ const { sourceType = ['album', 'camera'], success, complete, fail } = options, args = __rest(options, ["sourceType", "success", "complete", "fail"]);
19
+ if (sourceType.includes('camera') && sourceType.indexOf('user') > -1) {
20
+ camera = 'front';
30
21
  }
31
- let el = document.getElementById(imageId);
32
- if (!el) {
33
- const obj = document.createElement('input');
34
- obj.setAttribute('type', 'file');
35
- obj.setAttribute('id', imageId);
36
- if (count > 1) {
37
- obj.setAttribute('multiple', 'multiple');
38
- }
39
- if (acceptableSourceType.indexOf(sourceTypeString) > -1) {
40
- obj.setAttribute('capture', sourceTypeString);
41
- }
42
- obj.setAttribute('accept', 'image/*');
43
- obj.setAttribute('style', 'position: fixed; top: -4000px; left: -3000px; z-index: -300;');
44
- document.body.appendChild(obj);
45
- el = document.getElementById(imageId);
22
+ function parseRes(res) {
23
+ const { tempFiles = [], errMsg } = res;
24
+ return {
25
+ tempFilePaths: tempFiles.map(item => item.tempFilePath),
26
+ tempFiles: tempFiles.map(item => ({
27
+ path: item.tempFilePath,
28
+ size: item.size,
29
+ type: item.fileType,
30
+ originalFileObj: item.originalFileObj,
31
+ })),
32
+ errMsg,
33
+ };
46
34
  }
47
- else {
48
- if (count > 1) {
49
- el.setAttribute('multiple', 'multiple');
50
- }
51
- else {
52
- el.removeAttribute('multiple');
53
- }
54
- if (acceptableSourceType.indexOf(sourceTypeString) > -1) {
55
- el.setAttribute('capture', sourceTypeString);
56
- }
57
- else {
58
- el.removeAttribute('capture');
59
- }
60
- }
61
- return new Promise((resolve, reject) => {
62
- const TaroMouseEvents = document.createEvent('MouseEvents');
63
- TaroMouseEvents.initEvent('click', true, true);
64
- if (el) {
65
- el.dispatchEvent(TaroMouseEvents);
66
- el.onchange = function (e) {
67
- const target = e.target;
68
- if (target) {
69
- const files = target.files || [];
70
- const arr = [...files];
71
- arr && arr.forEach(item => {
72
- var _a, _b;
73
- const blob = new Blob([item], {
74
- type: item.type
75
- });
76
- const url = URL.createObjectURL(blob);
77
- (_a = res.tempFilePaths) === null || _a === void 0 ? void 0 : _a.push(url);
78
- (_b = res.tempFiles) === null || _b === void 0 ? void 0 : _b.push({ path: url, size: item.size, type: item.type, originalFileObj: item });
79
- });
80
- handle.success(res, { resolve, reject });
81
- target.value = '';
82
- }
83
- };
84
- }
85
- });
35
+ return chooseMedia(Object.assign(Object.assign({ mediaId: 'taroChooseImage' }, args), { sourceType: sourceType, mediaType: ['image'], camera, success: (res) => {
36
+ const param = parseRes(res);
37
+ success === null || success === void 0 ? void 0 : success(param);
38
+ complete === null || complete === void 0 ? void 0 : complete(param);
39
+ }, fail: (err) => {
40
+ fail === null || fail === void 0 ? void 0 : fail(err);
41
+ complete === null || complete === void 0 ? void 0 : complete(err);
42
+ } }), 'chooseImage').then(parseRes);
86
43
  };
87
44
 
88
45
  export { chooseImage };
@@ -1 +1 @@
1
- {"version":3,"file":"chooseImage.js","sources":["../../../../src/api/media/image/chooseImage.ts"],"sourcesContent":["import Taro from '@tarojs/api'\n\nimport { getParameterError, shouldBeObject } from '../../../utils'\nimport { MethodHandler } from '../../../utils/handler'\n\n/**\n * 从本地相册选择图片或使用相机拍照。\n */\nexport const chooseImage: typeof Taro.chooseImage = function (options) {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `chooseImage:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n const {\n count = 1,\n success,\n fail,\n complete,\n imageId = 'taroChooseImage',\n sourceType = ['album', 'camera']\n } = options\n const handle = new MethodHandler({ name: 'chooseImage', success, fail, complete })\n const res: Partial<Taro.chooseImage.SuccessCallbackResult> = {\n tempFilePaths: [],\n tempFiles: []\n }\n const sourceTypeString = sourceType && sourceType.toString()\n const acceptableSourceType = ['user', 'environment', 'camera']\n\n if (count && typeof count !== 'number') {\n res.errMsg = getParameterError({\n para: 'count',\n correct: 'Number',\n wrong: count\n })\n return handle.fail(res)\n }\n\n let el = document.getElementById(imageId)\n if (!el) {\n const obj = document.createElement('input')\n obj.setAttribute('type', 'file')\n obj.setAttribute('id', imageId)\n if (count > 1) {\n obj.setAttribute('multiple', 'multiple')\n }\n if (acceptableSourceType.indexOf(sourceTypeString) > -1) {\n obj.setAttribute('capture', sourceTypeString)\n }\n obj.setAttribute('accept', 'image/*')\n obj.setAttribute('style', 'position: fixed; top: -4000px; left: -3000px; z-index: -300;')\n document.body.appendChild(obj)\n el = document.getElementById(imageId)\n } else {\n if (count > 1) {\n el.setAttribute('multiple', 'multiple')\n } else {\n el.removeAttribute('multiple')\n }\n if (acceptableSourceType.indexOf(sourceTypeString) > -1) {\n el.setAttribute('capture', sourceTypeString)\n } else {\n el.removeAttribute('capture')\n }\n }\n\n return new Promise((resolve, reject) => {\n const TaroMouseEvents = document.createEvent('MouseEvents')\n TaroMouseEvents.initEvent('click', true, true)\n if (el) {\n el.dispatchEvent(TaroMouseEvents)\n el.onchange = function (e) {\n const target = e.target as HTMLInputElement\n if (target) {\n const files = target.files || []\n const arr = [...files]\n arr && arr.forEach(item => {\n const blob = new Blob([item], {\n type: item.type\n })\n const url = URL.createObjectURL(blob)\n res.tempFilePaths?.push(url)\n res.tempFiles?.push({ path: url, size: item.size, type: item.type, originalFileObj: item })\n })\n handle.success(res, { resolve, reject })\n target.value = ''\n }\n }\n }\n })\n}\n"],"names":[],"mappings":";;;AAKA;;AAEG;AACI,MAAM,WAAW,GAA4B,UAAU,OAAO,EAAA;;AAEnE,IAAA,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;AACxC,IAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;QAClB,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,CAAoB,iBAAA,EAAA,QAAQ,CAAC,GAAG,CAAE,CAAA,EAAE,CAAA;AAC1D,QAAA,OAAO,CAAC,KAAK,CAAC,GAA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AAC,CAAC,CAAA;AACJ;;;;"}
1
+ {"version":3,"file":"chooseImage.js","sources":["../../../../src/api/media/image/chooseImage.ts"],"sourcesContent":["import Taro from '@tarojs/api'\n\nimport { shouldBeObject } from '../../../utils'\nimport { chooseMedia } from '../video/chooseMedia'\n\n/**\n * 从本地相册选择图片或使用相机拍照。\n * @deprecated 请使用 chooseMedia 接口\n */\nexport const chooseImage: typeof Taro.chooseImage = function (options) {\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `chooseImage:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n let camera = 'back'\n const {\n sourceType = ['album', 'camera'],\n success,\n complete,\n fail,\n ...args\n } = options\n if (sourceType.includes('camera') && sourceType.indexOf('user') > -1) {\n camera = 'front'\n }\n\n function parseRes (res: Taro.chooseMedia.SuccessCallbackResult): Taro.chooseImage.SuccessCallbackResult {\n const { tempFiles = [], errMsg } = res\n return {\n tempFilePaths: tempFiles.map(item => item.tempFilePath),\n tempFiles: tempFiles.map(item => ({\n path: item.tempFilePath,\n size: item.size,\n type: item.fileType,\n originalFileObj: item.originalFileObj,\n })),\n errMsg,\n }\n }\n\n return chooseMedia({\n mediaId: 'taroChooseImage',\n ...args,\n sourceType: sourceType as Taro.chooseMedia.Option['sourceType'],\n mediaType: ['image'],\n camera,\n success: (res) => {\n const param = parseRes(res)\n success?.(param)\n complete?.(param)\n },\n fail: (err) => {\n fail?.(err)\n complete?.(err)\n },\n }, 'chooseImage').then(parseRes)\n}\n"],"names":[],"mappings":";;;;AAKA;;;AAGG;AACI,MAAM,WAAW,GAA4B,UAAU,OAAO,EAAA;;AAEnE,IAAA,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;AACxC,IAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;QAClB,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,CAAoB,iBAAA,EAAA,QAAQ,CAAC,GAAG,C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,EAAE,CAAC,GAAG,KAAI;AACf,YAAA,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAA;AAC3B,YAAA,OAAO,aAAP,OAAO,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAP,OAAO,CAAG,KAAK,CAAC,CAAA;AAChB,YAAA,QAAQ,aAAR,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAR,QAAQ,CAAG,KAAK,CAAC,CAAA;AACnB,SAAC,EACD,IAAI,EAAE,CAAC,GAAG,KAAI;AACZ,YAAA,IAAI,aAAJ,IAAI,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAJ,IAAI,CAAG,GAAG,CAAC,CAAA;AACX,YAAA,QAAQ,aAAR,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAR,QAAQ,CAAG,GAAG,CAAC,CAAA;SAChB,EAAA,CAAA,EACA,aAAa,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AAClC;;;;"}
@@ -1,8 +1,11 @@
1
- declare const saveImageToPhotosAlbum: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
2
- declare const previewMedia: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
1
+ import Taro from '@tarojs/api';
2
+ declare const previewMedia: typeof Taro.previewMedia;
3
3
  declare const compressImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
4
4
  declare const chooseMessageFile: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
5
- export { saveImageToPhotosAlbum, previewMedia, compressImage, chooseMessageFile };
5
+ declare const editImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
6
+ declare const cropImage: (option?: {}, ...args: any[]) => Promise<Partial<TaroGeneral.CallbackResult> & Record<string, unknown> & TaroGeneral.CallbackResult>;
7
+ export * from "./saveImageToPhotosAlbum.js";
8
+ export { previewMedia, compressImage, chooseMessageFile, editImage, cropImage };
6
9
  export * from "./getImageInfo.js";
7
10
  export * from "./previewImage.js";
8
11
  export * from "./chooseImage.js";
@@ -1,13 +1,14 @@
1
- import { temporarilyNotSupport } from '../../../utils/index.js';
1
+ import { temporarilyNotSupport, permanentlyNotSupport } from '../../../utils/index.js';
2
+ export { saveImageToPhotosAlbum } from './saveImageToPhotosAlbum.js';
2
3
  export { getImageInfo } from './getImageInfo.js';
3
4
  export { previewImage } from './previewImage.js';
4
5
  export { chooseImage } from './chooseImage.js';
5
6
 
6
- // 图片
7
- const saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum');
8
- const previewMedia = temporarilyNotSupport('previewMedia');
9
- const compressImage = temporarilyNotSupport('compressImage');
10
- const chooseMessageFile = temporarilyNotSupport('chooseMessageFile');
7
+ const previewMedia = /* @__PURE__ */ temporarilyNotSupport('previewMedia');
8
+ const compressImage = /* @__PURE__ */ temporarilyNotSupport('compressImage');
9
+ const chooseMessageFile = /* @__PURE__ */ permanentlyNotSupport('chooseMessageFile');
10
+ const editImage = /* @__PURE__ */ temporarilyNotSupport('editImage');
11
+ const cropImage = /* @__PURE__ */ temporarilyNotSupport('cropImage');
11
12
 
12
- export { chooseMessageFile, compressImage, previewMedia, saveImageToPhotosAlbum };
13
+ export { chooseMessageFile, compressImage, cropImage, editImage, previewMedia };
13
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/api/media/image/index.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../../utils'\r\n\r\n// 图片\r\nexport const saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum')\r\nexport const previewMedia = temporarilyNotSupport('previewMedia')\r\n\r\nexport * from './getImageInfo'\r\nexport * from './previewImage'\r\n\r\nexport const compressImage = temporarilyNotSupport('compressImage')\r\nexport const chooseMessageFile = temporarilyNotSupport('chooseMessageFile')\r\n\r\nexport * from './chooseImage'\r\n"],"names":[],"mappings":";;;;;AAEA;MACa,sBAAsB,GAAG,qBAAqB,CAAC,wBAAwB,EAAC;MACxE,YAAY,GAAG,qBAAqB,CAAC,cAAc,EAAC;MAKpD,aAAa,GAAG,qBAAqB,CAAC,eAAe,EAAC;MACtD,iBAAiB,GAAG,qBAAqB,CAAC,mBAAmB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/api/media/image/index.ts"],"sourcesContent":["import Taro from '@tarojs/api'\r\n\r\nimport { permanentlyNotSupport, temporarilyNotSupport } from '../../../utils'\r\n\r\n// 图片\r\nexport * from './saveImageToPhotosAlbum'\r\nexport const previewMedia: typeof Taro.previewMedia = /* @__PURE__ */ temporarilyNotSupport('previewMedia')\r\n\r\nexport * from './getImageInfo'\r\nexport * from './previewImage'\r\n\r\nexport const compressImage = /* @__PURE__ */ temporarilyNotSupport('compressImage')\r\nexport const chooseMessageFile = /* @__PURE__ */ permanentlyNotSupport('chooseMessageFile')\r\n\r\nexport * from './chooseImage'\r\n\r\nexport const editImage = /* @__PURE__ */ temporarilyNotSupport('editImage')\r\nexport const cropImage = /* @__PURE__ */ temporarilyNotSupport('cropImage')\r\n"],"names":[],"mappings":";;;;;;AAMa,MAAA,YAAY,mBAA6C,qBAAqB,CAAC,cAAc,EAAC;AAK9F,MAAA,aAAa,mBAAmB,qBAAqB,CAAC,eAAe,EAAC;AACtE,MAAA,iBAAiB,mBAAmB,qBAAqB,CAAC,mBAAmB,EAAC;AAI9E,MAAA,SAAS,mBAAmB,qBAAqB,CAAC,WAAW,EAAC;AAC9D,MAAA,SAAS,mBAAmB,qBAAqB,CAAC,WAAW;;;;"}
@@ -0,0 +1,3 @@
1
+ import Taro from '@tarojs/api';
2
+ declare const saveImageToPhotosAlbum: typeof Taro.saveImageToPhotosAlbum;
3
+ export { saveImageToPhotosAlbum };
@@ -0,0 +1,30 @@
1
+ import { shouldBeObject, getParameterError } from '../../../utils/index.js';
2
+ import { MethodHandler } from '../../../utils/handler.js';
3
+ import { createDownload } from '../../../utils/helper.js';
4
+
5
+ const saveImageToPhotosAlbum = (options) => {
6
+ const methodName = 'saveImageToPhotosAlbum';
7
+ // options must be an Object
8
+ const isObject = shouldBeObject(options);
9
+ if (!isObject.flag) {
10
+ const res = { errMsg: `${methodName}:fail ${isObject.msg}` };
11
+ console.error(res.errMsg);
12
+ return Promise.reject(res);
13
+ }
14
+ const { filePath, success, fail, complete, } = options;
15
+ const handle = new MethodHandler({ name: methodName, success, fail, complete });
16
+ if (typeof filePath !== 'string') {
17
+ return handle.fail({
18
+ errMsg: getParameterError({
19
+ para: 'filePath',
20
+ correct: 'String',
21
+ wrong: filePath
22
+ })
23
+ });
24
+ }
25
+ createDownload(filePath);
26
+ return handle.success();
27
+ };
28
+
29
+ export { saveImageToPhotosAlbum };
30
+ //# sourceMappingURL=saveImageToPhotosAlbum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saveImageToPhotosAlbum.js","sources":["../../../../src/api/media/image/saveImageToPhotosAlbum.ts"],"sourcesContent":["import Taro from '@tarojs/api'\n\nimport { createDownload, getParameterError, shouldBeObject } from '../../../utils'\nimport { MethodHandler } from '../../../utils/handler'\n\nexport const saveImageToPhotosAlbum: typeof Taro.saveImageToPhotosAlbum = (options) => {\n const methodName = 'saveImageToPhotosAlbum'\n // options must be an Object\n const isObject = shouldBeObject(options)\n if (!isObject.flag) {\n const res = { errMsg: `${methodName}:fail ${isObject.msg}` }\n console.error(res.errMsg)\n return Promise.reject(res)\n }\n\n const {\n filePath,\n success,\n fail,\n complete,\n } = options\n const handle = new MethodHandler({ name: methodName, success, fail, complete })\n if (typeof filePath !== 'string') {\n return handle.fail({\n errMsg: getParameterError({\n para: 'filePath',\n correct: 'String',\n wrong: filePath\n })\n })\n }\n\n createDownload(filePath)\n return handle.success()\n}\n"],"names":[],"mappings":";;;;AAKa,MAAA,sBAAsB,GAAuC,CAAC,OAAO,KAAI;IACpF,MAAM,UAAU,GAAG,wBAAwB,CAAA;;AAE3C,IAAA,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAA;AACxC,IAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;AAClB,QAAA,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,CAAA,EAAG,UAAU,CAAA,MAAA,EAAS,QAAQ,CAAC,GAAG,CAAA,CAAE,EAAE,CAAA;AAC5D,QAAA,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACzB,QAAA,OAAO,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;AAC3B,KAAA;IAED,MAAM,EACJ,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,QAAQ,GACT,GAAG,OAAO,CAAA;AACX,IAAA,MAAM,MAAM,GAAG,IAAI,aAAa,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;AAC/E,IAAA,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,OAAO,MAAM,CAAC,IAAI,CAAC;YACjB,MAAM,EAAE,iBAAiB,CAAC;AACxB,gBAAA,IAAI,EAAE,UAAU;AAChB,gBAAA,OAAO,EAAE,QAAQ;AACjB,gBAAA,KAAK,EAAE,QAAQ;aAChB,CAAC;AACH,SAAA,CAAC,CAAA;AACH,KAAA;IAED,cAAc,CAAC,QAAQ,CAAC,CAAA;AACxB,IAAA,OAAO,MAAM,CAAC,OAAO,EAAE,CAAA;AACzB;;;;"}
@@ -1,12 +1,12 @@
1
1
  export { createAudioContext, createInnerAudioContext, createMediaAudioPlayer, createWebAudioContext, getAvailableAudioSources, pauseVoice, playVoice, setInnerAudioOption, stopVoice } from './audio/index.js';
2
2
  export { getBackgroundAudioManager, getBackgroundAudioPlayerState, onBackgroundAudioPause, onBackgroundAudioPlay, onBackgroundAudioStop, pauseBackgroundAudio, playBackgroundAudio, seekBackgroundAudio, stopBackgroundAudio } from './background-audio/index.js';
3
3
  export { createCameraContext } from './camera.js';
4
- export { chooseMessageFile, compressImage, previewMedia, saveImageToPhotosAlbum } from './image/index.js';
4
+ export { chooseMessageFile, compressImage, cropImage, editImage, previewMedia } from './image/index.js';
5
5
  export { createLivePlayerContext, createLivePusherContext } from './live.js';
6
6
  export { createMapContext } from './map.js';
7
7
  export { createMediaRecorder } from './media-recorder.js';
8
8
  export { getRecorderManager, startRecord, stopRecord } from './recorder.js';
9
- export { chooseMedia, chooseVideo, compressVideo, createVideoContext, getVideoInfo, openVideoEditor, saveVideoToPhotosAlbum } from './video/index.js';
9
+ export { compressVideo, createVideoContext, openVideoEditor } from './video/index.js';
10
10
  export { createVideoDecoder } from './video-decoder.js';
11
11
  export { createMediaContainer } from './video-processing.js';
12
12
  export { exitVoIPChat, joinVoIPChat, offVoIPChatInterrupted, offVoIPChatMembersChanged, offVoIPChatStateChanged, offVoIPVideoMembersChanged, onVoIPChatInterrupted, onVoIPChatMembersChanged, onVoIPChatSpeakersChanged, onVoIPChatStateChanged, onVoIPVideoMembersChanged, setEnable1v1Chat, subscribeVoIPVideoMembers, updateVoIPChatMuteConfig } from './voip.js';
@@ -1,8 +1,8 @@
1
1
  import { temporarilyNotSupport } from '../../utils/index.js';
2
2
 
3
3
  // 实时音视频
4
- const createLivePusherContext = temporarilyNotSupport('createLivePusherContext');
5
- const createLivePlayerContext = temporarilyNotSupport('createLivePlayerContext');
4
+ const createLivePusherContext = /* @__PURE__ */ temporarilyNotSupport('createLivePusherContext');
5
+ const createLivePlayerContext = /* @__PURE__ */ temporarilyNotSupport('createLivePlayerContext');
6
6
 
7
7
  export { createLivePlayerContext, createLivePusherContext };
8
8
  //# sourceMappingURL=live.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"live.js","sources":["../../../src/api/media/live.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 实时音视频\nexport const createLivePusherContext = temporarilyNotSupport('createLivePusherContext')\nexport const createLivePlayerContext = temporarilyNotSupport('createLivePlayerContext')\n"],"names":[],"mappings":";;AAEA;MACa,uBAAuB,GAAG,qBAAqB,CAAC,yBAAyB,EAAC;MAC1E,uBAAuB,GAAG,qBAAqB,CAAC,yBAAyB;;;;"}
1
+ {"version":3,"file":"live.js","sources":["../../../src/api/media/live.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 实时音视频\nexport const createLivePusherContext = /* @__PURE__ */ temporarilyNotSupport('createLivePusherContext')\nexport const createLivePlayerContext = /* @__PURE__ */ temporarilyNotSupport('createLivePlayerContext')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,uBAAuB,mBAAmB,qBAAqB,CAAC,yBAAyB,EAAC;AAC1F,MAAA,uBAAuB,mBAAmB,qBAAqB,CAAC,yBAAyB;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { temporarilyNotSupport } from '../../utils/index.js';
2
2
 
3
3
  // 地图
4
- const createMapContext = temporarilyNotSupport('createMapContext');
4
+ const createMapContext = /* @__PURE__ */ temporarilyNotSupport('createMapContext');
5
5
 
6
6
  export { createMapContext };
7
7
  //# sourceMappingURL=map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"map.js","sources":["../../../src/api/media/map.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 地图\nexport const createMapContext = temporarilyNotSupport('createMapContext')\n"],"names":[],"mappings":";;AAEA;MACa,gBAAgB,GAAG,qBAAqB,CAAC,kBAAkB;;;;"}
1
+ {"version":3,"file":"map.js","sources":["../../../src/api/media/map.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 地图\nexport const createMapContext = /* @__PURE__ */ temporarilyNotSupport('createMapContext')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,gBAAgB,mBAAmB,qBAAqB,CAAC,kBAAkB;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { temporarilyNotSupport } from '../../utils/index.js';
2
2
 
3
3
  // 画面录制器
4
- const createMediaRecorder = temporarilyNotSupport('createMediaRecorder');
4
+ const createMediaRecorder = /* @__PURE__ */ temporarilyNotSupport('createMediaRecorder');
5
5
 
6
6
  export { createMediaRecorder };
7
7
  //# sourceMappingURL=media-recorder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"media-recorder.js","sources":["../../../src/api/media/media-recorder.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 画面录制器\nexport const createMediaRecorder = temporarilyNotSupport('createMediaRecorder')\n"],"names":[],"mappings":";;AAEA;MACa,mBAAmB,GAAG,qBAAqB,CAAC,qBAAqB;;;;"}
1
+ {"version":3,"file":"media-recorder.js","sources":["../../../src/api/media/media-recorder.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 画面录制器\nexport const createMediaRecorder = /* @__PURE__ */ temporarilyNotSupport('createMediaRecorder')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,mBAAmB,mBAAmB,qBAAqB,CAAC,qBAAqB;;;;"}
@@ -1,9 +1,9 @@
1
1
  import { temporarilyNotSupport } from '../../utils/index.js';
2
2
 
3
3
  // 录音
4
- const stopRecord = temporarilyNotSupport('stopRecord');
5
- const startRecord = temporarilyNotSupport('startRecord');
6
- const getRecorderManager = temporarilyNotSupport('getRecorderManager');
4
+ const stopRecord = /* @__PURE__ */ temporarilyNotSupport('stopRecord');
5
+ const startRecord = /* @__PURE__ */ temporarilyNotSupport('startRecord');
6
+ const getRecorderManager = /* @__PURE__ */ temporarilyNotSupport('getRecorderManager');
7
7
 
8
8
  export { getRecorderManager, startRecord, stopRecord };
9
9
  //# sourceMappingURL=recorder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recorder.js","sources":["../../../src/api/media/recorder.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 录音\nexport const stopRecord = temporarilyNotSupport('stopRecord')\nexport const startRecord = temporarilyNotSupport('startRecord')\nexport const getRecorderManager = temporarilyNotSupport('getRecorderManager')\n"],"names":[],"mappings":";;AAEA;MACa,UAAU,GAAG,qBAAqB,CAAC,YAAY,EAAC;MAChD,WAAW,GAAG,qBAAqB,CAAC,aAAa,EAAC;MAClD,kBAAkB,GAAG,qBAAqB,CAAC,oBAAoB;;;;"}
1
+ {"version":3,"file":"recorder.js","sources":["../../../src/api/media/recorder.ts"],"sourcesContent":["import { temporarilyNotSupport } from '../../utils'\n\n// 录音\nexport const stopRecord = /* @__PURE__ */ temporarilyNotSupport('stopRecord')\nexport const startRecord = /* @__PURE__ */ temporarilyNotSupport('startRecord')\nexport const getRecorderManager = /* @__PURE__ */ temporarilyNotSupport('getRecorderManager')\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,UAAU,mBAAmB,qBAAqB,CAAC,YAAY,EAAC;AAChE,MAAA,WAAW,mBAAmB,qBAAqB,CAAC,aAAa,EAAC;AAClE,MAAA,kBAAkB,mBAAmB,qBAAqB,CAAC,oBAAoB;;;;"}
@@ -0,0 +1,6 @@
1
+ import Taro from '@tarojs/api';
2
+ /**
3
+ * 拍摄或从手机相册中选择图片或视频。
4
+ */
5
+ declare const chooseMedia: (options: Taro.chooseMedia.Option, methodName?: string) => Promise<Taro.chooseMedia.SuccessCallbackResult>;
6
+ export { chooseMedia };