@open-dy/vibecoding-sdk-taro 0.0.1-beta.1 → 0.0.1-beta.3

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 (32) hide show
  1. package/dist/build/plugins/app-config.cjs +0 -3
  2. package/dist/build/plugins/depend-card/analyze.d.ts +27 -0
  3. package/dist/build/plugins/depend-card/analyze.js +120 -0
  4. package/dist/build/plugins/depend-card/analyze.js.map +1 -0
  5. package/dist/build/plugins/depend-card/source.d.ts +11 -0
  6. package/dist/build/plugins/depend-card/source.js +107 -0
  7. package/dist/build/plugins/depend-card/source.js.map +1 -0
  8. package/dist/build/plugins/vite-depend-card.d.ts +8 -10
  9. package/dist/build/plugins/vite-depend-card.js +23 -118
  10. package/dist/build/plugins/vite-depend-card.js.map +1 -1
  11. package/dist/build/taro.js +2 -2
  12. package/dist/build/taro.js.map +1 -1
  13. package/dist/components/miniapp-open-card.d.ts +11 -5
  14. package/dist/components/miniapp-open-card.js +28 -2
  15. package/dist/components/miniapp-open-card.js.map +1 -1
  16. package/dist/components/native-miniapp-open-card.d.ts +5 -0
  17. package/dist/components/native-miniapp-open-card.js +3 -0
  18. package/dist/components/native-miniapp-open-card.js.map +1 -0
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +2 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/reference/sdk-api/runtime/createMicroappClient.md +4 -89
  23. package/dist/reference/sdk-api.json +50 -625
  24. package/dist/runtime/client.d.ts +0 -19
  25. package/dist/runtime/client.js +0 -30
  26. package/dist/runtime/client.js.map +1 -1
  27. package/dist/runtime/default-client.d.ts +2 -21
  28. package/dist/runtime/default-client.js +2 -2
  29. package/package.json +12 -1
  30. package/dist/runtime/closed-domain-request-header.d.ts +0 -4
  31. package/dist/runtime/closed-domain-request-header.js +0 -8
  32. package/dist/runtime/closed-domain-request-header.js.map +0 -1
@@ -99,9 +99,9 @@
99
99
  "description": "平台渠道配置;默认使用内场渠道。"
100
100
  }
101
101
  ],
102
- "returns": "提供普通网络方法,以及显式追加 X-Closed-Domain 标记的对应方法;标记方法不改变请求目标或云服务 SERVICE_ID。",
102
+ "returns": "仅提供普通小程序的 request、uploadFile、downloadFile 和 streamSse。",
103
103
  "remarks": [
104
- "业务优先从模板的 @/network 导入 Network;HTTP(S) 绝对地址直接交给 Taro。"
104
+ "业务优先从模板的 @/network 导入 Network;HTTP(S) 绝对地址直接交给 Taro。宿主需要封闭域功能时通过 MiniappOpenCard 承载,请求与数据处理仅在卡内完成。"
105
105
  ],
