@dcloudio/uni-app-x 0.7.25 → 0.7.27

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 (338) hide show
  1. package/.prettierrc +5 -5
  2. package/README.md +1 -1
  3. package/index.d.ts +1 -1
  4. package/options.d.ts +9 -9
  5. package/package.json +27 -27
  6. package/types/app.d.ts +1002 -1002
  7. package/types/index.d.ts +7 -7
  8. package/types/native/AsyncApiResult.d.ts +7 -7
  9. package/types/native/CSSStyleDeclaration.d.ts +25 -25
  10. package/types/native/CanvasRenderingContext2D.d.ts +3635 -3634
  11. package/types/native/DOMRect.d.ts +56 -56
  12. package/types/native/DrawableContext.d.ts +162 -162
  13. package/types/native/INavigationBar.d.ts +22 -22
  14. package/types/native/IUniElement.d.ts +2928 -2928
  15. package/types/native/IUniError.d.ts +20 -20
  16. package/types/native/IUniForm.d.ts +9 -9
  17. package/types/native/IUniNativeViewElement.d.ts +124 -124
  18. package/types/native/NativeLoadFontFaceOptions.d.ts +11 -11
  19. package/types/native/NodeData.d.ts +22 -22
  20. package/types/native/PageNode.d.ts +6 -6
  21. package/types/native/Path2D.d.ts +269 -269
  22. package/types/native/SnapshotOptions.d.ts +63 -63
  23. package/types/native/SourceError.d.ts +46 -46
  24. package/types/native/UTSAndroidHookProxy.d.ts +14 -14
  25. package/types/native/UniAggregateError.d.ts +19 -19
  26. package/types/native/UniCallbackWrapper.d.ts +7 -7
  27. package/types/native/UniCanvasElement.d.ts +9 -9
  28. package/types/native/UniCustomEvent.d.ts +24 -24
  29. package/types/native/UniDocument.d.ts +83 -83
  30. package/types/native/UniElement.d.ts +79 -79
  31. package/types/native/UniError.d.ts +70 -70
  32. package/types/native/UniEvent.d.ts +92 -92
  33. package/types/native/UniFormControl.d.ts +8 -8
  34. package/types/native/UniFormControlElement.d.ts +14 -14
  35. package/types/native/UniImageErrorEvent.d.ts +33 -33
  36. package/types/native/UniImageLoadEvent.d.ts +37 -37
  37. package/types/native/UniInputBlurEvent.d.ts +36 -36
  38. package/types/native/UniInputConfirmEvent.d.ts +30 -30
  39. package/types/native/UniInputEvent.d.ts +38 -38
  40. package/types/native/UniInputFocusEvent.d.ts +53 -53
  41. package/types/native/{UniApp.d.ts → UniNativeApp.d.ts} +205 -205
  42. package/types/native/UniNativePage.d.ts +270 -270
  43. package/types/native/UniNestedPreScrollEvent.d.ts +45 -45
  44. package/types/native/UniPageEvent.d.ts +10 -10
  45. package/types/native/UniPageManager.d.ts +27 -27
  46. package/types/native/UniPageScrollEvent.d.ts +13 -13
  47. package/types/native/UniPointerEvent.d.ts +74 -74
  48. package/types/native/UniProvider.d.ts +32 -32
  49. package/types/native/UniRefresherEvent.d.ts +18 -18
  50. package/types/native/UniResizeEvent.d.ts +34 -34
  51. package/types/native/UniResizeObserver.d.ts +184 -184
  52. package/types/native/UniRichTextItemClickEvent.d.ts +41 -41
  53. package/types/native/UniScrollEvent.d.ts +42 -42
  54. package/types/native/UniScrollToLowerEvent.d.ts +23 -23
  55. package/types/native/UniScrollToUpperEvent.d.ts +23 -23
  56. package/types/native/UniStartNestedScrollEvent.d.ts +33 -33
  57. package/types/native/UniStopNestedScrollEvent.d.ts +28 -28
  58. package/types/native/UniSwiperAnimationFinishEvent.d.ts +44 -44
  59. package/types/native/UniSwiperChangeEvent.d.ts +44 -44
  60. package/types/native/UniSwiperTransitionEvent.d.ts +24 -24
  61. package/types/native/UniTabTapEvent.d.ts +18 -18
  62. package/types/native/UniTabsElement.d.ts +59 -59
  63. package/types/native/UniTextElement.d.ts +34 -34
  64. package/types/native/UniTextareaFocusEvent.d.ts +54 -54
  65. package/types/native/UniTouchEvent.d.ts +64 -64
  66. package/types/native/UniVideoElement.d.ts +83 -83
  67. package/types/native/UniWebViewDownloadEvent.d.ts +52 -52
  68. package/types/native/UniWebViewElement.d.ts +10 -10
  69. package/types/native/UniWebViewErrorEvent.d.ts +59 -59
  70. package/types/native/UniWebViewLoadEvent.d.ts +41 -41
  71. package/types/native/UniWebViewLoadingEvent.d.ts +41 -41
  72. package/types/native/UniWebViewMessageEvent.d.ts +36 -36
  73. package/types/native/UniWebViewServiceMessageEvent.d.ts +8 -8
  74. package/types/native/ViewToTempFilePathOptions.d.ts +47 -47
  75. package/types/native/WebViewStyles.d.ts +20 -20
  76. package/types/native/global.d.ts +616 -616
  77. package/types/native/index.d.ts +71 -71
  78. package/types/native-global/index.d.ts +1 -1
  79. package/types/page.d.ts +1872 -1682
  80. package/types/process.d.ts +5 -5
  81. package/types/uni/base/index.d.ts +3 -3
  82. package/types/uni/env/index.d.ts +103 -103
  83. package/types/uni/global.d.ts +6 -6
  84. package/types/uni/index.d.ts +4 -4
  85. package/types/uni/uts-plugin-api/global.d.ts +60 -58
  86. package/types/uni/uts-plugin-api/index.d.ts +60 -58
  87. package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/global.d.ts +26 -26
  88. package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/index.d.ts +12 -12
  89. package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/interface.d.ts +231 -231
  90. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/global.d.ts +10 -10
  91. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/index.d.ts +4 -4
  92. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +77 -77
  93. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/global.d.ts +60 -60
  94. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/index.d.ts +29 -29
  95. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/interface.d.ts +171 -171
  96. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/global.d.ts +10 -10
  97. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/index.d.ts +4 -4
  98. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +77 -77
  99. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/global.d.ts +22 -22
  100. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/index.d.ts +10 -10
  101. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/interface.d.ts +332 -332
  102. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/global.d.ts +40 -40
  103. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/index.d.ts +19 -19
  104. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +203 -203
  105. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/global.d.ts +12 -12
  106. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/index.d.ts +5 -5
  107. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +1733 -1733
  108. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/global.d.ts +20 -20
  109. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/index.d.ts +9 -9
  110. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +152 -152
  111. package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/global.d.ts +18 -18
  112. package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/index.d.ts +8 -8
  113. package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/interface.d.ts +61 -61
  114. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/global.d.ts +20 -20
  115. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/index.d.ts +9 -9
  116. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +464 -464
  117. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/global.d.ts +12 -12
  118. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/index.d.ts +5 -5
  119. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +137 -137
  120. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/global.d.ts +30 -28
  121. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/index.d.ts +14 -13
  122. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +1348 -1366
  123. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/global.d.ts +18 -16
  124. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/index.d.ts +8 -7
  125. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +312 -305
  126. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/global.d.ts +26 -26
  127. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/index.d.ts +12 -12
  128. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +97 -97
  129. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/global.d.ts +80 -80
  130. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/index.d.ts +39 -39
  131. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/interface.d.ts +174 -174
  132. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/global.d.ts +150 -142
  133. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/index.d.ts +74 -70
  134. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +1992 -1881
  135. package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/global.d.ts +10 -10
  136. package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +4 -4
  137. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/global.d.ts +12 -12
  138. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +5 -5
  139. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +455 -455
  140. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/global.d.ts +14 -14
  141. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/index.d.ts +6 -6
  142. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +818 -818
  143. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +12 -12
  144. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +5 -5
  145. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +297 -297
  146. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/global.d.ts +14 -14
  147. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/index.d.ts +6 -6
  148. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +657 -657
  149. package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/global.d.ts +10 -10
  150. package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/index.d.ts +4 -4
  151. package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/interface.d.ts +81 -81
  152. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/global.d.ts +12 -12
  153. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/index.d.ts +5 -5
  154. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +155 -155
  155. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/global.d.ts +12 -12
  156. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/index.d.ts +5 -5
  157. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +159 -159
  158. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/global.d.ts +24 -24
  159. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/index.d.ts +11 -11
  160. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/interface.d.ts +1008 -1008
  161. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/global.d.ts +8 -8
  162. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/index.d.ts +4 -4
  163. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/interface.d.ts +1 -1
  164. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/global.d.ts +8 -8
  165. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/index.d.ts +4 -4
  166. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/global.d.ts +32 -32
  167. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/index.d.ts +15 -15
  168. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/global.d.ts +22 -22
  169. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/index.d.ts +10 -10
  170. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +163 -163
  171. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/global.d.ts +36 -36
  172. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/index.d.ts +17 -17
  173. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/interface.d.ts +634 -521
  174. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/global.d.ts +16 -16
  175. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/index.d.ts +7 -7
  176. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/interface.d.ts +980 -980
  177. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/global.d.ts +30 -30
  178. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/index.d.ts +14 -14
  179. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +2139 -2138
  180. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/global.d.ts +12 -12
  181. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/index.d.ts +5 -5
  182. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +207 -207
  183. package/types/uni/uts-plugin-api/lib/uni-installApk/utssdk/global.d.ts +24 -24
  184. package/types/uni/uts-plugin-api/lib/uni-installApk/utssdk/index.d.ts +11 -11
  185. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/global.d.ts +16 -16
  186. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/index.d.ts +7 -7
  187. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +169 -169
  188. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/global.d.ts +22 -22
  189. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/index.d.ts +10 -10
  190. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +60 -60
  191. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/global.d.ts +26 -26
  192. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/index.d.ts +12 -12
  193. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +581 -581
  194. package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/global.d.ts +24 -24
  195. package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/index.d.ts +11 -11
  196. package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/interface.d.ts +100 -100
  197. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/global.d.ts +196 -160
  198. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +97 -79
  199. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +1657 -1386
  200. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/global.d.ts +68 -68
  201. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/index.d.ts +33 -33
  202. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +1002 -1002
  203. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/global.d.ts +72 -72
  204. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/index.d.ts +35 -35
  205. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +1539 -1539
  206. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/global.d.ts +66 -0
  207. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/index.d.ts +32 -0
  208. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +1592 -0
  209. package/types/uni/uts-plugin-api/lib/uni-oauth-huawei/utssdk/global.d.ts +8 -0
  210. package/types/uni/uts-plugin-api/lib/uni-oauth-huawei/utssdk/index.d.ts +4 -0
  211. package/types/uni/uts-plugin-api/lib/uni-oauth-huawei/utssdk/interface.d.ts +1 -0
  212. package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/global.d.ts +24 -24
  213. package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +11 -11
  214. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/global.d.ts +24 -24
  215. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/index.d.ts +11 -11
  216. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +70 -70
  217. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/global.d.ts +26 -26
  218. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/index.d.ts +12 -12
  219. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +153 -153
  220. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/global.d.ts +32 -32
  221. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/index.d.ts +15 -15
  222. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +527 -527
  223. package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/global.d.ts +8 -8
  224. package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/index.d.ts +4 -4
  225. package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/global.d.ts +8 -8
  226. package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/index.d.ts +4 -4
  227. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/global.d.ts +78 -78
  228. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/index.d.ts +38 -38
  229. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/global.d.ts +28 -28
  230. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/index.d.ts +13 -13
  231. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +189 -189
  232. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/global.d.ts +58 -58
  233. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/index.d.ts +28 -28
  234. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +2695 -2695
  235. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/global.d.ts +10 -10
  236. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/index.d.ts +4 -4
  237. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +38 -38
  238. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/global.d.ts +24 -24
  239. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/index.d.ts +11 -11
  240. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +73 -73
  241. package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/global.d.ts +22 -22
  242. package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/index.d.ts +10 -10
  243. package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/interface.d.ts +120 -120
  244. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/global.d.ts +78 -78
  245. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/index.d.ts +38 -38
  246. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +600 -600
  247. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/global.d.ts +148 -148
  248. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/index.d.ts +73 -73
  249. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +1106 -1106
  250. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/global.d.ts +42 -42
  251. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/index.d.ts +20 -20
  252. package/types/uni/uts-plugin-api/lib/uni-virtualPayment/utssdk/global.d.ts +112 -112
  253. package/types/uni/uts-plugin-api/lib/uni-virtualPayment/utssdk/index.d.ts +55 -55
  254. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/global.d.ts +58 -58
  255. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/index.d.ts +28 -28
  256. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +854 -854
  257. package/types/uni/uts-plugin-biz/global.d.ts +4 -4
  258. package/types/uni/uts-plugin-biz/index.d.ts +4 -4
  259. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/global.d.ts +44 -36
  260. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/index.d.ts +21 -17
  261. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +224 -141
  262. package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/global.d.ts +28 -28
  263. package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/index.d.ts +13 -13
  264. package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/interface.d.ts +160 -160
  265. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/global.d.ts +60 -60
  266. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/index.d.ts +29 -29
  267. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/global.d.ts +46 -46
  268. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/index.d.ts +22 -22
  269. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +207 -207
  270. package/types/uni/uts-plugin-component/global.d.ts +1 -1
  271. package/types/uni/uts-plugin-component/index.d.ts +1 -1
  272. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/global.d.ts +64 -64
  273. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/index.d.ts +31 -31
  274. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +522 -522
  275. package/types/uni/uts-plugin-extend/README.md +3 -3
  276. package/types/uni/uts-plugin-extend/global.d.ts +14 -14
  277. package/types/uni/uts-plugin-extend/index.d.ts +14 -14
  278. package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/global.d.ts +12 -12
  279. package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/index.d.ts +1 -1
  280. package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/interface.d.ts +365 -365
  281. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/global.d.ts +23 -23
  282. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/index.d.ts +10 -10
  283. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/interface.d.ts +710 -710
  284. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/global.d.ts +21 -21
  285. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/index.d.ts +9 -9
  286. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/interface.d.ts +151 -151
  287. package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/global.d.ts +25 -25
  288. package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/index.d.ts +11 -11
  289. package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/interface.d.ts +363 -363
  290. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/global.d.ts +11 -11
  291. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/index.d.ts +4 -4
  292. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +224 -224
  293. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/global.d.ts +53 -53
  294. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/index.d.ts +25 -25
  295. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/interface.d.ts +487 -487
  296. package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/global.d.ts +13 -13
  297. package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/index.d.ts +5 -5
  298. package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/interface.d.ts +126 -126
  299. package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +7 -7
  300. package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +1 -1
  301. package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +296 -296
  302. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/global.d.ts +15 -15
  303. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/index.d.ts +1 -1
  304. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/interface.d.ts +229 -229
  305. package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/global.d.ts +14 -14
  306. package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/index.d.ts +1 -1
  307. package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/interface.d.ts +559 -559
  308. package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/global.d.ts +9 -9
  309. package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/index.d.ts +1 -1
  310. package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/interface.d.ts +163 -163
  311. package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/global.d.ts +21 -21
  312. package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/index.d.ts +9 -9
  313. package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/interface.d.ts +143 -143
  314. package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/global.d.ts +7 -7
  315. package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/index.d.ts +1 -1
  316. package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/interface.d.ts +106 -106
  317. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/global.d.ts +9 -9
  318. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/index.d.ts +1 -1
  319. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/interface.d.ts +165 -165
  320. package/types/uni-cloud/index.d.ts +67 -67
  321. package/types/uni-cloud/interface.d.ts +987 -987
  322. package/types/uni-cloud/unicloud-db/index.ts +317 -317
  323. package/types/uni-global/index.d.ts +1 -1
  324. package/types/vue/CheckboxGroupChangeEvent.d.ts +41 -41
  325. package/types/vue/LifeCycle.d.ts +55 -55
  326. package/types/vue/PickerViewChangeEvent.d.ts +41 -41
  327. package/types/vue/ProgressActiveendEvent.d.ts +32 -32
  328. package/types/vue/RadioGroupChangeEvent.d.ts +41 -41
  329. package/types/vue/SliderChangeEvent.d.ts +35 -35
  330. package/types/vue/SwitchChangeEvent.d.ts +32 -32
  331. package/types/vue/UniCanvasElement.d.ts +275 -275
  332. package/types/vue/UniCloudDBElement.d.ts +217 -217
  333. package/types/vue/UniFormElement.d.ts +54 -54
  334. package/types/vue/UniNavigatorElement.d.ts +11 -11
  335. package/types/vue/global.d.ts +191 -191
  336. package/types/vue/index.d.ts +10 -10
  337. package/types/vue-global/index.d.ts +1 -1
  338. package/uts-plugin.d.ts +27 -27
