@spcsn/taro 0.1.2 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -6
- package/dist/index.js +223 -1
- package/dist/index.js.map +1 -1
- package/package.json +17 -48
- package/types/api/ad/index.d.ts +3 -6
- package/types/api/base/debug.d.ts +8 -8
- package/types/api/base/env.d.ts +3 -3
- 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 +8 -16
- package/types/api/base/update.d.ts +6 -6
- package/types/api/base/weapp/app-event.d.ts +12 -12
- package/types/api/base/weapp/life-cycle.d.ts +1 -1
- package/types/api/canvas/index.d.ts +71 -72
- package/types/api/data-analysis/index.d.ts +1 -1
- package/types/api/device/accelerometer.d.ts +4 -4
- package/types/api/device/accessibility.d.ts +1 -1
- package/types/api/device/battery.d.ts +2 -2
- package/types/api/device/bluetooth-ble.d.ts +14 -14
- package/types/api/device/bluetooth-peripheral.d.ts +15 -15
- package/types/api/device/bluetooth.d.ts +11 -11
- package/types/api/device/calendar.d.ts +2 -2
- package/types/api/device/clipboard.d.ts +2 -4
- package/types/api/device/compass.d.ts +4 -4
- package/types/api/device/gyroscope.d.ts +4 -4
- package/types/api/device/iBeacon.d.ts +7 -7
- package/types/api/device/keyboard.d.ts +3 -3
- package/types/api/device/memory.d.ts +2 -2
- package/types/api/device/motion.d.ts +4 -4
- package/types/api/device/network.d.ts +5 -20
- package/types/api/device/nfc.d.ts +17 -17
- package/types/api/device/phone.d.ts +1 -1
- package/types/api/device/scan.d.ts +1 -1
- package/types/api/device/screen.d.ts +6 -6
- package/types/api/device/sms.d.ts +1 -1
- package/types/api/device/vibrate.d.ts +2 -2
- package/types/api/device/wifi.d.ts +10 -10
- package/types/api/ext/index.d.ts +2 -2
- package/types/api/files/index.d.ts +46 -46
- package/types/api/framework/index.d.ts +2 -2
- package/types/api/location/index.d.ts +38 -45
- package/types/api/media/audio.d.ts +30 -30
- package/types/api/media/background-audio.d.ts +1 -1
- package/types/api/media/camera.d.ts +12 -25
- package/types/api/media/image.d.ts +8 -13
- package/types/api/media/map.d.ts +15 -15
- package/types/api/media/recorder.d.ts +11 -11
- package/types/api/media/video.d.ts +19 -21
- package/types/api/navigate/index.d.ts +2 -2
- package/types/api/network/download.d.ts +7 -8
- package/types/api/network/request.d.ts +14 -33
- package/types/api/network/upload.d.ts +7 -9
- package/types/api/network/websocket.d.ts +14 -14
- package/types/api/open-api/account.d.ts +1 -1
- package/types/api/open-api/address.d.ts +5 -5
- package/types/api/open-api/authorize.d.ts +1 -1
- package/types/api/open-api/login.d.ts +5 -5
- package/types/api/open-api/settings.d.ts +2 -2
- package/types/api/open-api/subscribe-message.d.ts +15 -15
- package/types/api/open-api/user-info.d.ts +2 -3
- package/types/api/payment/index.d.ts +1 -1
- package/types/api/route/index.d.ts +5 -8
- package/types/api/share/index.d.ts +3 -3
- package/types/api/storage/background-fetch.d.ts +6 -9
- package/types/api/storage/index.d.ts +11 -11
- package/types/api/taro.extend.d.ts +7 -24
- package/types/api/taro.hooks.d.ts +8 -33
- package/types/api/ui/animation.d.ts +33 -36
- package/types/api/ui/background.d.ts +2 -4
- package/types/api/ui/custom-component.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +1 -10
- 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 -7
- package/types/api/ui/pull-down-refresh.d.ts +2 -3
- package/types/api/ui/scroll.d.ts +3 -4
- 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 -23
- package/types/compile/compiler.d.ts +4 -10
- package/types/compile/config/index.d.ts +0 -3
- package/types/compile/config/mini.d.ts +17 -39
- package/types/compile/config/plugin.d.ts +14 -4
- package/types/compile/config/project.d.ts +23 -61
- package/types/compile/config/util.d.ts +18 -73
- package/types/compile/index.d.ts +16 -1
- package/types/compile/viteCompilerContext.d.ts +18 -52
- package/types/global.d.ts +1 -12
- package/types/index.d.ts +0 -11
- package/types/taro.api.d.ts +0 -9
- package/types/taro.component.d.ts +0 -2
- package/types/taro.config.d.ts +0 -120
- package/types/taro.runtime.d.ts +7 -3
- package/types/api/alipay/index.d.ts +0 -69
- package/types/api/qq/index.d.ts +0 -354
- package/types/api/swan/bookshelf.d.ts +0 -307
- package/types/api/swan/download-package.d.ts +0 -80
- package/types/api/swan/index.d.ts +0 -251
- package/types/api/swan/pay.d.ts +0 -139
- package/types/compile/config/h5.d.ts +0 -134
- package/types/compile/config/harmony.d.ts +0 -118
- package/types/compile/config/rn.d.ts +0 -85
|
@@ -25,7 +25,7 @@ declare module '../../index' {
|
|
|
25
25
|
/** 要存储的文件路径 */
|
|
26
26
|
filePath?: string
|
|
27
27
|
/** 要保存的本地临时文件路径
|
|
28
|
-
* @supported
|
|
28
|
+
* @supported weapp
|
|
29
29
|
*/
|
|
30
30
|
apFilePath?: string
|
|
31
31
|
/** 接口调用成功的回调函数 */
|
|
@@ -125,7 +125,7 @@ declare module '../../index' {
|
|
|
125
125
|
/** 本地路径 */
|
|
126
126
|
filePath: string
|
|
127
127
|
/** 文件路径
|
|
128
|
-
* @supported
|
|
128
|
+
* @supported weapp
|
|
129
129
|
*/
|
|
130
130
|
apFilePath?: string
|
|
131
131
|
/** 本地文件大小,以字节为单位 */
|
|
@@ -138,7 +138,7 @@ declare module '../../index' {
|
|
|
138
138
|
/** 文件路径 */
|
|
139
139
|
filePath: string
|
|
140
140
|
/** 文件路径
|
|
141
|
-
* @supported
|
|
141
|
+
* @supported weapp
|
|
142
142
|
*/
|
|
143
143
|
apFilePath?: string
|
|
144
144
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
@@ -163,7 +163,7 @@ declare module '../../index' {
|
|
|
163
163
|
/** 要读取的文件路径 */
|
|
164
164
|
filePath: string
|
|
165
165
|
/** 本地文件路径
|
|
166
|
-
* @supported
|
|
166
|
+
* @supported weapp
|
|
167
167
|
*/
|
|
168
168
|
apFilePath?: string
|
|
169
169
|
/**
|
|
@@ -196,17 +196,17 @@ declare module '../../index' {
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
/** 文件管理器,可通过 [Taro.getFileSystemManager](./getFileSystemManager) 获取。
|
|
199
|
-
* @supported weapp
|
|
199
|
+
* @supported weapp
|
|
200
200
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.html
|
|
201
201
|
*/
|
|
202
202
|
interface FileSystemManager {
|
|
203
203
|
/** 判断文件/目录是否存在
|
|
204
|
-
* @supported weapp
|
|
204
|
+
* @supported weapp
|
|
205
205
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.access.html
|
|
206
206
|
*/
|
|
207
207
|
access(option: FileSystemManager.AccessOption): void
|
|
208
208
|
/** [FileSystemManager.access](#access) 的同步版本
|
|
209
|
-
* @supported weapp
|
|
209
|
+
* @supported weapp
|
|
210
210
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.accessSync.html
|
|
211
211
|
*/
|
|
212
212
|
accessSync(
|
|
@@ -214,12 +214,12 @@ declare module '../../index' {
|
|
|
214
214
|
path: string,
|
|
215
215
|
): void
|
|
216
216
|
/** 在文件结尾追加内容
|
|
217
|
-
* @supported weapp
|
|
217
|
+
* @supported weapp
|
|
218
218
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFile.html
|
|
219
219
|
*/
|
|
220
220
|
appendFile(option: FileSystemManager.AppendFileOption): void
|
|
221
221
|
/** [FileSystemManager.appendFile](#appendfile) 的同步版本
|
|
222
|
-
* @supported weapp
|
|
222
|
+
* @supported weapp
|
|
223
223
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFileSync.html
|
|
224
224
|
*/
|
|
225
225
|
appendFileSync(
|
|
@@ -241,12 +241,12 @@ declare module '../../index' {
|
|
|
241
241
|
*/
|
|
242
242
|
closeSync(option: FileSystemManager.CloseSyncOption): void
|
|
243
243
|
/** 复制文件
|
|
244
|
-
* @supported weapp
|
|
244
|
+
* @supported weapp
|
|
245
245
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFile.html
|
|
246
246
|
*/
|
|
247
247
|
copyFile(option: FileSystemManager.CopyFileOption): void
|
|
248
248
|
/** [FileSystemManager.copyFile](#copyfile) 的同步版本
|
|
249
|
-
* @supported weapp
|
|
249
|
+
* @supported weapp
|
|
250
250
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFileSync.html
|
|
251
251
|
*/
|
|
252
252
|
copyFileSync(
|
|
@@ -276,22 +276,22 @@ declare module '../../index' {
|
|
|
276
276
|
*/
|
|
277
277
|
ftruncateSync(option: FileSystemManager.FtruncateSyncOption): void
|
|
278
278
|
/** 获取该小程序下的 `本地临时文件` 或 `本地缓存文件` 信息
|
|
279
|
-
* @supported weapp
|
|
279
|
+
* @supported weapp
|
|
280
280
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getFileInfo.html
|
|
281
281
|
*/
|
|
282
282
|
getFileInfo(option: FileSystemManager.getFileInfoOption): void
|
|
283
283
|
/** 获取该小程序下已保存的本地缓存文件列表
|
|
284
|
-
* @supported weapp
|
|
284
|
+
* @supported weapp
|
|
285
285
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getSavedFileList.html
|
|
286
286
|
*/
|
|
287
287
|
getSavedFileList(option?: FileSystemManager.getSavedFileListOption): void
|
|
288
288
|
/** 创建目录
|
|
289
|
-
* @supported weapp
|
|
289
|
+
* @supported weapp
|
|
290
290
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdir.html
|
|
291
291
|
*/
|
|
292
292
|
mkdir(option: FileSystemManager.MkdirOption): void
|
|
293
293
|
/** [FileSystemManager.mkdir](#mkdir) 的同步版本
|
|
294
|
-
* @supported weapp
|
|
294
|
+
* @supported weapp
|
|
295
295
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdirSync.html
|
|
296
296
|
*/
|
|
297
297
|
mkdirSync(
|
|
@@ -326,12 +326,12 @@ declare module '../../index' {
|
|
|
326
326
|
*/
|
|
327
327
|
readCompressedFileSync(option: FileSystemManager.readCompressedFileSync.Option): ArrayBuffer /** 文件读取结果 */
|
|
328
328
|
/** 读取目录内文件列表
|
|
329
|
-
* @supported weapp
|
|
329
|
+
* @supported weapp
|
|
330
330
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdir.html
|
|
331
331
|
*/
|
|
332
332
|
readdir(option: FileSystemManager.ReaddirOption): void
|
|
333
333
|
/** [FileSystemManager.readdir](#readdir) 的同步版本
|
|
334
|
-
* @supported weapp
|
|
334
|
+
* @supported weapp
|
|
335
335
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdirSync.html
|
|
336
336
|
*/
|
|
337
337
|
readdirSync(
|
|
@@ -339,12 +339,12 @@ declare module '../../index' {
|
|
|
339
339
|
dirPath: string,
|
|
340
340
|
): string[]
|
|
341
341
|
/** 读取本地文件内容
|
|
342
|
-
* @supported weapp
|
|
342
|
+
* @supported weapp
|
|
343
343
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFile.html
|
|
344
344
|
*/
|
|
345
345
|
readFile(option: FileSystemManager.ReadFileOption): void
|
|
346
346
|
/** [FileSystemManager.readFile](#readfile) 的同步版本
|
|
347
|
-
* @supported weapp
|
|
347
|
+
* @supported weapp
|
|
348
348
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFileSync.html
|
|
349
349
|
*/
|
|
350
350
|
readFileSync(
|
|
@@ -375,17 +375,17 @@ declare module '../../index' {
|
|
|
375
375
|
*/
|
|
376
376
|
readZipEntry(option: FileSystemManager.readZipEntry.Option): Promise<FileSystemManager.readZipEntry.Promised>
|
|
377
377
|
/** 删除该小程序下已保存的本地缓存文件
|
|
378
|
-
* @supported weapp
|
|
378
|
+
* @supported weapp
|
|
379
379
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.removeSavedFile.html
|
|
380
380
|
*/
|
|
381
381
|
removeSavedFile(option: FileSystemManager.RemoveSavedFileOption): void
|
|
382
382
|
/** 重命名文件。可以把文件从 oldPath 移动到 newPath
|
|
383
|
-
* @supported weapp
|
|
383
|
+
* @supported weapp
|
|
384
384
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rename.html
|
|
385
385
|
*/
|
|
386
386
|
rename(option: FileSystemManager.RenameOption): void
|
|
387
387
|
/** [FileSystemManager.rename](#rename) 的同步版本
|
|
388
|
-
* @supported weapp
|
|
388
|
+
* @supported weapp
|
|
389
389
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.renameSync.html
|
|
390
390
|
*/
|
|
391
391
|
renameSync(
|
|
@@ -395,12 +395,12 @@ declare module '../../index' {
|
|
|
395
395
|
newPath: string,
|
|
396
396
|
): void
|
|
397
397
|
/** 删除目录
|
|
398
|
-
* @supported weapp
|
|
398
|
+
* @supported weapp
|
|
399
399
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdir.html
|
|
400
400
|
*/
|
|
401
401
|
rmdir(option: FileSystemManager.RmdirOption): void
|
|
402
402
|
/** [FileSystemManager.rmdir](#rmdir) 的同步版本
|
|
403
|
-
* @supported weapp
|
|
403
|
+
* @supported weapp
|
|
404
404
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdirSync.html
|
|
405
405
|
*/
|
|
406
406
|
rmdirSync(
|
|
@@ -410,12 +410,12 @@ declare module '../../index' {
|
|
|
410
410
|
recursive?: boolean,
|
|
411
411
|
): void
|
|
412
412
|
/** 保存临时文件到本地。此接口会移动临时文件,因此调用成功后,tempFilePath 将不可用。
|
|
413
|
-
* @supported weapp
|
|
413
|
+
* @supported weapp
|
|
414
414
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFile.html
|
|
415
415
|
*/
|
|
416
416
|
saveFile(option: FileSystemManager.SaveFileOption): void
|
|
417
417
|
/** [FileSystemManager.saveFile](#savefile) 的同步版本
|
|
418
|
-
* @supported weapp
|
|
418
|
+
* @supported weapp
|
|
419
419
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFileSync.html
|
|
420
420
|
*/
|
|
421
421
|
saveFileSync(
|
|
@@ -425,12 +425,12 @@ declare module '../../index' {
|
|
|
425
425
|
filePath?: string,
|
|
426
426
|
): string
|
|
427
427
|
/** 获取文件 Stats 对象
|
|
428
|
-
* @supported weapp
|
|
428
|
+
* @supported weapp
|
|
429
429
|
* https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.stat.html
|
|
430
430
|
*/
|
|
431
431
|
stat(option: FileSystemManager.StatOption): void
|
|
432
432
|
/** [FileSystemManager.stat](#stat) 的同步版本
|
|
433
|
-
* @supported weapp
|
|
433
|
+
* @supported weapp
|
|
434
434
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.statSync.html
|
|
435
435
|
*/
|
|
436
436
|
statSync(
|
|
@@ -440,22 +440,22 @@ declare module '../../index' {
|
|
|
440
440
|
recursive?: boolean,
|
|
441
441
|
): Stats | TaroGeneral.IAnyObject
|
|
442
442
|
/** 对文件内容进行截断操作
|
|
443
|
-
* @supported weapp
|
|
443
|
+
* @supported weapp
|
|
444
444
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncate.html
|
|
445
445
|
*/
|
|
446
446
|
truncate(option: FileSystemManager.TruncateOption): void
|
|
447
447
|
/** 对文件内容进行截断操作 ([truncate](#truncate) 的同步版本)
|
|
448
|
-
* @supported weapp
|
|
448
|
+
* @supported weapp
|
|
449
449
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncateSync.html
|
|
450
450
|
*/
|
|
451
451
|
truncateSync(option: FileSystemManager.TruncateSyncOption): void
|
|
452
452
|
/** 删除文件
|
|
453
|
-
* @supported weapp
|
|
453
|
+
* @supported weapp
|
|
454
454
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlink.html
|
|
455
455
|
*/
|
|
456
456
|
unlink(option: FileSystemManager.UnlinkOption): void
|
|
457
457
|
/** [FileSystemManager.unlink](#unlink) 的同步版本
|
|
458
|
-
* @supported weapp
|
|
458
|
+
* @supported weapp
|
|
459
459
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlinkSync.html
|
|
460
460
|
*/
|
|
461
461
|
unlinkSync(
|
|
@@ -463,7 +463,7 @@ declare module '../../index' {
|
|
|
463
463
|
filePath: string,
|
|
464
464
|
): void
|
|
465
465
|
/** 解压文件
|
|
466
|
-
* @supported weapp
|
|
466
|
+
* @supported weapp
|
|
467
467
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unzip.html
|
|
468
468
|
*/
|
|
469
469
|
unzip(option: FileSystemManager.UnzipOption): void
|
|
@@ -473,12 +473,12 @@ declare module '../../index' {
|
|
|
473
473
|
*/
|
|
474
474
|
write(option: FileSystemManager.WriteOption): void
|
|
475
475
|
/** 写文件
|
|
476
|
-
* @supported weapp
|
|
476
|
+
* @supported weapp
|
|
477
477
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html
|
|
478
478
|
*/
|
|
479
479
|
writeFile(option: FileSystemManager.WriteFileOption): void
|
|
480
480
|
/** [FileSystemManager.writeFile](#writefile) 的同步版本
|
|
481
|
-
* @supported weapp
|
|
481
|
+
* @supported weapp
|
|
482
482
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFileSync.html
|
|
483
483
|
*/
|
|
484
484
|
writeFileSync(
|
|
@@ -816,7 +816,7 @@ declare module '../../index' {
|
|
|
816
816
|
/** 需要删除的文件路径 */
|
|
817
817
|
filePath: string
|
|
818
818
|
/** 本地缓存文件路径
|
|
819
|
-
* @supported
|
|
819
|
+
* @supported weapp
|
|
820
820
|
*/
|
|
821
821
|
apFilePath?: string
|
|
822
822
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
@@ -1316,12 +1316,12 @@ declare module '../../index' {
|
|
|
1316
1316
|
/** 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime */
|
|
1317
1317
|
lastModifiedTime: number
|
|
1318
1318
|
/** 判断当前文件是否一个目录
|
|
1319
|
-
* @supported weapp
|
|
1319
|
+
* @supported weapp
|
|
1320
1320
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isDirectory.html
|
|
1321
1321
|
*/
|
|
1322
1322
|
isDirectory(): boolean
|
|
1323
1323
|
/** 判断当前文件是否一个普通文件
|
|
1324
|
-
* @supported weapp
|
|
1324
|
+
* @supported weapp
|
|
1325
1325
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isFile.html
|
|
1326
1326
|
*/
|
|
1327
1327
|
isFile(): boolean
|
|
@@ -1338,7 +1338,7 @@ declare module '../../index' {
|
|
|
1338
1338
|
|
|
1339
1339
|
interface TaroStatic {
|
|
1340
1340
|
/** 保存文件系统的文件到用户磁盘,仅在 PC 端支持
|
|
1341
|
-
* @supported weapp
|
|
1341
|
+
* @supported weapp
|
|
1342
1342
|
* @example
|
|
1343
1343
|
* ```tsx
|
|
1344
1344
|
* Taro.saveFileToDisk({
|
|
@@ -1356,7 +1356,7 @@ declare module '../../index' {
|
|
|
1356
1356
|
saveFileToDisk(option: saveFileToDisk.Option): Promise<TaroGeneral.CallbackResult>
|
|
1357
1357
|
|
|
1358
1358
|
/** 保存文件到本地。**注意:saveFile 会把临时文件移动,因此调用成功后传入的 tempFilePath 将不可用**
|
|
1359
|
-
* @supported weapp
|
|
1359
|
+
* @supported weapp
|
|
1360
1360
|
* @example
|
|
1361
1361
|
* ```tsx
|
|
1362
1362
|
* Taro.chooseImage({
|
|
@@ -1376,7 +1376,7 @@ declare module '../../index' {
|
|
|
1376
1376
|
saveFile(option: saveFile.Option): Promise<saveFile.SuccessCallbackResult | saveFile.FailCallbackResult>
|
|
1377
1377
|
|
|
1378
1378
|
/** 删除该小程序下已保存的本地缓存文件
|
|
1379
|
-
* @supported weapp
|
|
1379
|
+
* @supported weapp
|
|
1380
1380
|
* @example
|
|
1381
1381
|
* ```tsx
|
|
1382
1382
|
* Taro.getSavedFileList({
|
|
@@ -1397,7 +1397,7 @@ declare module '../../index' {
|
|
|
1397
1397
|
removeSavedFile(option: removeSavedFile.Option): Promise<TaroGeneral.CallbackResult>
|
|
1398
1398
|
|
|
1399
1399
|
/** 新开页面打开文档,支持格式
|
|
1400
|
-
* @supported weapp
|
|
1400
|
+
* @supported weapp
|
|
1401
1401
|
* @example
|
|
1402
1402
|
* ```tsx
|
|
1403
1403
|
* Taro.downloadFile({
|
|
@@ -1418,7 +1418,7 @@ declare module '../../index' {
|
|
|
1418
1418
|
openDocument(option: openDocument.Option): Promise<TaroGeneral.CallbackResult>
|
|
1419
1419
|
|
|
1420
1420
|
/** 获取本地已保存的文件列表
|
|
1421
|
-
* @supported weapp
|
|
1421
|
+
* @supported weapp
|
|
1422
1422
|
* @example
|
|
1423
1423
|
* ```tsx
|
|
1424
1424
|
* Taro.getSavedFileList({
|
|
@@ -1432,7 +1432,7 @@ declare module '../../index' {
|
|
|
1432
1432
|
getSavedFileList(option?: getSavedFileList.Option): Promise<getSavedFileList.SuccessCallbackResult>
|
|
1433
1433
|
|
|
1434
1434
|
/** 获取本地文件的文件信息。此接口只能用于获取已保存到本地的文件,若需要获取临时文件信息,请使用 [Taro.getFileInfo](/docs/apis/files/getFileInfo) 接口。
|
|
1435
|
-
* @supported weapp
|
|
1435
|
+
* @supported weapp
|
|
1436
1436
|
* @example
|
|
1437
1437
|
* ```tsx
|
|
1438
1438
|
* Taro.getSavedFileInfo({
|
|
@@ -1449,7 +1449,7 @@ declare module '../../index' {
|
|
|
1449
1449
|
|
|
1450
1450
|
/**
|
|
1451
1451
|
* 获取该小程序下的 本地临时文件 或 本地缓存文件 信息
|
|
1452
|
-
* @supported weapp
|
|
1452
|
+
* @supported weapp
|
|
1453
1453
|
* @example
|
|
1454
1454
|
* ```tsx
|
|
1455
1455
|
* Taro.getFileInfo({
|
|
@@ -1464,7 +1464,7 @@ declare module '../../index' {
|
|
|
1464
1464
|
getFileInfo(option: getFileInfo.Option): Promise<getFileInfo.SuccessCallbackResult | getFileInfo.FailCallbackResult>
|
|
1465
1465
|
|
|
1466
1466
|
/** 获取全局唯一的文件管理器
|
|
1467
|
-
* @supported weapp
|
|
1467
|
+
* @supported weapp
|
|
1468
1468
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html
|
|
1469
1469
|
*/
|
|
1470
1470
|
getFileSystemManager(): FileSystemManager
|
|
@@ -33,7 +33,7 @@ declare module '../../index' {
|
|
|
33
33
|
* __注意:__
|
|
34
34
|
* - __不要尝试修改页面栈,会导致路由以及页面状态错误。__
|
|
35
35
|
* - 不要在 `App.onLaunch` 的时候调用 `getCurrentPages()`,此时 `page` 还没有生成。
|
|
36
|
-
* @supported weapp
|
|
36
|
+
* @supported weapp
|
|
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
|
|
46
|
+
* @supported weapp
|
|
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>
|
|
@@ -9,7 +9,6 @@ declare module '../../index' {
|
|
|
9
9
|
longitude: number
|
|
10
10
|
/** 缩放比例
|
|
11
11
|
* @weapp 范围 5~18,默认值18
|
|
12
|
-
* @alipay 范围 3~19,默认值15
|
|
13
12
|
*/
|
|
14
13
|
scale?: number
|
|
15
14
|
/** 位置名 */
|
|
@@ -17,7 +16,7 @@ declare module '../../index' {
|
|
|
17
16
|
/** 地址的详细说明 */
|
|
18
17
|
address?: string
|
|
19
18
|
/** 定义在拉起的地图 App 面板中需要被屏蔽的地图类 App
|
|
20
|
-
* @supported
|
|
19
|
+
* @supported weapp
|
|
21
20
|
*/
|
|
22
21
|
ignoredApps?: Array<any>
|
|
23
22
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
@@ -53,7 +52,7 @@ declare module '../../index' {
|
|
|
53
52
|
type?: string
|
|
54
53
|
/** 针对 iOS14/Android12 及以上的新特性,其他情况本参数忽略。默认情况宿主是精确定位就返回精确定位信息。
|
|
55
54
|
* 传入 true 会强制使用精确定位信息,iOS14/Android12 及以上如果没有精确定位权限,会弹出精确定位授权弹框
|
|
56
|
-
* @supported
|
|
55
|
+
* @supported weapp
|
|
57
56
|
* @default false
|
|
58
57
|
*/
|
|
59
58
|
needFullAccuracy?: boolean
|
|
@@ -74,39 +73,39 @@ declare module '../../index' {
|
|
|
74
73
|
/** 垂直精度,单位 m(Android 无法获取,返回 0) */
|
|
75
74
|
verticalAccuracy: number
|
|
76
75
|
/** 城市名称
|
|
77
|
-
* @supported
|
|
76
|
+
* @supported weapp
|
|
78
77
|
*/
|
|
79
78
|
street?: string
|
|
80
79
|
/** 国家代码
|
|
81
|
-
* @supported
|
|
80
|
+
* @supported weapp
|
|
82
81
|
*/
|
|
83
82
|
cityCode?: string
|
|
84
83
|
/** 城市名称
|
|
85
|
-
* @supported
|
|
84
|
+
* @supported weapp
|
|
86
85
|
*/
|
|
87
86
|
city?: string
|
|
88
87
|
/** 国家
|
|
89
|
-
* @supported
|
|
88
|
+
* @supported weapp
|
|
90
89
|
*/
|
|
91
90
|
country?: string
|
|
92
91
|
/** 国家代码
|
|
93
|
-
* @supported
|
|
92
|
+
* @supported weapp
|
|
94
93
|
*/
|
|
95
94
|
countryCode?: string
|
|
96
95
|
/** 省份
|
|
97
|
-
* @supported
|
|
96
|
+
* @supported weapp
|
|
98
97
|
*/
|
|
99
98
|
province?: string
|
|
100
99
|
/** 街道号码
|
|
101
|
-
* @supported
|
|
100
|
+
* @supported weapp
|
|
102
101
|
*/
|
|
103
102
|
streetNumber?: string
|
|
104
103
|
/** 区
|
|
105
|
-
* @supported
|
|
104
|
+
* @supported weapp
|
|
106
105
|
*/
|
|
107
106
|
district?: string
|
|
108
107
|
/** 是不是精确定位信息
|
|
109
|
-
* @supported
|
|
108
|
+
* @supported weapp
|
|
110
109
|
*/
|
|
111
110
|
isFullAccuracy?: boolean
|
|
112
111
|
/** 调用结果 */
|
|
@@ -147,14 +146,10 @@ declare module '../../index' {
|
|
|
147
146
|
/** 目标地经度 */
|
|
148
147
|
longitude?: number
|
|
149
148
|
/** 地图选点组件参数
|
|
150
|
-
* @supported h5
|
|
151
|
-
* @h5 仅支持 H5 使用
|
|
152
149
|
* @see https://lbs.qq.com/webApi/component/componentGuide/componentPicker
|
|
153
150
|
*/
|
|
154
151
|
mapOpts?: Record<string, unknown>
|
|
155
152
|
/** 页面显示标题
|
|
156
|
-
* @supported alipay
|
|
157
|
-
* @alipay 安卓默认值为 位置,iOS、IDE 默认值为 你在哪里?
|
|
158
153
|
* @see https://opendocs.alipay.com/mini/api/location?pathHash=951b46a1
|
|
159
154
|
*/
|
|
160
155
|
title?: string
|
|
@@ -176,27 +171,27 @@ declare module '../../index' {
|
|
|
176
171
|
/** 位置名称 */
|
|
177
172
|
name: string
|
|
178
173
|
/** 区县代码
|
|
179
|
-
* @supported
|
|
174
|
+
* @supported weapp
|
|
180
175
|
*/
|
|
181
176
|
adCode?: number
|
|
182
177
|
/** 区县名称
|
|
183
|
-
* @supported
|
|
178
|
+
* @supported weapp
|
|
184
179
|
*/
|
|
185
180
|
adName?: string
|
|
186
181
|
/** 城市代码
|
|
187
|
-
* @supported
|
|
182
|
+
* @supported weapp
|
|
188
183
|
*/
|
|
189
184
|
cityCode?: string
|
|
190
185
|
/** 城市名称
|
|
191
|
-
* @supported
|
|
186
|
+
* @supported weapp
|
|
192
187
|
*/
|
|
193
188
|
cityName?: string
|
|
194
189
|
/** 省份代码
|
|
195
|
-
* @supported
|
|
190
|
+
* @supported weapp
|
|
196
191
|
*/
|
|
197
192
|
provinceCode?: number
|
|
198
193
|
/** 省份名称
|
|
199
|
-
* @supported
|
|
194
|
+
* @supported weapp
|
|
200
195
|
*/
|
|
201
196
|
provinceName?: string
|
|
202
197
|
/** 调用结果 */
|
|
@@ -238,7 +233,7 @@ declare module '../../index' {
|
|
|
238
233
|
type?: string
|
|
239
234
|
/** 针对 iOS14/Android12 及以上的新特性,其他情况本参数忽略。默认情况宿主是精确定位就返回精确定位信息。
|
|
240
235
|
* 传入 true 会强制使用精确定位信息,iOS14/Android12 及以上如果没有精确定位权限,会弹出精确定位授权弹框
|
|
241
|
-
* @supported
|
|
236
|
+
* @supported weapp
|
|
242
237
|
* @default false
|
|
243
238
|
*/
|
|
244
239
|
needFullAccuracy?: boolean
|
|
@@ -261,8 +256,7 @@ declare module '../../index' {
|
|
|
261
256
|
/** 错误码 */
|
|
262
257
|
errCode: number
|
|
263
258
|
/** 错误信息
|
|
264
|
-
* @supported
|
|
265
|
-
* @tt 最低支持版本 2.48.0
|
|
259
|
+
* @supported weapp
|
|
266
260
|
*/
|
|
267
261
|
errMsg?: string
|
|
268
262
|
}
|
|
@@ -290,40 +284,39 @@ declare module '../../index' {
|
|
|
290
284
|
/** 垂直精度,单位 m(Android 无法获取,返回 0) */
|
|
291
285
|
verticalAccuracy: number
|
|
292
286
|
/** 街道名称
|
|
293
|
-
* @supported
|
|
287
|
+
* @supported weapp
|
|
294
288
|
*/
|
|
295
289
|
street?: string
|
|
296
290
|
/** 城市编码
|
|
297
|
-
* @supported
|
|
291
|
+
* @supported weapp
|
|
298
292
|
*/
|
|
299
293
|
cityCode?: string
|
|
300
294
|
/** 城市名称
|
|
301
|
-
* @supported
|
|
302
|
-
* @tt iOS 不支持
|
|
295
|
+
* @supported weapp
|
|
303
296
|
*/
|
|
304
297
|
city?: string
|
|
305
298
|
/** 国家
|
|
306
|
-
* @supported
|
|
299
|
+
* @supported weapp
|
|
307
300
|
*/
|
|
308
301
|
country?: string
|
|
309
302
|
/** 国家代码
|
|
310
|
-
* @supported
|
|
303
|
+
* @supported weapp
|
|
311
304
|
*/
|
|
312
305
|
countryCode?: string
|
|
313
306
|
/** 省份
|
|
314
|
-
* @supported
|
|
307
|
+
* @supported weapp
|
|
315
308
|
*/
|
|
316
309
|
province?: string
|
|
317
310
|
/** 街道号码
|
|
318
|
-
* @supported
|
|
311
|
+
* @supported weapp
|
|
319
312
|
*/
|
|
320
313
|
streetNumber?: string
|
|
321
314
|
/** 区
|
|
322
|
-
* @supported
|
|
315
|
+
* @supported weapp
|
|
323
316
|
*/
|
|
324
317
|
district?: string
|
|
325
318
|
/** 是不是精确定位信息
|
|
326
|
-
* @supported
|
|
319
|
+
* @supported weapp
|
|
327
320
|
*/
|
|
328
321
|
isFullAccuracy?: boolean
|
|
329
322
|
}
|
|
@@ -358,7 +351,7 @@ declare module '../../index' {
|
|
|
358
351
|
|
|
359
352
|
interface TaroStatic {
|
|
360
353
|
/** 关闭监听实时位置变化,前后台都停止消息接收
|
|
361
|
-
* @supported weapp
|
|
354
|
+
* @supported weapp
|
|
362
355
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.stopLocationUpdate.html
|
|
363
356
|
*/
|
|
364
357
|
stopLocationUpdate(option?: stopLocationUpdate.Option): void
|
|
@@ -380,13 +373,13 @@ declare module '../../index' {
|
|
|
380
373
|
*
|
|
381
374
|
* **注意**
|
|
382
375
|
* - 获取位置信息需配置[地理位置用途说明](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。
|
|
383
|
-
* @supported weapp
|
|
376
|
+
* @supported weapp
|
|
384
377
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdate.html
|
|
385
378
|
*/
|
|
386
379
|
startLocationUpdate(option?: startLocationUpdate.Option): void
|
|
387
380
|
|
|
388
381
|
/** 使用微信内置地图查看位置
|
|
389
|
-
* @supported weapp
|
|
382
|
+
* @supported weapp
|
|
390
383
|
* @example
|
|
391
384
|
* ```tsx
|
|
392
385
|
* Taro.getLocation({
|
|
@@ -407,7 +400,7 @@ declare module '../../index' {
|
|
|
407
400
|
openLocation(option: openLocation.Option): Promise<TaroGeneral.CallbackResult>
|
|
408
401
|
|
|
409
402
|
/** 监听持续定位接口返回失败时触发
|
|
410
|
-
* @supported weapp
|
|
403
|
+
* @supported weapp
|
|
411
404
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChangeError.html
|
|
412
405
|
*/
|
|
413
406
|
onLocationChangeError(
|
|
@@ -416,7 +409,7 @@ declare module '../../index' {
|
|
|
416
409
|
): void
|
|
417
410
|
|
|
418
411
|
/** 监听实时地理位置变化事件,需结合 Taro.startLocationUpdateBackground、Taro.startLocationUpdate 使用。
|
|
419
|
-
* @supported weapp
|
|
412
|
+
* @supported weapp
|
|
420
413
|
* @example
|
|
421
414
|
* ```tsx
|
|
422
415
|
* const _locationChangeFn = function (res) {
|
|
@@ -433,7 +426,7 @@ declare module '../../index' {
|
|
|
433
426
|
): void
|
|
434
427
|
|
|
435
428
|
/** 取消监听持续定位接口返回失败时触发
|
|
436
|
-
* @supported weapp
|
|
429
|
+
* @supported weapp
|
|
437
430
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChangeError.html
|
|
438
431
|
*/
|
|
439
432
|
offLocationChangeError(
|
|
@@ -442,7 +435,7 @@ declare module '../../index' {
|
|
|
442
435
|
): void
|
|
443
436
|
|
|
444
437
|
/** 取消监听实时地理位置变化事件
|
|
445
|
-
* @supported weapp
|
|
438
|
+
* @supported weapp
|
|
446
439
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChange.html
|
|
447
440
|
*/
|
|
448
441
|
offLocationChange(
|
|
@@ -455,7 +448,7 @@ declare module '../../index' {
|
|
|
455
448
|
* **注意**
|
|
456
449
|
* - 工具中定位模拟使用IP定位,可能会有一定误差。且工具目前仅支持 gcj02 坐标。
|
|
457
450
|
* - 使用第三方服务进行逆地址解析时,请确认第三方服务默认的坐标系,正确进行坐标转换。
|
|
458
|
-
* @supported weapp
|
|
451
|
+
* @supported weapp
|
|
459
452
|
* @example
|
|
460
453
|
* ```tsx
|
|
461
454
|
* Taro.getLocation({
|
|
@@ -481,7 +474,7 @@ declare module '../../index' {
|
|
|
481
474
|
/** 打开地图选择位置。
|
|
482
475
|
*
|
|
483
476
|
* `chooseLocation` api功能是依赖于腾讯位置服务,所以需要使用 api 密钥。如果您没有,可以前往腾讯位置服务[开发者控制台](https://lbs.qq.com/console/mykey.html?console=mykey)进行申请。
|
|
484
|
-
* @supported weapp
|
|
477
|
+
* @supported weapp
|
|
485
478
|
* @example
|
|
486
479
|
* ```tsx
|
|
487
480
|
* // config/index.js
|
|
@@ -499,7 +492,7 @@ declare module '../../index' {
|
|
|
499
492
|
chooseLocation(option: chooseLocation.Option): Promise<chooseLocation.SuccessCallbackResult>
|
|
500
493
|
|
|
501
494
|
/** 获取当前的模糊地理位置
|
|
502
|
-
* @supported weapp
|
|
495
|
+
* @supported weapp
|
|
503
496
|
* @example
|
|
504
497
|
* ```tsx
|
|
505
498
|
* Taro.getFuzzyLocation({
|