@dcloudio/uni-app-x 0.7.24 → 0.7.26

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 +28 -28
  121. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/index.d.ts +13 -13
  122. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +1341 -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,1881 +1,1992 @@
1
-
2
- export type ReadFileSuccessResult = {
3
- data : string
4
- }
5
-
6
- export type OpenFileSuccessResult = {
7
- fd : string
8
- }
9
-
10
-
11
- /**
12
- * 通用的正确返回结果
13
- */
14
- export type FileManagerSuccessResult = {
15
- errMsg : string,
16
- }
17
- /**
18
- * 通用的正确返回结果回调
19
- */
20
- export type FileManagerSuccessCallback = (res : FileManagerSuccessResult) => void
21
- /**
22
- * 通用的错误返回结果回调
23
- */
24
- export type FileManagerFailCallback = (res : FileSystemManagerFail) => void
25
- /**
26
- * 通用的结束返回结果回调
27
- */
28
- export type FileManagerCompleteCallback = (res : any) => void
29
-
30
-
31
-
32
- export type ReadFileSuccessCallback = (res : ReadFileSuccessResult) => void
33
-
34
-
35
-
36
- export type ReadFileOptions = {
37
- /**
38
- * base64 / utf-8
39
- */
40
- encoding : "base64" | "utf-8",
41
- /**
42
- * 文件路径,支持相对地址和绝对地址,app-android平台支持代码包文件目录
43
- */
44
- filePath : string.URIString,
45
- /**
46
- * 接口调用的回调函数
47
- */
48
- success ?: ReadFileSuccessCallback | null,
49
- /**
50
- * 接口调用失败的回调函数
51
- */
52
- fail ?: FileManagerFailCallback | null,
53
- /**
54
- * 接口调用结束的回调函数(调用成功、失败都会执行)
55
- */
56
- complete ?: FileManagerCompleteCallback | null
57
- }
58
-
59
-
60
-
61
-
62
-
63
- export type WriteFileOptions = {
64
- /**
65
- * 文件路径,只支持绝对地址
66
- */
67
- filePath : string.URIString,
68
- /**
69
- * 指定写入文件的字符编码
70
- * 支持:ascii base64 utf-8
71
- */
72
- encoding : "ascii" | "base64" | "utf-8",
73
- /**
74
- * 写入的文本内容
75
- */
76
- data : string,
77
- /**
78
- * 接口调用的回调函数
79
- */
80
- success ?: FileManagerSuccessCallback | null,
81
- /**
82
- * 接口调用失败的回调函数
83
- */
84
- fail ?: FileManagerFailCallback | null,
85
- /**
86
- * 接口调用结束的回调函数(调用成功、失败都会执行)
87
- */
88
- complete ?: FileManagerCompleteCallback | null
89
- }
90
-
91
- export type AppendFileOptions = {
92
- /**
93
- * 要追加内容的文件路径 (本地路径)
94
- */
95
- filePath : string.URIString,
96
- /**
97
- * 指定写入文件的字符编码
98
- * 支持:ascii base64 utf-8
99
- */
100
- encoding : "ascii" | "base64" | "utf-8",
101
- /**
102
- * 要追加的文本
103
- */
104
- data : string,
105
- /**
106
- * 接口调用的回调函数
107
- */
108
- success ?: FileManagerSuccessCallback | null,
109
- /**
110
- * 接口调用失败的回调函数
111
- */
112
- fail ?: FileManagerFailCallback | null,
113
- /**
114
- * 接口调用结束的回调函数(调用成功、失败都会执行)
115
- */
116
- complete ?: FileManagerCompleteCallback | null
117
- }
118
-
119
-
120
- export type OpenFileSuccessCallback = (res : OpenFileSuccessResult) => void
121
-
122
- export type OpenFileOptions = {
123
- /**
124
- * 要追加内容的文件路径 (本地路径)
125
- */
126
- filePath : string.URIString,
127
- /**
128
- * 文件系统标志,默认值: 'r'
129
- */
130
- flag : "a" | "ax" | "a+" | "ax+" | "r" | "r+" | "w" | "wx" | "w+" | "wx" | "wx+",
131
- /**
132
- * 接口调用的回调函数
133
- */
134
- success ?: OpenFileSuccessCallback | null,
135
- /**
136
- * 接口调用失败的回调函数
137
- */
138
- fail ?: FileManagerFailCallback | null,
139
- /**
140
- * 接口调用结束的回调函数(调用成功、失败都会执行)
141
- */
142
- complete ?: FileManagerCompleteCallback | null
143
- }
144
-
145
- export type OpenFileSyncOptions = {
146
- /**
147
- * 要追加内容的文件路径 (本地路径)
148
- */
149
- filePath : string.URIString,
150
- /**
151
- * 文件系统标志,默认值: 'r'
152
- */
153
- flag : "a" | "ax" | "a+" | "ax+" | "r" | "r+" | "w" | "wx" | "w+" | "wx" | "wx+",
154
- }
155
-
156
-
157
-
158
-
159
- export type UnLinkSuccessCallback = (res : FileManagerSuccessResult) => void
160
-
161
-
162
-
163
- export type UnLinkOptions = {
164
- /**
165
- * 文件路径,只支持绝对地址
166
- */
167
- filePath : string.URIString,
168
- /**
169
- * 接口调用的回调函数
170
- */
171
- success ?: UnLinkSuccessCallback | null,
172
- /**
173
- * 接口调用失败的回调函数
174
- */
175
- fail ?: FileManagerFailCallback | null,
176
- /**
177
- * 接口调用结束的回调函数(调用成功、失败都会执行)
178
- */
179
- complete ?: FileManagerCompleteCallback | null
180
- }
181
-
182
- export type MkDirSuccessCallback = (res : FileManagerSuccessResult) => void
183
-
184
-
185
-
186
-
187
- export type MkDirOptions = {
188
- /**
189
- * 创建的目录路径 (本地路径)
190
- */
191
- dirPath : string.URIString,
192
- /**
193
- *是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。
194
- */
195
- recursive : boolean,
196
- /**
197
- * 接口调用的回调函数
198
- */
199
- success ?: MkDirSuccessCallback | null,
200
- /**
201
- * 接口调用失败的回调函数
202
- */
203
- fail ?: FileManagerFailCallback | null,
204
- /**
205
- * 接口调用结束的回调函数(调用成功、失败都会执行)
206
- */
207
- complete ?: FileManagerCompleteCallback | null
208
- }
209
-
210
-
211
- export type RmDirSuccessCallback = (res : FileManagerSuccessResult) => void
212
-
213
-
214
-
215
-
216
- export type RmDirOptions = {
217
- /**
218
- * 要删除的目录路径 (本地路径)
219
- */
220
- dirPath : string.URIString,
221
- /**
222
- *是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。
223
- */
224
- recursive : boolean,
225
- /**
226
- * 接口调用的回调函数
227
- */
228
- success ?: MkDirSuccessCallback | null,
229
- /**
230
- * 接口调用失败的回调函数
231
- */
232
- fail ?: FileManagerFailCallback | null,
233
- /**
234
- * 接口调用结束的回调函数(调用成功、失败都会执行)
235
- */
236
- complete ?: FileManagerCompleteCallback | null
237
- }
238
-
239
-
240
- export type ReadDirSuccessResult = {
241
- files : string[],
242
- }
243
-
244
- export type ReadDirSuccessCallback = (res : ReadDirSuccessResult) => void
245
-
246
-
247
- export type ReadDirOptions = {
248
- /**
249
- * 要读取的目录路径 (本地路径)
250
- */
251
- dirPath : string.URIString,
252
-
253
- /**
254
- * 接口调用的回调函数
255
- */
256
- success ?: ReadDirSuccessCallback | null,
257
- /**
258
- * 接口调用失败的回调函数
259
- */
260
- fail ?: FileManagerFailCallback | null,
261
- /**
262
- * 接口调用结束的回调函数(调用成功、失败都会执行)
263
- */
264
- complete ?: FileManagerCompleteCallback | null
265
- }
266
-
267
-
268
-
269
-
270
- export type AccessOptions = {
271
- /**
272
- * 要判断是否存在的文件/目录路径 (本地路径)
273
- */
274
- path : string.URIString,
275
-
276
- /**
277
- * 接口调用的回调函数
278
- */
279
- success ?: FileManagerSuccessCallback | null,
280
- /**
281
- * 接口调用失败的回调函数
282
- */
283
- fail ?: FileManagerFailCallback | null,
284
- /**
285
- * 接口调用结束的回调函数(调用成功、失败都会执行)
286
- */
287
- complete ?: FileManagerCompleteCallback | null
288
- }
289
-
290
- export type RenameOptions = {
291
- /**
292
- * 源文件路径,支持本地路径
293
- */
294
- oldPath : string.URIString,
295
- /**
296
- * 新文件路径,支持本地路径
297
- */
298
- newPath : string.URIString,
299
-
300
- /**
301
- * 接口调用的回调函数
302
- */
303
- success ?: FileManagerSuccessCallback | null,
304
- /**
305
- * 接口调用失败的回调函数
306
- */
307
- fail ?: FileManagerFailCallback | null,
308
- /**
309
- * 接口调用结束的回调函数(调用成功、失败都会执行)
310
- */
311
- complete ?: FileManagerCompleteCallback | null
312
- }
313
-
314
- export type CopyFileOptions = {
315
- /**
316
- * 源文件路径,支持本地路径
317
- */
318
- srcPath : string.URIString,
319
- /**
320
- * 新文件路径,支持本地路径
321
- */
322
- destPath : string.URIString,
323
-
324
- /**
325
- * 接口调用的回调函数
326
- */
327
- success ?: FileManagerSuccessCallback | null,
328
- /**
329
- * 接口调用失败的回调函数
330
- */
331
- fail ?: FileManagerFailCallback | null,
332
- /**
333
- * 接口调用结束的回调函数(调用成功、失败都会执行)
334
- */
335
- complete ?: FileManagerCompleteCallback | null
336
- }
337
-
338
- export type SaveFileOptions = {
339
- /**
340
- * 临时存储文件路径 (本地路径)
341
- */
342
- tempFilePath : string.URIString,
343
- /**
344
- * 要存储的文件路径 (本地路径)
345
- */
346
- filePath ?: string.URIString | null,
347
-
348
- /**
349
- * 接口调用的回调函数
350
- */
351
- success ?: SaveFileSuccessCallback | null,
352
- /**
353
- * 接口调用失败的回调函数
354
- */
355
- fail ?: FileManagerFailCallback | null,
356
- /**
357
- * 接口调用结束的回调函数(调用成功、失败都会执行)
358
- */
359
- complete ?: FileManagerCompleteCallback | null
360
- }
361
-
362
-
363
- export type SaveFileSuccessCallback = (res : SaveFileSuccessResult) => void
364
-
365
- export type SaveFileSuccessResult = {
366
- /**
367
- * 存储后的文件路径 (本地路径)
368
- */
369
- savedFilePath : string,
370
- }
371
-
372
- export type GetFileInfoSuccessResult = {
373
- digest : string,
374
- size : number,
375
- errMsg : string
376
- }
377
-
378
- export type GetFileInfoSuccessCallback = (res : GetFileInfoSuccessResult) => void
379
-
380
- export type GetFileInfoOptions = {
381
- /**
382
- * 要读取的文件路径 (本地路径)
383
- */
384
- filePath : string.URIString,
385
- /**
386
- * md5 / sha1
387
- */
388
- digestAlgorithm : "md5" | "sha1" | null,
389
- /**
390
- * 接口调用的回调函数
391
- */
392
- success ?: GetFileInfoSuccessCallback | null,
393
- /**
394
- * 接口调用失败的回调函数
395
- */
396
- fail ?: FileManagerFailCallback | null,
397
- /**
398
- * 接口调用结束的回调函数(调用成功、失败都会执行)
399
- */
400
- complete ?: FileManagerCompleteCallback | null
401
- }
402
-
403
-
404
- export interface Stats {
405
- /**
406
- * 文件的类型和存取的权限,对应 POSIX stat.st_mode
407
- * 注意android中,文件类型只包含是否是目录与文件,
408
- * 另外在android中这里的权限指的是当前进程对文件或者文件夹是否有读,写,执行的权限,
409
- * 这里没有与 POSIX stat.st_mode对应的组,其他人等相关权限的数据返回,只有所有者的相关权限
410
- */
411
- mode : number;
412
- /**
413
- * 文件大小,单位:B,对应 POSIX stat.st_size
414
- */
415
- size : number;
416
- /**
417
- * 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime
418
- * 注意:android中由于系统限制无法获取该数据
419
- */
420
- lastAccessedTime : number;
421
- /**
422
- * 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime
423
- */
424
- lastModifiedTime : number;
425
- /**
426
- * @internal
427
- */
428
- mIsFile : boolean;
429
- /**
430
- * 判断当前文件是否一个目录
431
- */
432
- isDirectory() : boolean;
433
- /**
434
- * 判断当前文件是否一个普通文件
435
- */
436
- isFile() : boolean;
437
- }
438
-
439
-
440
- export type FileStats = {
441
- path : string,
442
- stats : Stats,
443
- }
444
-
445
- export type StatSuccessResult = {
446
- errMsg : string,
447
- stats : FileStats[]
448
- }
449
-
450
-
451
- export type StatSuccessCallback = (res : StatSuccessResult) => void
452
-
453
-
454
- export type StatOptions = {
455
- /**
456
- * 文件/目录路径 (本地路径)
457
- */
458
- path : string.URIString,
459
- /**
460
- * 是否递归获取目录下的每个文件的 Stats 信息
461
- */
462
- recursive : boolean,
463
- /**
464
- * 接口调用的回调函数
465
- */
466
- success ?: StatSuccessCallback | null,
467
- /**
468
- * 接口调用失败的回调函数
469
- */
470
- fail ?: FileManagerFailCallback | null,
471
- /**
472
- * 接口调用结束的回调函数(调用成功、失败都会执行)
473
- */
474
- complete ?: FileManagerCompleteCallback | null
475
- }
476
-
477
-
478
- export type UnzipFileOptions = {
479
- /**
480
- * 源文件路径,支持本地路径, 只可以是 zip 压缩文件
481
- */
482
- zipFilePath : string,
483
- /**
484
- * 目标目录路径, 支持本地路径
485
- */
486
- targetPath : string,
487
- /**
488
- * 接口调用的回调函数
489
- */
490
- success ?: FileManagerSuccessCallback | null,
491
- /**
492
- * 接口调用失败的回调函数
493
- */
494
- fail ?: FileManagerFailCallback | null,
495
- /**
496
- * 接口调用结束的回调函数(调用成功、失败都会执行)
497
- */
498
- complete ?: FileManagerCompleteCallback | null
499
- }
500
-
501
- export type GetSavedFileListResult = {
502
- fileList : string[]
503
- }
504
-
505
- export type GetSavedFileListCallback = (res : GetSavedFileListResult) => void
506
-
507
- export type GetSavedFileListOptions = {
508
- /**
509
- * 接口调用的回调函数
510
- */
511
- success ?: GetSavedFileListCallback | null,
512
- /**
513
- * 接口调用失败的回调函数
514
- */
515
- fail ?: FileManagerFailCallback | null,
516
- /**
517
- * 接口调用结束的回调函数(调用成功、失败都会执行)
518
- */
519
- complete ?: FileManagerCompleteCallback | null
520
- }
521
-
522
-
523
-
524
- export type TruncateFileOptions = {
525
- /**
526
- * 要截断的文件路径 (本地路径)
527
- */
528
- filePath : string.URIString,
529
- /**
530
- * 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;
531
- * 如果 length 大于文件长度,不做处理
532
- */
533
- length : number,
534
- /**
535
- * 接口调用的回调函数
536
- */
537
- success ?: FileManagerSuccessCallback | null,
538
- /**
539
- * 接口调用失败的回调函数
540
- */
541
- fail ?: FileManagerFailCallback | null,
542
- /**
543
- * 接口调用结束的回调函数(调用成功、失败都会执行)
544
- */
545
- complete ?: FileManagerCompleteCallback | null
546
- }
547
-
548
-
549
- export type ReadCompressedFileResult = {
550
- data : string
551
- }
552
-
553
- export type ReadCompressedFileCallback = (res : ReadCompressedFileResult) => void
554
- export type ReadCompressedFileOptions = {
555
- /**
556
- * 要读取的文件的路径 (本地用户文件或代码包文件),app-android平台支持代码包文件目录
557
- */
558
- filePath : string.URIString,
559
- /**
560
- * 文件压缩类型,目前仅支持 'br'。
561
- */
562
- compressionAlgorithm : "br",
563
- /**
564
- * 接口调用的回调函数
565
- */
566
- success ?: ReadCompressedFileCallback | null,
567
- /**
568
- * 接口调用失败的回调函数
569
- */
570
- fail ?: FileManagerFailCallback | null,
571
- /**
572
- * 接口调用结束的回调函数(调用成功、失败都会执行)
573
- */
574
- complete ?: FileManagerCompleteCallback | null
575
- }
576
-
577
-
578
- export type RemoveSavedFileOptions = {
579
- /**
580
- * 需要删除的文件路径 (本地路径)
581
- */
582
- filePath : string.URIString,
583
- /**
584
- * 接口调用的回调函数
585
- */
586
- success ?: FileManagerSuccessCallback | null,
587
- /**
588
- * 接口调用失败的回调函数
589
- */
590
- fail ?: FileManagerFailCallback | null,
591
- /**
592
- * 接口调用结束的回调函数(调用成功、失败都会执行)
593
- */
594
- complete ?: FileManagerCompleteCallback | null
595
- }
596
-
597
-
598
-
599
- export type WriteResult = {
600
- /**
601
- * 实际被写入到文件中的字节数(注意,被写入的字节数不一定与被写入的字符串字符数相同)
602
- */
603
- bytesWritten : number
604
- }
605
-
606
- export type WriteCallback = (res : WriteResult) => void
607
- export type WriteOptions = {
608
- /**
609
- * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
610
- */
611
- fd : string,
612
- /**
613
- * 写入的内容
614
- */
615
- data : string,
616
- /**
617
- * 指定写入文件的字符编码
618
- * 支持:ascii base64 utf-8
619
- */
620
- encoding : "ascii" | "base64" | "utf-8",
621
- // /**
622
- // * 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。
623
- // */
624
- // position : number | null,
625
-
626
- /**
627
- * 接口调用的回调函数
628
- */
629
- success ?: WriteCallback | null,
630
- /**
631
- * 接口调用失败的回调函数
632
- */
633
- fail ?: FileManagerFailCallback | null,
634
- /**
635
- * 接口调用结束的回调函数(调用成功、失败都会执行)
636
- */
637
- complete ?: FileManagerCompleteCallback | null
638
- }
639
- export type WriteSyncOptions = {
640
- /**
641
- * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
642
- */
643
- fd : string,
644
- /**
645
- * 写入的内容
646
- */
647
- data : string,
648
- /**
649
- * 指定写入文件的字符编码
650
- * 支持:ascii base64 utf-8
651
- */
652
- encoding : "ascii" | "base64" | "utf-8",
653
- }
654
-
655
- export type CloseOptions = {
656
- /**
657
- * 需要被关闭的文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
658
- */
659
- fd : string,
660
- /**
661
- * 接口调用的回调函数
662
- */
663
- success ?: FileManagerSuccessCallback | null,
664
- /**
665
- * 接口调用失败的回调函数
666
- */
667
- fail ?: FileManagerFailCallback | null,
668
- /**
669
- * 接口调用结束的回调函数(调用成功、失败都会执行)
670
- */
671
- complete ?: FileManagerCompleteCallback | null
672
- }
673
-
674
- export type CloseSyncOptions = {
675
- /**
676
- * 需要被关闭的文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
677
- */
678
- fd : string,
679
- }
680
-
681
-
682
- export type FStatSuccessResult = {
683
- /**
684
- * Stats 对象,包含了文件的状态信息
685
- */
686
- stats : Stats
687
- }
688
-
689
-
690
- export type FStatSuccessCallback = (res : FStatSuccessResult) => void
691
-
692
-
693
- export type FStatOptions = {
694
- /**
695
- * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
696
- */
697
- fd : string,
698
- /**
699
- * 接口调用的回调函数
700
- */
701
- success ?: FStatSuccessCallback | null,
702
- /**
703
- * 接口调用失败的回调函数
704
- */
705
- fail ?: FileManagerFailCallback | null,
706
- /**
707
- * 接口调用结束的回调函数(调用成功、失败都会执行)
708
- */
709
- complete ?: FileManagerCompleteCallback | null
710
- }
711
-
712
- export type FStatSyncOptions = {
713
- /**
714
- * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
715
- */
716
- fd : string
717
- }
718
-
719
- export type FTruncateFileOptions = {
720
- /**
721
- * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
722
- */
723
- fd : string,
724
- /**
725
- * 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;
726
- * 如果 length 大于文件长度,不做处理
727
- */
728
- length : number,
729
- /**
730
- * 接口调用的回调函数
731
- */
732
- success ?: FileManagerSuccessCallback | null,
733
- /**
734
- * 接口调用失败的回调函数
735
- */
736
- fail ?: FileManagerFailCallback | null,
737
- /**
738
- * 接口调用结束的回调函数(调用成功、失败都会执行)
739
- */
740
- complete ?: FileManagerCompleteCallback | null
741
- }
742
-
743
- export type FTruncateFileSyncOptions = {
744
- /**
745
- * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
746
- */
747
- fd : string,
748
- /**
749
- * 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;
750
- * 如果 length 大于文件长度,不做处理
751
- */
752
- length : number,
753
- }
754
-
755
-
756
- export type EntryItem = {
757
- /** 压缩包内文件路径 */
758
- path : string
759
- /**
760
- * 指定写入文件的字符编码
761
- * 支持:ascii base64 utf-8
762
- */
763
- encoding : "ascii" | "base64" | "base64",
764
- // /** 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */
765
- // length ?: number
766
- // /** 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */
767
- // position ?: number
768
- }
769
- export type EntriesResult = {
770
- /** 文件路径 */
771
- result : Map<string, ZipFileItem>
772
- }
773
- export type ZipFileItem = {
774
- /** 文件内容 */
775
- data ?: string | null,
776
- /** 错误信息 */
777
- errMsg : string
778
- }
779
- export type ReadZipEntryCallback = (res : EntriesResult) => void
780
- export type ReadZipEntryOptions = {
781
- /**
782
- * 要读取的压缩包的路径 (本地路径),app-android平台支持代码包文件目录
783
- */
784
- filePath : string.URIString,
785
- /**
786
- *统一指定读取文件的字符编码,只在 entries 值为"all"时有效。
787
- *如果 entries 值为"all"且不传 encoding,则以 string 格式读取文件的内容
788
- */
789
- encoding : "ascii" | "base64" | "utf-8",
790
- /** 要读取的压缩包内的文件列表(当不传入时表示读取压缩包内所有文件) */
791
- entries ?: EntryItem[] | null,
792
- /**
793
- * 接口调用的回调函数
794
- */
795
- success ?: ReadZipEntryCallback | null,
796
- /**
797
- * 接口调用失败的回调函数
798
- */
799
- fail ?: FileManagerFailCallback | null,
800
- /**
801
- * 接口调用结束的回调函数(调用成功、失败都会执行)
802
- */
803
- complete ?: FileManagerCompleteCallback | null
804
- }
805
-
806
-
807
- export interface FileSystemManager {
808
- /**
809
- * 读取本地文件内容
810
- * @uniPlatform {
811
- * "app": {
812
- * "android": {
813
- * "osVer": "5.0",
814
- * "uniVer": "x",
815
- * "unixVer": "3.9.0"
816
- * },
817
- * "ios": {
818
- * "osVer": "12.0",
819
- * "uniVer": "x",
820
- * "unixVer": "4.11"
821
- * }
822
- * },
823
- * "web": {
824
- * "uniVer": "x",
825
- * "unixVer": "x"
826
- * }
827
- * }
828
- */
829
- readFile(options : ReadFileOptions) : void;
830
- /**
831
- * FileSystemManager.readFile 的同步版本参数
832
- * @param filePath 文件路径,支持相对地址和绝对地址,app-android平台支持代码包文件目录
833
- * @param encoding base64 / utf-8
834
- * @uniPlatform {
835
- * "app": {
836
- * "android": {
837
- * "osVer": "5.0",
838
- * "uniVer": "x",
839
- * "unixVer": "4.13"
840
- * },
841
- * "ios": {
842
- * "osVer": "12.0",
843
- * "uniVer": "x",
844
- * "unixVer": "x"
845
- * }
846
- * },
847
- * "web": {
848
- * "uniVer": "x",
849
- * "unixVer": "x"
850
- * }
851
- * }
852
- */
853
- readFileSync(filePath : string, encoding : string | null) : string;
854
- /**
855
- * 写文件
856
- * @uniPlatform {
857
- * "app": {
858
- * "android": {
859
- * "osVer": "5.0",
860
- * "uniVer": "x",
861
- * "unixVer": "3.9.0"
862
- * },
863
- * "ios": {
864
- * "osVer": "12.0",
865
- * "uniVer": "x",
866
- * "unixVer": "4.11"
867
- * }
868
- * },
869
- * "web": {
870
- * "uniVer": "x",
871
- * "unixVer": "x"
872
- * }
873
- * }
874
- */
875
- writeFile(options : WriteFileOptions) : void;
876
- /**
877
- * FileSystemManager.writeFile 的同步版本
878
- * @param filePath 文件路径,只支持绝对地址
879
- * @param data 写入的文本内容
880
- * @param encoding 指定写入文件的字符编码,支持:ascii base64 utf-8
881
- * @uniPlatform {
882
- * "app": {
883
- * "android": {
884
- * "osVer": "5.0",
885
- * "uniVer": "x",
886
- * "unixVer": "4.13"
887
- * },
888
- * "ios": {
889
- * "osVer": "12.0",
890
- * "uniVer": "x",
891
- * "unixVer": "x"
892
- * }
893
- * },
894
- * "web": {
895
- * "uniVer": "x",
896
- * "unixVer": "x"
897
- * }
898
- * }
899
- */
900
- writeFileSync(filePath : string, data : string, encoding : string) : void;
901
- /**
902
- * 删除文件
903
- * @uniPlatform {
904
- * "app": {
905
- * "android": {
906
- * "osVer": "5.0",
907
- * "uniVer": "x",
908
- * "unixVer": "3.9.0"
909
- * },
910
- * "ios": {
911
- * "osVer": "12.0",
912
- * "uniVer": "x",
913
- * "unixVer": "4.11"
914
- * }
915
- * },
916
- * "web": {
917
- * "uniVer": "x",
918
- * "unixVer": "x"
919
- * }
920
- * }
921
- */
922
- unlink(options : UnLinkOptions) : void;
923
- /**
924
- * FileSystemManager.unlink 的同步版本
925
- * @param filePath 文件路径,只支持绝对地址
926
- * @uniPlatform {
927
- * "app": {
928
- * "android": {
929
- * "osVer": "5.0",
930
- * "uniVer": "x",
931
- * "unixVer": "4.13"
932
- * },
933
- * "ios": {
934
- * "osVer": "12.0",
935
- * "uniVer": "x",
936
- * "unixVer": "x"
937
- * }
938
- * },
939
- * "web": {
940
- * "uniVer": "x",
941
- * "unixVer": "x"
942
- * }
943
- * }
944
- */
945
- unlinkSync(filePath : string) : void;
946
- /**
947
- * 创建目录
948
- * @uniPlatform {
949
- * "app": {
950
- * "android": {
951
- * "osVer": "5.0",
952
- * "uniVer": "x",
953
- * "unixVer": "3.9.0"
954
- * },
955
- * "ios": {
956
- * "osVer": "12.0",
957
- * "uniVer": "x",
958
- * "unixVer": "4.11"
959
- * }
960
- * },
961
- * "web": {
962
- * "uniVer": "x",
963
- * "unixVer": "x"
964
- * }
965
- * }
966
- */
967
- mkdir(options : MkDirOptions) : void;
968
- /**
969
- * FileSystemManager.mkdir 的同步版本
970
- * @param dirPath 创建的目录路径 (本地路径)
971
- * @param recursive 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。
972
- * @uniPlatform {
973
- * "app": {
974
- * "android": {
975
- * "osVer": "5.0",
976
- * "uniVer": "x",
977
- * "unixVer": "4.13"
978
- * },
979
- * "ios": {
980
- * "osVer": "12.0",
981
- * "uniVer": "x",
982
- * "unixVer": "x"
983
- * }
984
- * },
985
- * "web": {
986
- * "uniVer": "x",
987
- * "unixVer": "x"
988
- * }
989
- * }
990
- */
991
- mkdirSync(dirPath : string, recursive : boolean) : void;
992
- /**
993
- * 删除目录
994
- * @uniPlatform {
995
- * "app": {
996
- * "android": {
997
- * "osVer": "5.0",
998
- * "uniVer": "x",
999
- * "unixVer": "3.9.0"
1000
- * },
1001
- * "ios": {
1002
- * "osVer": "12.0",
1003
- * "uniVer": "x",
1004
- * "unixVer": "4.11"
1005
- * }
1006
- * },
1007
- * "web": {
1008
- * "uniVer": "x",
1009
- * "unixVer": "x"
1010
- * }
1011
- * }
1012
- */
1013
- rmdir(options : RmDirOptions) : void;
1014
- /**
1015
- * FileSystemManager.rmdir 的同步版本
1016
- * @param dirPath 要删除的目录路径 (本地路径)
1017
- * @param recursive 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。
1018
- * @uniPlatform {
1019
- * "app": {
1020
- * "android": {
1021
- * "osVer": "5.0",
1022
- * "uniVer": "x",
1023
- * "unixVer": "4.13"
1024
- * },
1025
- * "ios": {
1026
- * "osVer": "12.0",
1027
- * "uniVer": "x",
1028
- * "unixVer": "x"
1029
- * }
1030
- * },
1031
- * "web": {
1032
- * "uniVer": "x",
1033
- * "unixVer": "x"
1034
- * }
1035
- * }
1036
- */
1037
- rmdirSync(dirPath : string, recursive : boolean) : void;
1038
- /**
1039
- * 读取目录内文件列表
1040
- * @uniPlatform {
1041
- * "app": {
1042
- * "android": {
1043
- * "osVer": "5.0",
1044
- * "uniVer": "x",
1045
- * "unixVer": "3.9.0"
1046
- * },
1047
- * "ios": {
1048
- * "osVer": "12.0",
1049
- * "uniVer": "x",
1050
- * "unixVer": "4.11"
1051
- * }
1052
- * },
1053
- * "web": {
1054
- * "uniVer": "x",
1055
- * "unixVer": "x"
1056
- * }
1057
- * }
1058
- */
1059
- readdir(options : ReadDirOptions) : void;
1060
- /**
1061
- * FileSystemManager.readdir 的同步版本
1062
- * @param dirPath 要读取的目录路径 (本地路径)
1063
- * @uniPlatform {
1064
- * "app": {
1065
- * "android": {
1066
- * "osVer": "5.0",
1067
- * "uniVer": "x",
1068
- * "unixVer": "4.13"
1069
- * },
1070
- * "ios": {
1071
- * "osVer": "12.0",
1072
- * "uniVer": "x",
1073
- * "unixVer": "x"
1074
- * }
1075
- * },
1076
- * "web": {
1077
- * "uniVer": "x",
1078
- * "unixVer": "x"
1079
- * }
1080
- * }
1081
- */
1082
- readdirSync(dirPath : string) : string[] | null;
1083
- /**
1084
- * 判断文件/目录是否存在
1085
- * @uniPlatform {
1086
- * "app": {
1087
- * "android": {
1088
- * "osVer": "5.0",
1089
- * "uniVer": "x",
1090
- * "unixVer": "3.9.0"
1091
- * },
1092
- * "ios": {
1093
- * "osVer": "12.0",
1094
- * "uniVer": "x",
1095
- * "unixVer": "4.11"
1096
- * }
1097
- * },
1098
- * "web": {
1099
- * "uniVer": "x",
1100
- * "unixVer": "x"
1101
- * }
1102
- * }
1103
- */
1104
- access(options : AccessOptions) : void;
1105
- /**
1106
- * FileSystemManager.access 的同步版本
1107
- * @param path 要判断是否存在的文件/目录路径 (本地路径)
1108
- * @uniPlatform {
1109
- * "app": {
1110
- * "android": {
1111
- * "osVer": "5.0",
1112
- * "uniVer": "x",
1113
- * "unixVer": "4.13"
1114
- * },
1115
- * "ios": {
1116
- * "osVer": "12.0",
1117
- * "uniVer": "x",
1118
- * "unixVer": "x"
1119
- * }
1120
- * },
1121
- * "web": {
1122
- * "uniVer": "x",
1123
- * "unixVer": "x"
1124
- * }
1125
- * }
1126
- */
1127
- accessSync(path : string) : void;
1128
- /**
1129
- * 重命名文件。可以把文件从 oldPath 移动到 newPath
1130
- * @uniPlatform {
1131
- * "app": {
1132
- * "android": {
1133
- * "osVer": "5.0",
1134
- * "uniVer": "x",
1135
- * "unixVer": "3.9.0"
1136
- * },
1137
- * "ios": {
1138
- * "osVer": "12.0",
1139
- * "uniVer": "x",
1140
- * "unixVer": "4.11"
1141
- * }
1142
- * },
1143
- * "web": {
1144
- * "uniVer": "x",
1145
- * "unixVer": "x"
1146
- * }
1147
- * }
1148
- */
1149
- rename(options : RenameOptions) : void;
1150
- /**
1151
- * FileSystemManager.rename 的同步版本
1152
- * @param oldPath 源文件路径,支持本地路径
1153
- * @param newPath 新文件路径,支持本地路径
1154
- * @uniPlatform {
1155
- * "app": {
1156
- * "android": {
1157
- * "osVer": "5.0",
1158
- * "uniVer": "x",
1159
- * "unixVer": "4.13"
1160
- * },
1161
- * "ios": {
1162
- * "osVer": "12.0",
1163
- * "uniVer": "x",
1164
- * "unixVer": "x"
1165
- * }
1166
- * },
1167
- * "web": {
1168
- * "uniVer": "x",
1169
- * "unixVer": "x"
1170
- * }
1171
- * }
1172
- */
1173
- renameSync(oldPath : string, newPath : string) : void;
1174
- /**
1175
- * 复制文件
1176
- * @uniPlatform {
1177
- * "app": {
1178
- * "android": {
1179
- * "osVer": "5.0",
1180
- * "uniVer": "x",
1181
- * "unixVer": "3.9.0"
1182
- * },
1183
- * "ios": {
1184
- * "osVer": "12.0",
1185
- * "uniVer": "x",
1186
- * "unixVer": "4.11"
1187
- * }
1188
- * },
1189
- * "web": {
1190
- * "uniVer": "x",
1191
- * "unixVer": "x"
1192
- * }
1193
- * }
1194
- */
1195
- copyFile(options : CopyFileOptions) : void;
1196
- /**
1197
- * FileSystemManager.copyFile 的同步版本
1198
- * @param srcPath 源文件路径,支持本地路径
1199
- * @param destPath 新文件路径,支持本地路径
1200
- * @uniPlatform {
1201
- * "app": {
1202
- * "android": {
1203
- * "osVer": "5.0",
1204
- * "uniVer": "x",
1205
- * "unixVer": "4.13"
1206
- * },
1207
- * "ios": {
1208
- * "osVer": "12.0",
1209
- * "uniVer": "x",
1210
- * "unixVer": "x"
1211
- * }
1212
- * },
1213
- * "web": {
1214
- * "uniVer": "x",
1215
- * "unixVer": "x"
1216
- * }
1217
- * }
1218
- */
1219
- copyFileSync(srcPath : string, destPath : string) : void;
1220
- /**
1221
- * 获取该本地临时文件 或 本地缓存文件 信息
1222
- * @uniPlatform {
1223
- * "app": {
1224
- * "android": {
1225
- * "osVer": "5.0",
1226
- * "uniVer": "x",
1227
- * "unixVer": "3.9.0"
1228
- * },
1229
- * "ios": {
1230
- * "osVer": "12.0",
1231
- * "uniVer": "x",
1232
- * "unixVer": "4.11"
1233
- * }
1234
- * },
1235
- * "web": {
1236
- * "uniVer": "x",
1237
- * "unixVer": "x"
1238
- * }
1239
- * }
1240
- */
1241
- getFileInfo(options : GetFileInfoOptions) : void;
1242
- /**
1243
- * 获取文件 Stats 对象
1244
- * @uniPlatform {
1245
- * "app": {
1246
- * "android": {
1247
- * "osVer": "5.0",
1248
- * "uniVer": "x",
1249
- * "unixVer": "3.9.0"
1250
- * },
1251
- * "ios": {
1252
- * "osVer": "12.0",
1253
- * "uniVer": "x",
1254
- * "unixVer": "4.11"
1255
- * }
1256
- * },
1257
- * "web": {
1258
- * "uniVer": "x",
1259
- * "unixVer": "x"
1260
- * }
1261
- * }
1262
- */
1263
- stat(options : StatOptions) : void;
1264
- /**
1265
- * FileSystemManager.stat 的同步版本
1266
- * @param path 文件/目录路径 (本地路径)
1267
- * @param recursive 是否递归获取目录下的每个文件的 Stats 信息
1268
- * @uniPlatform {
1269
- * "app": {
1270
- * "android": {
1271
- * "osVer": "5.0",
1272
- * "uniVer": "x",
1273
- * "unixVer": "4.13"
1274
- * },
1275
- * "ios": {
1276
- * "osVer": "12.0",
1277
- * "uniVer": "x",
1278
- * "unixVer": "x"
1279
- * }
1280
- * },
1281
- * "web": {
1282
- * "uniVer": "x",
1283
- * "unixVer": "x"
1284
- * }
1285
- * }
1286
- */
1287
- statSync(path : string, recursive : boolean) : FileStats[];
1288
- /**
1289
- * 在文件结尾追加内容
1290
- * @uniPlatform {
1291
- * "app": {
1292
- * "android": {
1293
- * "osVer": "5.0",
1294
- * "uniVer": "x",
1295
- * "unixVer": "4.13"
1296
- * },
1297
- * "ios": {
1298
- * "osVer": "12.0",
1299
- * "uniVer": "x",
1300
- * "unixVer": "x"
1301
- * }
1302
- * },
1303
- * "web": {
1304
- * "uniVer": "x",
1305
- * "unixVer": "x"
1306
- * }
1307
- * }
1308
- */
1309
- appendFile(options : AppendFileOptions) : void;
1310
- /**
1311
- * FileSystemManager.appendFile 的同步版本
1312
- * @param filePath 要追加内容的文件路径 (本地路径)
1313
- * @param data 要追加的文本
1314
- * @param encoding 指定写入文件的字符编码支持:ascii base64 utf-8
1315
- * @uniPlatform {
1316
- * "app": {
1317
- * "android": {
1318
- * "osVer": "5.0",
1319
- * "uniVer": "x",
1320
- * "unixVer": "4.13"
1321
- * },
1322
- * "ios": {
1323
- * "osVer": "12.0",
1324
- * "uniVer": "x",
1325
- * "unixVer": "x"
1326
- * }
1327
- * },
1328
- * "web": {
1329
- * "uniVer": "x",
1330
- * "unixVer": "x"
1331
- * }
1332
- * }
1333
- */
1334
- appendFileSync(filePath : string, data : string, encoding : string) : void;
1335
- /**
1336
- * 保存临时文件到本地。此接口会移动临时文件,因此调用成功后,tempFilePath 将不可用。
1337
- * @uniPlatform {
1338
- * "app": {
1339
- * "android": {
1340
- * "osVer": "5.0",
1341
- * "uniVer": "x",
1342
- * "unixVer": "4.13"
1343
- * },
1344
- * "ios": {
1345
- * "osVer": "12.0",
1346
- * "uniVer": "x",
1347
- * "unixVer": "x"
1348
- * }
1349
- * },
1350
- * "web": {
1351
- * "uniVer": "x",
1352
- * "unixVer": "x"
1353
- * }
1354
- *
1355
- * }
1356
- */
1357
- saveFile(options : SaveFileOptions) : void;
1358
- /**
1359
- * FileSystemManager.saveFile 的同步版本
1360
- * @param tempFilePath 临时存储文件路径 (本地路径)
1361
- * @param filePath 要存储的文件路径 (本地路径)
1362
- * @uniPlatform {
1363
- * "app": {
1364
- * "android": {
1365
- * "osVer": "5.0",
1366
- * "uniVer": "x",
1367
- * "unixVer": "4.13"
1368
- * },
1369
- * "ios": {
1370
- * "osVer": "12.0",
1371
- * "uniVer": "x",
1372
- * "unixVer": "x"
1373
- * }
1374
- * },
1375
- * "web": {
1376
- * "uniVer": "x",
1377
- * "unixVer": "x"
1378
- * }
1379
- * }
1380
- */
1381
- saveFileSync(tempFilePath : string, filePath : string | null) : string;
1382
- /**
1383
- * 删除该小程序下已保存的本地缓存文件
1384
- * @uniPlatform {
1385
- * "app": {
1386
- * "android": {
1387
- * "osVer": "5.0",
1388
- * "uniVer": "x",
1389
- * "unixVer": "4.13"
1390
- * },
1391
- * "ios": {
1392
- * "osVer": "12.0",
1393
- * "uniVer": "x",
1394
- * "unixVer": "x"
1395
- * }
1396
- * },
1397
- * "web": {
1398
- * "uniVer": "x",
1399
- * "unixVer": "x"
1400
- * }
1401
- * }
1402
- */
1403
- removeSavedFile(options : RemoveSavedFileOptions) : void;
1404
- /**
1405
- * 解压文件
1406
- * @uniPlatform {
1407
- * "app": {
1408
- * "android": {
1409
- * "osVer": "5.0",
1410
- * "uniVer": "x",
1411
- * "unixVer": "4.13"
1412
- * },
1413
- * "ios": {
1414
- * "osVer": "12.0",
1415
- * "uniVer": "x",
1416
- * "unixVer": "x"
1417
- * }
1418
- * },
1419
- * "web": {
1420
- * "uniVer": "x",
1421
- * "unixVer": "x"
1422
- * }
1423
- * }
1424
- */
1425
- unzip(options : UnzipFileOptions) : void;
1426
- /**
1427
- * 获取该已保存的本地缓存文件列表
1428
- * @uniPlatform {
1429
- * "app": {
1430
- * "android": {
1431
- * "osVer": "5.0",
1432
- * "uniVer": "x",
1433
- * "unixVer": "4.13"
1434
- * },
1435
- * "ios": {
1436
- * "osVer": "12.0",
1437
- * "uniVer": "x",
1438
- * "unixVer": "x"
1439
- * }
1440
- * },
1441
- * "web": {
1442
- * "uniVer": "x",
1443
- * "unixVer": "x"
1444
- * }
1445
- * }
1446
- */
1447
- getSavedFileList(options : GetSavedFileListOptions) : void;
1448
- /**
1449
- * 对文件内容进行截断操作
1450
- * @uniPlatform {
1451
- * "app": {
1452
- * "android": {
1453
- * "osVer": "5.0",
1454
- * "uniVer": "x",
1455
- * "unixVer": "4.13"
1456
- * },
1457
- * "ios": {
1458
- * "osVer": "12.0",
1459
- * "uniVer": "x",
1460
- * "unixVer": "x"
1461
- * }
1462
- * },
1463
- * "web": {
1464
- * "uniVer": "x",
1465
- * "unixVer": "x"
1466
- * }
1467
- * }
1468
- */
1469
- truncate(options : TruncateFileOptions) : void;
1470
- /**
1471
- * 对文件内容进行截断操作 (truncate 的同步版本)
1472
- * @param filePath 要截断的文件路径 (本地路径)
1473
- * @param length 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,不做处理
1474
- * @uniPlatform {
1475
- * "app": {
1476
- * "android": {
1477
- * "osVer": "5.0",
1478
- * "uniVer": "x",
1479
- * "unixVer": "4.13"
1480
- * },
1481
- * "ios": {
1482
- * "osVer": "12.0",
1483
- * "uniVer": "x",
1484
- * "unixVer": "x"
1485
- * }
1486
- * },
1487
- * "web": {
1488
- * "uniVer": "x",
1489
- * "unixVer": "x"
1490
- * }
1491
- * }
1492
- */
1493
- truncateSync(filePath : string, length ?: number) : void;
1494
- /**
1495
- * 读取指定压缩类型的本地文件内容
1496
- * @uniPlatform {
1497
- * "app": {
1498
- * "android": {
1499
- * "osVer": "5.0",
1500
- * "uniVer": "x",
1501
- * "unixVer": "4.13"
1502
- * },
1503
- * "ios": {
1504
- * "osVer": "12.0",
1505
- * "uniVer": "x",
1506
- * "unixVer": "x"
1507
- * }
1508
- * },
1509
- * "web": {
1510
- * "uniVer": "x",
1511
- * "unixVer": "x"
1512
- * }
1513
- * }
1514
- */
1515
- readCompressedFile(options : ReadCompressedFileOptions) : void;
1516
- /**
1517
- * 同步读取指定压缩类型的本地文件内容
1518
- * @param filePath 要读取的文件的路径 (本地用户文件或代码包文件),app-android平台支持代码包文件目录
1519
- * @param compressionAlgorithm 文件压缩类型,目前仅支持 'br'。
1520
- * @uniPlatform {
1521
- * "app": {
1522
- * "android": {
1523
- * "osVer": "5.0",
1524
- * "uniVer": "x",
1525
- * "unixVer": "4.13"
1526
- * },
1527
- * "ios": {
1528
- * "osVer": "12.0",
1529
- * "uniVer": "x",
1530
- * "unixVer": "x"
1531
- * }
1532
- * },
1533
- * "web": {
1534
- * "uniVer": "x",
1535
- * "unixVer": "x"
1536
- * }
1537
- * }
1538
- */
1539
- readCompressedFileSync(filePath : string, compressionAlgorithm : string) : string
1540
- /**
1541
- * 打开文件,返回文件描述符
1542
- * @uniPlatform {
1543
- * "app": {
1544
- * "android": {
1545
- * "osVer": "5.0",
1546
- * "uniVer": "x",
1547
- * "unixVer": "4.13"
1548
- * },
1549
- * "ios": {
1550
- * "osVer": "12.0",
1551
- * "uniVer": "x",
1552
- * "unixVer": "x"
1553
- * }
1554
- * },
1555
- * "web": {
1556
- * "uniVer": "x",
1557
- * "unixVer": "x"
1558
- * }
1559
- * }
1560
- */
1561
- open(options : OpenFileOptions) : void;
1562
- /**
1563
- * 同步打开文件,返回文件描述符
1564
- * @uniPlatform {
1565
- * "app": {
1566
- * "android": {
1567
- * "osVer": "5.0",
1568
- * "uniVer": "x",
1569
- * "unixVer": "4.13"
1570
- * },
1571
- * "ios": {
1572
- * "osVer": "12.0",
1573
- * "uniVer": "x",
1574
- * "unixVer": "x"
1575
- * }
1576
- * },
1577
- * "web": {
1578
- * "uniVer": "x",
1579
- * "unixVer": "x"
1580
- * }
1581
- * }
1582
- */
1583
- openSync(options : OpenFileSyncOptions) : string;
1584
- /**
1585
- * 写入文件
1586
- * @uniPlatform {
1587
- * "app": {
1588
- * "android": {
1589
- * "osVer": "5.0",
1590
- * "uniVer": "x",
1591
- * "unixVer": "4.13"
1592
- * },
1593
- * "ios": {
1594
- * "osVer": "12.0",
1595
- * "uniVer": "x",
1596
- * "unixVer": "x"
1597
- * }
1598
- * },
1599
- * "web": {
1600
- * "uniVer": "x",
1601
- * "unixVer": "x"
1602
- * }
1603
- * }
1604
- */
1605
- write(options : WriteOptions) : void;
1606
- /**
1607
- * 同步写入文件
1608
- * @uniPlatform {
1609
- * "app": {
1610
- * "android": {
1611
- * "osVer": "5.0",
1612
- * "uniVer": "x",
1613
- * "unixVer": "4.13"
1614
- * },
1615
- * "ios": {
1616
- * "osVer": "12.0",
1617
- * "uniVer": "x",
1618
- * "unixVer": "x"
1619
- * }
1620
- * },
1621
- * "web": {
1622
- * "uniVer": "x",
1623
- * "unixVer": "x"
1624
- * }
1625
- * }
1626
- */
1627
- writeSync(options : WriteSyncOptions) : WriteResult;
1628
- /**
1629
- * 关闭文件
1630
- * @uniPlatform {
1631
- * "app": {
1632
- * "android": {
1633
- * "osVer": "5.0",
1634
- * "uniVer": "x",
1635
- * "unixVer": "4.13"
1636
- * },
1637
- * "ios": {
1638
- * "osVer": "12.0",
1639
- * "uniVer": "x",
1640
- * "unixVer": "x"
1641
- * }
1642
- * },
1643
- * "web": {
1644
- * "uniVer": "x",
1645
- * "unixVer": "x"
1646
- * }
1647
- * }
1648
- */
1649
- close(options : CloseOptions) : void;
1650
- /**
1651
- * 同步关闭文件
1652
- * @uniPlatform {
1653
- * "app": {
1654
- * "android": {
1655
- * "osVer": "5.0",
1656
- * "uniVer": "x",
1657
- * "unixVer": "4.13"
1658
- * },
1659
- * "ios": {
1660
- * "osVer": "12.0",
1661
- * "uniVer": "x",
1662
- * "unixVer": "x"
1663
- * }
1664
- * },
1665
- * "web": {
1666
- * "uniVer": "x",
1667
- * "unixVer": "x"
1668
- * }
1669
- * }
1670
- */
1671
- closeSync(options : CloseSyncOptions) : void;
1672
- /**
1673
- * 获取文件的状态信息
1674
- * @uniPlatform {
1675
- * "app": {
1676
- * "android": {
1677
- * "osVer": "5.0",
1678
- * "uniVer": "x",
1679
- * "unixVer": "4.13"
1680
- * },
1681
- * "ios": {
1682
- * "osVer": "12.0",
1683
- * "uniVer": "x",
1684
- * "unixVer": "x"
1685
- * }
1686
- * },
1687
- * "web": {
1688
- * "uniVer": "x",
1689
- * "unixVer": "x"
1690
- * }
1691
- * }
1692
- */
1693
- fstat(options : FStatOptions) : void;
1694
- /**
1695
- * 同步获取文件的状态信息
1696
- * @uniPlatform {
1697
- * "app": {
1698
- * "android": {
1699
- * "osVer": "5.0",
1700
- * "uniVer": "x",
1701
- * "unixVer": "4.13"
1702
- * },
1703
- * "ios": {
1704
- * "osVer": "12.0",
1705
- * "uniVer": "x",
1706
- * "unixVer": "x"
1707
- * }
1708
- * },
1709
- * "web": {
1710
- * "uniVer": "x",
1711
- * "unixVer": "x"
1712
- * }
1713
- * }
1714
- */
1715
- fstatSync(options : FStatSyncOptions) : Stats;
1716
- /**
1717
- * 对文件内容进行截断操作
1718
- * @uniPlatform {
1719
- * "app": {
1720
- * "android": {
1721
- * "osVer": "5.0",
1722
- * "uniVer": "x",
1723
- * "unixVer": "4.13"
1724
- * },
1725
- * "ios": {
1726
- * "osVer": "12.0",
1727
- * "uniVer": "x",
1728
- * "unixVer": "x"
1729
- * }
1730
- * },
1731
- * "web": {
1732
- * "uniVer": "x",
1733
- * "unixVer": "x"
1734
- * }
1735
- * }
1736
- */
1737
- ftruncate(options : FTruncateFileOptions) : void;
1738
- /**
1739
- * 同步对文件内容进行截断操作
1740
- * @uniPlatform {
1741
- * "app": {
1742
- * "android": {
1743
- * "osVer": "5.0",
1744
- * "uniVer": "x",
1745
- * "unixVer": "4.13"
1746
- * },
1747
- * "ios": {
1748
- * "osVer": "12.0",
1749
- * "uniVer": "x",
1750
- * "unixVer": "x"
1751
- * }
1752
- * },
1753
- * "web": {
1754
- * "uniVer": "x",
1755
- * "unixVer": "x"
1756
- * }
1757
- * }
1758
- */
1759
- ftruncateSync(options : FTruncateFileSyncOptions) : void;
1760
- /**
1761
- * 读取压缩包内的文件
1762
- * @uniPlatform {
1763
- * "app": {
1764
- * "android": {
1765
- * "osVer": "5.0",
1766
- * "uniVer": "x",
1767
- * "unixVer": "4.13"
1768
- * },
1769
- * "ios": {
1770
- * "osVer": "12.0",
1771
- * "uniVer": "x",
1772
- * "unixVer": "x"
1773
- * }
1774
- * },
1775
- * "web": {
1776
- * "uniVer": "x",
1777
- * "unixVer": "x"
1778
- * }
1779
- * }
1780
- */
1781
- readZipEntry(options : ReadZipEntryOptions) : void;
1782
- }
1783
-
1784
-
1785
- export type GetFileSystemManager = () => FileSystemManager;
1786
-
1787
-
1788
- export interface Uni {
1789
- /**
1790
- * 获取文件管理器
1791
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-file-system-manager.html
1792
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-file-system-manager.html
1793
- * @uniPlatform {
1794
- * "app": {
1795
- * "android": {
1796
- * "osVer": "5.0",
1797
- * "uniVer": "x",
1798
- * "unixVer": "3.9.0"
1799
- * },
1800
- * "ios": {
1801
- * "osVer": "12.0",
1802
- * "uniVer": "x",
1803
- * "unixVer": "4.11"
1804
- * },
1805
- * "harmony": {
1806
- * "osVer": "x",
1807
- * "uniVer": "x",
1808
- * "unixVer": "x"
1809
- * }
1810
- * },
1811
- * "web": {
1812
- * "uniVer": "x",
1813
- * "unixVer": "x"
1814
- * }
1815
- * }
1816
- * @uniVueVersion 2,3 //支持的vue版本
1817
- */
1818
- getFileSystemManager() : FileSystemManager
1819
- }
1820
-
1821
- /**
1822
- * 错误码
1823
- */
1824
- export type FileSystemManagerErrorCode =
1825
- /**
1826
- * 类型错误。仅支持 base64 / utf-8
1827
- */
1828
- 1200002 |
1829
- /**
1830
- * 未找到文件
1831
- */
1832
- 1300002 |
1833
- /**
1834
- * 无权限
1835
- */
1836
- 1300013 |
1837
- /**
1838
- * 是目录
1839
- */
1840
- 1300021 |
1841
- /**
1842
- * 参数无效
1843
- */
1844
- 1300022 |
1845
- /**
1846
- * 目录非空
1847
- */
1848
- 1300066 |
1849
- /**
1850
- * 对目录的非法操作
1851
- */
1852
- 1301003 |
1853
- /**
1854
- * 文件已存在
1855
- */
1856
- 1301005 |
1857
- /**
1858
- * 系统错误
1859
- */
1860
- 1300201 |
1861
- /**
1862
- * 超出文件存储限制的最大尺寸
1863
- */
1864
- 1300202 |
1865
- /**
1866
- * brotli解压失败
1867
- */
1868
- 1301111 |
1869
- /**
1870
- * 标志无效
1871
- */
1872
- 1302003 |
1873
- /**
1874
- * 文件描述符错误
1875
- */
1876
- 1300009;
1877
-
1878
- export type FileSystemManagerFail = IFileSystemManagerFail;
1879
- export interface IFileSystemManagerFail extends IUniError {
1880
- errCode : FileSystemManagerErrorCode
1881
- };
1
+
2
+ export type ReadFileSuccessResult = {
3
+ data : any
4
+ }
5
+
6
+ export type OpenFileSuccessResult = {
7
+ fd : string
8
+ }
9
+
10
+
11
+ /**
12
+ * 通用的正确返回结果
13
+ */
14
+ export type FileManagerSuccessResult = {
15
+ errMsg : string,
16
+ }
17
+ /**
18
+ * 通用的正确返回结果回调
19
+ */
20
+ export type FileManagerSuccessCallback = (res : FileManagerSuccessResult) => void
21
+ /**
22
+ * 通用的错误返回结果回调
23
+ */
24
+ export type FileManagerFailCallback = (res : FileSystemManagerFail) => void
25
+ /**
26
+ * 通用的结束返回结果回调
27
+ */
28
+ export type FileManagerCompleteCallback = (res : any) => void
29
+
30
+
31
+
32
+ export type ReadFileSuccessCallback = (res : ReadFileSuccessResult) => void
33
+
34
+
35
+
36
+ export type ReadFileOptions = {
37
+ /**
38
+ * base64 / utf-8,指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容
39
+ */
40
+ encoding ?: "base64" | "utf-8",
41
+ /**
42
+ * 文件路径,支持相对地址和绝对地址,app-android平台支持代码包文件目录
43
+ */
44
+ filePath : string.URIString,
45
+ /**
46
+ * 接口调用的回调函数
47
+ */
48
+ success ?: ReadFileSuccessCallback | null,
49
+ /**
50
+ * 接口调用失败的回调函数
51
+ */
52
+ fail ?: FileManagerFailCallback | null,
53
+ /**
54
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
55
+ */
56
+ complete ?: FileManagerCompleteCallback | null
57
+ }
58
+
59
+
60
+
61
+
62
+
63
+ export type WriteFileOptions = {
64
+ /**
65
+ * 文件路径,只支持绝对地址
66
+ */
67
+ filePath : string.URIString,
68
+ /**
69
+ * 指定写入文件的字符编码
70
+ * 支持:ascii base64 utf-8 ,只在 data 类型是 String 时有效
71
+ */
72
+ encoding ?: "ascii" | "base64" | "utf-8" ,
73
+ /**
74
+ * string/ArrayBuffer,要写入的文本或二进制数据
75
+ */
76
+ data : any,
77
+ /**
78
+ * 接口调用的回调函数
79
+ */
80
+ success ?: FileManagerSuccessCallback | null,
81
+ /**
82
+ * 接口调用失败的回调函数
83
+ */
84
+ fail ?: FileManagerFailCallback | null,
85
+ /**
86
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
87
+ */
88
+ complete ?: FileManagerCompleteCallback | null
89
+ }
90
+
91
+ export type AppendFileOptions = {
92
+ /**
93
+ * 要追加内容的文件路径 (本地路径)
94
+ */
95
+ filePath : string.URIString,
96
+ /**
97
+ * 指定写入文件的字符编码
98
+ * 支持:ascii base64 utf-8
99
+ * 只在 data 类型是 String 时有效
100
+ */
101
+ encoding ?: "ascii" | "base64" | "utf-8",
102
+ /**
103
+ * string/ArrayBuffer 要追加的文本或二进制数据
104
+ */
105
+ data : any,
106
+ /**
107
+ * 接口调用的回调函数
108
+ */
109
+ success ?: FileManagerSuccessCallback | null,
110
+ /**
111
+ * 接口调用失败的回调函数
112
+ */
113
+ fail ?: FileManagerFailCallback | null,
114
+ /**
115
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
116
+ */
117
+ complete ?: FileManagerCompleteCallback | null
118
+ }
119
+
120
+
121
+ export type OpenFileSuccessCallback = (res : OpenFileSuccessResult) => void
122
+
123
+ export type OpenFileOptions = {
124
+ /**
125
+ * 要追加内容的文件路径 (本地路径)
126
+ */
127
+ filePath : string.URIString,
128
+ /**
129
+ * 文件系统标志,默认值: 'r'
130
+ */
131
+ flag : "a" | "ax" | "a+" | "ax+" | "r" | "r+" | "w" | "wx" | "w+" | "wx" | "wx+",
132
+ /**
133
+ * 接口调用的回调函数
134
+ */
135
+ success ?: OpenFileSuccessCallback | null,
136
+ /**
137
+ * 接口调用失败的回调函数
138
+ */
139
+ fail ?: FileManagerFailCallback | null,
140
+ /**
141
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
142
+ */
143
+ complete ?: FileManagerCompleteCallback | null
144
+ }
145
+
146
+ export type OpenFileSyncOptions = {
147
+ /**
148
+ * 要追加内容的文件路径 (本地路径)
149
+ */
150
+ filePath : string.URIString,
151
+ /**
152
+ * 文件系统标志,默认值: 'r'
153
+ */
154
+ flag : "a" | "ax" | "a+" | "ax+" | "r" | "r+" | "w" | "wx" | "w+" | "wx" | "wx+",
155
+ }
156
+
157
+
158
+
159
+
160
+ export type UnLinkSuccessCallback = (res : FileManagerSuccessResult) => void
161
+
162
+
163
+
164
+ export type UnLinkOptions = {
165
+ /**
166
+ * 文件路径,只支持绝对地址
167
+ */
168
+ filePath : string.URIString,
169
+ /**
170
+ * 接口调用的回调函数
171
+ */
172
+ success ?: UnLinkSuccessCallback | null,
173
+ /**
174
+ * 接口调用失败的回调函数
175
+ */
176
+ fail ?: FileManagerFailCallback | null,
177
+ /**
178
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
179
+ */
180
+ complete ?: FileManagerCompleteCallback | null
181
+ }
182
+
183
+ export type MkDirSuccessCallback = (res : FileManagerSuccessResult) => void
184
+
185
+
186
+
187
+
188
+ export type MkDirOptions = {
189
+ /**
190
+ * 创建的目录路径 (本地路径)
191
+ */
192
+ dirPath : string.URIString,
193
+ /**
194
+ *是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。
195
+ */
196
+ recursive : boolean,
197
+ /**
198
+ * 接口调用的回调函数
199
+ */
200
+ success ?: MkDirSuccessCallback | null,
201
+ /**
202
+ * 接口调用失败的回调函数
203
+ */
204
+ fail ?: FileManagerFailCallback | null,
205
+ /**
206
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
207
+ */
208
+ complete ?: FileManagerCompleteCallback | null
209
+ }
210
+
211
+
212
+
213
+
214
+
215
+
216
+ export type RmDirOptions = {
217
+ /**
218
+ * 要删除的目录路径 (本地路径)
219
+ */
220
+ dirPath : string.URIString,
221
+ /**
222
+ *是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。
223
+ */
224
+ recursive : boolean,
225
+ /**
226
+ * 接口调用的回调函数
227
+ */
228
+ success ?: MkDirSuccessCallback | null,
229
+ /**
230
+ * 接口调用失败的回调函数
231
+ */
232
+ fail ?: FileManagerFailCallback | null,
233
+ /**
234
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
235
+ */
236
+ complete ?: FileManagerCompleteCallback | null
237
+ }
238
+
239
+
240
+ export type ReadDirSuccessResult = {
241
+ files : string[],
242
+ }
243
+
244
+ export type ReadDirSuccessCallback = (res : ReadDirSuccessResult) => void
245
+
246
+
247
+ export type ReadDirOptions = {
248
+ /**
249
+ * 要读取的目录路径 (本地路径)
250
+ */
251
+ dirPath : string.URIString,
252
+
253
+ /**
254
+ * 接口调用的回调函数
255
+ */
256
+ success ?: ReadDirSuccessCallback | null,
257
+ /**
258
+ * 接口调用失败的回调函数
259
+ */
260
+ fail ?: FileManagerFailCallback | null,
261
+ /**
262
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
263
+ */
264
+ complete ?: FileManagerCompleteCallback | null
265
+ }
266
+
267
+
268
+
269
+
270
+ export type AccessOptions = {
271
+ /**
272
+ * 要判断是否存在的文件/目录路径 (本地路径)
273
+ */
274
+ path : string.URIString,
275
+
276
+ /**
277
+ * 接口调用的回调函数
278
+ */
279
+ success ?: FileManagerSuccessCallback | null,
280
+ /**
281
+ * 接口调用失败的回调函数
282
+ */
283
+ fail ?: FileManagerFailCallback | null,
284
+ /**
285
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
286
+ */
287
+ complete ?: FileManagerCompleteCallback | null
288
+ }
289
+
290
+ export type RenameOptions = {
291
+ /**
292
+ * 源文件路径,支持本地路径
293
+ */
294
+ oldPath : string.URIString,
295
+ /**
296
+ * 新文件路径,支持本地路径
297
+ */
298
+ newPath : string.URIString,
299
+
300
+ /**
301
+ * 接口调用的回调函数
302
+ */
303
+ success ?: FileManagerSuccessCallback | null,
304
+ /**
305
+ * 接口调用失败的回调函数
306
+ */
307
+ fail ?: FileManagerFailCallback | null,
308
+ /**
309
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
310
+ */
311
+ complete ?: FileManagerCompleteCallback | null
312
+ }
313
+
314
+ export type CopyFileOptions = {
315
+ /**
316
+ * 源文件路径,支持本地路径
317
+ */
318
+ srcPath : string.URIString,
319
+ /**
320
+ * 新文件路径,支持本地路径
321
+ */
322
+ destPath : string.URIString,
323
+
324
+ /**
325
+ * 接口调用的回调函数
326
+ */
327
+ success ?: FileManagerSuccessCallback | null,
328
+ /**
329
+ * 接口调用失败的回调函数
330
+ */
331
+ fail ?: FileManagerFailCallback | null,
332
+ /**
333
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
334
+ */
335
+ complete ?: FileManagerCompleteCallback | null
336
+ }
337
+
338
+ export type SaveFileOptions = {
339
+ /**
340
+ * 临时存储文件路径 (本地路径)
341
+ */
342
+ tempFilePath : string.URIString,
343
+ /**
344
+ * 要存储的文件路径 (本地路径)
345
+ */
346
+ filePath : string.URIString | null,
347
+
348
+ /**
349
+ * 接口调用的回调函数
350
+ */
351
+ success ?: SaveFileSuccessCallback | null,
352
+ /**
353
+ * 接口调用失败的回调函数
354
+ */
355
+ fail ?: FileManagerFailCallback | null,
356
+ /**
357
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
358
+ */
359
+ complete ?: FileManagerCompleteCallback | null
360
+ }
361
+
362
+
363
+ export type SaveFileSuccessCallback = (res : SaveFileSuccessResult) => void
364
+
365
+ export type SaveFileSuccessResult = {
366
+ /**
367
+ * 存储后的文件路径 (本地路径)
368
+ */
369
+ savedFilePath : string,
370
+ }
371
+
372
+ export type GetFileInfoSuccessResult = {
373
+ digest : string,
374
+ size : number,
375
+ errMsg : string
376
+ }
377
+
378
+ export type GetFileInfoSuccessCallback = (res : GetFileInfoSuccessResult) => void
379
+
380
+ export type GetFileInfoOptions = {
381
+ /**
382
+ * 要读取的文件路径 (本地路径)
383
+ */
384
+ filePath : string.URIString,
385
+ /**
386
+ * md5 / sha1
387
+ */
388
+ digestAlgorithm : "md5" | "sha1" | null,
389
+ /**
390
+ * 接口调用的回调函数
391
+ */
392
+ success ?: GetFileInfoSuccessCallback | null,
393
+ /**
394
+ * 接口调用失败的回调函数
395
+ */
396
+ fail ?: FileManagerFailCallback | null,
397
+ /**
398
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
399
+ */
400
+ complete ?: FileManagerCompleteCallback | null
401
+ }
402
+
403
+
404
+ export interface Stats {
405
+ /**
406
+ * 文件的类型和存取的权限,对应 POSIX stat.st_mode
407
+ * 注意android中,文件类型只包含是否是目录与文件,
408
+ * 另外在android中这里的权限指的是当前进程对文件或者文件夹是否有读,写,执行的权限,
409
+ * 这里没有与 POSIX stat.st_mode对应的组,其他人等相关权限的数据返回,只有所有者的相关权限
410
+ */
411
+ mode : number;
412
+ /**
413
+ * 文件大小,单位:B,对应 POSIX stat.st_size
414
+ */
415
+ size : number;
416
+ /**
417
+ * 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime
418
+ * 注意:android中由于系统限制无法获取该数据
419
+ */
420
+ lastAccessedTime : number;
421
+ /**
422
+ * 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime
423
+ */
424
+ lastModifiedTime : number;
425
+ /**
426
+ * @internal
427
+ */
428
+ mIsFile : boolean;
429
+ /**
430
+ * 判断当前文件是否一个目录
431
+ */
432
+ isDirectory() : boolean;
433
+ /**
434
+ * 判断当前文件是否一个普通文件
435
+ */
436
+ isFile() : boolean;
437
+ }
438
+
439
+
440
+ export type FileStats = {
441
+ path : string,
442
+ stats : Stats,
443
+ }
444
+
445
+ export type StatSuccessResult = {
446
+ errMsg : string,
447
+ stats : FileStats[]
448
+ }
449
+
450
+
451
+ export type StatSuccessCallback = (res : StatSuccessResult) => void
452
+
453
+
454
+ export type StatOptions = {
455
+ /**
456
+ * 文件/目录路径 (本地路径)
457
+ */
458
+ path : string.URIString,
459
+ /**
460
+ * 是否递归获取目录下的每个文件的 Stats 信息
461
+ */
462
+ recursive : boolean,
463
+ /**
464
+ * 接口调用的回调函数
465
+ */
466
+ success ?: StatSuccessCallback | null,
467
+ /**
468
+ * 接口调用失败的回调函数
469
+ */
470
+ fail ?: FileManagerFailCallback | null,
471
+ /**
472
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
473
+ */
474
+ complete ?: FileManagerCompleteCallback | null
475
+ }
476
+
477
+
478
+ export type UnzipFileOptions = {
479
+ /**
480
+ * 源文件路径,支持本地路径, 只可以是 zip 压缩文件
481
+ */
482
+ zipFilePath : string,
483
+ /**
484
+ * 目标目录路径, 支持本地路径
485
+ */
486
+ targetPath : string,
487
+ /**
488
+ * 接口调用的回调函数
489
+ */
490
+ success ?: FileManagerSuccessCallback | null,
491
+ /**
492
+ * 接口调用失败的回调函数
493
+ */
494
+ fail ?: FileManagerFailCallback | null,
495
+ /**
496
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
497
+ */
498
+ complete ?: FileManagerCompleteCallback | null
499
+ }
500
+
501
+ export type GetSavedFileListResult = {
502
+ fileList : string[]
503
+ }
504
+
505
+ export type GetSavedFileListCallback = (res : GetSavedFileListResult) => void
506
+
507
+ export type GetSavedFileListOptions = {
508
+ /**
509
+ * 接口调用的回调函数
510
+ */
511
+ success ?: GetSavedFileListCallback | null,
512
+ /**
513
+ * 接口调用失败的回调函数
514
+ */
515
+ fail ?: FileManagerFailCallback | null,
516
+ /**
517
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
518
+ */
519
+ complete ?: FileManagerCompleteCallback | null
520
+ }
521
+
522
+
523
+
524
+ export type TruncateFileOptions = {
525
+ /**
526
+ * 要截断的文件路径 (本地路径)
527
+ */
528
+ filePath : string.URIString,
529
+ /**
530
+ * 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;
531
+ * 如果 length 大于文件长度,不做处理
532
+ */
533
+ length : number,
534
+ /**
535
+ * 接口调用的回调函数
536
+ */
537
+ success ?: FileManagerSuccessCallback | null,
538
+ /**
539
+ * 接口调用失败的回调函数
540
+ */
541
+ fail ?: FileManagerFailCallback | null,
542
+ /**
543
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
544
+ */
545
+ complete ?: FileManagerCompleteCallback | null
546
+ }
547
+
548
+
549
+ export type ReadCompressedFileResult = {
550
+ data : string
551
+ }
552
+
553
+ export type ReadCompressedFileCallback = (res : ReadCompressedFileResult) => void
554
+ export type ReadCompressedFileOptions = {
555
+ /**
556
+ * 要读取的文件的路径 (本地用户文件或代码包文件),app-android平台支持代码包文件目录
557
+ */
558
+ filePath : string.URIString,
559
+ /**
560
+ * 文件压缩类型,目前仅支持 'br'。
561
+ */
562
+ compressionAlgorithm : "br",
563
+ /**
564
+ * 接口调用的回调函数
565
+ */
566
+ success ?: ReadCompressedFileCallback | null,
567
+ /**
568
+ * 接口调用失败的回调函数
569
+ */
570
+ fail ?: FileManagerFailCallback | null,
571
+ /**
572
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
573
+ */
574
+ complete ?: FileManagerCompleteCallback | null
575
+ }
576
+
577
+
578
+ export type RemoveSavedFileOptions = {
579
+ /**
580
+ * 需要删除的文件路径 (本地路径)
581
+ */
582
+ filePath : string.URIString,
583
+ /**
584
+ * 接口调用的回调函数
585
+ */
586
+ success ?: FileManagerSuccessCallback | null,
587
+ /**
588
+ * 接口调用失败的回调函数
589
+ */
590
+ fail ?: FileManagerFailCallback | null,
591
+ /**
592
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
593
+ */
594
+ complete ?: FileManagerCompleteCallback | null
595
+ }
596
+
597
+
598
+
599
+ export type WriteResult = {
600
+ /**
601
+ * 实际被写入到文件中的字节数(注意,被写入的字节数不一定与被写入的字符串字符数相同)
602
+ */
603
+ bytesWritten : number,
604
+ errMsg : string
605
+ }
606
+
607
+ export type WriteCallback = (res : WriteResult) => void
608
+ export type WriteOptions = {
609
+ /**
610
+ * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
611
+ */
612
+ fd : string,
613
+ /**
614
+ * 写入的内容,类型为 String 或 ArrayBuffer
615
+ */
616
+ data : any,
617
+ /**
618
+ * 只在 data 类型是 ArrayBuffer 时有效,决定 ArrayBuffer 中要被写入的部位,即 ArrayBuffer 中的索引,默认0
619
+ */
620
+ offset ?: number,
621
+ /**
622
+ * 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 ArrayBuffer 从0开始偏移 offset 个字节后剩余的字节数
623
+ */
624
+ length ?: number,
625
+ /**
626
+ * 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。
627
+ */
628
+ position ?: number
629
+ /**
630
+ * 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8
631
+ * 支持:ascii base64 utf-8
632
+ */
633
+ encoding ?: "ascii" | "base64" | "utf-8",
634
+ // /**
635
+ // * 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。
636
+ // */
637
+ // position : number | null,
638
+
639
+ /**
640
+ * 接口调用的回调函数
641
+ */
642
+ success ?: WriteCallback | null,
643
+ /**
644
+ * 接口调用失败的回调函数
645
+ */
646
+ fail ?: FileManagerFailCallback | null,
647
+ /**
648
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
649
+ */
650
+ complete ?: FileManagerCompleteCallback | null
651
+ }
652
+ export type WriteSyncOptions = {
653
+ /**
654
+ * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
655
+ */
656
+ fd : string,
657
+ /**
658
+ * 写入的内容,类型为 String 或 ArrayBuffer
659
+ */
660
+ data : any,
661
+ /**
662
+ * 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8
663
+ * 支持:ascii base64 utf-8
664
+ */
665
+ encoding ?: "ascii" | "base64" | "utf-8",
666
+ /** 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 arrayBuffer 从0开始偏移 offset 个字节后剩余的字节数 */
667
+ length ?: number
668
+ /** 只在 data 类型是 ArrayBuffer 时有效,决定 arrayBuffe 中要被写入的部位,即 arrayBuffer 中的索引,默认0 */
669
+ offset ?: number
670
+ /** 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 */
671
+ position ?: number
672
+ }
673
+
674
+ export type CloseOptions = {
675
+ /**
676
+ * 需要被关闭的文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
677
+ */
678
+ fd : string,
679
+ /**
680
+ * 接口调用的回调函数
681
+ */
682
+ success ?: FileManagerSuccessCallback | null,
683
+ /**
684
+ * 接口调用失败的回调函数
685
+ */
686
+ fail ?: FileManagerFailCallback | null,
687
+ /**
688
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
689
+ */
690
+ complete ?: FileManagerCompleteCallback | null
691
+ }
692
+
693
+ export type CloseSyncOptions = {
694
+ /**
695
+ * 需要被关闭的文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
696
+ */
697
+ fd : string,
698
+ }
699
+
700
+
701
+ export type FStatSuccessResult = {
702
+ /**
703
+ * Stats 对象,包含了文件的状态信息
704
+ */
705
+ stats : Stats
706
+ }
707
+
708
+
709
+ export type FStatSuccessCallback = (res : FStatSuccessResult) => void
710
+
711
+
712
+ export type FStatOptions = {
713
+ /**
714
+ * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
715
+ */
716
+ fd : string,
717
+ /**
718
+ * 接口调用的回调函数
719
+ */
720
+ success ?: FStatSuccessCallback | null,
721
+ /**
722
+ * 接口调用失败的回调函数
723
+ */
724
+ fail ?: FileManagerFailCallback | null,
725
+ /**
726
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
727
+ */
728
+ complete ?: FileManagerCompleteCallback | null
729
+ }
730
+
731
+ export type FStatSyncOptions = {
732
+ /**
733
+ * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
734
+ */
735
+ fd : string
736
+ }
737
+
738
+ export type FTruncateFileOptions = {
739
+ /**
740
+ * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
741
+ */
742
+ fd : string,
743
+ /**
744
+ * 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;
745
+ * 如果 length 大于文件长度,不做处理
746
+ */
747
+ length : number,
748
+ /**
749
+ * 接口调用的回调函数
750
+ */
751
+ success ?: FileManagerSuccessCallback | null,
752
+ /**
753
+ * 接口调用失败的回调函数
754
+ */
755
+ fail ?: FileManagerFailCallback | null,
756
+ /**
757
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
758
+ */
759
+ complete ?: FileManagerCompleteCallback | null
760
+ }
761
+
762
+ export type FTruncateFileSyncOptions = {
763
+ /**
764
+ * 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得
765
+ */
766
+ fd : string,
767
+ /**
768
+ * 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;
769
+ * 如果 length 大于文件长度,不做处理
770
+ */
771
+ length : number,
772
+ }
773
+
774
+
775
+ export type EntryItem = {
776
+ /** 压缩包内文件路径 */
777
+ path : string
778
+ /**
779
+ * 指定写入文件的字符编码
780
+ * 支持:ascii base64 utf-8
781
+ */
782
+ encoding : "ascii" | "base64" | "base64",
783
+ // /** 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */
784
+ // length ?: number
785
+ // /** 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */
786
+ // position ?: number
787
+ }
788
+ export type EntriesResult = {
789
+ /** 文件路径 */
790
+ result : Map<string, ZipFileItem>
791
+ }
792
+ export type ZipFileItem = {
793
+ /** string/ArrayBuffer 文件内容 */
794
+ data ?: any | null,
795
+ /** 错误信息 */
796
+ errMsg : string
797
+ }
798
+ export type ReadZipEntryCallback = (res : EntriesResult) => void
799
+ export type ReadZipEntryOptions = {
800
+ /**
801
+ * 要读取的压缩包的路径 (本地路径),app-android平台支持代码包文件目录
802
+ */
803
+ filePath : string.URIString,
804
+ /**
805
+ *统一指定读取文件的字符编码,只在 entries 值为"all"时有效。
806
+ *如果 entries 值为 null 且不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容
807
+ */
808
+ encoding ?: "ascii" | "base64" | "utf-8" | null,
809
+ /** 要读取的压缩包内的文件列表(当不传入时表示读取压缩包内所有文件) */
810
+ entries ?: EntryItem[] | null,
811
+ /**
812
+ * 接口调用的回调函数
813
+ */
814
+ success ?: ReadZipEntryCallback | null,
815
+ /**
816
+ * 接口调用失败的回调函数
817
+ */
818
+ fail ?: FileManagerFailCallback | null,
819
+ /**
820
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
821
+ */
822
+ complete ?: FileManagerCompleteCallback | null
823
+ }
824
+
825
+ export type ReadSuccessCallbackResult = {
826
+ /** 被写入的缓存区的对象,即接口入参的 arrayBuffer */
827
+ arrayBuffer : ArrayBuffer
828
+ /** 实际读取的字节数 */
829
+ bytesRead : number
830
+ errMsg : string
831
+ }
832
+ /** 接口调用成功的回调函数 */
833
+ export type ReadSuccessCallback = (result : ReadSuccessCallbackResult) => void
834
+ export type ReadOption = {
835
+ /** 数据写入的缓冲区,必须是 ArrayBuffer 实例 */
836
+ arrayBuffer : ArrayBuffer
837
+ /** 文件描述符。fd 通过 FileSystemManager.open 或 FileSystemManager.openSync 接口获得*/
838
+ fd : string
839
+ /** 要从文件中读取的字节数,默认0 */
840
+ length ?: number
841
+ /** 缓冲区中的写入偏移量,默认0 */
842
+ offset ?: number
843
+ /** 文件读取的起始位置,如不传或传 null,则会从当前文件指针的位置读取。如果 position 是正整数,则文件指针位置会保持不变并从 position 读取文件。 */
844
+ position ?: number
845
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
846
+ complete ?: FileManagerCompleteCallback
847
+ /** 接口调用失败的回调函数 */
848
+ fail ?: FileManagerFailCallback
849
+ /** 接口调用成功的回调函数 */
850
+ success ?: ReadSuccessCallback
851
+ }
852
+
853
+ export type ReadSyncOption = {
854
+ /** 数据写入的缓冲区,必须是 ArrayBuffer 实例 */
855
+ arrayBuffer : ArrayBuffer
856
+ /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */
857
+ fd : string
858
+ /** 要从文件中读取的字节数,默认0 */
859
+ length ?: number
860
+ /** 缓冲区中的写入偏移量,默认0 */
861
+ offset ?: number
862
+ /** 文件读取的起始位置,如不传或传 null,则会从当前文件指针的位置读取。如果 position 是正整数,则文件指针位置会保持不变并从 position 读取文件。 */
863
+ position ?: number
864
+ }
865
+ export type ReadResult = {
866
+ /** 被写入的缓存区的对象,即接口入参的 arrayBuffer */
867
+ arrayBuffer : ArrayBuffer
868
+ /** 实际读取的字节数 */
869
+ bytesRead : number
870
+ }
871
+ export interface FileSystemManager {
872
+ /**
873
+ * 读取本地文件内容
874
+ * @uniPlatform {
875
+ * "app": {
876
+ * "android": {
877
+ * "osVer": "5.0",
878
+ * "uniVer": "x",
879
+ * "unixVer": "3.9.0"
880
+ * },
881
+ * "ios": {
882
+ * "osVer": "12.0",
883
+ * "uniVer": "x",
884
+ * "unixVer": "4.11"
885
+ * }
886
+ * },
887
+ * "web": {
888
+ * "uniVer": "x",
889
+ * "unixVer": "x"
890
+ * }
891
+ * }
892
+ */
893
+ readFile(options : ReadFileOptions) : void;
894
+ /**
895
+ * FileSystemManager.readFile 的同步版本参数
896
+ * @param filePath 文件路径,支持相对地址和绝对地址,app-android平台支持代码包文件目录
897
+ * @param encoding base64 / utf-8,指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容
898
+ * @returns string|ArrayBuffer data文件内容
899
+ * @uniPlatform {
900
+ * "app": {
901
+ * "android": {
902
+ * "osVer": "5.0",
903
+ * "uniVer": "x",
904
+ * "unixVer": "4.13"
905
+ * },
906
+ * "ios": {
907
+ * "osVer": "12.0",
908
+ * "uniVer": "x",
909
+ * "unixVer": "x"
910
+ * }
911
+ * },
912
+ * "web": {
913
+ * "uniVer": "x",
914
+ * "unixVer": "x"
915
+ * }
916
+ * }
917
+ */
918
+ readFileSync(filePath : string, encoding ?: string) : any;
919
+
920
+ /**
921
+ * 写文件
922
+ * @uniPlatform {
923
+ * "app": {
924
+ * "android": {
925
+ * "osVer": "5.0",
926
+ * "uniVer": "x",
927
+ * "unixVer": "3.9.0"
928
+ * },
929
+ * "ios": {
930
+ * "osVer": "12.0",
931
+ * "uniVer": "x",
932
+ * "unixVer": "4.11"
933
+ * }
934
+ * },
935
+ * "web": {
936
+ * "uniVer": "x",
937
+ * "unixVer": "x"
938
+ * }
939
+ * }
940
+ */
941
+ writeFile(options : WriteFileOptions) : void;
942
+ /**
943
+ * 读文件
944
+ * @uniPlatform {
945
+ * "app": {
946
+ * "android": {
947
+ * "osVer": "5.0",
948
+ * "uniVer": "x",
949
+ * "unixVer": "4.26"
950
+ * },
951
+ * "ios": {
952
+ * "osVer": "12.0",
953
+ * "uniVer": "x",
954
+ * "unixVer": "x"
955
+ * }
956
+ * },
957
+ * "web": {
958
+ * "uniVer": "x",
959
+ * "unixVer": "x"
960
+ * }
961
+ * }
962
+ */
963
+ read(option : ReadOption) : void;
964
+ /**
965
+ * 读文件
966
+ * @uniPlatform {
967
+ * "app": {
968
+ * "android": {
969
+ * "osVer": "5.0",
970
+ * "uniVer": "x",
971
+ * "unixVer": "4.26"
972
+ * },
973
+ * "ios": {
974
+ * "osVer": "12.0",
975
+ * "uniVer": "x",
976
+ * "unixVer": "x"
977
+ * }
978
+ * },
979
+ * "web": {
980
+ * "uniVer": "x",
981
+ * "unixVer": "x"
982
+ * }
983
+ * }
984
+ */
985
+ readSync(option : ReadSyncOption) : ReadResult;
986
+ /**
987
+ * FileSystemManager.writeFile 的同步版本
988
+ * @param filePath 文件路径,只支持绝对地址
989
+ * @param data 要写入的文本或二进制数据
990
+ * @param encoding 指定写入文件的字符编码,支持:ascii base64 utf-8,只在 data 类型是 String 时有效
991
+ * @uniPlatform {
992
+ * "app": {
993
+ * "android": {
994
+ * "osVer": "5.0",
995
+ * "uniVer": "x",
996
+ * "unixVer": "4.13"
997
+ * },
998
+ * "ios": {
999
+ * "osVer": "12.0",
1000
+ * "uniVer": "x",
1001
+ * "unixVer": "x"
1002
+ * }
1003
+ * },
1004
+ * "web": {
1005
+ * "uniVer": "x",
1006
+ * "unixVer": "x"
1007
+ * }
1008
+ * }
1009
+ */
1010
+ writeFileSync(filePath : string, data : any, encoding ?: string) : void;
1011
+ /**
1012
+ * 删除文件
1013
+ * @uniPlatform {
1014
+ * "app": {
1015
+ * "android": {
1016
+ * "osVer": "5.0",
1017
+ * "uniVer": "x",
1018
+ * "unixVer": "3.9.0"
1019
+ * },
1020
+ * "ios": {
1021
+ * "osVer": "12.0",
1022
+ * "uniVer": "x",
1023
+ * "unixVer": "4.11"
1024
+ * }
1025
+ * },
1026
+ * "web": {
1027
+ * "uniVer": "x",
1028
+ * "unixVer": "x"
1029
+ * }
1030
+ * }
1031
+ */
1032
+ unlink(options : UnLinkOptions) : void;
1033
+ /**
1034
+ * FileSystemManager.unlink 的同步版本
1035
+ * @param filePath 文件路径,只支持绝对地址
1036
+ * @uniPlatform {
1037
+ * "app": {
1038
+ * "android": {
1039
+ * "osVer": "5.0",
1040
+ * "uniVer": "x",
1041
+ * "unixVer": "4.13"
1042
+ * },
1043
+ * "ios": {
1044
+ * "osVer": "12.0",
1045
+ * "uniVer": "x",
1046
+ * "unixVer": "x"
1047
+ * }
1048
+ * },
1049
+ * "web": {
1050
+ * "uniVer": "x",
1051
+ * "unixVer": "x"
1052
+ * }
1053
+ * }
1054
+ */
1055
+ unlinkSync(filePath : string) : void;
1056
+ /**
1057
+ * 创建目录
1058
+ * @uniPlatform {
1059
+ * "app": {
1060
+ * "android": {
1061
+ * "osVer": "5.0",
1062
+ * "uniVer": "x",
1063
+ * "unixVer": "3.9.0"
1064
+ * },
1065
+ * "ios": {
1066
+ * "osVer": "12.0",
1067
+ * "uniVer": "x",
1068
+ * "unixVer": "4.11"
1069
+ * }
1070
+ * },
1071
+ * "web": {
1072
+ * "uniVer": "x",
1073
+ * "unixVer": "x"
1074
+ * }
1075
+ * }
1076
+ */
1077
+ mkdir(options : MkDirOptions) : void;
1078
+ /**
1079
+ * FileSystemManager.mkdir 的同步版本
1080
+ * @param dirPath 创建的目录路径 (本地路径)
1081
+ * @param recursive 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。
1082
+ * @uniPlatform {
1083
+ * "app": {
1084
+ * "android": {
1085
+ * "osVer": "5.0",
1086
+ * "uniVer": "x",
1087
+ * "unixVer": "4.13"
1088
+ * },
1089
+ * "ios": {
1090
+ * "osVer": "12.0",
1091
+ * "uniVer": "x",
1092
+ * "unixVer": "x"
1093
+ * }
1094
+ * },
1095
+ * "web": {
1096
+ * "uniVer": "x",
1097
+ * "unixVer": "x"
1098
+ * }
1099
+ * }
1100
+ */
1101
+ mkdirSync(dirPath : string, recursive : boolean) : void;
1102
+ /**
1103
+ * 删除目录
1104
+ * @uniPlatform {
1105
+ * "app": {
1106
+ * "android": {
1107
+ * "osVer": "5.0",
1108
+ * "uniVer": "x",
1109
+ * "unixVer": "3.9.0"
1110
+ * },
1111
+ * "ios": {
1112
+ * "osVer": "12.0",
1113
+ * "uniVer": "x",
1114
+ * "unixVer": "4.11"
1115
+ * }
1116
+ * },
1117
+ * "web": {
1118
+ * "uniVer": "x",
1119
+ * "unixVer": "x"
1120
+ * }
1121
+ * }
1122
+ */
1123
+ rmdir(options : RmDirOptions) : void;
1124
+ /**
1125
+ * FileSystemManager.rmdir 的同步版本
1126
+ * @param dirPath 要删除的目录路径 (本地路径)
1127
+ * @param recursive 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。
1128
+ * @uniPlatform {
1129
+ * "app": {
1130
+ * "android": {
1131
+ * "osVer": "5.0",
1132
+ * "uniVer": "x",
1133
+ * "unixVer": "4.13"
1134
+ * },
1135
+ * "ios": {
1136
+ * "osVer": "12.0",
1137
+ * "uniVer": "x",
1138
+ * "unixVer": "x"
1139
+ * }
1140
+ * },
1141
+ * "web": {
1142
+ * "uniVer": "x",
1143
+ * "unixVer": "x"
1144
+ * }
1145
+ * }
1146
+ */
1147
+ rmdirSync(dirPath : string, recursive : boolean) : void;
1148
+ /**
1149
+ * 读取目录内文件列表
1150
+ * @uniPlatform {
1151
+ * "app": {
1152
+ * "android": {
1153
+ * "osVer": "5.0",
1154
+ * "uniVer": "x",
1155
+ * "unixVer": "3.9.0"
1156
+ * },
1157
+ * "ios": {
1158
+ * "osVer": "12.0",
1159
+ * "uniVer": "x",
1160
+ * "unixVer": "4.11"
1161
+ * }
1162
+ * },
1163
+ * "web": {
1164
+ * "uniVer": "x",
1165
+ * "unixVer": "x"
1166
+ * }
1167
+ * }
1168
+ */
1169
+ readdir(options : ReadDirOptions) : void;
1170
+ /**
1171
+ * FileSystemManager.readdir 的同步版本
1172
+ * @param dirPath 要读取的目录路径 (本地路径)
1173
+ * @uniPlatform {
1174
+ * "app": {
1175
+ * "android": {
1176
+ * "osVer": "5.0",
1177
+ * "uniVer": "x",
1178
+ * "unixVer": "4.13"
1179
+ * },
1180
+ * "ios": {
1181
+ * "osVer": "12.0",
1182
+ * "uniVer": "x",
1183
+ * "unixVer": "x"
1184
+ * }
1185
+ * },
1186
+ * "web": {
1187
+ * "uniVer": "x",
1188
+ * "unixVer": "x"
1189
+ * }
1190
+ * }
1191
+ */
1192
+ readdirSync(dirPath : string) : string[] | null;
1193
+ /**
1194
+ * 判断文件/目录是否存在
1195
+ * @uniPlatform {
1196
+ * "app": {
1197
+ * "android": {
1198
+ * "osVer": "5.0",
1199
+ * "uniVer": "x",
1200
+ * "unixVer": "3.9.0"
1201
+ * },
1202
+ * "ios": {
1203
+ * "osVer": "12.0",
1204
+ * "uniVer": "x",
1205
+ * "unixVer": "4.11"
1206
+ * }
1207
+ * },
1208
+ * "web": {
1209
+ * "uniVer": "x",
1210
+ * "unixVer": "x"
1211
+ * }
1212
+ * }
1213
+ */
1214
+ access(options : AccessOptions) : void;
1215
+ /**
1216
+ * FileSystemManager.access 的同步版本
1217
+ * @param path 要判断是否存在的文件/目录路径 (本地路径)
1218
+ * @uniPlatform {
1219
+ * "app": {
1220
+ * "android": {
1221
+ * "osVer": "5.0",
1222
+ * "uniVer": "x",
1223
+ * "unixVer": "4.13"
1224
+ * },
1225
+ * "ios": {
1226
+ * "osVer": "12.0",
1227
+ * "uniVer": "x",
1228
+ * "unixVer": "x"
1229
+ * }
1230
+ * },
1231
+ * "web": {
1232
+ * "uniVer": "x",
1233
+ * "unixVer": "x"
1234
+ * }
1235
+ * }
1236
+ */
1237
+ accessSync(path : string) : void;
1238
+ /**
1239
+ * 重命名文件。可以把文件从 oldPath 移动到 newPath
1240
+ * @uniPlatform {
1241
+ * "app": {
1242
+ * "android": {
1243
+ * "osVer": "5.0",
1244
+ * "uniVer": "x",
1245
+ * "unixVer": "3.9.0"
1246
+ * },
1247
+ * "ios": {
1248
+ * "osVer": "12.0",
1249
+ * "uniVer": "x",
1250
+ * "unixVer": "4.11"
1251
+ * }
1252
+ * },
1253
+ * "web": {
1254
+ * "uniVer": "x",
1255
+ * "unixVer": "x"
1256
+ * }
1257
+ * }
1258
+ */
1259
+ rename(options : RenameOptions) : void;
1260
+ /**
1261
+ * FileSystemManager.rename 的同步版本
1262
+ * @param oldPath 源文件路径,支持本地路径
1263
+ * @param newPath 新文件路径,支持本地路径
1264
+ * @uniPlatform {
1265
+ * "app": {
1266
+ * "android": {
1267
+ * "osVer": "5.0",
1268
+ * "uniVer": "x",
1269
+ * "unixVer": "4.13"
1270
+ * },
1271
+ * "ios": {
1272
+ * "osVer": "12.0",
1273
+ * "uniVer": "x",
1274
+ * "unixVer": "x"
1275
+ * }
1276
+ * },
1277
+ * "web": {
1278
+ * "uniVer": "x",
1279
+ * "unixVer": "x"
1280
+ * }
1281
+ * }
1282
+ */
1283
+ renameSync(oldPath : string, newPath : string) : void;
1284
+ /**
1285
+ * 复制文件
1286
+ * @uniPlatform {
1287
+ * "app": {
1288
+ * "android": {
1289
+ * "osVer": "5.0",
1290
+ * "uniVer": "x",
1291
+ * "unixVer": "3.9.0"
1292
+ * },
1293
+ * "ios": {
1294
+ * "osVer": "12.0",
1295
+ * "uniVer": "x",
1296
+ * "unixVer": "4.11"
1297
+ * }
1298
+ * },
1299
+ * "web": {
1300
+ * "uniVer": "x",
1301
+ * "unixVer": "x"
1302
+ * }
1303
+ * }
1304
+ */
1305
+ copyFile(options : CopyFileOptions) : void;
1306
+ /**
1307
+ * FileSystemManager.copyFile 的同步版本
1308
+ * @param srcPath 源文件路径,支持本地路径
1309
+ * @param destPath 新文件路径,支持本地路径
1310
+ * @uniPlatform {
1311
+ * "app": {
1312
+ * "android": {
1313
+ * "osVer": "5.0",
1314
+ * "uniVer": "x",
1315
+ * "unixVer": "4.13"
1316
+ * },
1317
+ * "ios": {
1318
+ * "osVer": "12.0",
1319
+ * "uniVer": "x",
1320
+ * "unixVer": "x"
1321
+ * }
1322
+ * },
1323
+ * "web": {
1324
+ * "uniVer": "x",
1325
+ * "unixVer": "x"
1326
+ * }
1327
+ * }
1328
+ */
1329
+ copyFileSync(srcPath : string, destPath : string) : void;
1330
+ /**
1331
+ * 获取该本地临时文件 或 本地缓存文件 信息
1332
+ * @uniPlatform {
1333
+ * "app": {
1334
+ * "android": {
1335
+ * "osVer": "5.0",
1336
+ * "uniVer": "x",
1337
+ * "unixVer": "3.9.0"
1338
+ * },
1339
+ * "ios": {
1340
+ * "osVer": "12.0",
1341
+ * "uniVer": "x",
1342
+ * "unixVer": "4.11"
1343
+ * }
1344
+ * },
1345
+ * "web": {
1346
+ * "uniVer": "x",
1347
+ * "unixVer": "x"
1348
+ * }
1349
+ * }
1350
+ */
1351
+ getFileInfo(options : GetFileInfoOptions) : void;
1352
+ /**
1353
+ * 获取文件 Stats 对象
1354
+ * @uniPlatform {
1355
+ * "app": {
1356
+ * "android": {
1357
+ * "osVer": "5.0",
1358
+ * "uniVer": "x",
1359
+ * "unixVer": "3.9.0"
1360
+ * },
1361
+ * "ios": {
1362
+ * "osVer": "12.0",
1363
+ * "uniVer": "x",
1364
+ * "unixVer": "4.11"
1365
+ * }
1366
+ * },
1367
+ * "web": {
1368
+ * "uniVer": "x",
1369
+ * "unixVer": "x"
1370
+ * }
1371
+ * }
1372
+ */
1373
+ stat(options : StatOptions) : void;
1374
+ /**
1375
+ * FileSystemManager.stat 的同步版本
1376
+ * @param path 文件/目录路径 (本地路径)
1377
+ * @param recursive 是否递归获取目录下的每个文件的 Stats 信息
1378
+ * @uniPlatform {
1379
+ * "app": {
1380
+ * "android": {
1381
+ * "osVer": "5.0",
1382
+ * "uniVer": "x",
1383
+ * "unixVer": "4.13"
1384
+ * },
1385
+ * "ios": {
1386
+ * "osVer": "12.0",
1387
+ * "uniVer": "x",
1388
+ * "unixVer": "x"
1389
+ * }
1390
+ * },
1391
+ * "web": {
1392
+ * "uniVer": "x",
1393
+ * "unixVer": "x"
1394
+ * }
1395
+ * }
1396
+ */
1397
+ statSync(path : string, recursive : boolean) : FileStats[];
1398
+ /**
1399
+ * 在文件结尾追加内容
1400
+ * @uniPlatform {
1401
+ * "app": {
1402
+ * "android": {
1403
+ * "osVer": "5.0",
1404
+ * "uniVer": "x",
1405
+ * "unixVer": "4.13"
1406
+ * },
1407
+ * "ios": {
1408
+ * "osVer": "12.0",
1409
+ * "uniVer": "x",
1410
+ * "unixVer": "x"
1411
+ * }
1412
+ * },
1413
+ * "web": {
1414
+ * "uniVer": "x",
1415
+ * "unixVer": "x"
1416
+ * }
1417
+ * }
1418
+ */
1419
+ appendFile(options : AppendFileOptions) : void;
1420
+ /**
1421
+ * FileSystemManager.appendFile 的同步版本
1422
+ * @param filePath 要追加内容的文件路径 (本地路径)
1423
+ * @param data 要追加的文本或二进制数据
1424
+ * @param encoding 指定写入文件的字符编码支持:ascii base64 utf-8,只在 data 类型是 String 时有效
1425
+ * @uniPlatform {
1426
+ * "app": {
1427
+ * "android": {
1428
+ * "osVer": "5.0",
1429
+ * "uniVer": "x",
1430
+ * "unixVer": "4.13"
1431
+ * },
1432
+ * "ios": {
1433
+ * "osVer": "12.0",
1434
+ * "uniVer": "x",
1435
+ * "unixVer": "x"
1436
+ * }
1437
+ * },
1438
+ * "web": {
1439
+ * "uniVer": "x",
1440
+ * "unixVer": "x"
1441
+ * }
1442
+ * }
1443
+ */
1444
+
1445
+ appendFileSync(filePath : string, data : any, encoding ?: string) : void;
1446
+
1447
+ /**
1448
+ * 保存临时文件到本地。此接口会移动临时文件,因此调用成功后,tempFilePath 将不可用。
1449
+ * @uniPlatform {
1450
+ * "app": {
1451
+ * "android": {
1452
+ * "osVer": "5.0",
1453
+ * "uniVer": "x",
1454
+ * "unixVer": "4.13"
1455
+ * },
1456
+ * "ios": {
1457
+ * "osVer": "12.0",
1458
+ * "uniVer": "x",
1459
+ * "unixVer": "x"
1460
+ * }
1461
+ * },
1462
+ * "web": {
1463
+ * "uniVer": "x",
1464
+ * "unixVer": "x"
1465
+ * }
1466
+ * }
1467
+ */
1468
+ saveFile(options : SaveFileOptions) : void;
1469
+ /**
1470
+ * FileSystemManager.saveFile 的同步版本
1471
+ * @param tempFilePath 临时存储文件路径 (本地路径)
1472
+ * @param filePath 要存储的文件路径 (本地路径)
1473
+ * @uniPlatform {
1474
+ * "app": {
1475
+ * "android": {
1476
+ * "osVer": "5.0",
1477
+ * "uniVer": "x",
1478
+ * "unixVer": "4.13"
1479
+ * },
1480
+ * "ios": {
1481
+ * "osVer": "12.0",
1482
+ * "uniVer": "x",
1483
+ * "unixVer": "x"
1484
+ * }
1485
+ * },
1486
+ * "web": {
1487
+ * "uniVer": "x",
1488
+ * "unixVer": "x"
1489
+ * }
1490
+ * }
1491
+ */
1492
+ saveFileSync(tempFilePath : string, filePath : string | null) : string;
1493
+ /**
1494
+ * 删除该小程序下已保存的本地缓存文件
1495
+ * @uniPlatform {
1496
+ * "app": {
1497
+ * "android": {
1498
+ * "osVer": "5.0",
1499
+ * "uniVer": "x",
1500
+ * "unixVer": "4.13"
1501
+ * },
1502
+ * "ios": {
1503
+ * "osVer": "12.0",
1504
+ * "uniVer": "x",
1505
+ * "unixVer": "x"
1506
+ * }
1507
+ * },
1508
+ * "web": {
1509
+ * "uniVer": "x",
1510
+ * "unixVer": "x"
1511
+ * }
1512
+ * }
1513
+ */
1514
+ removeSavedFile(options : RemoveSavedFileOptions) : void;
1515
+ /**
1516
+ * 解压文件
1517
+ * @uniPlatform {
1518
+ * "app": {
1519
+ * "android": {
1520
+ * "osVer": "5.0",
1521
+ * "uniVer": "x",
1522
+ * "unixVer": "4.13"
1523
+ * },
1524
+ * "ios": {
1525
+ * "osVer": "12.0",
1526
+ * "uniVer": "x",
1527
+ * "unixVer": "x"
1528
+ * }
1529
+ * },
1530
+ * "web": {
1531
+ * "uniVer": "x",
1532
+ * "unixVer": "x"
1533
+ * }
1534
+ * }
1535
+ */
1536
+ unzip(options : UnzipFileOptions) : void;
1537
+ /**
1538
+ * 获取该已保存的本地缓存文件列表
1539
+ * @uniPlatform {
1540
+ * "app": {
1541
+ * "android": {
1542
+ * "osVer": "5.0",
1543
+ * "uniVer": "x",
1544
+ * "unixVer": "4.13"
1545
+ * },
1546
+ * "ios": {
1547
+ * "osVer": "12.0",
1548
+ * "uniVer": "x",
1549
+ * "unixVer": "x"
1550
+ * }
1551
+ * },
1552
+ * "web": {
1553
+ * "uniVer": "x",
1554
+ * "unixVer": "x"
1555
+ * }
1556
+ * }
1557
+ */
1558
+ getSavedFileList(options : GetSavedFileListOptions) : void;
1559
+ /**
1560
+ * 对文件内容进行截断操作
1561
+ * @uniPlatform {
1562
+ * "app": {
1563
+ * "android": {
1564
+ * "osVer": "5.0",
1565
+ * "uniVer": "x",
1566
+ * "unixVer": "4.13"
1567
+ * },
1568
+ * "ios": {
1569
+ * "osVer": "12.0",
1570
+ * "uniVer": "x",
1571
+ * "unixVer": "x"
1572
+ * }
1573
+ * },
1574
+ * "web": {
1575
+ * "uniVer": "x",
1576
+ * "unixVer": "x"
1577
+ * }
1578
+ * }
1579
+ */
1580
+ truncate(options : TruncateFileOptions) : void;
1581
+ /**
1582
+ * 对文件内容进行截断操作 (truncate 的同步版本)
1583
+ * @param filePath 要截断的文件路径 (本地路径)
1584
+ * @param length 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,不做处理
1585
+ * @uniPlatform {
1586
+ * "app": {
1587
+ * "android": {
1588
+ * "osVer": "5.0",
1589
+ * "uniVer": "x",
1590
+ * "unixVer": "4.13"
1591
+ * },
1592
+ * "ios": {
1593
+ * "osVer": "12.0",
1594
+ * "uniVer": "x",
1595
+ * "unixVer": "x"
1596
+ * }
1597
+ * },
1598
+ * "web": {
1599
+ * "uniVer": "x",
1600
+ * "unixVer": "x"
1601
+ * }
1602
+ * }
1603
+ */
1604
+ truncateSync(filePath : string, length ?: number) : void;
1605
+ /**
1606
+ * 读取指定压缩类型的本地文件内容
1607
+ * @uniPlatform {
1608
+ * "app": {
1609
+ * "android": {
1610
+ * "osVer": "5.0",
1611
+ * "uniVer": "x",
1612
+ * "unixVer": "4.13"
1613
+ * },
1614
+ * "ios": {
1615
+ * "osVer": "12.0",
1616
+ * "uniVer": "x",
1617
+ * "unixVer": "x"
1618
+ * }
1619
+ * },
1620
+ * "web": {
1621
+ * "uniVer": "x",
1622
+ * "unixVer": "x"
1623
+ * }
1624
+ * }
1625
+ */
1626
+ readCompressedFile(options : ReadCompressedFileOptions) : void;
1627
+ /**
1628
+ * 同步读取指定压缩类型的本地文件内容
1629
+ * @param filePath 要读取的文件的路径 (本地用户文件或代码包文件),app-android平台支持代码包文件目录
1630
+ * @param compressionAlgorithm 文件压缩类型,目前仅支持 'br'。
1631
+ * @uniPlatform {
1632
+ * "app": {
1633
+ * "android": {
1634
+ * "osVer": "5.0",
1635
+ * "uniVer": "x",
1636
+ * "unixVer": "4.13"
1637
+ * },
1638
+ * "ios": {
1639
+ * "osVer": "12.0",
1640
+ * "uniVer": "x",
1641
+ * "unixVer": "x"
1642
+ * }
1643
+ * },
1644
+ * "web": {
1645
+ * "uniVer": "x",
1646
+ * "unixVer": "x"
1647
+ * }
1648
+ * }
1649
+ */
1650
+ readCompressedFileSync(filePath : string, compressionAlgorithm : string) : string
1651
+ /**
1652
+ * 打开文件,返回文件描述符
1653
+ * @uniPlatform {
1654
+ * "app": {
1655
+ * "android": {
1656
+ * "osVer": "5.0",
1657
+ * "uniVer": "x",
1658
+ * "unixVer": "4.13"
1659
+ * },
1660
+ * "ios": {
1661
+ * "osVer": "12.0",
1662
+ * "uniVer": "x",
1663
+ * "unixVer": "x"
1664
+ * }
1665
+ * },
1666
+ * "web": {
1667
+ * "uniVer": "x",
1668
+ * "unixVer": "x"
1669
+ * }
1670
+ * }
1671
+ */
1672
+ open(options : OpenFileOptions) : void;
1673
+ /**
1674
+ * 同步打开文件,返回文件描述符
1675
+ * @uniPlatform {
1676
+ * "app": {
1677
+ * "android": {
1678
+ * "osVer": "5.0",
1679
+ * "uniVer": "x",
1680
+ * "unixVer": "4.13"
1681
+ * },
1682
+ * "ios": {
1683
+ * "osVer": "12.0",
1684
+ * "uniVer": "x",
1685
+ * "unixVer": "x"
1686
+ * }
1687
+ * },
1688
+ * "web": {
1689
+ * "uniVer": "x",
1690
+ * "unixVer": "x"
1691
+ * }
1692
+ * }
1693
+ */
1694
+ openSync(options : OpenFileSyncOptions) : string;
1695
+ /**
1696
+ * 写入文件
1697
+ * @uniPlatform {
1698
+ * "app": {
1699
+ * "android": {
1700
+ * "osVer": "5.0",
1701
+ * "uniVer": "x",
1702
+ * "unixVer": "4.13"
1703
+ * },
1704
+ * "ios": {
1705
+ * "osVer": "12.0",
1706
+ * "uniVer": "x",
1707
+ * "unixVer": "x"
1708
+ * }
1709
+ * },
1710
+ * "web": {
1711
+ * "uniVer": "x",
1712
+ * "unixVer": "x"
1713
+ * }
1714
+ * }
1715
+ */
1716
+ write(options : WriteOptions) : void;
1717
+ /**
1718
+ * 同步写入文件
1719
+ * @uniPlatform {
1720
+ * "app": {
1721
+ * "android": {
1722
+ * "osVer": "5.0",
1723
+ * "uniVer": "x",
1724
+ * "unixVer": "4.13"
1725
+ * },
1726
+ * "ios": {
1727
+ * "osVer": "12.0",
1728
+ * "uniVer": "x",
1729
+ * "unixVer": "x"
1730
+ * }
1731
+ * },
1732
+ * "web": {
1733
+ * "uniVer": "x",
1734
+ * "unixVer": "x"
1735
+ * }
1736
+ * }
1737
+ */
1738
+ writeSync(options : WriteSyncOptions) : WriteResult;
1739
+ /**
1740
+ * 关闭文件
1741
+ * @uniPlatform {
1742
+ * "app": {
1743
+ * "android": {
1744
+ * "osVer": "5.0",
1745
+ * "uniVer": "x",
1746
+ * "unixVer": "4.13"
1747
+ * },
1748
+ * "ios": {
1749
+ * "osVer": "12.0",
1750
+ * "uniVer": "x",
1751
+ * "unixVer": "x"
1752
+ * }
1753
+ * },
1754
+ * "web": {
1755
+ * "uniVer": "x",
1756
+ * "unixVer": "x"
1757
+ * }
1758
+ * }
1759
+ */
1760
+ close(options : CloseOptions) : void;
1761
+ /**
1762
+ * 同步关闭文件
1763
+ * @uniPlatform {
1764
+ * "app": {
1765
+ * "android": {
1766
+ * "osVer": "5.0",
1767
+ * "uniVer": "x",
1768
+ * "unixVer": "4.13"
1769
+ * },
1770
+ * "ios": {
1771
+ * "osVer": "12.0",
1772
+ * "uniVer": "x",
1773
+ * "unixVer": "x"
1774
+ * }
1775
+ * },
1776
+ * "web": {
1777
+ * "uniVer": "x",
1778
+ * "unixVer": "x"
1779
+ * }
1780
+ * }
1781
+ */
1782
+ closeSync(options : CloseSyncOptions) : void;
1783
+ /**
1784
+ * 获取文件的状态信息
1785
+ * @uniPlatform {
1786
+ * "app": {
1787
+ * "android": {
1788
+ * "osVer": "5.0",
1789
+ * "uniVer": "x",
1790
+ * "unixVer": "4.13"
1791
+ * },
1792
+ * "ios": {
1793
+ * "osVer": "12.0",
1794
+ * "uniVer": "x",
1795
+ * "unixVer": "x"
1796
+ * }
1797
+ * },
1798
+ * "web": {
1799
+ * "uniVer": "x",
1800
+ * "unixVer": "x"
1801
+ * }
1802
+ * }
1803
+ */
1804
+ fstat(options : FStatOptions) : void;
1805
+ /**
1806
+ * 同步获取文件的状态信息
1807
+ * @uniPlatform {
1808
+ * "app": {
1809
+ * "android": {
1810
+ * "osVer": "5.0",
1811
+ * "uniVer": "x",
1812
+ * "unixVer": "4.13"
1813
+ * },
1814
+ * "ios": {
1815
+ * "osVer": "12.0",
1816
+ * "uniVer": "x",
1817
+ * "unixVer": "x"
1818
+ * }
1819
+ * },
1820
+ * "web": {
1821
+ * "uniVer": "x",
1822
+ * "unixVer": "x"
1823
+ * }
1824
+ * }
1825
+ */
1826
+ fstatSync(options : FStatSyncOptions) : Stats;
1827
+ /**
1828
+ * 对文件内容进行截断操作
1829
+ * @uniPlatform {
1830
+ * "app": {
1831
+ * "android": {
1832
+ * "osVer": "5.0",
1833
+ * "uniVer": "x",
1834
+ * "unixVer": "4.13"
1835
+ * },
1836
+ * "ios": {
1837
+ * "osVer": "12.0",
1838
+ * "uniVer": "x",
1839
+ * "unixVer": "x"
1840
+ * }
1841
+ * },
1842
+ * "web": {
1843
+ * "uniVer": "x",
1844
+ * "unixVer": "x"
1845
+ * }
1846
+ * }
1847
+ */
1848
+ ftruncate(options : FTruncateFileOptions) : void;
1849
+ /**
1850
+ * 同步对文件内容进行截断操作
1851
+ * @uniPlatform {
1852
+ * "app": {
1853
+ * "android": {
1854
+ * "osVer": "5.0",
1855
+ * "uniVer": "x",
1856
+ * "unixVer": "4.13"
1857
+ * },
1858
+ * "ios": {
1859
+ * "osVer": "12.0",
1860
+ * "uniVer": "x",
1861
+ * "unixVer": "x"
1862
+ * }
1863
+ * },
1864
+ * "web": {
1865
+ * "uniVer": "x",
1866
+ * "unixVer": "x"
1867
+ * }
1868
+ * }
1869
+ */
1870
+ ftruncateSync(options : FTruncateFileSyncOptions) : void;
1871
+ /**
1872
+ * 读取压缩包内的文件
1873
+ * @uniPlatform {
1874
+ * "app": {
1875
+ * "android": {
1876
+ * "osVer": "5.0",
1877
+ * "uniVer": "x",
1878
+ * "unixVer": "4.13"
1879
+ * },
1880
+ * "ios": {
1881
+ * "osVer": "12.0",
1882
+ * "uniVer": "x",
1883
+ * "unixVer": "x"
1884
+ * }
1885
+ * },
1886
+ * "web": {
1887
+ * "uniVer": "x",
1888
+ * "unixVer": "x"
1889
+ * }
1890
+ * }
1891
+ */
1892
+ readZipEntry(options : ReadZipEntryOptions) : void;
1893
+ }
1894
+
1895
+
1896
+ export type GetFileSystemManager = () => FileSystemManager;
1897
+
1898
+
1899
+ export interface Uni {
1900
+ /**
1901
+ * 获取文件管理器
1902
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-file-system-manager.html
1903
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-file-system-manager.html
1904
+ * @uniPlatform {
1905
+ * "app": {
1906
+ * "android": {
1907
+ * "osVer": "5.0",
1908
+ * "uniVer": "x",
1909
+ * "unixVer": "3.9.0"
1910
+ * },
1911
+ * "ios": {
1912
+ * "osVer": "12.0",
1913
+ * "uniVer": "x",
1914
+ * "unixVer": "4.11"
1915
+ * },
1916
+ * "harmony": {
1917
+ * "osVer": "x",
1918
+ * "uniVer": "x",
1919
+ * "unixVer": "x"
1920
+ * }
1921
+ * },
1922
+ * "web": {
1923
+ * "uniVer": "x",
1924
+ * "unixVer": "x"
1925
+ * }
1926
+ * }
1927
+ * @uniVueVersion 2,3 //支持的vue版本
1928
+ */
1929
+ getFileSystemManager() : FileSystemManager
1930
+ }
1931
+
1932
+ /**
1933
+ * 错误码
1934
+ */
1935
+ export type FileSystemManagerErrorCode =
1936
+ /**
1937
+ * 类型错误。仅支持 base64 / utf-8
1938
+ */
1939
+ 1200002 |
1940
+ /**
1941
+ * 未找到文件
1942
+ */
1943
+ 1300002 |
1944
+ /**
1945
+ * 无权限
1946
+ */
1947
+ 1300013 |
1948
+ /**
1949
+ * 是目录
1950
+ */
1951
+ 1300021 |
1952
+ /**
1953
+ * 参数无效
1954
+ */
1955
+ 1300022 |
1956
+ /**
1957
+ * 目录非空
1958
+ */
1959
+ 1300066 |
1960
+ /**
1961
+ * 对目录的非法操作
1962
+ */
1963
+ 1301003 |
1964
+ /**
1965
+ * 文件已存在
1966
+ */
1967
+ 1301005 |
1968
+ /**
1969
+ * 系统错误
1970
+ */
1971
+ 1300201 |
1972
+ /**
1973
+ * 超出文件存储限制的最大尺寸
1974
+ */
1975
+ 1300202 |
1976
+ /**
1977
+ * brotli解压失败
1978
+ */
1979
+ 1301111 |
1980
+ /**
1981
+ * 标志无效
1982
+ */
1983
+ 1302003 |
1984
+ /**
1985
+ * 文件描述符错误
1986
+ */
1987
+ 1300009;
1988
+
1989
+ export type FileSystemManagerFail = IFileSystemManagerFail;
1990
+ export interface IFileSystemManagerFail extends IUniError {
1991
+ errCode : FileSystemManagerErrorCode
1992
+ };