@@ -1,1386 +1,1657 @@
1
- export type MediaOrientation =
2
- | 'up'
3
- | 'down'
4
- | 'left'
5
- | 'right'
6
- | 'up-mirrored'
7
- | 'down-mirrored'
8
- | 'left-mirrored'
9
- | 'right-mirrored'
10
-
11
- /**
12
- * 错误码
13
- */
14
- export type MediaErrorCode =
15
- /**
16
- * 用户取消
17
- */
18
- 1101001 |
19
- /**
20
- * urls至少包含一张图片地址
21
- */
22
- 1101002 |
23
- /**
24
- * 文件不存在
25
- */
26
- 1101003 |
27
- /**
28
- * 图片加载失败
29
- */
30
- 1101004 |
31
- /**
32
- * 未获取权限
33
- */
34
- 1101005 |
35
- /**
36
- * 图片或视频保存失败
37
- */
38
- 1101006 |
39
- /**
40
- * 图片裁剪失败
41
- */
42
- 1101007 |
43
- /**
44
- * 拍照或录像失败
45
- */
46
- 1101008 |
47
- /**
48
- * 图片压缩失败
49
- */
50
- 1101009 |
51
- /**
52
- * 其他错误
53
- */
54
- 1101010;
55
-
56
- /**
57
- * 图片或视频操作失败的错误回调
58
- */
59
- export interface IMediaError extends IUniError {
60
- errCode : MediaErrorCode
61
- };
62
-
63
-
64
- export type ChooseImageSuccess = {
65
- /**
66
- * 调用API的名称
67
- */
68
- errSubject : string,
69
- /**
70
- * 描述信息
71
- */
72
- errMsg : string,
73
- /**
74
- * 图片的本地文件路径列表
75
- * @type string | string []
76
- */
77
- tempFilePaths : Array<string>,
78
- /**
79
- * 图片的本地文件列表
80
- */
81
- tempFiles : any
82
- }
83
-
84
- export type ChooseImageFail = IMediaError;
85
- export type ChooseImageSuccessCallback = (callback : ChooseImageSuccess) => void
86
- export type ChooseImageFailCallback = (callback : ChooseImageFail) => void
87
- export type ChooseImageCompleteCallback = (callback : any) => void
88
-
89
- export type ChooseImageCropOptions = {
90
- /**
91
- * 裁剪的宽度,单位为px,用于计算裁剪宽高比。
92
- */
93
- width : number;
94
- /**
95
- * 裁剪的高度,单位为px,用于计算裁剪宽高比。
96
- */
97
- height : number;
98
- /**
99
- * 取值范围为1-100,数值越小,质量越低(仅对jpg格式有效)。默认值为80。
100
- * @defaultValue 80
101
- */
102
- quality ?: (number) | null;
103
- /**
104
- * 是否将width和height作为裁剪保存图片真实的像素值。默认值为true。注:设置为false时在裁剪编辑界面显示图片的像素值,设置为true时不显示。
105
- * @type boolean
106
- */
107
- resize ?: (boolean) | null;
108
- }
109
-
110
- export type ChooseImageOptions = {
111
- /**
112
- * 最多可以选择的图片张数,app端不限制,微信小程序最多可支持20个。
113
- * @defaultValue 9
114
- */
115
- count ?: (number) | null,
116
- /**
117
- * original 原图,compressed 压缩图,默认二者都有
118
- * @type string | string []
119
- * @defaultValue ['original','compressed']
120
- * @uniPlatform {
121
- * "app":{
122
- * "harmony": {
123
- * "osVer": "3.0",
124
- * "uniVer": "4.23",
125
- * "unixVer": "x"
126
- * }
127
- * },
128
- * "web": {
129
- * "uniVer": "x",
130
- * "unixVer": "x"
131
- * }
132
- * }
133
- */
134
- sizeType ?: (string[]) | null,
135
- /**
136
- * album 从相册选图,camera 使用相机,默认二者都有
137
- * @defaultValue ['album','camera']
138
- */
139
- sourceType ?: (string[]) | null,
140
- /**
141
- * 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。仅H5支持
142
- * @uniPlatform {
143
- * "app": {
144
- * "android": {
145
- * "osVer": "5.0",
146
- * "uniVer": "",
147
- * "unixVer": "x"
148
- * },
149
- * "harmony": {
150
- * "osVer": "x",
151
- * "uniVer": "x",
152
- * "unixVer": "x"
153
- * }
154
- * },
155
- * "web": {
156
- * "uniVer": "2.9.9",
157
- * "unixVer": "4.0"
158
- * }
159
- * }
160
- */
161
- extension ?: (string[]) | null,
162
- /**
163
- * 图像裁剪参数,设置后 sizeType 失效。
164
- * @uniPlatform {
165
- * "app":{
166
- * "harmony": {
167
- * "osVer": "x",
168
- * "uniVer": "x",
169
- * "unixVer": "x"
170
- * }
171
- * },
172
- * "web": {
173
- * "uniVer": "x",
174
- * "unixVer": "x"
175
- * }
176
- * }
177
- */
178
- crop ?: (ChooseImageCropOptions) | null,
179
- /**
180
- * 成功则返回图片的本地文件路径列表 tempFilePaths
181
- */
182
- success ?: (ChooseImageSuccessCallback) | null,
183
- /**
184
- * 接口调用失败的回调函数
185
- */
186
- fail ?: (ChooseImageFailCallback) | null,
187
- /**
188
- * 接口调用结束的回调函数(调用成功、失败都会执行)
189
- */
190
- complete ?: (ChooseImageCompleteCallback) | null
191
- }
192
-
193
- export type ChooseImage = (options : ChooseImageOptions) => void
194
-
195
- export type PreviewImageSuccess = {
196
- /**
197
- * 调用API的名称
198
- */
199
- errSubject : string,
200
- /**
201
- * 描述信息
202
- */
203
- errMsg : string
204
- }
205
-
206
- export type LongPressActionsSuccessData = {
207
- /**
208
- * 接口调用失败的回调函数
209
- */
210
- tapIndex : number,
211
- /**
212
- * 接口调用结束的回调函数(调用成功、失败都会执行)
213
- */
214
- index : number
215
- };
216
- export type LongPressActionsOptions = {
217
- /**
218
- * 按钮的文字数组
219
- */
220
- itemList : string[],
221
- /**
222
- * 按钮的文字颜色,字符串格式,默认为"#000000"
223
- */
224
- itemColor : string | null,
225
- /**
226
- * 接口调用成功的回调函数
227
- */
228
- success : ((result : LongPressActionsSuccessData) => void) | null,
229
- /**
230
- * 接口调用失败的回调函数
231
- */
232
- fail : ((result : any) => void) | null,
233
- /**
234
- * 接口调用结束的回调函数(调用成功、失败都会执行)
235
- */
236
- complete : ((result : any) => void) | null
237
- };
238
-
239
-
240
- export type PreviewImageFail = IMediaError;
241
- export type PreviewImageSuccessCallback = (callback : PreviewImageSuccess) => void
242
- export type PreviewImageFailCallback = (callback : PreviewImageFail) => void
243
- export type PreviewImageCompleteCallback = ChooseImageCompleteCallback
244
-
245
- export type PreviewImageOptions = {
246
- /**
247
- * current 为当前显示图片的链接/索引值,不填或填写的值无效则为 urls 的第一张。APP平台仅支持索引值。
248
- * @type string | number
249
- */
250
- current ?: any | null,
251
- /**
252
- * 需要预览的图片链接列表
253
- */
254
- urls : Array<string.ImageURIString>,
255
- /**
256
- * 是否显示长按菜单
257
- */
258
- showmenu ?: boolean | null,
259
- /**
260
- * 图片指示器样式
261
- *
262
- * @uniPlatform {
263
- * "app": {
264
- * "harmony": {
265
- * "osVer": "x",
266
- * "uniVer": "x",
267
- * "unixVer": "x"
268
- * }
269
- * }
270
- * }
271
- */
272
- indicator ?:
273
- /**
274
- * 底部圆点指示器
275
- */
276
- 'default' |
277
- /**
278
- * 顶部数字指示器
279
- */
280
- 'number' |
281
- /**
282
- * 不显示指示器
283
- */
284
- 'none' |
285
- null,
286
- /**
287
- * 是否可循环预览
288
- * @type boolean
289
- */
290
- loop ?: boolean | null,
291
- /**
292
- * 长按图片显示操作菜单,如不填默认为保存相册。
293
- * @uniPlatform {
294
- * "app": {
295
- * "android": {
296
- * "osVer": "5.0",
297
- * "uniVer": "√",
298
- * "unixVer": "x"
299
- * },
300
- * "harmony": {
301
- * "osVer": "x",
302
- * "uniVer": "x",
303
- * "unixVer": "x"
304
- * }
305
- * }
306
- * }
307
- */
308
- longPressActions ?: LongPressActionsOptions | null,
309
- /**
310
- * 接口调用成功的回调函数
311
- */
312
- success ?: (PreviewImageSuccessCallback) | null,
313
- /**
314
- * 接口调用失败的回调函数
315
- */
316
- fail ?: (PreviewImageFailCallback) | null,
317
- /**
318
- * 接口调用结束的回调函数(调用成功、失败都会执行)
319
- */
320
- complete ?: (PreviewImageCompleteCallback) | null
321
- };
322
-
323
- export type PreviewImage = (options : PreviewImageOptions) => void;
324
-
325
- export type ClosePreviewImage = (options : ClosePreviewImageOptions) => void;
326
- export type ClosePreviewImageSuccess = {
327
- /**
328
- * 错误信息
329
- */
330
- errMsg : string
331
- };
332
-
333
- export type ClosePreviewImageFail = IMediaError;
334
- export type ClosePreviewImageSuccessCallback = (callback : ClosePreviewImageSuccess) => void
335
- export type ClosePreviewImageFailCallback = (callback : ClosePreviewImageFail) => void
336
- export type ClosePreviewImageCompleteCallback = ChooseImageCompleteCallback
337
-
338
- export type ClosePreviewImageOptions = {
339
- /**
340
- * 接口调用成功的回调函数
341
- */
342
- success ?: (ClosePreviewImageSuccessCallback) | null,
343
- /**
344
- * 接口调用失败的回调函数
345
- */
346
- fail ?: (ClosePreviewImageFailCallback) | null,
347
- /**
348
- * 接口调用结束的回调函数(调用成功、失败都会执行)
349
- */
350
- complete ?: (ClosePreviewImageCompleteCallback) | null
351
- };
352
-
353
- export type GetImageInfo = (options : GetImageInfoOptions) => void;
354
- export type GetImageInfoSuccess = {
355
- /**
356
- * 图片宽度,单位px
357
- */
358
- width : number,
359
- /**
360
- * 图片高度,单位px
361
- */
362
- height : number,
363
- /**
364
- * 返回图片的本地路径
365
- */
366
- path : string,
367
- /**
368
- * 返回图片的方向
369
- * @uniPlatform {
370
- * "web": {
371
- * "uniVer": "x",
372
- * "unixVer": "x"
373
- * }
374
- * }
375
- */
376
- orientation ?: MediaOrientation,
377
- /**
378
- * 返回图片的格式
379
- * @uniPlatform {
380
- * "web": {
381
- * "uniVer": "x",
382
- * "unixVer": "x"
383
- * }
384
- * }
385
- */
386
- type : string | null
387
- };
388
-
389
- export type GetImageInfoFail = IMediaError;
390
- export type GetImageInfoSuccessCallback = (callback : GetImageInfoSuccess) => void
391
- export type GetImageInfoFailCallback = (callback : GetImageInfoFail) => void
392
- export type GetImageInfoCompleteCallback = ChooseImageCompleteCallback
393
-
394
- export type GetImageInfoOptions = {
395
- /**
396
- * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径
397
- */
398
- src : string.ImageURIString,
399
- /**
400
- * 接口调用成功的回调函数
401
- */
402
- success ?: (GetImageInfoSuccessCallback) | null,
403
- /**
404
- * 接口调用失败的回调函数
405
- */
406
- fail ?: (GetImageInfoFailCallback) | null,
407
- /**
408
- * 接口调用结束的回调函数(调用成功、失败都会执行)
409
- */
410
- complete ?: (GetImageInfoCompleteCallback) | null
411
- };
412
-
413
- export type SaveImageToPhotosAlbum = (options : SaveImageToPhotosAlbumOptions) => void;
414
-
415
- export type SaveImageToPhotosAlbumSuccess = {
416
- /**
417
- * 保存到相册的图片路径
418
- */
419
- path : string
420
- };
421
-
422
- export type SaveImageToPhotosAlbumFail = IMediaError;
423
- export type SaveImageToPhotosAlbumSuccessCallback = (callback : SaveImageToPhotosAlbumSuccess) => void
424
- export type SaveImageToPhotosAlbumFailCallback = (callback : SaveImageToPhotosAlbumFail) => void
425
- export type SaveImageToPhotosAlbumCompleteCallback = ChooseImageCompleteCallback
426
-
427
- export type SaveImageToPhotosAlbumOptions = {
428
- /**
429
- * 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径
430
- */
431
- filePath : string.ImageURIString,
432
- /**
433
- * 接口调用成功的回调函数
434
- */
435
- success ?: (SaveImageToPhotosAlbumSuccessCallback) | null,
436
- /**
437
- * 接口调用失败的回调函数
438
- */
439
- fail ?: (SaveImageToPhotosAlbumFailCallback) | null,
440
- /**
441
- * 接口调用结束的回调函数(调用成功、失败都会执行)
442
- */
443
- complete ?: (SaveImageToPhotosAlbumCompleteCallback) | null
444
- };
445
- export type CompressImage = (options : CompressImageOptions) => void;
446
- export type CompressImageSuccess = {
447
- /**
448
- * 压缩后图片的临时文件路径
449
- */
450
- tempFilePath : string
451
- };
452
-
453
- export type CompressImageFail = IMediaError;
454
- export type CompressImageSuccessCallback = (callback : CompressImageSuccess) => void
455
- export type CompressImageFailCallback = (callback : CompressImageFail) => void
456
- export type CompressImageCompleteCallback = ChooseImageCompleteCallback
457
-
458
- export type CompressImageOptions = {
459
- /**
460
- * 图片路径,图片的路径,可以是相对路径、临时文件路径、存储文件路径
461
- */
462
- src : string.ImageURIString,
463
- /**
464
- * 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)
465
- */
466
- quality ?: number | null,
467
- /**
468
- * 旋转度数,范围0~360
469
- */
470
- rotate ?: number | null,
471
- /**
472
- * 缩放图片的宽度
473
- * @deprecated 已废弃
474
- */
475
- width ?: string | null,
476
- /**
477
- * 缩放图片的高度
478
- * @deprecated 已废弃
479
- */
480
- height ?: string | null,
481
- /**
482
- * 压缩后图片的高度,单位为px,若不填写则默认以compressedWidth为准等比缩放
483
- */
484
- compressedHeight ?: number | null,
485
- /**
486
- * 压缩后图片的宽度,单位为px,若不填写则默认以compressedHeight为准等比缩放。
487
- */
488
- compressedWidth ?: number | null,
489
- /**
490
- * 接口调用成功的回调函数
491
- */
492
- success ?: (CompressImageSuccessCallback) | null,
493
- /**
494
- * 接口调用失败的回调函数
495
- */
496
- fail ?: (CompressImageFailCallback) | null,
497
- /**
498
- * 接口调用结束的回调函数(调用成功、失败都会执行)
499
- */
500
- complete ?: (CompressImageCompleteCallback) | null
501
- };
502
-
503
- export type ChooseVideoSuccess = {
504
- /**
505
- * 选定视频的临时文件路径
506
- */
507
- tempFilePath : string,
508
- /**
509
- * 选定的视频文件,仅H5支持
510
- */
511
- // tempFile: File|null,
512
- /**
513
- * 选定视频的时间长度
514
- */
515
- duration : number,
516
- /**
517
- * 选定视频的数据量大小
518
- */
519
- size : number,
520
- /**
521
- * 返回选定视频的长
522
- */
523
- height : number,
524
- /**
525
- * 返回选定视频的宽
526
- */
527
- width : number,
528
- /**
529
- * 包含扩展名的文件名称(仅H5支持)
530
- */
531
- // name: string | null
532
- };
533
-
534
- export type ChooseVideoFail = IMediaError;
535
- export type ChooseVideoSuccessCallback = (callback : ChooseVideoSuccess) => void
536
- export type ChooseVideoFailCallback = (callback : ChooseVideoFail) => void
537
- export type ChooseVideoCompleteCallback = ChooseImageCompleteCallback
538
-
539
- export type ChooseVideoOptions = {
540
- /**
541
- * album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera']
542
- */
543
- sourceType ?: (string[]) | null,
544
- /**
545
- * 是否压缩所选的视频源文件,默认值为true,需要压缩
546
- * @type boolean
547
- * @default true
548
- * @uniPlatform {
549
- * "app": {
550
- * "harmony": {
551
- * "osVer": "x",
552
- * "uniVer": "x",
553
- * "unixVer": "x"
554
- * }
555
- * },
556
- * "web": {
557
- * "uniVer": "x",
558
- * "unixVer": "x"
559
- * }
560
- * }
561
- */
562
- compressed ?: boolean | null,
563
- /**
564
- * 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒
565
- * @uniPlatform {
566
- * "app": {
567
- * "harmony": {
568
- * "osVer": "x",
569
- * "uniVer": "x",
570
- * "unixVer": "x"
571
- * }
572
- * },
573
- * "web": {
574
- * "uniVer": "x",
575
- * "unixVer": "x"
576
- * }
577
- * }
578
- */
579
- maxDuration ?: number | null,
580
- /**
581
- * 摄像切换
582
- *
583
- * @uniPlatform {
584
- * "app": {
585
- * "harmony": {
586
- * "osVer": "x",
587
- * "uniVer": "x",
588
- * "unixVer": "x"
589
- * }
590
- * },
591
- * "web": {
592
- * "uniVer": "x",
593
- * "unixVer": "x"
594
- * }
595
- * }
596
- */
597
- camera ?:
598
- /**
599
- * 前置摄像头
600
- */
601
- 'front' |
602
- /**
603
- * 后置摄像头
604
- */
605
- 'back' | null,
606
- /**
607
- * 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。
608
- * @uniPlatform {
609
- * "app": {
610
- * "android": {
611
- * "osVer": "5.0",
612
- * "uniVer": "√",
613
- * "unixVer": "x"
614
- * },
615
- * "harmony": {
616
- * "osVer": "x",
617
- * "uniVer": "x",
618
- * "unixVer": "x"
619
- * }
620
- * }
621
- * }
622
- */
623
- extension ?: (string[]) | null,
624
- /**
625
- * 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明
626
- */
627
- success ?: (ChooseVideoSuccessCallback) | null,
628
- /**
629
- * 接口调用失败的回调函数
630
- */
631
- fail ?: (ChooseVideoFailCallback) | null,
632
- /**
633
- * 接口调用结束的回调函数(调用成功、失败都会执行)
634
- */
635
- complete ?: (ChooseVideoCompleteCallback) | null
636
- };
637
-
638
- export type ChooseVideo = (options : ChooseVideoOptions) => void;
639
-
640
- export type GetVideoInfoSuccess = {
641
- /**
642
- * 画面方向
643
- * @uniPlatform {
644
- * "app": {
645
- * "harmony": {
646
- * "osVer": "3.0",
647
- * "uniVer": "4.23",
648
- * "unixVer": "x"
649
- * }
650
- * },
651
- * "web": {
652
- * "uniVer": "x",
653
- * "unixVer": "x"
654
- * }
655
- * }
656
- */
657
- orientation ?: MediaOrientation,
658
- /**
659
- * 视频格式
660
- * @uniPlatform {
661
- * "app": {
662
- * "harmony": {
663
- * "osVer": "3.0",
664
- * "uniVer": "4.23",
665
- * "unixVer": "x"
666
- * }
667
- * },
668
- * "web": {
669
- * "uniVer": "x",
670
- * "unixVer": "x"
671
- * }
672
- * }
673
- */
674
- type : string | null,
675
- /**
676
- * 视频长度
677
- */
678
- duration : number,
679
- /**
680
- * 视频大小,单位 kB
681
- */
682
- size : number,
683
- /**
684
- * 视频的长,单位 px
685
- */
686
- height : number,
687
- /**
688
- * 视频的宽,单位 px
689
- */
690
- width : number,
691
- /**
692
- * 视频帧率
693
- * @uniPlatform {
694
- * "app": {
695
- * "harmony": {
696
- * "osVer": "x",
697
- * "uniVer": "x",
698
- * "unixVer": "x"
699
- * }
700
- * },
701
- * "web": {
702
- * "uniVer": "x",
703
- * "unixVer": "x"
704
- * }
705
- * }
706
- */
707
- fps : number | null,
708
- /**
709
- * 视频码率,单位 kbps
710
- * @uniPlatform {
711
- * "app": {
712
- * "harmony": {
713
- * "osVer": "x",
714
- * "uniVer": "x",
715
- * "unixVer": "x"
716
- * }
717
- * },
718
- * "web": {
719
- * "uniVer": "x",
720
- * "unixVer": "x"
721
- * }
722
- * }
723
- */
724
- bitrate : number | null
725
- };
726
-
727
- export type GetVideoInfoFail = IMediaError;
728
- export type GetVideoInfoSuccessCallback = (callback : GetVideoInfoSuccess) => void
729
- export type GetVideoInfoFailCallback = (callback : GetVideoInfoFail) => void
730
- export type GetVideoInfoCompleteCallback = ChooseImageCompleteCallback
731
-
732
- export type GetVideoInfoOptions = {
733
- /**
734
- * 视频文件路径,可以是临时文件路径也可以是永久文件路径
735
- */
736
- src : string.VideoURIString,
737
- /**
738
- * 接口调用成功的回调函数
739
- */
740
- success ?: (GetVideoInfoSuccessCallback) | null,
741
- /**
742
- * 接口调用失败的回调函数
743
- */
744
- fail ?: (GetVideoInfoFailCallback) | null,
745
- /**
746
- * 接口调用结束的回调函数(调用成功、失败都会执行)
747
- */
748
- complete ?: (GetVideoInfoCompleteCallback) | null
749
- };
750
-
751
- export type GetVideoInfo = (options : GetVideoInfoOptions) => void;
752
-
753
- export type SaveVideoToPhotosAlbumSuccess = {};
754
-
755
- export type SaveVideoToPhotosAlbumFail = IMediaError;
756
- export type SaveVideoToPhotosAlbumSuccessCallback = (callback : SaveVideoToPhotosAlbumSuccess) => void
757
- export type SaveVideoToPhotosAlbumFailCallback = (callback : SaveVideoToPhotosAlbumFail) => void
758
- export type SaveVideoToPhotosAlbumCompleteCallback = ChooseImageCompleteCallback
759
-
760
- export type SaveVideoToPhotosAlbumOptions = {
761
- /**
762
- * 视频文件路径,可以是临时文件路径也可以是永久文件路径
763
- */
764
- filePath : string.VideoURIString,
765
- /**
766
- * 接口调用成功的回调函数
767
- */
768
- success ?: (SaveVideoToPhotosAlbumSuccessCallback) | null,
769
- /**
770
- * 接口调用失败的回调函数
771
- */
772
- fail ?: (SaveVideoToPhotosAlbumFailCallback) | null,
773
- /**
774
- * 接口调用结束的回调函数(调用成功、失败都会执行)
775
- */
776
- complete ?: (SaveVideoToPhotosAlbumCompleteCallback) | null
777
- };
778
-
779
- export type SaveVideoToPhotosAlbum = (options : SaveVideoToPhotosAlbumOptions) => void;
780
-
781
- export type CompressVideoSuccess = {
782
- /**
783
- * 压缩后的临时文件地址
784
- */
785
- tempFilePath : string,
786
- /**
787
- * 压缩后的大小,单位 kB
788
- */
789
- size : number
790
- };
791
-
792
- export type CompressVideoFail = IMediaError;
793
- export type CompressVideoSuccessCallback = (callback : CompressVideoSuccess) => void
794
- export type CompressVideoFailCallback = (callback : CompressVideoFail) => void
795
- export type CompressVideoCompleteCallback = ChooseImageCompleteCallback
796
-
797
- export type CompressVideoOptions = {
798
- /**
799
- * 视频文件路径,可以是临时文件路径也可以是永久文件路径
800
- */
801
- src : string.VideoURIString,
802
- /**
803
- * 压缩质量
804
- *
805
- * @type 'low' | 'medium' | 'high'
806
- */
807
- quality ?: string | null,
808
- /**
809
- * 码率,单位 kbps
810
- * @uniPlatform {
811
- * "app": {
812
- * "android": {
813
- * "osVer": "5.0",
814
- * "uniVer": "√",
815
- * "unixVer": "x"
816
- * }
817
- * }
818
- * }
819
- */
820
- bitrate ?: number | null,
821
- /**
822
- * 帧率
823
- * @uniPlatform {
824
- * "app": {
825
- * "android": {
826
- * "osVer": "5.0",
827
- * "uniVer": "√",
828
- * "unixVer": "x"
829
- * }
830
- * }
831
- * }
832
- */
833
- fps ?: number | null,
834
- /**
835
- * 相对于原视频的分辨率比例,取值范围(0, 1]
836
- */
837
- resolution ?: number | null,
838
- /**
839
- * 接口调用成功的回调函数
840
- */
841
- success ?: (CompressVideoSuccessCallback) | null,
842
- /**
843
- * 接口调用失败的回调函数
844
- */
845
- fail ?: (CompressVideoFailCallback) | null,
846
- /**
847
- * 接口调用结束的回调函数(调用成功、失败都会执行)
848
- */
849
- complete ?: (CompressVideoCompleteCallback) | null
850
- };
851
-
852
- export type CompressVideo = (options : CompressVideoOptions) => void;
853
-
854
- export interface Uni {
855
- /**
856
- * 从本地相册选择图片或使用相机拍照
857
- * @description 从本地相册选择图片或使用相机拍照
858
- * @uniPlatform {
859
- * "app": {
860
- * "android": {
861
- * "osVer": "5.0",
862
- * "uniVer": "√",
863
- * "unixVer": "3.9+"
864
- * },
865
- * "ios": {
866
- * "osVer": "12.0",
867
- * "uniVer": "√",
868
- * "unixVer": "4.11"
869
- * },
870
- * "harmony": {
871
- * "osVer": "3.0",
872
- * "uniVer": "4.23",
873
- * "unixVer": "x"
874
- * }
875
- * },
876
- * "web": {
877
- * "uniVer": "√",
878
- * "unixVer": "4.0"
879
- * },
880
- * "mp": {
881
- * "weixin": {
882
- * "hostVer": "√",
883
- * "uniVer": "√",
884
- * "unixVer": "x"
885
- * },
886
- * "alipay": {
887
- * "hostVer": "√",
888
- * "uniVer": "√",
889
- * "unixVer": "x"
890
- * },
891
- * "baidu": {
892
- * "hostVer": "√",
893
- * "uniVer": "√",
894
- * "unixVer": "x"
895
- * },
896
- * "toutiao": {
897
- * "hostVer": "√",
898
- * "uniVer": "√",
899
- * "unixVer": "x"
900
- * },
901
- * "lark": {
902
- * "hostVer": "√",
903
- * "uniVer": "√",
904
- * "unixVer": "x"
905
- * },
906
- * "qq": {
907
- * "hostVer": "√",
908
- * "uniVer": "√",
909
- * "unixVer": "x"
910
- * },
911
- * "kuaishou": {
912
- * "hostVer": "√",
913
- * "uniVer": "√",
914
- * "unixVer": "x"
915
- * },
916
- * "jd": {
917
- * "hostVer": "√",
918
- * "uniVer": "√",
919
- * "unixVer": "x"
920
- * }
921
- * }
922
- * }
923
- * @uniVueVersion 2,3
924
- * @example
925
- * ```typescript
926
- * uni.chooseImage({
927
- * count:3,
928
- * success(e){
929
- * console.log(JSON.stringify(e))
930
- * }
931
- * })
932
- * ```
933
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#chooseimage
934
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/choose-image.html
935
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/choose-image.html
936
- * @autotest {
937
- generated:false
938
- }
939
- */
940
- chooseImage(options : ChooseImageOptions) : void;
941
- /**
942
- * 预览图片
943
- * @description 预览图片
944
- * @uniPlatform {
945
- * "app": {
946
- * "android": {
947
- * "osVer": "5.0",
948
- * "uniVer": "√",
949
- * "unixVer": "3.9+"
950
- * },
951
- * "ios": {
952
- * "osVer": "12.0",
953
- * "uniVer": "√",
954
- * "unixVer": "4.11"
955
- * },
956
- * "harmony": {
957
- * "osVer": "3.0",
958
- * "uniVer": "4.23",
959
- * "unixVer": "x"
960
- * }
961
- * },
962
- * "web": {
963
- * "uniVer": "√",
964
- * "unixVer": "4.0"
965
- * },
966
- * "mp": {
967
- * "weixin": {
968
- * "hostVer": "√",
969
- * "uniVer": "√",
970
- * "unixVer": "x"
971
- * },
972
- * "alipay": {
973
- * "hostVer": "√",
974
- * "uniVer": "√",
975
- * "unixVer": "x"
976
- * },
977
- * "baidu": {
978
- * "hostVer": "√",
979
- * "uniVer": "√",
980
- * "unixVer": "x"
981
- * },
982
- * "toutiao": {
983
- * "hostVer": "√",
984
- * "uniVer": "√",
985
- * "unixVer": "x"
986
- * },
987
- * "lark": {
988
- * "hostVer": "√",
989
- * "uniVer": "√",
990
- * "unixVer": "x"
991
- * },
992
- * "qq": {
993
- * "hostVer": "",
994
- * "uniVer": "",
995
- * "unixVer": "x"
996
- * },
997
- * "kuaishou": {
998
- * "hostVer": "",
999
- * "uniVer": "",
1000
- * "unixVer": "x"
1001
- * },
1002
- * "jd": {
1003
- * "hostVer": "x",
1004
- * "uniVer": "x",
1005
- * "unixVer": "x"
1006
- * }
1007
- * }
1008
- * }
1009
- * @uniVueVersion 2,3
1010
- * @example
1011
- * ```typescript
1012
- * uni.previewImage({
1013
- * urls:['/static/a.jpg','/static/b.jpg'],
1014
- * success(e){
1015
- * console.log(JSON.stringify(e))
1016
- * }
1017
- * })
1018
- * ```
1019
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#unipreviewimageobject
1020
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/preview-image.html
1021
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/preview-image.html
1022
- * @autotest {
1023
- generated:false
1024
- }
1025
- */
1026
- previewImage(options : PreviewImageOptions) : void;
1027
- /**
1028
- * 关闭图片预览
1029
- * @description 关闭图片预览
1030
- * @uniPlatform {
1031
- * "app": {
1032
- * "android": {
1033
- * "osVer": "5.0",
1034
- * "uniVer": "",
1035
- * "unixVer": "3.9+"
1036
- * },
1037
- * "ios": {
1038
- * "osVer": "12.0",
1039
- * "uniVer": "√",
1040
- * "unixVer": "4.11"
1041
- * },
1042
- * "harmony": {
1043
- * "osVer": "3.0",
1044
- * "uniVer": "4.23",
1045
- * "unixVer": "x"
1046
- * }
1047
- * },
1048
- * "web": {
1049
- * "uniVer": "√",
1050
- * "unixVer": "4.0"
1051
- * }
1052
- * }
1053
- * @uniVueVersion 2,3
1054
- * @example
1055
- * ```typescript
1056
- * uni.closePreviewImage({
1057
- * success(e){
1058
- * console.log(JSON.stringify(e))
1059
- * }
1060
- * })
1061
- * ```
1062
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#closepreviewimage
1063
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/preview-image.html#closepreviewimage
1064
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/preview-image.html#closepreviewimage
1065
- * @autotest {
1066
- generated:false
1067
- }
1068
- */
1069
- closePreviewImage(options : ClosePreviewImageOptions) : void;
1070
- /**
1071
- * 获取图片信息
1072
- * @description 获取图片信息
1073
- * @uniPlatform {
1074
- * "app": {
1075
- * "android": {
1076
- * "osVer": "5.0",
1077
- * "uniVer": "√",
1078
- * "unixVer": "4.18"
1079
- * },
1080
- * "ios": {
1081
- * "osVer": "12.0",
1082
- * "uniVer": "",
1083
- * "unixVer": "4.25"
1084
- * },
1085
- * "harmony": {
1086
- * "osVer": "3.0",
1087
- * "uniVer": "4.23",
1088
- * "unixVer": "x"
1089
- * }
1090
- * },
1091
- * "web": {
1092
- * "uniVer": "√",
1093
- * "unixVer": "4.0"
1094
- * }
1095
- * }
1096
- * @uniVueVersion 2,3
1097
- * @example
1098
- * ```typescript
1099
- * uni.getImageInfo({
1100
- * src:'/static/a.jpg',
1101
- * success(e){
1102
- * console.log(JSON.stringify(e))
1103
- * },
1104
- * })
1105
- * ```
1106
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#getimageinfo
1107
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-image-info.html
1108
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-image-info.html
1109
- * @autotest {
1110
- generated:false,
1111
- case:[
1112
- {
1113
- input:[{"src":"/static/a.jpg"}]
1114
- }
1115
- ]
1116
- }
1117
- */
1118
- getImageInfo(options : GetImageInfoOptions) : void;
1119
- /**
1120
- * 保存图片到系统相册
1121
- * @description 保存图片到系统相册
1122
- * @uniPlatform {
1123
- * "app": {
1124
- * "android": {
1125
- * "osVer": "5.0",
1126
- * "uniVer": "√",
1127
- * "unixVer": "3.9+"
1128
- * },
1129
- * "ios": {
1130
- * "osVer": "12.0",
1131
- * "uniVer": "√",
1132
- * "unixVer": "4.11"
1133
- * },
1134
- * "harmony": {
1135
- * "osVer": "3.0",
1136
- * "uniVer": "4.23",
1137
- * "unixVer": "x"
1138
- * }
1139
- * },
1140
- * "web": {
1141
- * "uniVer": "x",
1142
- * "unixVer": "x"
1143
- * }
1144
- * }
1145
- * @uniVueVersion 2,3
1146
- * @example
1147
- * ```typescript
1148
- * uni.saveImageToPhotosAlbum({
1149
- * filePath:'/static/a.jpg',
1150
- * success(e){
1151
- * console.log(JSON.stringify(e))
1152
- * },
1153
- * })
1154
- * ```
1155
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#saveimagetophotosalbum
1156
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/save-image-to-photos-album.html
1157
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/save-image-to-photos-album.html
1158
- * @autotest {
1159
- generated:false,
1160
- case:[
1161
- {
1162
- input:[{"filePath":"/static/a.jpg"}]
1163
- }
1164
- ]
1165
- }
1166
- */
1167
- saveImageToPhotosAlbum(options : SaveImageToPhotosAlbumOptions) : void;
1168
- /**
1169
- * 压缩图片
1170
- * @description 压缩图片
1171
- * @uniPlatform {
1172
- * "app": {
1173
- * "android": {
1174
- * "osVer": "5.0",
1175
- * "uniVer": "√",
1176
- * "unixVer": "4.18"
1177
- * },
1178
- * "ios": {
1179
- * "osVer": "12.0",
1180
- * "uniVer": "",
1181
- * "unixVer": "4.25"
1182
- * },
1183
- * "harmony": {
1184
- * "osVer": "3.0",
1185
- * "uniVer": "4.25",
1186
- * "unixVer": "x"
1187
- * }
1188
- * },
1189
- * "web": {
1190
- * "uniVer": "x",
1191
- * "unixVer": "x"
1192
- * }
1193
- * }
1194
- * @uniVueVersion 2,3
1195
- * @example
1196
- * ```typescript
1197
- * uni.compressImage({
1198
- * src:'/static/a.jpg',
1199
- * quality:80,
1200
- * success(e){
1201
- * console.log(JSON.stringify(e))
1202
- * },
1203
- * })
1204
- * ```
1205
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#compressimage
1206
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/compress-image.html
1207
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/compress-image.html
1208
- * @autotest {
1209
- generated:false,
1210
- case:[
1211
- {
1212
- input:[{"src":"/static/d.jpg"},{"rotate","30"}]
1213
- }
1214
- ]
1215
- }
1216
- */
1217
- compressImage(options : CompressImageOptions) : void;
1218
- /**
1219
- * 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。
1220
- * @description 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。
1221
- * @uniPlatform {
1222
- * "app": {
1223
- * "android": {
1224
- * "osVer": "5.0",
1225
- * "uniVer": "√",
1226
- * "unixVer": "4.18"
1227
- * },
1228
- * "ios": {
1229
- * "osVer": "12.0",
1230
- * "uniVer": "√",
1231
- * "unixVer": "4.18"
1232
- * },
1233
- * "harmony": {
1234
- * "osVer": "3.0",
1235
- * "uniVer": "4.23",
1236
- * "unixVer": "x"
1237
- * }
1238
- * },
1239
- * "web": {
1240
- * "uniVer": "√",
1241
- * "unixVer": "4.0"
1242
- * }
1243
- * }
1244
- * @uniVueVersion 2,3
1245
- * @example
1246
- * ```typescript
1247
- * uni.chooseVideo({
1248
- * success(e){
1249
- * console.log(JSON.stringify(e))
1250
- * },
1251
- * })
1252
- * ```
1253
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html
1254
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/choose-video.html
1255
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/choose-video.html
1256
- *
1257
- */
1258
- chooseVideo(options : ChooseVideoOptions) : void;
1259
- /**
1260
- * 获取视频详细信息
1261
- * @description 获取视频详细信息
1262
- * @uniPlatform {
1263
- * "app": {
1264
- * "android": {
1265
- * "osVer": "5.0",
1266
- * "uniVer": "√",
1267
- * "unixVer": "4.18"
1268
- * },
1269
- * "ios": {
1270
- * "osVer": "12.0",
1271
- * "uniVer": "√",
1272
- * "unixVer": "4.25"
1273
- * },
1274
- * "harmony": {
1275
- * "osVer": "3.0",
1276
- * "uniVer": "4.23",
1277
- * "unixVer": "x"
1278
- * }
1279
- * },
1280
- * "web": {
1281
- * "uniVer": "√",
1282
- * "unixVer": "4.0"
1283
- * }
1284
- * }
1285
- * @uniVueVersion 2,3
1286
- * @example
1287
- * ```typescript
1288
- * uni.GetVideoInfo({
1289
- * src:"/static/a.mp4",
1290
- * success(e){
1291
- * console.log(JSON.stringify(e))
1292
- * },
1293
- * })
1294
- * ```
1295
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html#getvideoinfo
1296
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-video-info.html
1297
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-video-info.html
1298
- *
1299
- */
1300
- getVideoInfo(options : GetVideoInfoOptions) : void;
1301
- /**
1302
- * 保存视频到系统相册
1303
- * @description 保存视频到系统相册
1304
- * @uniPlatform {
1305
- * "app": {
1306
- * "android": {
1307
- * "osVer": "5.0",
1308
- * "uniVer": "√",
1309
- * "unixVer": "4.18"
1310
- * },
1311
- * "ios": {
1312
- * "osVer": "12.0",
1313
- * "uniVer": "√",
1314
- * "unixVer": "4.18"
1315
- * },
1316
- * "harmony": {
1317
- * "osVer": "3.0",
1318
- * "uniVer": "4.23",
1319
- * "unixVer": "x"
1320
- * }
1321
- * },
1322
- * "web": {
1323
- * "uniVer": "x",
1324
- * "unixVer": "x"
1325
- * }
1326
- * }
1327
- * @uniVueVersion 2,3
1328
- * @example
1329
- * ```typescript
1330
- * uni.saveVideoToPhotosAlbum({
1331
- * filePath:"/static/a.mp4",
1332
- * success(e){
1333
- * console.log(JSON.stringify(e))
1334
- * },
1335
- * })
1336
- * ```
1337
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html#savevideotophotosalbum
1338
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/save-video-to-photos-album.html
1339
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/save-video-to-photos-album.html
1340
- *
1341
- */
1342
- saveVideoToPhotosAlbum(options : SaveVideoToPhotosAlbumOptions) : void;
1343
- /**
1344
- * 压缩视频
1345
- * @description 压缩视频
1346
- * @uniPlatform {
1347
- * "app": {
1348
- * "android": {
1349
- * "osVer": "5.0",
1350
- * "uniVer": "3,1.10",
1351
- * "unixVer": "4.18"
1352
- * },
1353
- * "ios": {
1354
- * "osVer": "12.0",
1355
- * "uniVer": "√",
1356
- * "unixVer": "4.25"
1357
- * },
1358
- * "harmony": {
1359
- * "osVer": "x",
1360
- * "uniVer": "x",
1361
- * "unixVer": "x"
1362
- * }
1363
- * },
1364
- * "web": {
1365
- * "uniVer": "x",
1366
- * "unixVer": "x"
1367
- * }
1368
- * }
1369
- * @uniVueVersion 2,3
1370
- * @example
1371
- * ```typescript
1372
- * uni.compressVideo({
1373
- * src:"/static/a.mp4",
1374
- * quality:"low",
1375
- * success(e){
1376
- * console.log(JSON.stringify(e))
1377
- * },
1378
- * })
1379
- * ```
1380
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html#compressvideo
1381
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/compress-video.html
1382
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/compress-video.html
1383
- *
1384
- */
1385
- compressVideo(options : CompressVideoOptions) : void;
1386
- }
1
+ export type MediaOrientation =
2
+ | 'up'
3
+ | 'down'
4
+ | 'left'
5
+ | 'right'
6
+ | 'up-mirrored'
7
+ | 'down-mirrored'
8
+ | 'left-mirrored'
9
+ | 'right-mirrored'
10
+
11
+ /**
12
+ * 错误码
13
+ */
14
+ export type MediaErrorCode =
15
+ /**
16
+ * 用户取消
17
+ */
18
+ 1101001 |
19
+ /**
20
+ * urls至少包含一张图片地址
21
+ */
22
+ 1101002 |
23
+ /**
24
+ * 文件不存在
25
+ */
26
+ 1101003 |
27
+ /**
28
+ * 图片加载失败
29
+ */
30
+ 1101004 |
31
+ /**
32
+ * 未获取权限
33
+ */
34
+ 1101005 |
35
+ /**
36
+ * 图片或视频保存失败
37
+ */
38
+ 1101006 |
39
+ /**
40
+ * 图片裁剪失败
41
+ */
42
+ 1101007 |
43
+ /**
44
+ * 拍照或录像失败
45
+ */
46
+ 1101008 |
47
+ /**
48
+ * 图片压缩失败
49
+ */
50
+ 1101009 |
51
+ /**
52
+ * 其他错误
53
+ */
54
+ 1101010;
55
+
56
+ /**
57
+ * 图片或视频操作失败的错误回调
58
+ */
59
+ export interface IMediaError extends IUniError {
60
+ errCode : MediaErrorCode
61
+ };
62
+
63
+ export type ChooseImageTempFile = {
64
+ /**
65
+ * 本地文件路径
66
+ */
67
+ path: string,
68
+ /**
69
+ * 本地文件大小,单位:B
70
+ */
71
+ size: number,
72
+ /**
73
+ * 包含扩展名的文件名称,仅H5支持
74
+ */
75
+ name?: string | null,
76
+ /**
77
+ * 文件类型,仅H5支持
78
+ */
79
+ type?: string | null
80
+ }
81
+ export type ChooseImageSuccess = {
82
+ /**
83
+ * 调用API的名称
84
+ */
85
+ errSubject : string,
86
+ /**
87
+ * 描述信息
88
+ */
89
+ errMsg : string,
90
+ /**
91
+ * 图片的本地文件路径列表
92
+ * @type string | string []
93
+ */
94
+ tempFilePaths : Array<string>,
95
+ /**
96
+ * 图片的本地文件列表
97
+ */
98
+ tempFiles : ChooseImageTempFile[]
99
+ }
100
+
101
+ export type ChooseImageFail = IMediaError;
102
+ export type ChooseImageSuccessCallback = (callback : ChooseImageSuccess) => void
103
+ export type ChooseImageFailCallback = (callback : ChooseImageFail) => void
104
+ export type ChooseImageCompleteCallback = (callback : any) => void
105
+
106
+ export type ChooseImageCropOptions = {
107
+ /**
108
+ * 裁剪的宽度,单位为px,用于计算裁剪宽高比。
109
+ */
110
+ width : number;
111
+ /**
112
+ * 裁剪的高度,单位为px,用于计算裁剪宽高比。
113
+ */
114
+ height : number;
115
+ /**
116
+ * 取值范围为1-100,数值越小,质量越低(仅对jpg格式有效)。默认值为80。
117
+ * @defaultValue 80
118
+ */
119
+ quality ?: (number) | null;
120
+ /**
121
+ * 是否将width和height作为裁剪保存图片真实的像素值。默认值为true。注:设置为false时在裁剪编辑界面显示图片的像素值,设置为true时不显示。
122
+ * @type boolean
123
+ */
124
+ resize ?: (boolean) | null;
125
+ }
126
+
127
+ export type ChooseImageOptions = {
128
+ /**
129
+ * 最多可以选择的图片张数,app端不限制,微信小程序最多可支持20个。
130
+ * @defaultValue 9
131
+ */
132
+ count ?: (number) | null,
133
+ /**
134
+ * original 原图,compressed 压缩图,默认二者都有
135
+ * @type string | string []
136
+ * @defaultValue ['original','compressed']
137
+ * @uniPlatform {
138
+ * "app":{
139
+ * "harmony": {
140
+ * "osVer": "3.0",
141
+ * "uniVer": "4.23",
142
+ * "unixVer": "x"
143
+ * }
144
+ * },
145
+ * "web": {
146
+ * "uniVer": "x",
147
+ * "unixVer": "x"
148
+ * }
149
+ * }
150
+ */
151
+ sizeType ?: (string[]) | null,
152
+ /**
153
+ * album 从相册选图,camera 使用相机,默认二者都有
154
+ * @defaultValue ['album','camera']
155
+ */
156
+ sourceType ?: (string[]) | null,
157
+ /**
158
+ * 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。仅H5支持
159
+ * @uniPlatform {
160
+ * "app": {
161
+ * "android": {
162
+ * "osVer": "5.0",
163
+ * "uniVer": "√",
164
+ * "unixVer": "x"
165
+ * },
166
+ * "harmony": {
167
+ * "osVer": "x",
168
+ * "uniVer": "x",
169
+ * "unixVer": "x"
170
+ * }
171
+ * },
172
+ * "web": {
173
+ * "uniVer": "2.9.9",
174
+ * "unixVer": "4.0"
175
+ * }
176
+ * }
177
+ */
178
+ extension ?: (string[]) | null,
179
+ /**
180
+ * 图像裁剪参数,设置后 sizeType 失效。
181
+ * @uniPlatform {
182
+ * "app":{
183
+ * "harmony": {
184
+ * "osVer": "x",
185
+ * "uniVer": "x",
186
+ * "unixVer": "x"
187
+ * }
188
+ * },
189
+ * "web": {
190
+ * "uniVer": "x",
191
+ * "unixVer": "x"
192
+ * }
193
+ * }
194
+ */
195
+ crop ?: (ChooseImageCropOptions) | null,
196
+ /**
197
+ * 成功则返回图片的本地文件路径列表 tempFilePaths
198
+ */
199
+ success ?: (ChooseImageSuccessCallback) | null,
200
+ /**
201
+ * 接口调用失败的回调函数
202
+ */
203
+ fail ?: (ChooseImageFailCallback) | null,
204
+ /**
205
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
206
+ */
207
+ complete ?: (ChooseImageCompleteCallback) | null
208
+ }
209
+
210
+ export type ChooseImage = (options : ChooseImageOptions) => void
211
+
212
+ export type PreviewImageSuccess = {
213
+ /**
214
+ * 调用API的名称
215
+ */
216
+ errSubject : string,
217
+ /**
218
+ * 描述信息
219
+ */
220
+ errMsg : string
221
+ }
222
+
223
+ export type LongPressActionsSuccessData = {
224
+ /**
225
+ * 接口调用失败的回调函数
226
+ */
227
+ tapIndex : number,
228
+ /**
229
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
230
+ */
231
+ index : number
232
+ };
233
+ export type LongPressActionsOptions = {
234
+ /**
235
+ * 按钮的文字数组
236
+ */
237
+ itemList : string[],
238
+ /**
239
+ * 按钮的文字颜色,字符串格式,默认为"#000000"
240
+ */
241
+ itemColor : string | null,
242
+ /**
243
+ * 接口调用成功的回调函数
244
+ */
245
+ success : ((result : LongPressActionsSuccessData) => void) | null,
246
+ /**
247
+ * 接口调用失败的回调函数
248
+ */
249
+ fail : ((result : any) => void) | null,
250
+ /**
251
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
252
+ */
253
+ complete : ((result : any) => void) | null
254
+ };
255
+
256
+
257
+ export type PreviewImageFail = IMediaError;
258
+ export type PreviewImageSuccessCallback = (callback : PreviewImageSuccess) => void
259
+ export type PreviewImageFailCallback = (callback : PreviewImageFail) => void
260
+ export type PreviewImageCompleteCallback = ChooseImageCompleteCallback
261
+
262
+ export type PreviewImageOptions = {
263
+ /**
264
+ * current 为当前显示图片的链接/索引值,不填或填写的值无效则为 urls 的第一张。APP平台仅支持索引值。
265
+ * @type string | number
266
+ */
267
+ current ?: any | null,
268
+ /**
269
+ * 需要预览的图片链接列表
270
+ */
271
+ urls : Array<string.ImageURIString>,
272
+ /**
273
+ * 是否显示长按菜单
274
+ */
275
+ showmenu ?: boolean | null,
276
+ /**
277
+ * 图片指示器样式
278
+ *
279
+ * @uniPlatform {
280
+ * "app": {
281
+ * "harmony": {
282
+ * "osVer": "x",
283
+ * "uniVer": "x",
284
+ * "unixVer": "x"
285
+ * }
286
+ * }
287
+ * }
288
+ */
289
+ indicator ?:
290
+ /**
291
+ * 底部圆点指示器
292
+ */
293
+ 'default' |
294
+ /**
295
+ * 顶部数字指示器
296
+ */
297
+ 'number' |
298
+ /**
299
+ * 不显示指示器
300
+ */
301
+ 'none' |
302
+ null,
303
+ /**
304
+ * 是否可循环预览
305
+ * @type boolean
306
+ */
307
+ loop ?: boolean | null,
308
+ /**
309
+ * 长按图片显示操作菜单,如不填默认为保存相册。
310
+ * @uniPlatform {
311
+ * "app": {
312
+ * "android": {
313
+ * "osVer": "5.0",
314
+ * "uniVer": "√",
315
+ * "unixVer": "x"
316
+ * },
317
+ * "harmony": {
318
+ * "osVer": "x",
319
+ * "uniVer": "x",
320
+ * "unixVer": "x"
321
+ * }
322
+ * }
323
+ * }
324
+ */
325
+ longPressActions ?: LongPressActionsOptions | null,
326
+ /**
327
+ * 接口调用成功的回调函数
328
+ */
329
+ success ?: (PreviewImageSuccessCallback) | null,
330
+ /**
331
+ * 接口调用失败的回调函数
332
+ */
333
+ fail ?: (PreviewImageFailCallback) | null,
334
+ /**
335
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
336
+ */
337
+ complete ?: (PreviewImageCompleteCallback) | null
338
+ };
339
+
340
+ export type PreviewImage = (options : PreviewImageOptions) => void;
341
+
342
+ export type ClosePreviewImage = (options : ClosePreviewImageOptions) => void;
343
+ export type ClosePreviewImageSuccess = {
344
+ /**
345
+ * 错误信息
346
+ */
347
+ errMsg : string
348
+ };
349
+
350
+ export type ClosePreviewImageFail = IMediaError;
351
+ export type ClosePreviewImageSuccessCallback = (callback : ClosePreviewImageSuccess) => void
352
+ export type ClosePreviewImageFailCallback = (callback : ClosePreviewImageFail) => void
353
+ export type ClosePreviewImageCompleteCallback = ChooseImageCompleteCallback
354
+
355
+ export type ClosePreviewImageOptions = {
356
+ /**
357
+ * 接口调用成功的回调函数
358
+ */
359
+ success ?: (ClosePreviewImageSuccessCallback) | null,
360
+ /**
361
+ * 接口调用失败的回调函数
362
+ */
363
+ fail ?: (ClosePreviewImageFailCallback) | null,
364
+ /**
365
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
366
+ */
367
+ complete ?: (ClosePreviewImageCompleteCallback) | null
368
+ };
369
+
370
+ export type GetImageInfo = (options : GetImageInfoOptions) => void;
371
+ export type GetImageInfoSuccess = {
372
+ /**
373
+ * 图片宽度,单位px
374
+ */
375
+ width : number,
376
+ /**
377
+ * 图片高度,单位px
378
+ */
379
+ height : number,
380
+ /**
381
+ * 返回图片的本地路径
382
+ */
383
+ path : string,
384
+ /**
385
+ * 返回图片的方向
386
+ * @uniPlatform {
387
+ * "web": {
388
+ * "uniVer": "x",
389
+ * "unixVer": "x"
390
+ * }
391
+ * }
392
+ */
393
+ orientation ?: MediaOrientation,
394
+ /**
395
+ * 返回图片的格式
396
+ * @uniPlatform {
397
+ * "web": {
398
+ * "uniVer": "x",
399
+ * "unixVer": "x"
400
+ * }
401
+ * }
402
+ */
403
+ type : string | null
404
+ };
405
+
406
+ export type GetImageInfoFail = IMediaError;
407
+ export type GetImageInfoSuccessCallback = (callback : GetImageInfoSuccess) => void
408
+ export type GetImageInfoFailCallback = (callback : GetImageInfoFail) => void
409
+ export type GetImageInfoCompleteCallback = ChooseImageCompleteCallback
410
+
411
+ export type GetImageInfoOptions = {
412
+ /**
413
+ * 图片的路径,可以是相对路径,临时文件路径,存储文件路径,网络图片路径
414
+ */
415
+ src : string.ImageURIString,
416
+ /**
417
+ * 接口调用成功的回调函数
418
+ */
419
+ success ?: (GetImageInfoSuccessCallback) | null,
420
+ /**
421
+ * 接口调用失败的回调函数
422
+ */
423
+ fail ?: (GetImageInfoFailCallback) | null,
424
+ /**
425
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
426
+ */
427
+ complete ?: (GetImageInfoCompleteCallback) | null
428
+ };
429
+
430
+ export type SaveImageToPhotosAlbum = (options : SaveImageToPhotosAlbumOptions) => void;
431
+
432
+ export type SaveImageToPhotosAlbumSuccess = {
433
+ /**
434
+ * 保存到相册的图片路径
435
+ */
436
+ path : string
437
+ };
438
+
439
+ export type SaveImageToPhotosAlbumFail = IMediaError;
440
+ export type SaveImageToPhotosAlbumSuccessCallback = (callback : SaveImageToPhotosAlbumSuccess) => void
441
+ export type SaveImageToPhotosAlbumFailCallback = (callback : SaveImageToPhotosAlbumFail) => void
442
+ export type SaveImageToPhotosAlbumCompleteCallback = ChooseImageCompleteCallback
443
+
444
+ export type SaveImageToPhotosAlbumOptions = {
445
+ /**
446
+ * 图片文件路径,可以是临时文件路径也可以是永久文件路径,不支持网络图片路径
447
+ */
448
+ filePath : string.ImageURIString,
449
+ /**
450
+ * 接口调用成功的回调函数
451
+ */
452
+ success ?: (SaveImageToPhotosAlbumSuccessCallback) | null,
453
+ /**
454
+ * 接口调用失败的回调函数
455
+ */
456
+ fail ?: (SaveImageToPhotosAlbumFailCallback) | null,
457
+ /**
458
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
459
+ */
460
+ complete ?: (SaveImageToPhotosAlbumCompleteCallback) | null
461
+ };
462
+ export type CompressImage = (options : CompressImageOptions) => void;
463
+ export type CompressImageSuccess = {
464
+ /**
465
+ * 压缩后图片的临时文件路径
466
+ */
467
+ tempFilePath : string
468
+ };
469
+
470
+ export type CompressImageFail = IMediaError;
471
+ export type CompressImageSuccessCallback = (callback : CompressImageSuccess) => void
472
+ export type CompressImageFailCallback = (callback : CompressImageFail) => void
473
+ export type CompressImageCompleteCallback = ChooseImageCompleteCallback
474
+
475
+ export type CompressImageOptions = {
476
+ /**
477
+ * 图片路径,图片的路径,可以是相对路径、临时文件路径、存储文件路径
478
+ */
479
+ src : string.ImageURIString,
480
+ /**
481
+ * 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)
482
+ */
483
+ quality ?: number | null,
484
+ /**
485
+ * 旋转度数,范围0~360
486
+ */
487
+ rotate ?: number | null,
488
+ /**
489
+ * 缩放图片的宽度
490
+ * @deprecated 已废弃
491
+ */
492
+ width ?: string | null,
493
+ /**
494
+ * 缩放图片的高度
495
+ * @deprecated 已废弃
496
+ */
497
+ height ?: string | null,
498
+ /**
499
+ * 压缩后图片的高度,单位为px,若不填写则默认以compressedWidth为准等比缩放
500
+ */
501
+ compressedHeight ?: number | null,
502
+ /**
503
+ * 压缩后图片的宽度,单位为px,若不填写则默认以compressedHeight为准等比缩放。
504
+ */
505
+ compressedWidth ?: number | null,
506
+ /**
507
+ * 接口调用成功的回调函数
508
+ */
509
+ success ?: (CompressImageSuccessCallback) | null,
510
+ /**
511
+ * 接口调用失败的回调函数
512
+ */
513
+ fail ?: (CompressImageFailCallback) | null,
514
+ /**
515
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
516
+ */
517
+ complete ?: (CompressImageCompleteCallback) | null
518
+ };
519
+
520
+ export type ChooseVideoSuccess = {
521
+ /**
522
+ * 选定视频的临时文件路径
523
+ */
524
+ tempFilePath : string,
525
+ /**
526
+ * 选定的视频文件,仅H5支持
527
+ */
528
+ // tempFile: File|null,
529
+ /**
530
+ * 选定视频的时间长度
531
+ */
532
+ duration : number,
533
+ /**
534
+ * 选定视频的数据量大小
535
+ */
536
+ size : number,
537
+ /**
538
+ * 返回选定视频的长
539
+ */
540
+ height : number,
541
+ /**
542
+ * 返回选定视频的宽
543
+ */
544
+ width : number,
545
+ /**
546
+ * 包含扩展名的文件名称(仅H5支持)
547
+ */
548
+ // name: string | null
549
+ };
550
+
551
+ export type ChooseVideoFail = IMediaError;
552
+ export type ChooseVideoSuccessCallback = (callback : ChooseVideoSuccess) => void
553
+ export type ChooseVideoFailCallback = (callback : ChooseVideoFail) => void
554
+ export type ChooseVideoCompleteCallback = ChooseImageCompleteCallback
555
+
556
+ export type ChooseVideoOptions = {
557
+ /**
558
+ * album 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera']
559
+ */
560
+ sourceType ?: (string[]) | null,
561
+ /**
562
+ * 是否压缩所选的视频源文件,默认值为true,需要压缩
563
+ * @type boolean
564
+ * @default true
565
+ * @uniPlatform {
566
+ * "app": {
567
+ * "harmony": {
568
+ * "osVer": "x",
569
+ * "uniVer": "x",
570
+ * "unixVer": "x"
571
+ * }
572
+ * },
573
+ * "web": {
574
+ * "uniVer": "x",
575
+ * "unixVer": "x"
576
+ * }
577
+ * }
578
+ */
579
+ compressed ?: boolean | null,
580
+ /**
581
+ * 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒
582
+ * @uniPlatform {
583
+ * "app": {
584
+ * "harmony": {
585
+ * "osVer": "3.0",
586
+ * "uniVer": "4.25",
587
+ * "unixVer": "x"
588
+ * }
589
+ * },
590
+ * "web": {
591
+ * "uniVer": "x",
592
+ * "unixVer": "x"
593
+ * }
594
+ * }
595
+ */
596
+ maxDuration ?: number | null,
597
+ /**
598
+ * 摄像切换
599
+ *
600
+ * @uniPlatform {
601
+ * "app": {
602
+ * "harmony": {
603
+ * "osVer": "3.0",
604
+ * "uniVer": "4.25",
605
+ * "unixVer": "x"
606
+ * }
607
+ * },
608
+ * "web": {
609
+ * "uniVer": "x",
610
+ * "unixVer": "x"
611
+ * }
612
+ * }
613
+ */
614
+ camera ?:
615
+ /**
616
+ * 前置摄像头
617
+ */
618
+ 'front' |
619
+ /**
620
+ * 后置摄像头
621
+ */
622
+ 'back' | null,
623
+ /**
624
+ * 根据文件拓展名过滤,每一项都不能是空字符串。默认不过滤。
625
+ * @uniPlatform {
626
+ * "app": {
627
+ * "android": {
628
+ * "osVer": "5.0",
629
+ * "uniVer": "√",
630
+ * "unixVer": "x"
631
+ * },
632
+ * "harmony": {
633
+ * "osVer": "x",
634
+ * "uniVer": "x",
635
+ * "unixVer": "x"
636
+ * }
637
+ * }
638
+ * }
639
+ */
640
+ extension ?: (string[]) | null,
641
+ /**
642
+ * 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明
643
+ */
644
+ success ?: (ChooseVideoSuccessCallback) | null,
645
+ /**
646
+ * 接口调用失败的回调函数
647
+ */
648
+ fail ?: (ChooseVideoFailCallback) | null,
649
+ /**
650
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
651
+ */
652
+ complete ?: (ChooseVideoCompleteCallback) | null
653
+ };
654
+
655
+ export type ChooseVideo = (options : ChooseVideoOptions) => void;
656
+
657
+ export type GetVideoInfoSuccess = {
658
+ /**
659
+ * 画面方向
660
+ * @uniPlatform {
661
+ * "app": {
662
+ * "harmony": {
663
+ * "osVer": "3.0",
664
+ * "uniVer": "4.23",
665
+ * "unixVer": "x"
666
+ * }
667
+ * },
668
+ * "web": {
669
+ * "uniVer": "x",
670
+ * "unixVer": "x"
671
+ * }
672
+ * }
673
+ */
674
+ orientation ?: MediaOrientation,
675
+ /**
676
+ * 视频格式
677
+ * @uniPlatform {
678
+ * "app": {
679
+ * "harmony": {
680
+ * "osVer": "3.0",
681
+ * "uniVer": "4.23",
682
+ * "unixVer": "x"
683
+ * }
684
+ * },
685
+ * "web": {
686
+ * "uniVer": "x",
687
+ * "unixVer": "x"
688
+ * }
689
+ * }
690
+ */
691
+ type : string | null,
692
+ /**
693
+ * 视频长度
694
+ */
695
+ duration : number,
696
+ /**
697
+ * 视频大小,单位 kB
698
+ */
699
+ size : number,
700
+ /**
701
+ * 视频的长,单位 px
702
+ */
703
+ height : number,
704
+ /**
705
+ * 视频的宽,单位 px
706
+ */
707
+ width : number,
708
+ /**
709
+ * 视频帧率
710
+ * @uniPlatform {
711
+ * "app": {
712
+ * "harmony": {
713
+ * "osVer": "x",
714
+ * "uniVer": "x",
715
+ * "unixVer": "x"
716
+ * }
717
+ * },
718
+ * "web": {
719
+ * "uniVer": "x",
720
+ * "unixVer": "x"
721
+ * }
722
+ * }
723
+ */
724
+ fps : number | null,
725
+ /**
726
+ * 视频码率,单位 kbps
727
+ * @uniPlatform {
728
+ * "app": {
729
+ * "harmony": {
730
+ * "osVer": "x",
731
+ * "uniVer": "x",
732
+ * "unixVer": "x"
733
+ * }
734
+ * },
735
+ * "web": {
736
+ * "uniVer": "x",
737
+ * "unixVer": "x"
738
+ * }
739
+ * }
740
+ */
741
+ bitrate : number | null
742
+ };
743
+
744
+ export type GetVideoInfoFail = IMediaError;
745
+ export type GetVideoInfoSuccessCallback = (callback : GetVideoInfoSuccess) => void
746
+ export type GetVideoInfoFailCallback = (callback : GetVideoInfoFail) => void
747
+ export type GetVideoInfoCompleteCallback = ChooseImageCompleteCallback
748
+
749
+ export type GetVideoInfoOptions = {
750
+ /**
751
+ * 视频文件路径,可以是临时文件路径也可以是永久文件路径
752
+ */
753
+ src : string.VideoURIString,
754
+ /**
755
+ * 接口调用成功的回调函数
756
+ */
757
+ success ?: (GetVideoInfoSuccessCallback) | null,
758
+ /**
759
+ * 接口调用失败的回调函数
760
+ */
761
+ fail ?: (GetVideoInfoFailCallback) | null,
762
+ /**
763
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
764
+ */
765
+ complete ?: (GetVideoInfoCompleteCallback) | null
766
+ };
767
+
768
+ export type GetVideoInfo = (options : GetVideoInfoOptions) => void;
769
+
770
+ export type SaveVideoToPhotosAlbumSuccess = {};
771
+
772
+ export type SaveVideoToPhotosAlbumFail = IMediaError;
773
+ export type SaveVideoToPhotosAlbumSuccessCallback = (callback : SaveVideoToPhotosAlbumSuccess) => void
774
+ export type SaveVideoToPhotosAlbumFailCallback = (callback : SaveVideoToPhotosAlbumFail) => void
775
+ export type SaveVideoToPhotosAlbumCompleteCallback = ChooseImageCompleteCallback
776
+
777
+ export type SaveVideoToPhotosAlbumOptions = {
778
+ /**
779
+ * 视频文件路径,可以是临时文件路径也可以是永久文件路径
780
+ */
781
+ filePath : string.VideoURIString,
782
+ /**
783
+ * 接口调用成功的回调函数
784
+ */
785
+ success ?: (SaveVideoToPhotosAlbumSuccessCallback) | null,
786
+ /**
787
+ * 接口调用失败的回调函数
788
+ */
789
+ fail ?: (SaveVideoToPhotosAlbumFailCallback) | null,
790
+ /**
791
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
792
+ */
793
+ complete ?: (SaveVideoToPhotosAlbumCompleteCallback) | null
794
+ };
795
+
796
+ export type SaveVideoToPhotosAlbum = (options : SaveVideoToPhotosAlbumOptions) => void;
797
+
798
+ export type CompressVideoSuccess = {
799
+ /**
800
+ * 压缩后的临时文件地址
801
+ */
802
+ tempFilePath : string,
803
+ /**
804
+ * 压缩后的大小,单位 kB
805
+ */
806
+ size : number
807
+ };
808
+
809
+ export type CompressVideoFail = IMediaError;
810
+ export type CompressVideoSuccessCallback = (callback : CompressVideoSuccess) => void
811
+ export type CompressVideoFailCallback = (callback : CompressVideoFail) => void
812
+ export type CompressVideoCompleteCallback = ChooseImageCompleteCallback
813
+
814
+ export type CompressVideoOptions = {
815
+ /**
816
+ * 视频文件路径,可以是临时文件路径也可以是永久文件路径
817
+ */
818
+ src : string.VideoURIString,
819
+ /**
820
+ * 压缩质量
821
+ *
822
+ * @type 'low' | 'medium' | 'high'
823
+ */
824
+ quality ?: string | null,
825
+ /**
826
+ * 码率,单位 kbps
827
+ * @uniPlatform {
828
+ * "app": {
829
+ * "android": {
830
+ * "osVer": "5.0",
831
+ * "uniVer": "√",
832
+ * "unixVer": "x"
833
+ * }
834
+ * }
835
+ * }
836
+ */
837
+ bitrate ?: number | null,
838
+ /**
839
+ * 帧率
840
+ * @uniPlatform {
841
+ * "app": {
842
+ * "android": {
843
+ * "osVer": "5.0",
844
+ * "uniVer": "√",
845
+ * "unixVer": "x"
846
+ * }
847
+ * }
848
+ * }
849
+ */
850
+ fps ?: number | null,
851
+ /**
852
+ * 相对于原视频的分辨率比例,取值范围(0, 1]
853
+ */
854
+ resolution ?: number | null,
855
+ /**
856
+ * 接口调用成功的回调函数
857
+ */
858
+ success ?: (CompressVideoSuccessCallback) | null,
859
+ /**
860
+ * 接口调用失败的回调函数
861
+ */
862
+ fail ?: (CompressVideoFailCallback) | null,
863
+ /**
864
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
865
+ */
866
+ complete ?: (CompressVideoCompleteCallback) | null
867
+ };
868
+
869
+ export type CompressVideo = (options : CompressVideoOptions) => void;
870
+
871
+ export type ChooseFile = (options: ChooseFileOptions) => void;
872
+ export type ChooseFileSuccess = {
873
+ /**
874
+ * 文件的本地文件路径列表
875
+ * @type string | string []
876
+ */
877
+ tempFilePaths: string[],
878
+ /**
879
+ * 文件的本地文件列表,每一项是一个 File 对象
880
+ * @type ChooseFileSuccessCallbackResultFile | ChooseFileSuccessCallbackResultFile [] | File | File []
881
+ */
882
+ tempFiles: any
883
+ };
884
+ export type ChooseFileSuccessCallback = (result: ChooseFileSuccess) => void;
885
+ export type ChooseFileFail = IMediaError;
886
+ export type ChooseFileFailCallback = (result: ChooseFileFail) => void;
887
+ export type ChooseFileComplete = any;
888
+ export type ChooseFileCompleteCallback = (result: ChooseFileComplete) => void;
889
+ export type ChooseFileOptions = {
890
+ /**
891
+ * 最多可以选择的文件数,默认100
892
+ */
893
+ count?: number | null,
894
+ /**
895
+ * 选择文件的类型,默认all,可选image、video
896
+ * - image: 选择图片文件
897
+ * - video: 选择视频文件
898
+ * - all: 默认值,选择本地文件,包含图片和视频
899
+ */
900
+ type?: 'image' | 'video' | 'all' | null,
901
+ /**
902
+ * 选择文件的后缀名,暂只支持.zip、.png等,不支持application/msword等值
903
+ */
904
+ extension?: (string[]) | null,
905
+ /**
906
+ * original 原图,compressed 压缩图,默认二者都有
907
+ * @type string | string []
908
+ */
909
+ sizeType?: any | null,
910
+ /**
911
+ * album 从相册选图,camera 使用相机,默认二者都有
912
+ */
913
+ sourceType?: (string[]) | null,
914
+ /**
915
+ * 成功则返回图片的本地文件路径列表 tempFilePaths、tempFiles
916
+ */
917
+ success?: ChooseFileSuccessCallback | null,
918
+ /**
919
+ * 接口调用失败的回调函数
920
+ */
921
+ fail?: ChooseFileFailCallback | null,
922
+ /**
923
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
924
+ */
925
+ complete?: ChooseFileCompleteCallback | null
926
+ };
927
+
928
+
929
+ export type ChooseMediaFileType = 'image' | 'video'
930
+ export type ChooseMediaTempFile = {
931
+ /**
932
+ * 选定视频的临时文件路径
933
+ */
934
+ tempFilePath : string,
935
+ /**
936
+ * 文件类型
937
+ */
938
+ fileType: ChooseMediaFileType
939
+ /**
940
+ * 选定视频的数据量大小
941
+ */
942
+ size : number,
943
+ /**
944
+ * 选定视频的时间长度
945
+ */
946
+ duration ?: number | null,
947
+ /**
948
+ * 返回选定视频的长
949
+ */
950
+ height ?: number | null,
951
+ /**
952
+ * 返回选定视频的宽
953
+ */
954
+ width ?: number | null,
955
+ /**
956
+ * 视频缩略图临时文件路径
957
+ */
958
+ thumbTempFilePath?: string | null
959
+ }
960
+ export type ChooseMediaSuccess = {
961
+ tempFiles: ChooseMediaTempFile[],
962
+ type: 'image' | 'video' | 'mix'
963
+ };
964
+
965
+ export type ChooseMediaFail = IMediaError;
966
+ export type ChooseMediaSuccessCallback = (callback : ChooseMediaSuccess) => void
967
+ export type ChooseMediaFailCallback = (callback : ChooseMediaFail) => void
968
+ export type ChooseMediaCompleteCallback = ChooseImageCompleteCallback
969
+
970
+ export type ChooseMediaOptions = {
971
+ /**
972
+ * 最多可以选择的文件个数
973
+ * @defaultValue 9
974
+ */
975
+ count?: number | null
976
+ /**
977
+ * album 从相册选视频,camera 使用相机拍摄,合法值:'image'、'video'、'mix'
978
+ * @defaultValue ['image', 'video']
979
+ */
980
+ mediaType ?: (string[]) | null,
981
+ /**
982
+ * album 从相册选视频,camera 使用相机拍摄
983
+ * @defaultValue ['album', 'camera']
984
+ */
985
+ sourceType ?: (string[]) | null,
986
+ /**
987
+ * 仅对 mediaType 为 image 时有效,是否压缩所选文件
988
+ * @defaultValue ['original','compressed']
989
+ * @uniPlatform {
990
+ * "app":{
991
+ * "harmony": {
992
+ * "osVer": "3.0",
993
+ * "uniVer": "4.23",
994
+ * "unixVer": "x"
995
+ * }
996
+ * },
997
+ * "web": {
998
+ * "uniVer": "x",
999
+ * "unixVer": "x"
1000
+ * }
1001
+ * }
1002
+ */
1003
+ sizeType ?: (string[]) | null,
1004
+ /**
1005
+ * 拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 30s 之间
1006
+ * @defaultValue 10
1007
+ * @uniPlatform {
1008
+ * "app": {
1009
+ * "harmony": {
1010
+ * "osVer": "3.0",
1011
+ * "uniVer": "4.27",
1012
+ * "unixVer": "x"
1013
+ * }
1014
+ * },
1015
+ * "web": {
1016
+ * "uniVer": "x",
1017
+ * "unixVer": "x"
1018
+ * }
1019
+ * }
1020
+ */
1021
+ maxDuration ?: number | null,
1022
+ /**
1023
+ * 仅在 sourceType 为 camera 时生效,使用前置或后置摄像头
1024
+ *
1025
+ * @uniPlatform {
1026
+ * "app": {
1027
+ * "harmony": {
1028
+ * "osVer": "3.0",
1029
+ * "uniVer": "4.25",
1030
+ * "unixVer": "x"
1031
+ * }
1032
+ * },
1033
+ * "web": {
1034
+ * "uniVer": "x",
1035
+ * "unixVer": "x"
1036
+ * }
1037
+ * }
1038
+ */
1039
+ camera ?:
1040
+ /**
1041
+ * 前置摄像头
1042
+ */
1043
+ 'front' |
1044
+ /**
1045
+ * 后置摄像头
1046
+ */
1047
+ 'back' | null,
1048
+ /**
1049
+ * 接口调用成功,返回视频文件的临时文件路径,详见返回参数说明
1050
+ */
1051
+ success ?: (ChooseMediaSuccessCallback) | null,
1052
+ /**
1053
+ * 接口调用失败的回调函数
1054
+ */
1055
+ fail ?: (ChooseMediaFailCallback) | null,
1056
+ /**
1057
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
1058
+ */
1059
+ complete ?: (ChooseMediaCompleteCallback) | null
1060
+ };
1061
+
1062
+ export type ChooseMedia = (options : ChooseMediaOptions) => void;
1063
+
1064
+ export interface Uni {
1065
+ /**
1066
+ * 从本地相册选择图片或使用相机拍照
1067
+ * @description 从本地相册选择图片或使用相机拍照
1068
+ * @uniPlatform {
1069
+ * "app": {
1070
+ * "android": {
1071
+ * "osVer": "5.0",
1072
+ * "uniVer": "√",
1073
+ * "unixVer": "3.9+"
1074
+ * },
1075
+ * "ios": {
1076
+ * "osVer": "12.0",
1077
+ * "uniVer": "√",
1078
+ * "unixVer": "4.11"
1079
+ * },
1080
+ * "harmony": {
1081
+ * "osVer": "3.0",
1082
+ * "uniVer": "4.23",
1083
+ * "unixVer": "x"
1084
+ * }
1085
+ * },
1086
+ * "web": {
1087
+ * "uniVer": "",
1088
+ * "unixVer": "4.0"
1089
+ * },
1090
+ * "mp": {
1091
+ * "weixin": {
1092
+ * "hostVer": "√",
1093
+ * "uniVer": "",
1094
+ * "unixVer": "x"
1095
+ * },
1096
+ * "alipay": {
1097
+ * "hostVer": "√",
1098
+ * "uniVer": "√",
1099
+ * "unixVer": "x"
1100
+ * },
1101
+ * "baidu": {
1102
+ * "hostVer": "√",
1103
+ * "uniVer": "√",
1104
+ * "unixVer": "x"
1105
+ * },
1106
+ * "toutiao": {
1107
+ * "hostVer": "√",
1108
+ * "uniVer": "√",
1109
+ * "unixVer": "x"
1110
+ * },
1111
+ * "lark": {
1112
+ * "hostVer": "√",
1113
+ * "uniVer": "",
1114
+ * "unixVer": "x"
1115
+ * },
1116
+ * "qq": {
1117
+ * "hostVer": "√",
1118
+ * "uniVer": "√",
1119
+ * "unixVer": "x"
1120
+ * },
1121
+ * "kuaishou": {
1122
+ * "hostVer": "√",
1123
+ * "uniVer": "√",
1124
+ * "unixVer": "x"
1125
+ * },
1126
+ * "jd": {
1127
+ * "hostVer": "",
1128
+ * "uniVer": "√",
1129
+ * "unixVer": "x"
1130
+ * }
1131
+ * }
1132
+ * }
1133
+ * @uniVueVersion 2,3
1134
+ * @example
1135
+ * ```typescript
1136
+ * uni.chooseImage({
1137
+ * count:3,
1138
+ * success(e){
1139
+ * console.log(JSON.stringify(e))
1140
+ * }
1141
+ * })
1142
+ * ```
1143
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#chooseimage
1144
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/choose-image.html
1145
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/choose-image.html
1146
+ * @autotest {
1147
+ generated:false
1148
+ }
1149
+ */
1150
+ chooseImage(options : ChooseImageOptions) : void;
1151
+ /**
1152
+ * 预览图片
1153
+ * @description 预览图片
1154
+ * @uniPlatform {
1155
+ * "app": {
1156
+ * "android": {
1157
+ * "osVer": "5.0",
1158
+ * "uniVer": "√",
1159
+ * "unixVer": "3.9+"
1160
+ * },
1161
+ * "ios": {
1162
+ * "osVer": "12.0",
1163
+ * "uniVer": "√",
1164
+ * "unixVer": "4.11"
1165
+ * },
1166
+ * "harmony": {
1167
+ * "osVer": "3.0",
1168
+ * "uniVer": "4.23",
1169
+ * "unixVer": "x"
1170
+ * }
1171
+ * },
1172
+ * "web": {
1173
+ * "uniVer": "√",
1174
+ * "unixVer": "4.0"
1175
+ * },
1176
+ * "mp": {
1177
+ * "weixin": {
1178
+ * "hostVer": "√",
1179
+ * "uniVer": "",
1180
+ * "unixVer": "x"
1181
+ * },
1182
+ * "alipay": {
1183
+ * "hostVer": "√",
1184
+ * "uniVer": "",
1185
+ * "unixVer": "x"
1186
+ * },
1187
+ * "baidu": {
1188
+ * "hostVer": "√",
1189
+ * "uniVer": "√",
1190
+ * "unixVer": "x"
1191
+ * },
1192
+ * "toutiao": {
1193
+ * "hostVer": "√",
1194
+ * "uniVer": "√",
1195
+ * "unixVer": "x"
1196
+ * },
1197
+ * "lark": {
1198
+ * "hostVer": "√",
1199
+ * "uniVer": "√",
1200
+ * "unixVer": "x"
1201
+ * },
1202
+ * "qq": {
1203
+ * "hostVer": "√",
1204
+ * "uniVer": "√",
1205
+ * "unixVer": "x"
1206
+ * },
1207
+ * "kuaishou": {
1208
+ * "hostVer": "√",
1209
+ * "uniVer": "√",
1210
+ * "unixVer": "x"
1211
+ * },
1212
+ * "jd": {
1213
+ * "hostVer": "x",
1214
+ * "uniVer": "x",
1215
+ * "unixVer": "x"
1216
+ * }
1217
+ * }
1218
+ * }
1219
+ * @uniVueVersion 2,3
1220
+ * @example
1221
+ * ```typescript
1222
+ * uni.previewImage({
1223
+ * urls:['/static/a.jpg','/static/b.jpg'],
1224
+ * success(e){
1225
+ * console.log(JSON.stringify(e))
1226
+ * }
1227
+ * })
1228
+ * ```
1229
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#unipreviewimageobject
1230
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/preview-image.html
1231
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/preview-image.html
1232
+ * @autotest {
1233
+ generated:false
1234
+ }
1235
+ */
1236
+ previewImage(options : PreviewImageOptions) : void;
1237
+ /**
1238
+ * 关闭图片预览
1239
+ * @description 关闭图片预览
1240
+ * @uniPlatform {
1241
+ * "app": {
1242
+ * "android": {
1243
+ * "osVer": "5.0",
1244
+ * "uniVer": "√",
1245
+ * "unixVer": "3.9+"
1246
+ * },
1247
+ * "ios": {
1248
+ * "osVer": "12.0",
1249
+ * "uniVer": "√",
1250
+ * "unixVer": "4.11"
1251
+ * },
1252
+ * "harmony": {
1253
+ * "osVer": "3.0",
1254
+ * "uniVer": "4.23",
1255
+ * "unixVer": "x"
1256
+ * }
1257
+ * },
1258
+ * "web": {
1259
+ * "uniVer": "√",
1260
+ * "unixVer": "4.0"
1261
+ * }
1262
+ * }
1263
+ * @uniVueVersion 2,3
1264
+ * @example
1265
+ * ```typescript
1266
+ * uni.closePreviewImage({
1267
+ * success(e){
1268
+ * console.log(JSON.stringify(e))
1269
+ * }
1270
+ * })
1271
+ * ```
1272
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#closepreviewimage
1273
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/preview-image.html#closepreviewimage
1274
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/preview-image.html#closepreviewimage
1275
+ * @autotest {
1276
+ generated:false
1277
+ }
1278
+ */
1279
+ closePreviewImage(options : ClosePreviewImageOptions) : void;
1280
+ /**
1281
+ * 获取图片信息
1282
+ * @description 获取图片信息
1283
+ * @uniPlatform {
1284
+ * "app": {
1285
+ * "android": {
1286
+ * "osVer": "5.0",
1287
+ * "uniVer": "√",
1288
+ * "unixVer": "4.18"
1289
+ * },
1290
+ * "ios": {
1291
+ * "osVer": "12.0",
1292
+ * "uniVer": "√",
1293
+ * "unixVer": "4.25"
1294
+ * },
1295
+ * "harmony": {
1296
+ * "osVer": "3.0",
1297
+ * "uniVer": "4.23",
1298
+ * "unixVer": "x"
1299
+ * }
1300
+ * },
1301
+ * "web": {
1302
+ * "uniVer": "√",
1303
+ * "unixVer": "4.0"
1304
+ * }
1305
+ * }
1306
+ * @uniVueVersion 2,3
1307
+ * @example
1308
+ * ```typescript
1309
+ * uni.getImageInfo({
1310
+ * src:'/static/a.jpg',
1311
+ * success(e){
1312
+ * console.log(JSON.stringify(e))
1313
+ * },
1314
+ * })
1315
+ * ```
1316
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#getimageinfo
1317
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-image-info.html
1318
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-image-info.html
1319
+ * @autotest {
1320
+ generated:false,
1321
+ case:[
1322
+ {
1323
+ input:[{"src":"/static/a.jpg"}]
1324
+ }
1325
+ ]
1326
+ }
1327
+ */
1328
+ getImageInfo(options : GetImageInfoOptions) : void;
1329
+ /**
1330
+ * 保存图片到系统相册
1331
+ * @description 保存图片到系统相册
1332
+ * @uniPlatform {
1333
+ * "app": {
1334
+ * "android": {
1335
+ * "osVer": "5.0",
1336
+ * "uniVer": "√",
1337
+ * "unixVer": "3.9+"
1338
+ * },
1339
+ * "ios": {
1340
+ * "osVer": "12.0",
1341
+ * "uniVer": "√",
1342
+ * "unixVer": "4.11"
1343
+ * },
1344
+ * "harmony": {
1345
+ * "osVer": "3.0",
1346
+ * "uniVer": "4.23",
1347
+ * "unixVer": "x"
1348
+ * }
1349
+ * },
1350
+ * "web": {
1351
+ * "uniVer": "x",
1352
+ * "unixVer": "x"
1353
+ * }
1354
+ * }
1355
+ * @uniVueVersion 2,3
1356
+ * @example
1357
+ * ```typescript
1358
+ * uni.saveImageToPhotosAlbum({
1359
+ * filePath:'/static/a.jpg',
1360
+ * success(e){
1361
+ * console.log(JSON.stringify(e))
1362
+ * },
1363
+ * })
1364
+ * ```
1365
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#saveimagetophotosalbum
1366
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/save-image-to-photos-album.html
1367
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/save-image-to-photos-album.html
1368
+ * @autotest {
1369
+ generated:false,
1370
+ case:[
1371
+ {
1372
+ input:[{"filePath":"/static/a.jpg"}]
1373
+ }
1374
+ ]
1375
+ }
1376
+ */
1377
+ saveImageToPhotosAlbum(options : SaveImageToPhotosAlbumOptions) : void;
1378
+ /**
1379
+ * 压缩图片
1380
+ * @description 压缩图片
1381
+ * @uniPlatform {
1382
+ * "app": {
1383
+ * "android": {
1384
+ * "osVer": "5.0",
1385
+ * "uniVer": "√",
1386
+ * "unixVer": "4.18"
1387
+ * },
1388
+ * "ios": {
1389
+ * "osVer": "12.0",
1390
+ * "uniVer": "√",
1391
+ * "unixVer": "4.25"
1392
+ * },
1393
+ * "harmony": {
1394
+ * "osVer": "3.0",
1395
+ * "uniVer": "4.25",
1396
+ * "unixVer": "x"
1397
+ * }
1398
+ * },
1399
+ * "web": {
1400
+ * "uniVer": "x",
1401
+ * "unixVer": "x"
1402
+ * }
1403
+ * }
1404
+ * @uniVueVersion 2,3
1405
+ * @example
1406
+ * ```typescript
1407
+ * uni.compressImage({
1408
+ * src:'/static/a.jpg',
1409
+ * quality:80,
1410
+ * success(e){
1411
+ * console.log(JSON.stringify(e))
1412
+ * },
1413
+ * })
1414
+ * ```
1415
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/image.html#compressimage
1416
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/compress-image.html
1417
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/compress-image.html
1418
+ * @autotest {
1419
+ generated:false,
1420
+ case:[
1421
+ {
1422
+ input:[{"src":"/static/d.jpg"},{"rotate","30"}]
1423
+ }
1424
+ ]
1425
+ }
1426
+ */
1427
+ compressImage(options : CompressImageOptions) : void;
1428
+ /**
1429
+ * 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。
1430
+ * @description 拍摄视频或从手机相册中选视频,返回视频的临时文件路径。
1431
+ * @uniPlatform {
1432
+ * "app": {
1433
+ * "android": {
1434
+ * "osVer": "5.0",
1435
+ * "uniVer": "√",
1436
+ * "unixVer": "4.18"
1437
+ * },
1438
+ * "ios": {
1439
+ * "osVer": "12.0",
1440
+ * "uniVer": "√",
1441
+ * "unixVer": "4.18"
1442
+ * },
1443
+ * "harmony": {
1444
+ * "osVer": "3.0",
1445
+ * "uniVer": "4.23",
1446
+ * "unixVer": "x"
1447
+ * }
1448
+ * },
1449
+ * "web": {
1450
+ * "uniVer": "√",
1451
+ * "unixVer": "4.0"
1452
+ * }
1453
+ * }
1454
+ * @uniVueVersion 2,3
1455
+ * @example
1456
+ * ```typescript
1457
+ * uni.chooseVideo({
1458
+ * success(e){
1459
+ * console.log(JSON.stringify(e))
1460
+ * },
1461
+ * })
1462
+ * ```
1463
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html
1464
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/choose-video.html
1465
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/choose-video.html
1466
+ *
1467
+ */
1468
+ chooseVideo(options : ChooseVideoOptions) : void;
1469
+ /**
1470
+ * 获取视频详细信息
1471
+ * @description 获取视频详细信息
1472
+ * @uniPlatform {
1473
+ * "app": {
1474
+ * "android": {
1475
+ * "osVer": "5.0",
1476
+ * "uniVer": "√",
1477
+ * "unixVer": "4.18"
1478
+ * },
1479
+ * "ios": {
1480
+ * "osVer": "12.0",
1481
+ * "uniVer": "√",
1482
+ * "unixVer": "4.25"
1483
+ * },
1484
+ * "harmony": {
1485
+ * "osVer": "3.0",
1486
+ * "uniVer": "4.23",
1487
+ * "unixVer": "x"
1488
+ * }
1489
+ * },
1490
+ * "web": {
1491
+ * "uniVer": "√",
1492
+ * "unixVer": "4.0"
1493
+ * }
1494
+ * }
1495
+ * @uniVueVersion 2,3
1496
+ * @example
1497
+ * ```typescript
1498
+ * uni.GetVideoInfo({
1499
+ * src:"/static/a.mp4",
1500
+ * success(e){
1501
+ * console.log(JSON.stringify(e))
1502
+ * },
1503
+ * })
1504
+ * ```
1505
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html#getvideoinfo
1506
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-video-info.html
1507
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-video-info.html
1508
+ *
1509
+ */
1510
+ getVideoInfo(options : GetVideoInfoOptions) : void;
1511
+ /**
1512
+ * 保存视频到系统相册
1513
+ * @description 保存视频到系统相册
1514
+ * @uniPlatform {
1515
+ * "app": {
1516
+ * "android": {
1517
+ * "osVer": "5.0",
1518
+ * "uniVer": "√",
1519
+ * "unixVer": "4.18"
1520
+ * },
1521
+ * "ios": {
1522
+ * "osVer": "12.0",
1523
+ * "uniVer": "√",
1524
+ * "unixVer": "4.18"
1525
+ * },
1526
+ * "harmony": {
1527
+ * "osVer": "3.0",
1528
+ * "uniVer": "4.23",
1529
+ * "unixVer": "x"
1530
+ * }
1531
+ * },
1532
+ * "web": {
1533
+ * "uniVer": "x",
1534
+ * "unixVer": "x"
1535
+ * }
1536
+ * }
1537
+ * @uniVueVersion 2,3
1538
+ * @example
1539
+ * ```typescript
1540
+ * uni.saveVideoToPhotosAlbum({
1541
+ * filePath:"/static/a.mp4",
1542
+ * success(e){
1543
+ * console.log(JSON.stringify(e))
1544
+ * },
1545
+ * })
1546
+ * ```
1547
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html#savevideotophotosalbum
1548
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/save-video-to-photos-album.html
1549
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/save-video-to-photos-album.html
1550
+ *
1551
+ */
1552
+ saveVideoToPhotosAlbum(options : SaveVideoToPhotosAlbumOptions) : void;
1553
+ /**
1554
+ * 压缩视频
1555
+ * @description 压缩视频
1556
+ * @uniPlatform {
1557
+ * "app": {
1558
+ * "android": {
1559
+ * "osVer": "5.0",
1560
+ * "uniVer": "3,1.10",
1561
+ * "unixVer": "4.18"
1562
+ * },
1563
+ * "ios": {
1564
+ * "osVer": "12.0",
1565
+ * "uniVer": "√",
1566
+ * "unixVer": "4.25"
1567
+ * },
1568
+ * "harmony": {
1569
+ * "osVer": "x",
1570
+ * "uniVer": "x",
1571
+ * "unixVer": "x"
1572
+ * }
1573
+ * },
1574
+ * "web": {
1575
+ * "uniVer": "x",
1576
+ * "unixVer": "x"
1577
+ * }
1578
+ * }
1579
+ * @uniVueVersion 2,3
1580
+ * @example
1581
+ * ```typescript
1582
+ * uni.compressVideo({
1583
+ * src:"/static/a.mp4",
1584
+ * quality:"low",
1585
+ * success(e){
1586
+ * console.log(JSON.stringify(e))
1587
+ * },
1588
+ * })
1589
+ * ```
1590
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html#compressvideo
1591
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/compress-video.html
1592
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/compress-video.html
1593
+ *
1594
+ */
1595
+ compressVideo(options : CompressVideoOptions) : void;
1596
+ /**
1597
+ * 从本地选择文件(仅支持H5)
1598
+ *
1599
+ * @tutorial https://uniapp.dcloud.net.cn/api/media/file.html#choosefile
1600
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/file.html#choosefile
1601
+ * @uniPlatform {
1602
+ * "app": {
1603
+ * "android": {
1604
+ * "osVer": "x",
1605
+ * "uniVer": "x",
1606
+ * "unixVer": "x"
1607
+ * },
1608
+ * "ios": {
1609
+ * "osVer": "x",
1610
+ * "uniVer": "x",
1611
+ * "unixVer": "x"
1612
+ * },
1613
+ * "harmony": {
1614
+ * "osVer": "3.0",
1615
+ * "uniVer": "4.27",
1616
+ * "unixVer": "x"
1617
+ * }
1618
+ * },
1619
+ * "web": {
1620
+ * "uniVer": "2.9.9",
1621
+ * "unixVer": "4.0"
1622
+ * }
1623
+ * }
1624
+ */
1625
+ chooseFile: ChooseFile;
1626
+ /**
1627
+ * 拍摄或从手机相册中选择图片或视频。
1628
+ *
1629
+ * @tutorial https://uniapp.dcloud.net.cn/api/media/video.html#choosemedia
1630
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/media/video.html#choosemedia
1631
+ * @uniPlatform {
1632
+ * "app": {
1633
+ * "android": {
1634
+ * "osVer": "x",
1635
+ * "uniVer": "x",
1636
+ * "unixVer": "x"
1637
+ * },
1638
+ * "ios": {
1639
+ * "osVer": "x",
1640
+ * "uniVer": "x",
1641
+ * "unixVer": "x"
1642
+ * },
1643
+ * "harmony": {
1644
+ * "osVer": "3.0",
1645
+ * "uniVer": "4.27",
1646
+ * "unixVer": "x"
1647
+ * }
1648
+ * },
1649
+ * "web": {
1650
+ * "uniVer": "x",
1651
+ * "unixVer": "x"
1652
+ * }
1653
+ * }
1654
+ */
1655
+ chooseMedia: ChooseMedia;
1656
+
1657
+ }