@dcloudio/uni-app-x 0.7.19 → 0.7.21

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 (335) 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 -842
  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 +2048 -2047
  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 +2859 -2859
  15. package/types/native/IUniError.d.ts +20 -20
  16. package/types/native/IUniForm.d.ts +9 -9
  17. package/types/native/IUniObjectElement.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 +240 -240
  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/UniApp.d.ts +205 -205
  27. package/types/native/UniCallbackWrapper.d.ts +7 -7
  28. package/types/native/UniCanvasElement.d.ts +9 -9
  29. package/types/native/UniCustomEvent.d.ts +24 -24
  30. package/types/native/UniDocument.d.ts +83 -83
  31. package/types/native/UniElement.d.ts +79 -79
  32. package/types/native/UniError.d.ts +70 -70
  33. package/types/native/UniEvent.d.ts +92 -92
  34. package/types/native/UniFormControl.d.ts +8 -8
  35. package/types/native/UniFormControlElement.d.ts +14 -14
  36. package/types/native/UniImageErrorEvent.d.ts +33 -33
  37. package/types/native/UniImageLoadEvent.d.ts +37 -37
  38. package/types/native/UniInputBlurEvent.d.ts +36 -36
  39. package/types/native/UniInputConfirmEvent.d.ts +30 -30
  40. package/types/native/UniInputEvent.d.ts +38 -38
  41. package/types/native/UniInputFocusEvent.d.ts +53 -53
  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 -20
  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 +15 -15
  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 +75 -75
  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 +598 -598
  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 +1682 -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 +58 -57
  86. package/types/uni/uts-plugin-api/index.d.ts +58 -57
  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-animationFrame/utssdk/global.d.ts +12 -12
  91. package/types/uni/uts-plugin-api/lib/uni-animationFrame/utssdk/index.d.ts +5 -5
  92. package/types/uni/uts-plugin-api/lib/uni-animationFrame/utssdk/interface.d.ts +50 -50
  93. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/global.d.ts +10 -10
  94. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/index.d.ts +4 -4
  95. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +77 -77
  96. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/global.d.ts +60 -0
  97. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/index.d.ts +29 -0
  98. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/interface.d.ts +161 -0
  99. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/global.d.ts +10 -10
  100. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/index.d.ts +4 -4
  101. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +77 -77
  102. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/global.d.ts +20 -20
  103. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/index.d.ts +9 -9
  104. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/interface.d.ts +264 -242
  105. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/global.d.ts +40 -40
  106. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/index.d.ts +19 -19
  107. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +203 -203
  108. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/global.d.ts +12 -12
  109. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/index.d.ts +5 -5
  110. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +1733 -1733
  111. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/global.d.ts +20 -20
  112. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/index.d.ts +9 -9
  113. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +152 -152
  114. package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/global.d.ts +18 -18
  115. package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/index.d.ts +8 -8
  116. package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/interface.d.ts +61 -61
  117. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/global.d.ts +20 -20
  118. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/index.d.ts +9 -9
  119. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +464 -427
  120. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/global.d.ts +12 -12
  121. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/index.d.ts +5 -5
  122. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +137 -137
  123. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/global.d.ts +28 -28
  124. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/index.d.ts +13 -13
  125. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +1336 -1336
  126. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/global.d.ts +16 -16
  127. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/index.d.ts +7 -7
  128. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +305 -305
  129. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/global.d.ts +26 -26
  130. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/index.d.ts +12 -12
  131. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +91 -91
  132. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/global.d.ts +80 -80
  133. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/index.d.ts +39 -39
  134. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/interface.d.ts +174 -174
  135. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/global.d.ts +142 -142
  136. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/index.d.ts +70 -70
  137. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +1840 -1840
  138. package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/global.d.ts +10 -10
  139. package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/index.d.ts +4 -4
  140. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/global.d.ts +12 -12
  141. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/index.d.ts +5 -5
  142. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +329 -329
  143. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/global.d.ts +14 -14
  144. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/index.d.ts +6 -6
  145. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +818 -818
  146. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +12 -12
  147. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +5 -5
  148. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +297 -297
  149. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/global.d.ts +14 -14
  150. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/index.d.ts +6 -6
  151. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +657 -657
  152. package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/global.d.ts +10 -10
  153. package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/index.d.ts +4 -4
  154. package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/interface.d.ts +81 -81
  155. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/global.d.ts +12 -12
  156. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/index.d.ts +5 -5
  157. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +155 -155
  158. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/global.d.ts +12 -12
  159. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/index.d.ts +5 -5
  160. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +159 -159
  161. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/global.d.ts +24 -24
  162. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/index.d.ts +11 -11
  163. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/interface.d.ts +563 -564
  164. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/global.d.ts +8 -8
  165. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/index.d.ts +4 -4
  166. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/interface.d.ts +1 -1
  167. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/global.d.ts +8 -8
  168. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/index.d.ts +4 -4
  169. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/global.d.ts +32 -32
  170. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/index.d.ts +15 -15
  171. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/global.d.ts +22 -22
  172. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/index.d.ts +10 -10
  173. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +163 -163
  174. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/global.d.ts +30 -32
  175. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/index.d.ts +14 -15
  176. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/interface.d.ts +375 -375
  177. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/global.d.ts +16 -16
  178. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/index.d.ts +7 -7
  179. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/interface.d.ts +980 -980
  180. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/global.d.ts +30 -30
  181. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/index.d.ts +14 -14
  182. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +2131 -2131
  183. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/global.d.ts +12 -12
  184. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/index.d.ts +5 -5
  185. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +169 -169
  186. package/types/uni/uts-plugin-api/lib/uni-installApk/utssdk/global.d.ts +24 -24
  187. package/types/uni/uts-plugin-api/lib/uni-installApk/utssdk/index.d.ts +11 -11
  188. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/global.d.ts +16 -16
  189. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/index.d.ts +7 -7
  190. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +169 -169
  191. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/global.d.ts +22 -22
  192. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/index.d.ts +10 -10
  193. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +60 -60
  194. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/global.d.ts +26 -26
  195. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/index.d.ts +12 -12
  196. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +564 -564
  197. package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/global.d.ts +24 -24
  198. package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/index.d.ts +11 -11
  199. package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/interface.d.ts +100 -100
  200. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/global.d.ts +160 -160
  201. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +79 -79
  202. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +1339 -1339
  203. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/global.d.ts +68 -68
  204. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/index.d.ts +33 -33
  205. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +1002 -1002
  206. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/global.d.ts +72 -72
  207. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/index.d.ts +35 -35
  208. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +1493 -1493
  209. package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/global.d.ts +24 -24
  210. package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/index.d.ts +11 -11
  211. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/global.d.ts +24 -24
  212. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/index.d.ts +11 -11
  213. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +70 -70
  214. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/global.d.ts +26 -26
  215. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/index.d.ts +12 -12
  216. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +153 -153
  217. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/global.d.ts +32 -32
  218. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/index.d.ts +15 -15
  219. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +240 -240
  220. package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/global.d.ts +8 -8
  221. package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/index.d.ts +4 -4
  222. package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/global.d.ts +8 -8
  223. package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/index.d.ts +4 -4
  224. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/global.d.ts +78 -74
  225. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/index.d.ts +38 -36
  226. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +193 -8
  227. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/global.d.ts +28 -28
  228. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/index.d.ts +13 -13
  229. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +189 -189
  230. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/global.d.ts +58 -58
  231. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/index.d.ts +28 -28
  232. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +2165 -2165
  233. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/global.d.ts +10 -10
  234. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/index.d.ts +4 -4
  235. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +38 -38
  236. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/global.d.ts +24 -24
  237. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/index.d.ts +11 -11
  238. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +73 -73
  239. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/global.d.ts +78 -78
  240. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/index.d.ts +38 -38
  241. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +600 -600
  242. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/global.d.ts +148 -148
  243. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/index.d.ts +73 -73
  244. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +1086 -1086
  245. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/global.d.ts +42 -42
  246. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/index.d.ts +20 -20
  247. package/types/uni/uts-plugin-api/lib/uni-virtualPayment/utssdk/global.d.ts +112 -112
  248. package/types/uni/uts-plugin-api/lib/uni-virtualPayment/utssdk/index.d.ts +55 -55
  249. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/global.d.ts +58 -58
  250. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/index.d.ts +28 -28
  251. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +844 -844
  252. package/types/uni/uts-plugin-biz/global.d.ts +4 -4
  253. package/types/uni/uts-plugin-biz/index.d.ts +4 -4
  254. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/global.d.ts +36 -36
  255. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/index.d.ts +17 -17
  256. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +141 -141
  257. package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/global.d.ts +28 -28
  258. package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/index.d.ts +13 -13
  259. package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/interface.d.ts +160 -160
  260. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/global.d.ts +60 -60
  261. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/index.d.ts +29 -29
  262. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +808 -778
  263. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/global.d.ts +46 -46
  264. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/index.d.ts +22 -22
  265. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +207 -207
  266. package/types/uni/uts-plugin-component/global.d.ts +1 -1
  267. package/types/uni/uts-plugin-component/index.d.ts +1 -1
  268. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/global.d.ts +64 -64
  269. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/index.d.ts +31 -31
  270. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +522 -522
  271. package/types/uni/uts-plugin-extend/README.md +3 -3
  272. package/types/uni/uts-plugin-extend/global.d.ts +14 -14
  273. package/types/uni/uts-plugin-extend/index.d.ts +14 -14
  274. package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/global.d.ts +12 -12
  275. package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/index.d.ts +1 -1
  276. package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/interface.d.ts +365 -365
  277. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/global.d.ts +23 -23
  278. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/index.d.ts +10 -10
  279. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/interface.d.ts +710 -710
  280. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/global.d.ts +21 -21
  281. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/index.d.ts +9 -9
  282. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/interface.d.ts +151 -151
  283. package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/global.d.ts +25 -25
  284. package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/index.d.ts +11 -11
  285. package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/interface.d.ts +363 -363
  286. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/global.d.ts +11 -11
  287. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/index.d.ts +4 -4
  288. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +224 -224
  289. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/global.d.ts +53 -53
  290. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/index.d.ts +25 -25
  291. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/interface.d.ts +487 -487
  292. package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/global.d.ts +13 -13
  293. package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/index.d.ts +5 -5
  294. package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/interface.d.ts +126 -126
  295. package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/global.d.ts +7 -7
  296. package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/index.d.ts +1 -1
  297. package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +296 -296
  298. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/global.d.ts +15 -15
  299. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/index.d.ts +1 -1
  300. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/interface.d.ts +229 -229
  301. package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/global.d.ts +14 -14
  302. package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/index.d.ts +1 -1
  303. package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/interface.d.ts +559 -559
  304. package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/global.d.ts +9 -9
  305. package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/index.d.ts +1 -1
  306. package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/interface.d.ts +163 -163
  307. package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/global.d.ts +21 -21
  308. package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/index.d.ts +9 -9
  309. package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/interface.d.ts +143 -143
  310. package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/global.d.ts +7 -7
  311. package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/index.d.ts +1 -1
  312. package/types/uni/uts-plugin-extend/lib/uni-preloadPage/utssdk/interface.d.ts +106 -106
  313. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/global.d.ts +9 -9
  314. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/index.d.ts +1 -1
  315. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/interface.d.ts +165 -165
  316. package/types/uni-cloud/index.d.ts +67 -63
  317. package/types/uni-cloud/interface.d.ts +987 -991
  318. package/types/uni-cloud/unicloud-db/index.ts +314 -314
  319. package/types/uni-global/index.d.ts +1 -1
  320. package/types/vue/CheckboxGroupChangeEvent.d.ts +41 -41
  321. package/types/vue/LifeCycle.d.ts +55 -55
  322. package/types/vue/PickerViewChangeEvent.d.ts +41 -41
  323. package/types/vue/ProgressActiveendEvent.d.ts +32 -32
  324. package/types/vue/RadioGroupChangeEvent.d.ts +41 -41
  325. package/types/vue/SliderChangeEvent.d.ts +35 -35
  326. package/types/vue/SwitchChangeEvent.d.ts +32 -32
  327. package/types/vue/UniCanvasElement.d.ts +275 -275
  328. package/types/vue/UniCloudDBElement.d.ts +217 -217
  329. package/types/vue/UniFormElement.d.ts +54 -54
  330. package/types/vue/UniNavigatorElement.d.ts +11 -11
  331. package/types/vue/global.d.ts +191 -191
  332. package/types/vue/index.d.ts +10 -10
  333. package/types/vue-global/index.d.ts +1 -1
  334. package/uts-plugin.d.ts +27 -27
  335. package/types/shim-uts-basic.d.ts +0 -4495