106
106
  "examples": [
107
107
  {
@@ -119,7 +119,7 @@
119
119
  "signature": "function createMicroappClient(options?: CreateMicroappClientOptions);",
120
120
  "contract": {
121
121
  "kind": "callable",
122
- "signature": "(options?: CreateMicroappClientOptions): { request: <T = any, U = any>(option: Taro.request.Option<T, U>) => Taro.RequestTask<T>; requestClosedDomain: <T = any, U = any>(option: Taro.request.Option<T, U>) => Taro.RequestTask<T>; uploadFile: (option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }) => ReturnType<typeof Taro.uploadFile>; uploadFileClosedDomain: (option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }) => ReturnType<typeof Taro.uploadFile>; downloadFile: (option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }) => ReturnType<typeof Taro.downloadFile>; downloadFileClosedDomain: (option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }) => ReturnType<typeof Taro.downloadFile>; streamSse: (option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }) => Promise<{ close: () => void; }>; streamSseClosedDomain: (option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }) => Promise<{ close: () => void; }>; }",
122
+ "signature": "(options?: CreateMicroappClientOptions): { request: <T = any, U = any>(option: Taro.request.Option<T, U>) => Taro.RequestTask<T>; uploadFile: (option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }) => ReturnType<typeof Taro.uploadFile>; downloadFile: (option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }) => ReturnType<typeof Taro.downloadFile>; streamSse: (option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }) => Promise<{ close: () => void; }>; }",
123
123
  "parameters": [
124
124
  {
125
125
  "name": "options",
@@ -137,7 +137,7 @@
137
137
  }
138
138
  ],
139
139
  "returns": {
140
- "type": "{ request: <T = any, U = any>(option: Taro.request.Option<T, U>) => Taro.RequestTask<T>; requestClosedDomain: <T = any, U = any>(option: Taro.request.Option<T, U>) => Taro.RequestTask<T>; uploadFile: (option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }) => ReturnType<typeof Taro.uploadFile>; uploadFileClosedDomain: (option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }) => ReturnType<typeof Taro.uploadFile>; downloadFile: (option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }) => ReturnType<typeof Taro.downloadFile>; downloadFileClosedDomain: (option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }) => ReturnType<typeof Taro.downloadFile>; streamSse: (option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }) => Promise<{ close: () => void; }>; streamSseClosedDomain: (option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }) => Promise<{ close: () => void; }>; }",
140
+ "type": "{ request: <T = any, U = any>(option: Taro.request.Option<T, U>) => Taro.RequestTask<T>; uploadFile: (option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }) => ReturnType<typeof Taro.uploadFile>; downloadFile: (option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }) => ReturnType<typeof Taro.downloadFile>; streamSse: (option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }) => Promise<{ close: () => void; }>; }",
141
141
  "fields": [
142
142
  {
143
143
  "name": "request",
@@ -145,47 +145,23 @@
145
145
  "type": "<T = any, U = any>(option: Taro.request.Option<T, U>) => Taro.RequestTask<T>",
146
146
  "description": "发起请求并复用 SDK 管理的身份与当前应用服务配置。"
147
147
  },
148
- {
149
- "name": "requestClosedDomain",
150
- "optional": false,
151
- "type": "<T = any, U = any>(option: Taro.request.Option<T, U>) => Taro.RequestTask<T>",
152
- "description": "发起请求并追加 X-Closed-Domain 标记;不改变请求目标或云服务 SERVICE_ID。"
153
- },
154
148
  {
155
149
  "name": "uploadFile",
156
150
  "optional": false,
157
151
  "type": "(option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }) => ReturnType<typeof Taro.uploadFile>",
158
152
  "description": "上传文件并返回平台上传结果。"
159
153
  },
160
- {
161
- "name": "uploadFileClosedDomain",
162
- "optional": false,
163
- "type": "(option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }) => ReturnType<typeof Taro.uploadFile>",
164
- "description": "上传文件并追加 X-Closed-Domain 标记;不改变请求目标或云服务 SERVICE_ID。"
165
- },
166
154
  {
167
155
  "name": "downloadFile",
168
156
  "optional": false,
169
157
  "type": "(option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }) => ReturnType<typeof Taro.downloadFile>",
170
158
  "description": "下载文件并返回平台下载结果。"
171
159
  },
172
- {
173
- "name": "downloadFileClosedDomain",
174
- "optional": false,
175
- "type": "(option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }) => ReturnType<typeof Taro.downloadFile>",
176
- "description": "下载文件并追加 X-Closed-Domain 标记;不改变请求目标或云服务 SERVICE_ID。"
177
- },
178
160
  {
179
161
  "name": "streamSse",
180
162
  "optional": false,
181
163
  "type": "(option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }) => Promise<{ close: () => void; }>",
182
164
  "description": "建立服务端事件流并返回可关闭的流句柄。"
183
- },
184
- {
185
- "name": "streamSseClosedDomain",
186
- "optional": false,
187
- "type": "(option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }) => Promise<{ close: () => void; }>",
188
- "description": "建立带 X-Closed-Domain 标记的服务端事件流;不改变请求目标或云服务 SERVICE_ID。"
189
165
  }
190
166
  ]
191
167
  },
@@ -441,33 +417,33 @@
441
417
  }
442
418
  },
443
419
  {
444
- "name": "requestClosedDomain",
445
- "description": "发起请求并追加 X-Closed-Domain 标记;不改变请求目标或云服务 SERVICE_ID。",
446
- "signature": "<T = any, U = any>(option: Taro.request.Option<T, U>): Taro.RequestTask<T>",
420
+ "name": "uploadFile",
421
+ "description": "上传文件并返回平台上传结果。",
422
+ "signature": "(option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }): ReturnType<typeof Taro.uploadFile>",
447
423
  "parameters": [
448
424
  {
449
425
  "name": "option",
450
426
  "optional": false,
451
- "type": "Taro.request.Option<T, U>",
427
+ "type": "Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }",
452
428
  "description": "请求、上传或下载的配置对象。",
453
429
  "fields": [
454
430
  {
455
- "name": "url",
431
+ "name": "filePath",
456
432
  "optional": false,
457
433
  "type": "string",
458
- "description": "开发者服务器接口地址"
434
+ "description": "要上传文件资源的路径"
459
435
  },
460
436
  {
461
- "name": "data",
437
+ "name": "header",
462
438
  "optional": true,
463
- "type": "U | undefined",
464
- "description": "请求的参数"
439
+ "type": "TaroGeneral.IAnyObject | undefined",
440
+ "description": "HTTP 请求 Header,Header 中不能设置 Referer"
465
441
  },
466
442
  {
467
- "name": "header",
443
+ "name": "formData",
468
444
  "optional": true,
469
445
  "type": "TaroGeneral.IAnyObject | undefined",
470
- "description": "设置请求的 header,header 中不能设置 Referer。 `content-type` 默认为 `application/json`"
446
+ "description": "HTTP 请求中其他额外的 form data"
471
447
  },
472
448
  {
473
449
  "name": "timeout",
@@ -476,88 +452,22 @@
476
452
  "description": "超时时间,单位为毫秒"
477
453
  },
478
454
  {
479
- "name": "method",
480
- "optional": true,
481
- "type": "keyof Taro.request.Method | undefined",
482
- "description": "HTTP 请求方法"
483
- },
484
- {
485
- "name": "dataType",
486
- "optional": true,
487
- "type": "string | undefined",
488
- "description": "返回的数据格式"
489
- },
490
- {
491
- "name": "responseType",
492
- "optional": true,
493
- "type": "keyof Taro.request.ResponseType | undefined",
494
- "description": "响应的数据类型"
495
- },
496
- {
497
- "name": "useHighPerformanceMode",
498
- "optional": true,
499
- "type": "boolean | undefined",
500
- "description": "使用高性能模式。从基础库 v3.5.0 开始在 Android 端默认开启,其他端暂不生效。该模式下有更优的网络性能表现。"
501
- },
502
- {
503
- "name": "enableHttp2",
504
- "optional": true,
505
- "type": "boolean | undefined",
506
- "description": "开启 http2"
507
- },
508
- {
509
- "name": "enableQuic",
510
- "optional": true,
511
- "type": "boolean | undefined",
512
- "description": "开启 quic"
513
- },
514
- {
515
- "name": "enableCache",
516
- "optional": true,
517
- "type": "boolean | undefined",
518
- "description": "开启 cache"
519
- },
520
- {
521
- "name": "enableHttpDNS",
522
- "optional": true,
523
- "type": "boolean | undefined",
524
- "description": "是否开启 HttpDNS 服务。如开启,需要同时填入 httpDNSServiceId 。 HttpDNS 用法详见 移动解析HttpDNS"
525
- },
526
- {
527
- "name": "httpDNSServiceId",
455
+ "name": "fileName",
528
456
  "optional": true,
529
457
  "type": "string | undefined",
530
- "description": "HttpDNS 服务商 Id。 HttpDNS 用法详见 移动解析HttpDNS"
531
- },
532
- {
533
- "name": "enableChunked",
534
- "optional": true,
535
- "type": "boolean | undefined",
536
- "description": "开启 transfer-encoding chunked。"
537
- },
538
- {
539
- "name": "forceCellularNetwork",
540
- "optional": true,
541
- "type": "boolean | undefined",
542
- "description": "wifi下使用移动网络发送请求"
458
+ "description": "上传的文件名"
543
459
  },
544
460
  {
545
- "name": "enableCookie",
461
+ "name": "withCredentials",
546
462
  "optional": true,
547
463
  "type": "boolean | undefined",
548
- "description": "headers 中设置 cookie 字段是否生效。如果为 false,则 headers 中的 cookie 字段将被忽略,请求头中将包含服务端上一次返回的 cookie(如果有)。"
549
- },
550
- {
551
- "name": "referrerStrategy",
552
- "optional": true,
553
- "type": "keyof Taro.request.ReferrerStrategy | undefined",
554
- "description": "referer 策略,用于控制当前请求 header 对象中 referer 字段格式。该参数默认值可通过 app.json 中的配置进行修改。"
464
+ "description": "是否应使用传出凭据 (cookie) 发送此请求"
555
465
  },
556
466
  {
557
- "name": "success",
467
+ "name": "complete",
558
468
  "optional": true,
559
- "type": "((result: Taro.request.SuccessCallbackResult<T>) => void) | undefined",
560
- "description": "接口调用成功的回调函数"
469
+ "type": "((res: TaroGeneral.CallbackResult) => void) | undefined",
470
+ "description": "接口调用结束的回调函数(调用成功、失败都会执行)"
561
471
  },
562
472
  {
563
473
  "name": "fail",
@@ -566,109 +476,36 @@
566
476
  "description": "接口调用失败的回调函数"
567
477
  },
568
478
  {
569
- "name": "complete",
570
- "optional": true,
571
- "type": "((res: Partial<Taro.request.SuccessCallbackResult> & TaroGeneral.CallbackResult) => void) | undefined",
572
- "description": "接口调用结束的回调函数(调用成功、失败都会执行)"
573
- },
574
- {
575
- "name": "jsonp",
576
- "optional": true,
577
- "type": "string | boolean | undefined",
578
- "description": "设置是否使用 jsonp 方式获取数据"
579
- },
580
- {
581
- "name": "jsonpCache",
582
- "optional": true,
583
- "type": "RequestCache | undefined",
584
- "description": "设置 jsonp 请求 url 是否需要被缓存"
585
- },
586
- {
587
- "name": "mode",
588
- "optional": true,
589
- "type": "keyof Taro.request.CorsMode | undefined",
590
- "description": "设置是否允许跨域请求"
591
- },
592
- {
593
- "name": "credentials",
594
- "optional": true,
595
- "type": "keyof Taro.request.Credentials | undefined",
596
- "description": "设置是否携带 Cookie"
597
- },
598
- {
599
- "name": "cache",
600
- "optional": true,
601
- "type": "keyof Taro.request.Cache | undefined",
602
- "description": "设置缓存模式"
603
- },
604
- {
605
- "name": "retryTimes",
606
- "optional": true,
607
- "type": "number | undefined",
608
- "description": "设置请求重试次数"
609
- },
610
- {
611
- "name": "backup",
612
- "optional": true,
613
- "type": "string | string[] | undefined",
614
- "description": "设置请求的兜底接口"
615
- },
616
- {
617
- "name": "signal",
618
- "optional": true,
619
- "type": "AbortSignal | undefined",
620
- "description": "设置请求中止信号"
621
- },
622
- {
623
- "name": "dataCheck",
624
- "optional": true,
625
- "type": "(() => boolean) | undefined",
626
- "description": "设置请求响应的数据校验函数,若返回 false,则请求兜底接口,若无兜底接口,则报请求失败"
627
- },
628
- {
629
- "name": "useStore",
630
- "optional": true,
631
- "type": "boolean | undefined",
632
- "description": "设置请求是否使用缓存"
633
- },
634
- {
635
- "name": "storeCheckKey",
479
+ "name": "success",
636
480
  "optional": true,
637
- "type": "string | undefined",
638
- "description": "设置请求缓存校验的 key"
481
+ "type": "((result: Taro.uploadFile.SuccessCallbackResult) => void) | undefined",
482
+ "description": "接口调用成功的回调函数"
639
483
  },
640
484
  {
641
- "name": "storeSign",
485
+ "name": "url",
642
486
  "optional": true,
643
487
  "type": "string | undefined",
644
- "description": "设置请求缓存签名"
488
+ "description": "请求地址。"
645
489
  },
646
490
  {
647
- "name": "storeCheck",
491
+ "name": "name",
648
492
  "optional": true,
649
- "type": "(() => boolean) | undefined",
650
- "description": "设置请求校验函数,一般不需要设置"
493
+ "type": "string | undefined"
651
494
  }
652
495
  ]
653
496
  }
654
497
  ],
655
498
  "returns": {
656
- "type": "Taro.RequestTask<T>",
499
+ "type": "Taro.UploadTask.UploadTaskPromise",
657
500
  "promise": true,
658
- "resolvesTo": "Taro.request.SuccessCallbackResult<T>",
501
+ "resolvesTo": "Taro.uploadFile.SuccessCallbackResult",
659
502
  "fields": [
660
503
  {
661
504
  "name": "data",
662
505
  "optional": false,
663
- "type": "T",
506
+ "type": "string",
664
507
  "description": "开发者服务器返回的数据"
665
508
  },
666
- {
667
- "name": "header",
668
- "optional": false,
669
- "type": "TaroGeneral.IAnyObject",
670
- "description": "开发者服务器返回的 HTTP Response Header"
671
- },
672
509
  {
673
510
  "name": "statusCode",
674
511
  "optional": false,
@@ -681,6 +518,12 @@
681
518
  "type": "string",
682
519
  "description": "调用结果"
683
520
  },
521
+ {
522
+ "name": "header",
523
+ "optional": true,
524
+ "type": "TaroGeneral.IAnyObject | undefined",
525
+ "description": "开发者服务器返回的 HTTP Response Header"
526
+ },
684
527
  {
685
528
  "name": "cookies",
686
529
  "optional": true,
@@ -691,33 +534,27 @@
691
534
  }
692
535
  },
693
536
  {
694
- "name": "uploadFile",
695
- "description": "上传文件并返回平台上传结果。",
696
- "signature": "(option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }): ReturnType<typeof Taro.uploadFile>",
537
+ "name": "downloadFile",
538
+ "description": "下载文件并返回平台下载结果。",
539
+ "signature": "(option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }): ReturnType<typeof Taro.downloadFile>",
697
540
  "parameters": [
698
541
  {
699
542
  "name": "option",
700
543
  "optional": false,
701
- "type": "Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }",
544
+ "type": "Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }",
702
545
  "description": "请求、上传或下载的配置对象。",
703
546
  "fields": [
704
547
  {
705
548
  "name": "filePath",
706
- "optional": false,
707
- "type": "string",
708
- "description": "要上传文件资源的路径"
709
- },
710
- {
711
- "name": "header",
712
549
  "optional": true,
713
- "type": "TaroGeneral.IAnyObject | undefined",
714
- "description": "HTTP 请求 Header,Header 中不能设置 Referer"
550
+ "type": "string | undefined",
551
+ "description": "指定文件下载后存储的路径"
715
552
  },
716
553
  {
717
- "name": "formData",
554
+ "name": "header",
718
555
  "optional": true,
719
556
  "type": "TaroGeneral.IAnyObject | undefined",
720
- "description": "HTTP 请求中其他额外的 form data"
557
+ "description": "HTTP 请求的 Header,Header 中不能设置 Referer"
721
558
  },
722
559
  {
723
560
  "name": "timeout",
@@ -725,12 +562,6 @@
725
562
  "type": "number | undefined",
726
563
  "description": "超时时间,单位为毫秒"
727
564
  },
728
- {
729
- "name": "fileName",
730
- "optional": true,
731
- "type": "string | undefined",
732
- "description": "上传的文件名"
733
- },
734
565
  {
735
566
  "name": "withCredentials",
736
567
  "optional": true,
@@ -752,7 +583,7 @@
752
583
  {
753
584
  "name": "success",
754
585
  "optional": true,
755
- "type": "((result: Taro.uploadFile.SuccessCallbackResult) => void) | undefined",
586
+ "type": "((result: Taro.downloadFile.FileSuccessCallbackResult) => void) | undefined",
756
587
  "description": "接口调用成功的回调函数"
757
588
  },
758
589
  {
@@ -760,357 +591,17 @@
760
591
  "optional": true,
761
592
  "type": "string | undefined",
762
593
  "description": "请求地址。"
763
- },
764
- {
765
- "name": "name",
766
- "optional": true,
767
- "type": "string | undefined"
768
594
  }
769
595
  ]
770
596
  }
771
597
  ],
772
598
  "returns": {
773
- "type": "Taro.UploadTask.UploadTaskPromise",
599
+ "type": "Taro.DownloadTask.DownloadTaskPromise",
774
600
  "promise": true,
775
- "resolvesTo": "Taro.uploadFile.SuccessCallbackResult",
601
+ "resolvesTo": "Taro.downloadFile.FileSuccessCallbackResult",
776
602
  "fields": [
777
603
  {
778
- "name": "data",
779
- "optional": false,
780
- "type": "string",
781
- "description": "开发者服务器返回的数据"
782
- },
783
- {
784
- "name": "statusCode",
785
- "optional": false,
786
- "type": "number",
787
- "description": "开发者服务器返回的 HTTP 状态码"
788
- },
789
- {
790
- "name": "errMsg",
791
- "optional": false,
792
- "type": "string",
793
- "description": "调用结果"
794
- },
795
- {
796
- "name": "header",
797
- "optional": true,
798
- "type": "TaroGeneral.IAnyObject | undefined",
799
- "description": "开发者服务器返回的 HTTP Response Header"
800
- },
801
- {
802
- "name": "cookies",
803
- "optional": true,
804
- "type": "string[] | undefined",
805
- "description": "cookies"
806
- }
807
- ]
808
- }
809
- },
810
- {
811
- "name": "uploadFileClosedDomain",
812
- "description": "上传文件并追加 X-Closed-Domain 标记;不改变请求目标或云服务 SERVICE_ID。",
813
- "signature": "(option: Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }): ReturnType<typeof Taro.uploadFile>",
814
- "parameters": [
815
- {
816
- "name": "option",
817
- "optional": false,
818
- "type": "Omit<Taro.uploadFile.Option, \"url\" | \"name\"> & { url?: string; name?: string; }",
819
- "description": "请求、上传或下载的配置对象。",
820
- "fields": [
821
- {
822
- "name": "filePath",
823
- "optional": false,
824
- "type": "string",
825
- "description": "要上传文件资源的路径"
826
- },
827
- {
828
- "name": "header",
829
- "optional": true,
830
- "type": "TaroGeneral.IAnyObject | undefined",
831
- "description": "HTTP 请求 Header,Header 中不能设置 Referer"
832
- },
833
- {
834
- "name": "formData",
835
- "optional": true,
836
- "type": "TaroGeneral.IAnyObject | undefined",
837
- "description": "HTTP 请求中其他额外的 form data"
838
- },
839
- {
840
- "name": "timeout",
841
- "optional": true,
842
- "type": "number | undefined",
843
- "description": "超时时间,单位为毫秒"
844
- },
845
- {
846
- "name": "fileName",
847
- "optional": true,
848
- "type": "string | undefined",
849
- "description": "上传的文件名"
850
- },
851
- {
852
- "name": "withCredentials",
853
- "optional": true,
854
- "type": "boolean | undefined",
855
- "description": "是否应使用传出凭据 (cookie) 发送此请求"
856
- },
857
- {
858
- "name": "complete",
859
- "optional": true,
860
- "type": "((res: TaroGeneral.CallbackResult) => void) | undefined",
861
- "description": "接口调用结束的回调函数(调用成功、失败都会执行)"
862
- },
863
- {
864
- "name": "fail",
865
- "optional": true,
866
- "type": "((res: TaroGeneral.CallbackResult) => void) | undefined",
867
- "description": "接口调用失败的回调函数"
868
- },
869
- {
870
- "name": "success",
871
- "optional": true,
872
- "type": "((result: Taro.uploadFile.SuccessCallbackResult) => void) | undefined",
873
- "description": "接口调用成功的回调函数"
874
- },
875
- {
876
- "name": "url",
877
- "optional": true,
878
- "type": "string | undefined",
879
- "description": "请求地址。"
880
- },
881
- {
882
- "name": "name",
883
- "optional": true,
884
- "type": "string | undefined"
885
- }
886
- ]
887
- }
888
- ],
889
- "returns": {
890
- "type": "Taro.UploadTask.UploadTaskPromise",
891
- "promise": true,
892
- "resolvesTo": "Taro.uploadFile.SuccessCallbackResult",
893
- "fields": [
894
- {
895
- "name": "data",
896
- "optional": false,
897
- "type": "string",
898
- "description": "开发者服务器返回的数据"
899
- },
900
- {
901
- "name": "statusCode",
902
- "optional": false,
903
- "type": "number",
904
- "description": "开发者服务器返回的 HTTP 状态码"
905
- },
906
- {
907
- "name": "errMsg",
908
- "optional": false,
909
- "type": "string",
910
- "description": "调用结果"
911
- },
912
- {
913
- "name": "header",
914
- "optional": true,
915
- "type": "TaroGeneral.IAnyObject | undefined",
916
- "description": "开发者服务器返回的 HTTP Response Header"
917
- },
918
- {
919
- "name": "cookies",
920
- "optional": true,
921
- "type": "string[] | undefined",
922
- "description": "cookies"
923
- }
924
- ]
925
- }
926
- },
927
- {
928
- "name": "downloadFile",
929
- "description": "下载文件并返回平台下载结果。",
930
- "signature": "(option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }): ReturnType<typeof Taro.downloadFile>",
931
- "parameters": [
932
- {
933
- "name": "option",
934
- "optional": false,
935
- "type": "Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }",
936
- "description": "请求、上传或下载的配置对象。",
937
- "fields": [
938
- {
939
- "name": "filePath",
940
- "optional": true,
941
- "type": "string | undefined",
942
- "description": "指定文件下载后存储的路径"
943
- },
944
- {
945
- "name": "header",
946
- "optional": true,
947
- "type": "TaroGeneral.IAnyObject | undefined",
948
- "description": "HTTP 请求的 Header,Header 中不能设置 Referer"
949
- },
950
- {
951
- "name": "timeout",
952
- "optional": true,
953
- "type": "number | undefined",
954
- "description": "超时时间,单位为毫秒"
955
- },
956
- {
957
- "name": "withCredentials",
958
- "optional": true,
959
- "type": "boolean | undefined",
960
- "description": "是否应使用传出凭据 (cookie) 发送此请求"
961
- },
962
- {
963
- "name": "complete",
964
- "optional": true,
965
- "type": "((res: TaroGeneral.CallbackResult) => void) | undefined",
966
- "description": "接口调用结束的回调函数(调用成功、失败都会执行)"
967
- },
968
- {
969
- "name": "fail",
970
- "optional": true,
971
- "type": "((res: TaroGeneral.CallbackResult) => void) | undefined",
972
- "description": "接口调用失败的回调函数"
973
- },
974
- {
975
- "name": "success",
976
- "optional": true,
977
- "type": "((result: Taro.downloadFile.FileSuccessCallbackResult) => void) | undefined",
978
- "description": "接口调用成功的回调函数"
979
- },
980
- {
981
- "name": "url",
982
- "optional": true,
983
- "type": "string | undefined",
984
- "description": "请求地址。"
985
- }
986
- ]
987
- }
988
- ],
989
- "returns": {
990
- "type": "Taro.DownloadTask.DownloadTaskPromise",
991
- "promise": true,
992
- "resolvesTo": "Taro.downloadFile.FileSuccessCallbackResult",
993
- "fields": [
994
- {
995
- "name": "filePath",
996
- "optional": false,
997
- "type": "string",
998
- "description": "用户文件路径。传入 filePath 时会返回,跟传入的 filePath 一致"
999
- },
1000
- {
1001
- "name": "statusCode",
1002
- "optional": false,
1003
- "type": "number",
1004
- "description": "开发者服务器返回的 HTTP 状态码"
1005
- },
1006
- {
1007
- "name": "tempFilePath",
1008
- "optional": false,
1009
- "type": "string",
1010
- "description": "临时文件路径。没传入 filePath 指定文件存储路径时会返回,下载后的文件会存储到一个临时文件"
1011
- },
1012
- {
1013
- "name": "errMsg",
1014
- "optional": false,
1015
- "type": "string",
1016
- "description": "调用结果"
1017
- },
1018
- {
1019
- "name": "header",
1020
- "optional": true,
1021
- "type": "TaroGeneral.IAnyObject | undefined",
1022
- "description": "开发者服务器返回的 HTTP Response Header"
1023
- },
1024
- {
1025
- "name": "dataLength",
1026
- "optional": true,
1027
- "type": "number | undefined",
1028
- "description": "数据长度,单位 Byte"
1029
- },
1030
- {
1031
- "name": "cookies",
1032
- "optional": true,
1033
- "type": "string[] | undefined",
1034
- "description": "cookies"
1035
- },
1036
- {
1037
- "name": "profile",
1038
- "optional": true,
1039
- "type": "TaroGeneral.IAnyObject | undefined",
1040
- "description": "网络请求过程中一些调试信息"
1041
- }
1042
- ]
1043
- }
1044
- },
1045
- {
1046
- "name": "downloadFileClosedDomain",
1047
- "description": "下载文件并追加 X-Closed-Domain 标记;不改变请求目标或云服务 SERVICE_ID。",
1048
- "signature": "(option: Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }): ReturnType<typeof Taro.downloadFile>",
1049
- "parameters": [
1050
- {
1051
- "name": "option",
1052
- "optional": false,
1053
- "type": "Omit<Taro.downloadFile.Option, \"url\"> & { url?: string; }",
1054
- "description": "请求、上传或下载的配置对象。",
1055
- "fields": [
1056
- {
1057
- "name": "filePath",
1058
- "optional": true,
1059
- "type": "string | undefined",
1060
- "description": "指定文件下载后存储的路径"
1061
- },
1062
- {
1063
- "name": "header",
1064
- "optional": true,
1065
- "type": "TaroGeneral.IAnyObject | undefined",
1066
- "description": "HTTP 请求的 Header,Header 中不能设置 Referer"
1067
- },
1068
- {
1069
- "name": "timeout",
1070
- "optional": true,
1071
- "type": "number | undefined",
1072
- "description": "超时时间,单位为毫秒"
1073
- },
1074
- {
1075
- "name": "withCredentials",
1076
- "optional": true,
1077
- "type": "boolean | undefined",
1078
- "description": "是否应使用传出凭据 (cookie) 发送此请求"
1079
- },
1080
- {
1081
- "name": "complete",
1082
- "optional": true,
1083
- "type": "((res: TaroGeneral.CallbackResult) => void) | undefined",
1084
- "description": "接口调用结束的回调函数(调用成功、失败都会执行)"
1085
- },
1086
- {
1087
- "name": "fail",
1088
- "optional": true,
1089
- "type": "((res: TaroGeneral.CallbackResult) => void) | undefined",
1090
- "description": "接口调用失败的回调函数"
1091
- },
1092
- {
1093
- "name": "success",
1094
- "optional": true,
1095
- "type": "((result: Taro.downloadFile.FileSuccessCallbackResult) => void) | undefined",
1096
- "description": "接口调用成功的回调函数"
1097
- },
1098
- {
1099
- "name": "url",
1100
- "optional": true,
1101
- "type": "string | undefined",
1102
- "description": "请求地址。"
1103
- }
1104
- ]
1105
- }
1106
- ],
1107
- "returns": {
1108
- "type": "Taro.DownloadTask.DownloadTaskPromise",
1109
- "promise": true,
1110
- "resolvesTo": "Taro.downloadFile.FileSuccessCallbackResult",
1111
- "fields": [
1112
- {
1113
- "name": "filePath",
604
+ "name": "filePath",
1114
605
  "optional": false,
1115
606
  "type": "string",
1116
607
  "description": "用户文件路径。传入 filePath 时会返回,跟传入的 filePath 一致"
@@ -1225,72 +716,6 @@
1225
716
  }
1226
717
  ]
1227
718
  }
1228
- },
1229
- {
1230
- "name": "streamSseClosedDomain",
1231
- "description": "建立带 X-Closed-Domain 标记的服务端事件流;不改变请求目标或云服务 SERVICE_ID。",
1232
- "signature": "(option: { url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }): Promise<{ close: () => void; }>",
1233
- "parameters": [
1234
- {
1235
- "name": "option",
1236
- "optional": false,
1237
- "type": "{ url: string; method?: string; data?: unknown; header?: Record<string, unknown>; onMessage(frame: string): void; onError?(error: Error): void; onComplete?(): void; }",
1238
- "description": "请求、上传或下载的配置对象。",
1239
- "fields": [
1240
- {
1241
- "name": "url",
1242
- "optional": false,
1243
- "type": "string",
1244
- "description": "请求地址。"
1245
- },
1246
- {
1247
- "name": "method",
1248
- "optional": true,
1249
- "type": "string | undefined",
1250
- "description": "HTTP 请求方法。"
1251
- },
1252
- {
1253
- "name": "data",
1254
- "optional": true,
1255
- "type": "unknown",
1256
- "description": "请求负载。"
1257
- },
1258
- {
1259
- "name": "header",
1260
- "optional": true,
1261
- "type": "Record<string, unknown> | undefined",
1262
- "description": "请求头。"
1263
- },
1264
- {
1265
- "name": "onMessage",
1266
- "optional": false,
1267
- "type": "(frame: string) => void"
1268
- },
1269
- {
1270
- "name": "onError",
1271
- "optional": true,
1272
- "type": "((error: Error) => void) | undefined"
1273
- },
1274
- {
1275
- "name": "onComplete",
1276
- "optional": true,
1277
- "type": "(() => void) | undefined"
1278
- }
1279
- ]
1280
- }
1281
- ],
1282
- "returns": {
1283
- "type": "Promise<{ close: () => void; }>",
1284
- "promise": true,
1285
- "resolvesTo": "{ close: () => void; }",
1286
- "fields": [
1287
- {
1288
- "name": "close",
1289
- "optional": false,
1290
- "type": "() => void"
1291
- }
1292
- ]
1293
- }
1294
719
  }
1295
720
  ]
1296
721
  }