@tarojs/taro 3.8.0-canary.0 → 4.0.0-alpha.2
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.
- package/html.css +9 -0
- package/package.json +16 -4
- package/types/api/ad/index.d.ts +6 -18
- package/types/api/ai/inference.d.ts +4 -8
- package/types/api/ai/visionkit.d.ts +625 -54
- package/types/api/base/debug.d.ts +8 -8
- package/types/api/base/env.d.ts +1 -1
- package/types/api/base/index.d.ts +3 -3
- package/types/api/base/performance.d.ts +5 -5
- package/types/api/base/system.d.ts +6 -6
- package/types/api/base/weapp/app-event.d.ts +10 -10
- package/types/api/base/weapp/life-cycle.d.ts +1 -1
- package/types/api/canvas/index.d.ts +389 -72
- package/types/api/data-analysis/index.d.ts +51 -1
- package/types/api/device/accelerometer.d.ts +8 -6
- package/types/api/device/accessibility.d.ts +1 -1
- package/types/api/device/battery.d.ts +3 -3
- package/types/api/device/bluetooth-ble.d.ts +40 -17
- package/types/api/device/bluetooth-peripheral.d.ts +26 -26
- package/types/api/device/bluetooth.d.ts +37 -13
- package/types/api/device/calendar.d.ts +11 -1
- package/types/api/device/clipboard.d.ts +17 -17
- package/types/api/device/compass.d.ts +5 -5
- package/types/api/device/gyroscope.d.ts +4 -4
- package/types/api/device/iBeacon.d.ts +10 -8
- package/types/api/device/keyboard.d.ts +7 -5
- package/types/api/device/memory.d.ts +3 -4
- package/types/api/device/motion.d.ts +8 -6
- package/types/api/device/network.d.ts +12 -6
- package/types/api/device/nfc.d.ts +13 -13
- package/types/api/device/phone.d.ts +1 -1
- package/types/api/device/scan.d.ts +5 -3
- package/types/api/device/screen.d.ts +28 -12
- package/types/api/device/sms.d.ts +1 -1
- package/types/api/device/vibrate.d.ts +5 -5
- package/types/api/device/wifi.d.ts +25 -13
- package/types/api/files/index.d.ts +73 -43
- package/types/api/framework/index.d.ts +2 -2
- package/types/api/location/index.d.ts +167 -19
- package/types/api/media/audio.d.ts +71 -42
- package/types/api/media/background-audio.d.ts +1 -1
- package/types/api/media/camera.d.ts +6 -3
- package/types/api/media/image.d.ts +5 -5
- package/types/api/media/video.d.ts +11 -11
- package/types/api/navigate/index.d.ts +3 -1
- package/types/api/network/download.d.ts +7 -15
- package/types/api/network/request.d.ts +7 -7
- package/types/api/network/upload.d.ts +9 -17
- package/types/api/network/websocket.d.ts +8 -8
- package/types/api/open-api/account.d.ts +1 -1
- package/types/api/open-api/address.d.ts +13 -5
- package/types/api/open-api/authorize.d.ts +1 -1
- package/types/api/open-api/channels.d.ts +16 -0
- package/types/api/open-api/device-voip.d.ts +42 -2
- package/types/api/open-api/invoice.d.ts +1 -1
- package/types/api/open-api/login.d.ts +16 -3
- package/types/api/open-api/my-miniprogram.d.ts +2 -2
- package/types/api/open-api/privacy.d.ts +107 -0
- package/types/api/open-api/settings.d.ts +3 -2
- package/types/api/open-api/sticker.d.ts +83 -0
- package/types/api/open-api/subscribe-message.d.ts +148 -6
- package/types/api/open-api/user-info.d.ts +6 -1
- package/types/api/qq/index.d.ts +306 -1
- package/types/api/route/index.d.ts +8 -5
- package/types/api/skyline/index.d.ts +59 -0
- package/types/api/storage/background-fetch.d.ts +63 -11
- package/types/api/storage/cache-manager.d.ts +61 -10
- package/types/api/storage/index.d.ts +125 -10
- package/types/api/swan/bookshelf.d.ts +307 -0
- package/types/api/swan/download-package.d.ts +80 -0
- package/types/api/swan/index.d.ts +151 -0
- package/types/api/swan/pay.d.ts +139 -0
- package/types/api/taro.extend.d.ts +15 -6
- package/types/api/taro.hooks.d.ts +9 -9
- package/types/api/ui/animation.d.ts +32 -32
- package/types/api/ui/custom-component.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +4 -3
- package/types/api/ui/interaction.d.ts +6 -6
- package/types/api/ui/menu.d.ts +1 -1
- package/types/api/ui/navigation-bar.d.ts +5 -5
- package/types/api/ui/pull-down-refresh.d.ts +2 -2
- package/types/api/ui/scroll.d.ts +1 -1
- package/types/api/ui/tab-bar.d.ts +8 -8
- package/types/api/ui/window.d.ts +2 -2
- package/types/api/wxml/index.d.ts +19 -19
- package/types/compile/compiler.d.ts +9 -4
- package/types/compile/config/h5.d.ts +23 -10
- package/types/compile/config/harmony.d.ts +82 -0
- package/types/compile/config/index.d.ts +1 -0
- package/types/compile/config/mini.d.ts +58 -30
- package/types/compile/config/plugin.d.ts +34 -0
- package/types/compile/config/project.d.ts +26 -13
- package/types/compile/config/util.d.ts +22 -8
- package/types/compile/viteCompilerContext.d.ts +155 -0
- package/types/global.d.ts +3 -1
- package/types/index.d.ts +92 -44
- package/types/taro.api.d.ts +24 -13
- package/types/taro.component.d.ts +2 -1
- package/types/taro.config.d.ts +47 -6
- package/types/taro.lifecycle.d.ts +3 -0
- package/types/taro.runtime.d.ts +9 -0
|
@@ -24,6 +24,10 @@ declare module '../../index' {
|
|
|
24
24
|
fail?: (result: FailCallbackResult) => void
|
|
25
25
|
/** 要存储的文件路径 */
|
|
26
26
|
filePath?: string
|
|
27
|
+
/** 要保存的本地临时文件路径
|
|
28
|
+
* @supported alipay
|
|
29
|
+
*/
|
|
30
|
+
apFilePath?: string
|
|
27
31
|
/** 接口调用成功的回调函数 */
|
|
28
32
|
success?: (result: SuccessCallbackResult) => void
|
|
29
33
|
}
|
|
@@ -120,6 +124,10 @@ declare module '../../index' {
|
|
|
120
124
|
createTime: number
|
|
121
125
|
/** 本地路径 */
|
|
122
126
|
filePath: string
|
|
127
|
+
/** 文件路径
|
|
128
|
+
* @supported alipay
|
|
129
|
+
*/
|
|
130
|
+
apFilePath?: string
|
|
123
131
|
/** 本地文件大小,以字节为单位 */
|
|
124
132
|
size: number
|
|
125
133
|
}
|
|
@@ -129,6 +137,10 @@ declare module '../../index' {
|
|
|
129
137
|
interface Option {
|
|
130
138
|
/** 文件路径 */
|
|
131
139
|
filePath: string
|
|
140
|
+
/** 文件路径
|
|
141
|
+
* @supported alipay
|
|
142
|
+
*/
|
|
143
|
+
apFilePath?: string
|
|
132
144
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
133
145
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
134
146
|
/** 接口调用失败的回调函数 */
|
|
@@ -150,6 +162,10 @@ declare module '../../index' {
|
|
|
150
162
|
interface Option {
|
|
151
163
|
/** 要读取的文件路径 */
|
|
152
164
|
filePath: string
|
|
165
|
+
/** 本地文件路径
|
|
166
|
+
* @supported alipay
|
|
167
|
+
*/
|
|
168
|
+
apFilePath?: string
|
|
153
169
|
/**
|
|
154
170
|
* 计算文件摘要的算法
|
|
155
171
|
* @default 'md5'
|
|
@@ -180,17 +196,17 @@ declare module '../../index' {
|
|
|
180
196
|
}
|
|
181
197
|
|
|
182
198
|
/** 文件管理器,可通过 [Taro.getFileSystemManager](./getFileSystemManager) 获取。
|
|
183
|
-
* @supported weapp, tt
|
|
199
|
+
* @supported weapp, tt, harmony_hybrid
|
|
184
200
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.html
|
|
185
201
|
*/
|
|
186
202
|
interface FileSystemManager {
|
|
187
203
|
/** 判断文件/目录是否存在
|
|
188
|
-
* @supported weapp, tt
|
|
204
|
+
* @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid
|
|
189
205
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.access.html
|
|
190
206
|
*/
|
|
191
207
|
access(option: FileSystemManager.AccessOption): void
|
|
192
208
|
/** [FileSystemManager.access](#access) 的同步版本
|
|
193
|
-
* @supported weapp, tt
|
|
209
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
194
210
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.accessSync.html
|
|
195
211
|
*/
|
|
196
212
|
accessSync(
|
|
@@ -198,12 +214,12 @@ declare module '../../index' {
|
|
|
198
214
|
path: string,
|
|
199
215
|
): void
|
|
200
216
|
/** 在文件结尾追加内容
|
|
201
|
-
* @supported weapp
|
|
217
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
202
218
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFile.html
|
|
203
219
|
*/
|
|
204
220
|
appendFile(option: FileSystemManager.AppendFileOption): void
|
|
205
221
|
/** [FileSystemManager.appendFile](#appendfile) 的同步版本
|
|
206
|
-
* @supported weapp
|
|
222
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
207
223
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFileSync.html
|
|
208
224
|
*/
|
|
209
225
|
appendFileSync(
|
|
@@ -225,12 +241,12 @@ declare module '../../index' {
|
|
|
225
241
|
*/
|
|
226
242
|
closeSync(option: FileSystemManager.CloseSyncOption): void
|
|
227
243
|
/** 复制文件
|
|
228
|
-
* @supported weapp, tt
|
|
244
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
229
245
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFile.html
|
|
230
246
|
*/
|
|
231
247
|
copyFile(option: FileSystemManager.CopyFileOption): void
|
|
232
248
|
/** [FileSystemManager.copyFile](#copyfile) 的同步版本
|
|
233
|
-
* @supported weapp, tt
|
|
249
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
234
250
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFileSync.html
|
|
235
251
|
*/
|
|
236
252
|
copyFileSync(
|
|
@@ -260,22 +276,22 @@ declare module '../../index' {
|
|
|
260
276
|
*/
|
|
261
277
|
ftruncateSync(option: FileSystemManager.FtruncateSyncOption): void
|
|
262
278
|
/** 获取该小程序下的 `本地临时文件` 或 `本地缓存文件` 信息
|
|
263
|
-
* @supported weapp, tt
|
|
279
|
+
* @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid
|
|
264
280
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getFileInfo.html
|
|
265
281
|
*/
|
|
266
282
|
getFileInfo(option: FileSystemManager.getFileInfoOption): void
|
|
267
283
|
/** 获取该小程序下已保存的本地缓存文件列表
|
|
268
|
-
* @supported weapp, tt
|
|
284
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
269
285
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getSavedFileList.html
|
|
270
286
|
*/
|
|
271
287
|
getSavedFileList(option?: FileSystemManager.getSavedFileListOption): void
|
|
272
288
|
/** 创建目录
|
|
273
|
-
* @supported weapp, tt
|
|
289
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
274
290
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdir.html
|
|
275
291
|
*/
|
|
276
292
|
mkdir(option: FileSystemManager.MkdirOption): void
|
|
277
293
|
/** [FileSystemManager.mkdir](#mkdir) 的同步版本
|
|
278
|
-
* @supported weapp, tt
|
|
294
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
279
295
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdirSync.html
|
|
280
296
|
*/
|
|
281
297
|
mkdirSync(
|
|
@@ -310,12 +326,12 @@ declare module '../../index' {
|
|
|
310
326
|
*/
|
|
311
327
|
readCompressedFileSync(option: FileSystemManager.readCompressedFileSync.Option): ArrayBuffer /** 文件读取结果 */
|
|
312
328
|
/** 读取目录内文件列表
|
|
313
|
-
* @supported weapp, tt
|
|
329
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
314
330
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdir.html
|
|
315
331
|
*/
|
|
316
332
|
readdir(option: FileSystemManager.ReaddirOption): void
|
|
317
333
|
/** [FileSystemManager.readdir](#readdir) 的同步版本
|
|
318
|
-
* @supported weapp, tt
|
|
334
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
319
335
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdirSync.html
|
|
320
336
|
*/
|
|
321
337
|
readdirSync(
|
|
@@ -323,12 +339,12 @@ declare module '../../index' {
|
|
|
323
339
|
dirPath: string,
|
|
324
340
|
): string[]
|
|
325
341
|
/** 读取本地文件内容
|
|
326
|
-
* @supported weapp, tt
|
|
342
|
+
* @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid
|
|
327
343
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFile.html
|
|
328
344
|
*/
|
|
329
345
|
readFile(option: FileSystemManager.ReadFileOption): void
|
|
330
346
|
/** [FileSystemManager.readFile](#readfile) 的同步版本
|
|
331
|
-
* @supported weapp, tt
|
|
347
|
+
* @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid
|
|
332
348
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFileSync.html
|
|
333
349
|
*/
|
|
334
350
|
readFileSync(
|
|
@@ -359,17 +375,17 @@ declare module '../../index' {
|
|
|
359
375
|
*/
|
|
360
376
|
readZipEntry(option: FileSystemManager.readZipEntry.Option): Promise<FileSystemManager.readZipEntry.Promised>
|
|
361
377
|
/** 删除该小程序下已保存的本地缓存文件
|
|
362
|
-
* @supported weapp
|
|
378
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
363
379
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.removeSavedFile.html
|
|
364
380
|
*/
|
|
365
381
|
removeSavedFile(option: FileSystemManager.RemoveSavedFileOption): void
|
|
366
382
|
/** 重命名文件。可以把文件从 oldPath 移动到 newPath
|
|
367
|
-
* @supported weapp, tt
|
|
383
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
368
384
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rename.html
|
|
369
385
|
*/
|
|
370
386
|
rename(option: FileSystemManager.RenameOption): void
|
|
371
387
|
/** [FileSystemManager.rename](#rename) 的同步版本
|
|
372
|
-
* @supported weapp, tt
|
|
388
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
373
389
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.renameSync.html
|
|
374
390
|
*/
|
|
375
391
|
renameSync(
|
|
@@ -394,12 +410,12 @@ declare module '../../index' {
|
|
|
394
410
|
recursive?: boolean,
|
|
395
411
|
): void
|
|
396
412
|
/** 保存临时文件到本地。此接口会移动临时文件,因此调用成功后,tempFilePath 将不可用。
|
|
397
|
-
* @supported weapp, tt
|
|
413
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
398
414
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFile.html
|
|
399
415
|
*/
|
|
400
416
|
saveFile(option: FileSystemManager.SaveFileOption): void
|
|
401
417
|
/** [FileSystemManager.saveFile](#savefile) 的同步版本
|
|
402
|
-
* @supported weapp, tt
|
|
418
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
403
419
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFileSync.html
|
|
404
420
|
*/
|
|
405
421
|
saveFileSync(
|
|
@@ -409,12 +425,12 @@ declare module '../../index' {
|
|
|
409
425
|
filePath?: string,
|
|
410
426
|
): string
|
|
411
427
|
/** 获取文件 Stats 对象
|
|
412
|
-
* @supported weapp, tt
|
|
428
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
413
429
|
* https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.stat.html
|
|
414
430
|
*/
|
|
415
431
|
stat(option: FileSystemManager.StatOption): void
|
|
416
432
|
/** [FileSystemManager.stat](#stat) 的同步版本
|
|
417
|
-
* @supported weapp, tt
|
|
433
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
418
434
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.statSync.html
|
|
419
435
|
*/
|
|
420
436
|
statSync(
|
|
@@ -424,22 +440,22 @@ declare module '../../index' {
|
|
|
424
440
|
recursive?: boolean,
|
|
425
441
|
): Stats | TaroGeneral.IAnyObject
|
|
426
442
|
/** 对文件内容进行截断操作
|
|
427
|
-
* @supported weapp
|
|
443
|
+
* @supported weapp, tt
|
|
428
444
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncate.html
|
|
429
445
|
*/
|
|
430
446
|
truncate(option: FileSystemManager.TruncateOption): void
|
|
431
447
|
/** 对文件内容进行截断操作 ([truncate](#truncate) 的同步版本)
|
|
432
|
-
* @supported weapp
|
|
448
|
+
* @supported weapp, tt
|
|
433
449
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncateSync.html
|
|
434
450
|
*/
|
|
435
451
|
truncateSync(option: FileSystemManager.TruncateSyncOption): void
|
|
436
452
|
/** 删除文件
|
|
437
|
-
* @supported weapp, tt
|
|
453
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
438
454
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlink.html
|
|
439
455
|
*/
|
|
440
456
|
unlink(option: FileSystemManager.UnlinkOption): void
|
|
441
457
|
/** [FileSystemManager.unlink](#unlink) 的同步版本
|
|
442
|
-
* @supported weapp, tt
|
|
458
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
443
459
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlinkSync.html
|
|
444
460
|
*/
|
|
445
461
|
unlinkSync(
|
|
@@ -447,7 +463,7 @@ declare module '../../index' {
|
|
|
447
463
|
filePath: string,
|
|
448
464
|
): void
|
|
449
465
|
/** 解压文件
|
|
450
|
-
* @supported weapp, tt
|
|
466
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
451
467
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unzip.html
|
|
452
468
|
*/
|
|
453
469
|
unzip(option: FileSystemManager.UnzipOption): void
|
|
@@ -457,12 +473,12 @@ declare module '../../index' {
|
|
|
457
473
|
*/
|
|
458
474
|
write(option: FileSystemManager.WriteOption): void
|
|
459
475
|
/** 写文件
|
|
460
|
-
* @supported weapp, tt
|
|
476
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
461
477
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html
|
|
462
478
|
*/
|
|
463
479
|
writeFile(option: FileSystemManager.WriteFileOption): void
|
|
464
480
|
/** [FileSystemManager.writeFile](#writefile) 的同步版本
|
|
465
|
-
* @supported weapp, tt
|
|
481
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
466
482
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFileSync.html
|
|
467
483
|
*/
|
|
468
484
|
writeFileSync(
|
|
@@ -543,10 +559,10 @@ declare module '../../index' {
|
|
|
543
559
|
data: string | ArrayBuffer
|
|
544
560
|
/** 要追加内容的文件路径 */
|
|
545
561
|
filePath: string
|
|
546
|
-
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
547
|
-
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
548
562
|
/** 指定写入文件的字符编码 */
|
|
549
563
|
encoding?: keyof FileSystemManager.Encoding
|
|
564
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
565
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
550
566
|
/** 接口调用失败的回调函数 */
|
|
551
567
|
fail?: (result: AppendFileFailCallbackResult) => void
|
|
552
568
|
/** 接口调用成功的回调函数 */
|
|
@@ -590,6 +606,11 @@ declare module '../../index' {
|
|
|
590
606
|
interface getFileInfoOption {
|
|
591
607
|
/** 要读取的文件路径 */
|
|
592
608
|
filePath: string
|
|
609
|
+
/**
|
|
610
|
+
* 计算文件摘要的算法
|
|
611
|
+
* @default 'md5'
|
|
612
|
+
*/
|
|
613
|
+
digestAlgorithm?: 'md5' | 'sha1'
|
|
593
614
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
594
615
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
595
616
|
/** 接口调用失败的回调函数 */
|
|
@@ -608,6 +629,8 @@ declare module '../../index' {
|
|
|
608
629
|
interface GetFileInfoSuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
609
630
|
/** 文件大小,以字节为单位 */
|
|
610
631
|
size: number
|
|
632
|
+
/** 按照传入的 digestAlgorithm 计算得出的的文件摘要 */
|
|
633
|
+
digest?: string
|
|
611
634
|
/** 调用结果 */
|
|
612
635
|
errMsg: string
|
|
613
636
|
}
|
|
@@ -640,12 +663,15 @@ declare module '../../index' {
|
|
|
640
663
|
interface MkdirOption {
|
|
641
664
|
/** 创建的目录路径 */
|
|
642
665
|
dirPath: string
|
|
666
|
+
/** 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。
|
|
667
|
+
* 如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。
|
|
668
|
+
* @default false
|
|
669
|
+
*/
|
|
670
|
+
recursive?: boolean
|
|
643
671
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
644
672
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
645
673
|
/** 接口调用失败的回调函数 */
|
|
646
674
|
fail?: (result: MkdirFailCallbackResult) => void
|
|
647
|
-
/** 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 */
|
|
648
|
-
recursive?: boolean
|
|
649
675
|
/** 接口调用成功的回调函数 */
|
|
650
676
|
success?: (res: TaroGeneral.CallbackResult) => void
|
|
651
677
|
}
|
|
@@ -789,6 +815,10 @@ declare module '../../index' {
|
|
|
789
815
|
interface RemoveSavedFileOption {
|
|
790
816
|
/** 需要删除的文件路径 */
|
|
791
817
|
filePath: string
|
|
818
|
+
/** 本地缓存文件路径
|
|
819
|
+
* @supported alipay
|
|
820
|
+
*/
|
|
821
|
+
apFilePath?: string
|
|
792
822
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
793
823
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
794
824
|
/** 接口调用失败的回调函数 */
|
|
@@ -1286,12 +1316,12 @@ declare module '../../index' {
|
|
|
1286
1316
|
/** 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime */
|
|
1287
1317
|
lastModifiedTime: number
|
|
1288
1318
|
/** 判断当前文件是否一个目录
|
|
1289
|
-
* @supported weapp
|
|
1319
|
+
* @supported weapp, alipay, jd, qq, tt
|
|
1290
1320
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isDirectory.html
|
|
1291
1321
|
*/
|
|
1292
1322
|
isDirectory(): boolean
|
|
1293
1323
|
/** 判断当前文件是否一个普通文件
|
|
1294
|
-
* @supported weapp
|
|
1324
|
+
* @supported weapp, aliapy, jd, qq, tt
|
|
1295
1325
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isFile.html
|
|
1296
1326
|
*/
|
|
1297
1327
|
isFile(): boolean
|
|
@@ -1308,7 +1338,7 @@ declare module '../../index' {
|
|
|
1308
1338
|
|
|
1309
1339
|
interface TaroStatic {
|
|
1310
1340
|
/** 保存文件系统的文件到用户磁盘,仅在 PC 端支持
|
|
1311
|
-
* @supported weapp
|
|
1341
|
+
* @supported weapp, alipay
|
|
1312
1342
|
* @example
|
|
1313
1343
|
* ```tsx
|
|
1314
1344
|
* Taro.saveFileToDisk({
|
|
@@ -1326,7 +1356,7 @@ declare module '../../index' {
|
|
|
1326
1356
|
saveFileToDisk(option: saveFileToDisk.Option): Promise<TaroGeneral.CallbackResult>
|
|
1327
1357
|
|
|
1328
1358
|
/** 保存文件到本地。**注意:saveFile 会把临时文件移动,因此调用成功后传入的 tempFilePath 将不可用**
|
|
1329
|
-
* @supported weapp,
|
|
1359
|
+
* @supported weapp, alipay, swan, jd, qq, tt, rn
|
|
1330
1360
|
* @example
|
|
1331
1361
|
* ```tsx
|
|
1332
1362
|
* Taro.chooseImage({
|
|
@@ -1367,9 +1397,9 @@ declare module '../../index' {
|
|
|
1367
1397
|
removeSavedFile(option: removeSavedFile.Option): Promise<TaroGeneral.CallbackResult>
|
|
1368
1398
|
|
|
1369
1399
|
/** 新开页面打开文档,支持格式
|
|
1370
|
-
* @supported weapp, tt
|
|
1400
|
+
* @supported weapp, alipay, swan, jd, qq, tt
|
|
1371
1401
|
* @example
|
|
1372
|
-
```tsx
|
|
1402
|
+
* ```tsx
|
|
1373
1403
|
* Taro.downloadFile({
|
|
1374
1404
|
* url: 'https://example.com/somefile.pdf',
|
|
1375
1405
|
* success: function (res) {
|
|
@@ -1388,7 +1418,7 @@ declare module '../../index' {
|
|
|
1388
1418
|
openDocument(option: openDocument.Option): Promise<TaroGeneral.CallbackResult>
|
|
1389
1419
|
|
|
1390
1420
|
/** 获取本地已保存的文件列表
|
|
1391
|
-
* @supported weapp,
|
|
1421
|
+
* @supported weapp, alipay, swan, jd, qq, tt, rn
|
|
1392
1422
|
* @example
|
|
1393
1423
|
* ```tsx
|
|
1394
1424
|
* Taro.getSavedFileList({
|
|
@@ -1402,7 +1432,7 @@ declare module '../../index' {
|
|
|
1402
1432
|
getSavedFileList(option?: getSavedFileList.Option): Promise<getSavedFileList.SuccessCallbackResult>
|
|
1403
1433
|
|
|
1404
1434
|
/** 获取本地文件的文件信息。此接口只能用于获取已保存到本地的文件,若需要获取临时文件信息,请使用 [Taro.getFileInfo](/docs/apis/files/getFileInfo) 接口。
|
|
1405
|
-
* @supported weapp, rn
|
|
1435
|
+
* @supported weapp, alipay, swan, jd, qq, rn
|
|
1406
1436
|
* @example
|
|
1407
1437
|
* ```tsx
|
|
1408
1438
|
* Taro.getSavedFileInfo({
|
|
@@ -1419,7 +1449,7 @@ declare module '../../index' {
|
|
|
1419
1449
|
|
|
1420
1450
|
/**
|
|
1421
1451
|
* 获取该小程序下的 本地临时文件 或 本地缓存文件 信息
|
|
1422
|
-
* @supported weapp,
|
|
1452
|
+
* @supported weapp, alipay, swan, jd, qq, tt, rn
|
|
1423
1453
|
* @example
|
|
1424
1454
|
* ```tsx
|
|
1425
1455
|
* Taro.getFileInfo({
|
|
@@ -1434,7 +1464,7 @@ declare module '../../index' {
|
|
|
1434
1464
|
getFileInfo(option: getFileInfo.Option): Promise<getFileInfo.SuccessCallbackResult | getFileInfo.FailCallbackResult>
|
|
1435
1465
|
|
|
1436
1466
|
/** 获取全局唯一的文件管理器
|
|
1437
|
-
* @supported weapp, tt
|
|
1467
|
+
* @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid
|
|
1438
1468
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html
|
|
1439
1469
|
*/
|
|
1440
1470
|
getFileSystemManager(): FileSystemManager
|
|
@@ -33,7 +33,7 @@ declare module '../../index' {
|
|
|
33
33
|
* __注意:__
|
|
34
34
|
* - __不要尝试修改页面栈,会导致路由以及页面状态错误。__
|
|
35
35
|
* - 不要在 `App.onLaunch` 的时候调用 `getCurrentPages()`,此时 `page` 还没有生成。
|
|
36
|
-
* @supported weapp, h5, rn, tt
|
|
36
|
+
* @supported weapp, h5, rn, tt, harmony_hybrid
|
|
37
37
|
* @example
|
|
38
38
|
* ```tsx
|
|
39
39
|
* Taro.getCurrentPages().length
|
|
@@ -43,7 +43,7 @@ declare module '../../index' {
|
|
|
43
43
|
getCurrentPages(): Page[]
|
|
44
44
|
|
|
45
45
|
/** 获取到小程序全局唯一的 App 实例。
|
|
46
|
-
* @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp
|
|
46
|
+
* @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp, harmony_hybrid
|
|
47
47
|
* @see https://developers.weixin.qq.com/miniprogram/dev/reference/api/getApp.html
|
|
48
48
|
*/
|
|
49
49
|
getApp<T = TaroGeneral.IAnyObject>(opts?: getApp.Option): getApp.Instance<T>
|