@@ -1,1840 +1,1840 @@
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
- saveFile(options : SaveFileOptions) : void;
1357
- /**
1358
- * FileSystemManager.saveFile 的同步版本
1359
- * @param tempFilePath 临时存储文件路径 (本地路径)
1360
- * @param filePath 要存储的文件路径 (本地路径)
1361
- * @uniPlatform {
1362
- * "app": {
1363
- * "android": {
1364
- * "osVer": "5.0",
1365
- * "uniVer": "x",
1366
- * "unixVer": "4.13"
1367
- * },
1368
- * "ios": {
1369
- * "osVer": "12.0",
1370
- * "uniVer": "x",
1371
- * "unixVer": "x"
1372
- * }
1373
- * },
1374
- * "web": {
1375
- * "uniVer": "x",
1376
- * "unixVer": "x"
1377
- * }
1378
- * }
1379
- */
1380
- saveFileSync(tempFilePath : string, filePath : string | null) : string;
1381
- /**
1382
- * 删除该小程序下已保存的本地缓存文件
1383
- * @uniPlatform {
1384
- * "app": {
1385
- * "android": {
1386
- * "osVer": "5.0",
1387
- * "uniVer": "x",
1388
- * "unixVer": "4.13"
1389
- * },
1390
- * "ios": {
1391
- * "osVer": "12.0",
1392
- * "uniVer": "x",
1393
- * "unixVer": "x"
1394
- * }
1395
- * },
1396
- * "web": {
1397
- * "uniVer": "x",
1398
- * "unixVer": "x"
1399
- * }
1400
- * }
1401
- */
1402
- removeSavedFile(options : RemoveSavedFileOptions) : void;
1403
- /**
1404
- * 解压文件
1405
- * @uniPlatform {
1406
- * "app": {
1407
- * "android": {
1408
- * "osVer": "5.0",
1409
- * "uniVer": "x",
1410
- * "unixVer": "4.13"
1411
- * },
1412
- * "ios": {
1413
- * "osVer": "12.0",
1414
- * "uniVer": "x",
1415
- * "unixVer": "x"
1416
- * }
1417
- * },
1418
- * "web": {
1419
- * "uniVer": "x",
1420
- * "unixVer": "x"
1421
- * }
1422
- * }
1423
- */
1424
- unzip(options : UnzipFileOptions) : void;
1425
- /**
1426
- * 获取该已保存的本地缓存文件列表
1427
- * @uniPlatform {
1428
- * "app": {
1429
- * "android": {
1430
- * "osVer": "5.0",
1431
- * "uniVer": "x",
1432
- * "unixVer": "4.13"
1433
- * },
1434
- * "ios": {
1435
- * "osVer": "12.0",
1436
- * "uniVer": "x",
1437
- * "unixVer": "x"
1438
- * }
1439
- * },
1440
- * "web": {
1441
- * "uniVer": "x",
1442
- * "unixVer": "x"
1443
- * }
1444
- * }
1445
- */
1446
- getSavedFileList(options : GetSavedFileListOptions) : void;
1447
- /**
1448
- * 对文件内容进行截断操作
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
- truncate(options : TruncateFileOptions) : void;
1469
- /**
1470
- * 对文件内容进行截断操作 (truncate 的同步版本)
1471
- * @param filePath 要截断的文件路径 (本地路径)
1472
- * @param length 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,不做处理
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
- truncateSync(filePath : string, length ?: number) : void;
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
- readCompressedFile(options : ReadCompressedFileOptions) : void;
1515
- /**
1516
- * 同步读取指定压缩类型的本地文件内容
1517
- * @param filePath 要读取的文件的路径 (本地用户文件或代码包文件),app-android平台支持代码包文件目录
1518
- * @param compressionAlgorithm 文件压缩类型,目前仅支持 'br'。
1519
- * @uniPlatform {
1520
- * "app": {
1521
- * "android": {
1522
- * "osVer": "5.0",
1523
- * "uniVer": "x",
1524
- * "unixVer": "4.13"
1525
- * },
1526
- * "ios": {
1527
- * "osVer": "12.0",
1528
- * "uniVer": "x",
1529
- * "unixVer": "x"
1530
- * }
1531
- * },
1532
- * "web": {
1533
- * "uniVer": "x",
1534
- * "unixVer": "x"
1535
- * }
1536
- * }
1537
- */
1538
- readCompressedFileSync(filePath : string, compressionAlgorithm : string) : string
1539
- /**
1540
- * 打开文件,返回文件描述符
1541
- * @uniPlatform {
1542
- * "app": {
1543
- * "android": {
1544
- * "osVer": "5.0",
1545
- * "uniVer": "x",
1546
- * "unixVer": "4.13"
1547
- * },
1548
- * "ios": {
1549
- * "osVer": "12.0",
1550
- * "uniVer": "x",
1551
- * "unixVer": "x"
1552
- * }
1553
- * },
1554
- * "web": {
1555
- * "uniVer": "x",
1556
- * "unixVer": "x"
1557
- * }
1558
- * }
1559
- */
1560
- open(options : OpenFileOptions) : void;
1561
- /**
1562
- * 同步打开文件,返回文件描述符
1563
- * @uniPlatform {
1564
- * "app": {
1565
- * "android": {
1566
- * "osVer": "5.0",
1567
- * "uniVer": "x",
1568
- * "unixVer": "4.13"
1569
- * },
1570
- * "ios": {
1571
- * "osVer": "12.0",
1572
- * "uniVer": "x",
1573
- * "unixVer": "x"
1574
- * }
1575
- * },
1576
- * "web": {
1577
- * "uniVer": "x",
1578
- * "unixVer": "x"
1579
- * }
1580
- * }
1581
- */
1582
- openSync(options : OpenFileSyncOptions) : string;
1583
- /**
1584
- * 写入文件
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
- write(options : WriteOptions) : 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
- writeSync(options : WriteSyncOptions) : WriteResult;
1627
- /**
1628
- * 关闭文件
1629
- * @uniPlatform {
1630
- * "app": {
1631
- * "android": {
1632
- * "osVer": "5.0",
1633
- * "uniVer": "x",
1634
- * "unixVer": "4.13"
1635
- * },
1636
- * "ios": {
1637
- * "osVer": "12.0",
1638
- * "uniVer": "x",
1639
- * "unixVer": "x"
1640
- * }
1641
- * },
1642
- * "web": {
1643
- * "uniVer": "x",
1644
- * "unixVer": "x"
1645
- * }
1646
- * }
1647
- */
1648
- close(options : CloseOptions) : void;
1649
- /**
1650
- * 同步关闭文件
1651
- * @uniPlatform {
1652
- * "app": {
1653
- * "android": {
1654
- * "osVer": "5.0",
1655
- * "uniVer": "x",
1656
- * "unixVer": "4.13"
1657
- * },
1658
- * "ios": {
1659
- * "osVer": "12.0",
1660
- * "uniVer": "x",
1661
- * "unixVer": "x"
1662
- * }
1663
- * },
1664
- * "web": {
1665
- * "uniVer": "x",
1666
- * "unixVer": "x"
1667
- * }
1668
- * }
1669
- */
1670
- closeSync(options : CloseSyncOptions) : void;
1671
- /**
1672
- * 获取文件的状态信息
1673
- * @uniPlatform {
1674
- * "app": {
1675
- * "android": {
1676
- * "osVer": "5.0",
1677
- * "uniVer": "x",
1678
- * "unixVer": "4.13"
1679
- * },
1680
- * "ios": {
1681
- * "osVer": "12.0",
1682
- * "uniVer": "x",
1683
- * "unixVer": "x"
1684
- * }
1685
- * },
1686
- * "web": {
1687
- * "uniVer": "x",
1688
- * "unixVer": "x"
1689
- * }
1690
- * }
1691
- */
1692
- fstat(options : FStatOptions) : void;
1693
- /**
1694
- * 同步获取文件的状态信息
1695
- * @uniPlatform {
1696
- * "app": {
1697
- * "android": {
1698
- * "osVer": "5.0",
1699
- * "uniVer": "x",
1700
- * "unixVer": "4.13"
1701
- * },
1702
- * "ios": {
1703
- * "osVer": "12.0",
1704
- * "uniVer": "x",
1705
- * "unixVer": "x"
1706
- * }
1707
- * },
1708
- * "web": {
1709
- * "uniVer": "x",
1710
- * "unixVer": "x"
1711
- * }
1712
- * }
1713
- */
1714
- fstatSync(options : FStatSyncOptions) : Stats;
1715
- /**
1716
- * 对文件内容进行截断操作
1717
- * @uniPlatform {
1718
- * "app": {
1719
- * "android": {
1720
- * "osVer": "5.0",
1721
- * "uniVer": "x",
1722
- * "unixVer": "4.13"
1723
- * },
1724
- * "ios": {
1725
- * "osVer": "12.0",
1726
- * "uniVer": "x",
1727
- * "unixVer": "x"
1728
- * }
1729
- * },
1730
- * "web": {
1731
- * "uniVer": "x",
1732
- * "unixVer": "x"
1733
- * }
1734
- * }
1735
- */
1736
- ftruncate(options : FTruncateFileOptions) : void;
1737
- /**
1738
- * 同步对文件内容进行截断操作
1739
- * @uniPlatform {
1740
- * "app": {
1741
- * "android": {
1742
- * "osVer": "5.0",
1743
- * "uniVer": "x",
1744
- * "unixVer": "4.13"
1745
- * },
1746
- * "ios": {
1747
- * "osVer": "12.0",
1748
- * "uniVer": "x",
1749
- * "unixVer": "x"
1750
- * }
1751
- * },
1752
- * "web": {
1753
- * "uniVer": "x",
1754
- * "unixVer": "x"
1755
- * }
1756
- * }
1757
- */
1758
- ftruncateSync(options : FTruncateFileSyncOptions) : void;
1759
- /**
1760
- * 读取压缩包内的文件
1761
- * @uniPlatform {
1762
- * "app": {
1763
- * "android": {
1764
- * "osVer": "5.0",
1765
- * "uniVer": "x",
1766
- * "unixVer": "4.13"
1767
- * },
1768
- * "ios": {
1769
- * "osVer": "12.0",
1770
- * "uniVer": "x",
1771
- * "unixVer": "x"
1772
- * }
1773
- * },
1774
- * "web": {
1775
- * "uniVer": "x",
1776
- * "unixVer": "x"
1777
- * }
1778
- * }
1779
- */
1780
- readZipEntry(options : ReadZipEntryOptions) : void;
1781
- }
1782
-
1783
-
1784
- export type GetFileSystemManager = () => FileSystemManager;
1785
-
1786
-
1787
- export interface Uni {
1788
- /**
1789
- * 获取文件管理器
1790
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-file-system-manager.html
1791
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-file-system-manager.html
1792
- * @uniPlatform {
1793
- * "app": {
1794
- * "android": {
1795
- * "osVer": "5.0",
1796
- * "uniVer": "x",
1797
- * "unixVer": "3.9.0"
1798
- * },
1799
- * "ios": {
1800
- * "osVer": "12.0",
1801
- * "uniVer": "x",
1802
- * "unixVer": "4.11"
1803
- * },
1804
- * "harmony": {
1805
- * "osVer": "x",
1806
- * "uniVer": "x",
1807
- * "unixVer": "x"
1808
- * }
1809
- * },
1810
- * "web": {
1811
- * "uniVer": "x",
1812
- * "unixVer": "x"
1813
- * }
1814
- * }
1815
- * @uniVueVersion 2,3 //支持的vue版本
1816
- */
1817
- getFileSystemManager() : FileSystemManager
1818
- }
1819
-
1820
- /**
1821
- * 错误码
1822
- * - 1200002 类型错误。仅支持 base64 / utf-8
1823
- * - 1300002 未找到文件
1824
- * - 1300013 无权限
1825
- * - 1300021 是目录
1826
- * - 1300022 参数无效
1827
- * - 1300066 目录非空
1828
- * - 1301003 对目录的非法操作
1829
- * - 1301005 文件已存在
1830
- * - 1300201 系统错误
1831
- * - 1300202 超出文件存储限制的最大尺寸
1832
- * - 1301111 brotli解压失败
1833
- * - 1302003 标志无效
1834
- * - 1300009 文件描述符错误
1835
- */
1836
- export type FileSystemManagerErrorCode = 1200002 | 1300002 | 1300013 | 1300021 | 1300022 | 1300066 | 1301003 | 1301005 | 1300201 | 1300202 | 1301111 | 1302003 | 1300009;
1837
- export type FileSystemManagerFail = IFileSystemManagerFail;
1838
- export interface IFileSystemManagerFail extends IUniError {
1839
- errCode : FileSystemManagerErrorCode
1840
- };
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
+ saveFile(options : SaveFileOptions) : void;
1357
+ /**
1358
+ * FileSystemManager.saveFile 的同步版本
1359
+ * @param tempFilePath 临时存储文件路径 (本地路径)
1360
+ * @param filePath 要存储的文件路径 (本地路径)
1361
+ * @uniPlatform {
1362
+ * "app": {
1363
+ * "android": {
1364
+ * "osVer": "5.0",
1365
+ * "uniVer": "x",
1366
+ * "unixVer": "4.13"
1367
+ * },
1368
+ * "ios": {
1369
+ * "osVer": "12.0",
1370
+ * "uniVer": "x",
1371
+ * "unixVer": "x"
1372
+ * }
1373
+ * },
1374
+ * "web": {
1375
+ * "uniVer": "x",
1376
+ * "unixVer": "x"
1377
+ * }
1378
+ * }
1379
+ */
1380
+ saveFileSync(tempFilePath : string, filePath : string | null) : string;
1381
+ /**
1382
+ * 删除该小程序下已保存的本地缓存文件
1383
+ * @uniPlatform {
1384
+ * "app": {
1385
+ * "android": {
1386
+ * "osVer": "5.0",
1387
+ * "uniVer": "x",
1388
+ * "unixVer": "4.13"
1389
+ * },
1390
+ * "ios": {
1391
+ * "osVer": "12.0",
1392
+ * "uniVer": "x",
1393
+ * "unixVer": "x"
1394
+ * }
1395
+ * },
1396
+ * "web": {
1397
+ * "uniVer": "x",
1398
+ * "unixVer": "x"
1399
+ * }
1400
+ * }
1401
+ */
1402
+ removeSavedFile(options : RemoveSavedFileOptions) : void;
1403
+ /**
1404
+ * 解压文件
1405
+ * @uniPlatform {
1406
+ * "app": {
1407
+ * "android": {
1408
+ * "osVer": "5.0",
1409
+ * "uniVer": "x",
1410
+ * "unixVer": "4.13"
1411
+ * },
1412
+ * "ios": {
1413
+ * "osVer": "12.0",
1414
+ * "uniVer": "x",
1415
+ * "unixVer": "x"
1416
+ * }
1417
+ * },
1418
+ * "web": {
1419
+ * "uniVer": "x",
1420
+ * "unixVer": "x"
1421
+ * }
1422
+ * }
1423
+ */
1424
+ unzip(options : UnzipFileOptions) : void;
1425
+ /**
1426
+ * 获取该已保存的本地缓存文件列表
1427
+ * @uniPlatform {
1428
+ * "app": {
1429
+ * "android": {
1430
+ * "osVer": "5.0",
1431
+ * "uniVer": "x",
1432
+ * "unixVer": "4.13"
1433
+ * },
1434
+ * "ios": {
1435
+ * "osVer": "12.0",
1436
+ * "uniVer": "x",
1437
+ * "unixVer": "x"
1438
+ * }
1439
+ * },
1440
+ * "web": {
1441
+ * "uniVer": "x",
1442
+ * "unixVer": "x"
1443
+ * }
1444
+ * }
1445
+ */
1446
+ getSavedFileList(options : GetSavedFileListOptions) : void;
1447
+ /**
1448
+ * 对文件内容进行截断操作
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
+ truncate(options : TruncateFileOptions) : void;
1469
+ /**
1470
+ * 对文件内容进行截断操作 (truncate 的同步版本)
1471
+ * @param filePath 要截断的文件路径 (本地路径)
1472
+ * @param length 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,不做处理
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
+ truncateSync(filePath : string, length ?: number) : void;
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
+ readCompressedFile(options : ReadCompressedFileOptions) : void;
1515
+ /**
1516
+ * 同步读取指定压缩类型的本地文件内容
1517
+ * @param filePath 要读取的文件的路径 (本地用户文件或代码包文件),app-android平台支持代码包文件目录
1518
+ * @param compressionAlgorithm 文件压缩类型,目前仅支持 'br'。
1519
+ * @uniPlatform {
1520
+ * "app": {
1521
+ * "android": {
1522
+ * "osVer": "5.0",
1523
+ * "uniVer": "x",
1524
+ * "unixVer": "4.13"
1525
+ * },
1526
+ * "ios": {
1527
+ * "osVer": "12.0",
1528
+ * "uniVer": "x",
1529
+ * "unixVer": "x"
1530
+ * }
1531
+ * },
1532
+ * "web": {
1533
+ * "uniVer": "x",
1534
+ * "unixVer": "x"
1535
+ * }
1536
+ * }
1537
+ */
1538
+ readCompressedFileSync(filePath : string, compressionAlgorithm : string) : string
1539
+ /**
1540
+ * 打开文件,返回文件描述符
1541
+ * @uniPlatform {
1542
+ * "app": {
1543
+ * "android": {
1544
+ * "osVer": "5.0",
1545
+ * "uniVer": "x",
1546
+ * "unixVer": "4.13"
1547
+ * },
1548
+ * "ios": {
1549
+ * "osVer": "12.0",
1550
+ * "uniVer": "x",
1551
+ * "unixVer": "x"
1552
+ * }
1553
+ * },
1554
+ * "web": {
1555
+ * "uniVer": "x",
1556
+ * "unixVer": "x"
1557
+ * }
1558
+ * }
1559
+ */
1560
+ open(options : OpenFileOptions) : void;
1561
+ /**
1562
+ * 同步打开文件,返回文件描述符
1563
+ * @uniPlatform {
1564
+ * "app": {
1565
+ * "android": {
1566
+ * "osVer": "5.0",
1567
+ * "uniVer": "x",
1568
+ * "unixVer": "4.13"
1569
+ * },
1570
+ * "ios": {
1571
+ * "osVer": "12.0",
1572
+ * "uniVer": "x",
1573
+ * "unixVer": "x"
1574
+ * }
1575
+ * },
1576
+ * "web": {
1577
+ * "uniVer": "x",
1578
+ * "unixVer": "x"
1579
+ * }
1580
+ * }
1581
+ */
1582
+ openSync(options : OpenFileSyncOptions) : string;
1583
+ /**
1584
+ * 写入文件
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
+ write(options : WriteOptions) : 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
+ writeSync(options : WriteSyncOptions) : WriteResult;
1627
+ /**
1628
+ * 关闭文件
1629
+ * @uniPlatform {
1630
+ * "app": {
1631
+ * "android": {
1632
+ * "osVer": "5.0",
1633
+ * "uniVer": "x",
1634
+ * "unixVer": "4.13"
1635
+ * },
1636
+ * "ios": {
1637
+ * "osVer": "12.0",
1638
+ * "uniVer": "x",
1639
+ * "unixVer": "x"
1640
+ * }
1641
+ * },
1642
+ * "web": {
1643
+ * "uniVer": "x",
1644
+ * "unixVer": "x"
1645
+ * }
1646
+ * }
1647
+ */
1648
+ close(options : CloseOptions) : void;
1649
+ /**
1650
+ * 同步关闭文件
1651
+ * @uniPlatform {
1652
+ * "app": {
1653
+ * "android": {
1654
+ * "osVer": "5.0",
1655
+ * "uniVer": "x",
1656
+ * "unixVer": "4.13"
1657
+ * },
1658
+ * "ios": {
1659
+ * "osVer": "12.0",
1660
+ * "uniVer": "x",
1661
+ * "unixVer": "x"
1662
+ * }
1663
+ * },
1664
+ * "web": {
1665
+ * "uniVer": "x",
1666
+ * "unixVer": "x"
1667
+ * }
1668
+ * }
1669
+ */
1670
+ closeSync(options : CloseSyncOptions) : void;
1671
+ /**
1672
+ * 获取文件的状态信息
1673
+ * @uniPlatform {
1674
+ * "app": {
1675
+ * "android": {
1676
+ * "osVer": "5.0",
1677
+ * "uniVer": "x",
1678
+ * "unixVer": "4.13"
1679
+ * },
1680
+ * "ios": {
1681
+ * "osVer": "12.0",
1682
+ * "uniVer": "x",
1683
+ * "unixVer": "x"
1684
+ * }
1685
+ * },
1686
+ * "web": {
1687
+ * "uniVer": "x",
1688
+ * "unixVer": "x"
1689
+ * }
1690
+ * }
1691
+ */
1692
+ fstat(options : FStatOptions) : void;
1693
+ /**
1694
+ * 同步获取文件的状态信息
1695
+ * @uniPlatform {
1696
+ * "app": {
1697
+ * "android": {
1698
+ * "osVer": "5.0",
1699
+ * "uniVer": "x",
1700
+ * "unixVer": "4.13"
1701
+ * },
1702
+ * "ios": {
1703
+ * "osVer": "12.0",
1704
+ * "uniVer": "x",
1705
+ * "unixVer": "x"
1706
+ * }
1707
+ * },
1708
+ * "web": {
1709
+ * "uniVer": "x",
1710
+ * "unixVer": "x"
1711
+ * }
1712
+ * }
1713
+ */
1714
+ fstatSync(options : FStatSyncOptions) : Stats;
1715
+ /**
1716
+ * 对文件内容进行截断操作
1717
+ * @uniPlatform {
1718
+ * "app": {
1719
+ * "android": {
1720
+ * "osVer": "5.0",
1721
+ * "uniVer": "x",
1722
+ * "unixVer": "4.13"
1723
+ * },
1724
+ * "ios": {
1725
+ * "osVer": "12.0",
1726
+ * "uniVer": "x",
1727
+ * "unixVer": "x"
1728
+ * }
1729
+ * },
1730
+ * "web": {
1731
+ * "uniVer": "x",
1732
+ * "unixVer": "x"
1733
+ * }
1734
+ * }
1735
+ */
1736
+ ftruncate(options : FTruncateFileOptions) : void;
1737
+ /**
1738
+ * 同步对文件内容进行截断操作
1739
+ * @uniPlatform {
1740
+ * "app": {
1741
+ * "android": {
1742
+ * "osVer": "5.0",
1743
+ * "uniVer": "x",
1744
+ * "unixVer": "4.13"
1745
+ * },
1746
+ * "ios": {
1747
+ * "osVer": "12.0",
1748
+ * "uniVer": "x",
1749
+ * "unixVer": "x"
1750
+ * }
1751
+ * },
1752
+ * "web": {
1753
+ * "uniVer": "x",
1754
+ * "unixVer": "x"
1755
+ * }
1756
+ * }
1757
+ */
1758
+ ftruncateSync(options : FTruncateFileSyncOptions) : void;
1759
+ /**
1760
+ * 读取压缩包内的文件
1761
+ * @uniPlatform {
1762
+ * "app": {
1763
+ * "android": {
1764
+ * "osVer": "5.0",
1765
+ * "uniVer": "x",
1766
+ * "unixVer": "4.13"
1767
+ * },
1768
+ * "ios": {
1769
+ * "osVer": "12.0",
1770
+ * "uniVer": "x",
1771
+ * "unixVer": "x"
1772
+ * }
1773
+ * },
1774
+ * "web": {
1775
+ * "uniVer": "x",
1776
+ * "unixVer": "x"
1777
+ * }
1778
+ * }
1779
+ */
1780
+ readZipEntry(options : ReadZipEntryOptions) : void;
1781
+ }
1782
+
1783
+
1784
+ export type GetFileSystemManager = () => FileSystemManager;
1785
+
1786
+
1787
+ export interface Uni {
1788
+ /**
1789
+ * 获取文件管理器
1790
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/get-file-system-manager.html
1791
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/get-file-system-manager.html
1792
+ * @uniPlatform {
1793
+ * "app": {
1794
+ * "android": {
1795
+ * "osVer": "5.0",
1796
+ * "uniVer": "x",
1797
+ * "unixVer": "3.9.0"
1798
+ * },
1799
+ * "ios": {
1800
+ * "osVer": "12.0",
1801
+ * "uniVer": "x",
1802
+ * "unixVer": "4.11"
1803
+ * },
1804
+ * "harmony": {
1805
+ * "osVer": "x",
1806
+ * "uniVer": "x",
1807
+ * "unixVer": "x"
1808
+ * }
1809
+ * },
1810
+ * "web": {
1811
+ * "uniVer": "x",
1812
+ * "unixVer": "x"
1813
+ * }
1814
+ * }
1815
+ * @uniVueVersion 2,3 //支持的vue版本
1816
+ */
1817
+ getFileSystemManager() : FileSystemManager
1818
+ }
1819
+
1820
+ /**
1821
+ * 错误码
1822
+ * - 1200002 类型错误。仅支持 base64 / utf-8
1823
+ * - 1300002 未找到文件
1824
+ * - 1300013 无权限
1825
+ * - 1300021 是目录
1826
+ * - 1300022 参数无效
1827
+ * - 1300066 目录非空
1828
+ * - 1301003 对目录的非法操作
1829
+ * - 1301005 文件已存在
1830
+ * - 1300201 系统错误
1831
+ * - 1300202 超出文件存储限制的最大尺寸
1832
+ * - 1301111 brotli解压失败
1833
+ * - 1302003 标志无效
1834
+ * - 1300009 文件描述符错误
1835
+ */
1836
+ export type FileSystemManagerErrorCode = 1200002 | 1300002 | 1300013 | 1300021 | 1300022 | 1300066 | 1301003 | 1301005 | 1300201 | 1300202 | 1301111 | 1302003 | 1300009;
1837
+ export type FileSystemManagerFail = IFileSystemManagerFail;
1838
+ export interface IFileSystemManagerFail extends IUniError {
1839
+ errCode : FileSystemManagerErrorCode
1840
+ };