@tarojs/taro 4.0.0-canary.8 → 4.0.0-canary.9

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 (63) hide show
  1. package/package.json +10 -5
  2. package/types/api/base/debug.d.ts +8 -8
  3. package/types/api/base/env.d.ts +1 -1
  4. package/types/api/base/index.d.ts +3 -3
  5. package/types/api/base/system.d.ts +6 -6
  6. package/types/api/base/weapp/app-event.d.ts +10 -10
  7. package/types/api/base/weapp/life-cycle.d.ts +1 -1
  8. package/types/api/canvas/index.d.ts +367 -63
  9. package/types/api/device/battery.d.ts +1 -1
  10. package/types/api/device/clipboard.d.ts +2 -2
  11. package/types/api/device/keyboard.d.ts +1 -1
  12. package/types/api/device/network.d.ts +3 -3
  13. package/types/api/device/phone.d.ts +1 -1
  14. package/types/api/device/screen.d.ts +2 -2
  15. package/types/api/files/index.d.ts +7 -7
  16. package/types/api/framework/index.d.ts +2 -2
  17. package/types/api/location/index.d.ts +4 -4
  18. package/types/api/media/audio.d.ts +11 -11
  19. package/types/api/media/background-audio.d.ts +1 -1
  20. package/types/api/media/image.d.ts +5 -5
  21. package/types/api/media/video.d.ts +11 -11
  22. package/types/api/navigate/index.d.ts +1 -1
  23. package/types/api/network/download.d.ts +5 -5
  24. package/types/api/network/request.d.ts +5 -5
  25. package/types/api/network/upload.d.ts +7 -7
  26. package/types/api/network/websocket.d.ts +8 -8
  27. package/types/api/open-api/account.d.ts +1 -1
  28. package/types/api/open-api/address.d.ts +13 -5
  29. package/types/api/open-api/authorize.d.ts +1 -1
  30. package/types/api/open-api/bookshelf.d.ts +307 -0
  31. package/types/api/open-api/channels.d.ts +16 -0
  32. package/types/api/open-api/device-voip.d.ts +40 -0
  33. package/types/api/open-api/invoice.d.ts +1 -1
  34. package/types/api/open-api/login.d.ts +15 -2
  35. package/types/api/open-api/privacy.d.ts +8 -0
  36. package/types/api/open-api/settings.d.ts +3 -2
  37. package/types/api/open-api/sticker.d.ts +83 -0
  38. package/types/api/open-api/subscribe-message.d.ts +148 -6
  39. package/types/api/open-api/user-info.d.ts +6 -1
  40. package/types/api/qq/index.d.ts +306 -1
  41. package/types/api/route/index.d.ts +5 -5
  42. package/types/api/storage/index.d.ts +10 -10
  43. package/types/api/swan/download-package.d.ts +80 -0
  44. package/types/api/swan/index.d.ts +151 -0
  45. package/types/api/swan/pay.d.ts +139 -0
  46. package/types/api/taro.extend.d.ts +2 -1
  47. package/types/api/taro.hooks.d.ts +9 -9
  48. package/types/api/ui/animation.d.ts +32 -32
  49. package/types/api/ui/custom-component.d.ts +1 -1
  50. package/types/api/ui/fonts.d.ts +1 -1
  51. package/types/api/ui/interaction.d.ts +6 -6
  52. package/types/api/ui/menu.d.ts +1 -1
  53. package/types/api/ui/navigation-bar.d.ts +2 -2
  54. package/types/api/ui/pull-down-refresh.d.ts +2 -2
  55. package/types/api/ui/scroll.d.ts +1 -1
  56. package/types/api/ui/tab-bar.d.ts +8 -8
  57. package/types/api/ui/window.d.ts +2 -2
  58. package/types/api/wxml/index.d.ts +17 -17
  59. package/types/compile/compiler.d.ts +2 -0
  60. package/types/global.d.ts +2 -1
  61. package/types/index.d.ts +13 -4
  62. package/types/taro.api.d.ts +22 -14
  63. package/types/taro.config.d.ts +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/taro",
3
- "version": "4.0.0-canary.8",
3
+ "version": "4.0.0-canary.9",
4
4
  "description": "Taro framework",
5
5
  "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
6
6
  "main": "index.js",
@@ -21,12 +21,17 @@
21
21
  "author": "O2Team",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@tarojs/api": "4.0.0-canary.8",
25
- "@tarojs/runtime": "4.0.0-canary.8"
24
+ "@tarojs/api": "4.0.0-canary.9"
26
25
  },
27
26
  "devDependencies": {
28
- "@tarojs/helper": "4.0.0-canary.8",
29
- "@tarojs/shared": "4.0.0-canary.8"
27
+ "@tarojs/helper": "4.0.0-canary.9",
28
+ "@tarojs/shared": "4.0.0-canary.9",
29
+ "@tarojs/runtime": "4.0.0-canary.9"
30
+ },
31
+ "peerDependencies": {
32
+ "@tarojs/helper": "~4.0.0-canary.9",
33
+ "@tarojs/shared": "~4.0.0-canary.9",
34
+ "@tarojs/runtime": "~4.0.0-canary.9"
30
35
  },
31
36
  "peerDependenciesMeta": {
32
37
  "@types/react": {
@@ -39,12 +39,12 @@ declare module '../../index' {
39
39
  * **注意**
40
40
  * - 由于 vConsole 功能有限,以及不同客户端对 console 方法的支持情况有差异,建议开发者在小程序中只使用本文档中提供的方法。
41
41
  * - 部分内容展示的限制请参见调试
42
- * @supported weapp
42
+ * @supported weapp, harmony_hybrid
43
43
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.html
44
44
  */
45
45
  interface console {
46
46
  /** 向调试面板中打印 debug 日志
47
- * @supported weapp
47
+ * @supported weapp, harmony_hybrid
48
48
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.debug.html
49
49
  */
50
50
  debug(
@@ -52,7 +52,7 @@ declare module '../../index' {
52
52
  ...args: any[]
53
53
  ): void
54
54
  /** 向调试面板中打印 error 日志
55
- * @supported weapp
55
+ * @supported weapp, harmony_hybrid
56
56
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.error.html
57
57
  */
58
58
  error(
@@ -63,7 +63,7 @@ declare module '../../index' {
63
63
  *
64
64
  * **注意**
65
65
  * 仅在工具中有效,在 vConsole 中为空函数实现。
66
- * @supported weapp
66
+ * @supported weapp, harmony_hybrid
67
67
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.group.html
68
68
  */
69
69
  group(
@@ -74,12 +74,12 @@ declare module '../../index' {
74
74
  *
75
75
  * **注意**
76
76
  * 仅在工具中有效,在 vConsole 中为空函数实现。
77
- * @supported weapp
77
+ * @supported weapp, harmony_hybrid
78
78
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.groupEnd.html
79
79
  */
80
80
  groupEnd(): void
81
81
  /** 向调试面板中打印 info 日志
82
- * @supported weapp
82
+ * @supported weapp, harmony_hybrid
83
83
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.info.html
84
84
  */
85
85
  info(
@@ -87,7 +87,7 @@ declare module '../../index' {
87
87
  ...args: any[]
88
88
  ): void
89
89
  /** 向调试面板中打印 log 日志
90
- * @supported weapp, tt
90
+ * @supported weapp, tt, harmony_hybrid
91
91
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.log.html
92
92
  */
93
93
  log(
@@ -95,7 +95,7 @@ declare module '../../index' {
95
95
  ...args: any[]
96
96
  ): void
97
97
  /** 向调试面板中打印 warn 日志
98
- * @supported weapp
98
+ * @supported weapp, harmony_hybrid
99
99
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.warn.html
100
100
  */
101
101
  warn(
@@ -3,7 +3,7 @@ import Taro from '../../index'
3
3
  declare module '../../index' {
4
4
  interface TaroStatic {
5
5
  /**
6
- * @supported weapp, h5, rn
6
+ * @supported weapp, h5, rn, harmony_hybrid
7
7
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/env/envObj.html
8
8
  */
9
9
  env: {
@@ -3,7 +3,7 @@ import Taro from '../../index'
3
3
  declare module '../../index' {
4
4
  interface TaroStatic {
5
5
  /** 判断小程序的 API,回调,参数,组件等是否在当前版本可用。
6
- * @supported weapp, tt, h5
6
+ * @supported weapp, tt, h5, harmony_hybrid
7
7
  * @example
8
8
  * ```tsx
9
9
  * Taro.canIUse('openBluetoothAdapter')
@@ -44,7 +44,7 @@ declare module '../../index' {
44
44
 
45
45
  /**
46
46
  * 将 Base64 字符串转成 ArrayBuffer 数据。
47
- * @supported weapp, h5, rn, tt
47
+ * @supported weapp, h5, rn, tt, harmony_hybrid
48
48
  * @example
49
49
  * ```tsx
50
50
  * const base64 = 'CxYh'
@@ -59,7 +59,7 @@ declare module '../../index' {
59
59
 
60
60
  /**
61
61
  * 将 ArrayBuffer 数据转成 Base64 字符串。
62
- * @supported weapp, h5, rn, tt
62
+ * @supported weapp, h5, rn, tt, harmony_hybrid
63
63
  * @example
64
64
  * ```tsx
65
65
  * const arrayBuffer = new Uint8Array([11, 22, 33])
@@ -510,7 +510,7 @@ declare module '../../index' {
510
510
  openAppAuthorizeSetting(option: openAppAuthorizeSetting.Option): Promise<TaroGeneral.CallbackResult>
511
511
 
512
512
  /** 获取窗口信息
513
- * @supported weapp
513
+ * @supported weapp, harmony_hybrid
514
514
  * @h5 不支持 statusBarHeight、safeArea
515
515
  * @example
516
516
  * ```tsx
@@ -530,7 +530,7 @@ declare module '../../index' {
530
530
  getWindowInfo(): getWindowInfo.Result
531
531
 
532
532
  /** 获取设备设置
533
- * @supported weapp, h5
533
+ * @supported weapp, h5, harmony_hybrid
534
534
  * @h5 不支持 bluetoothEnabled、locationEnabled、wifiEnabled
535
535
  * @example
536
536
  * ```tsx
@@ -546,7 +546,7 @@ declare module '../../index' {
546
546
  getSystemSetting(): getSystemSetting.Result
547
547
 
548
548
  /** [Taro.getSystemInfo](./getSystemInfo) 的同步版本
549
- * @supported weapp, h5, rn, tt, harmony
549
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
550
550
  * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
551
551
  * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
552
552
  * @example
@@ -591,7 +591,7 @@ declare module '../../index' {
591
591
  getSystemInfoAsync(res?: getSystemInfoAsync.Option): Promise<getSystemInfo.Result>
592
592
 
593
593
  /** 获取系统信息,支持 `Promise` 化使用。
594
- * @supported weapp, h5, rn, tt, harmony
594
+ * @supported weapp, h5, rn, tt, harmony, harmony_hybrid
595
595
  * @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
596
596
  * @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
597
597
  * @example
@@ -659,7 +659,7 @@ declare module '../../index' {
659
659
  getDeviceInfo(): getDeviceInfo.Result
660
660
 
661
661
  /** 获取微信APP基础信息
662
- * @supported weapp, h5
662
+ * @supported weapp, h5, harmony_hybrid
663
663
  * @h5 不支持 SDKVersion、host、version
664
664
  * @example
665
665
  * ```tsx
@@ -681,7 +681,7 @@ declare module '../../index' {
681
681
  * - 'authorized' 表示已经获得授权,无需再次请求授权;
682
682
  * - 'denied' 表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户[打开系统设置](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),在设置页中打开权限)
683
683
  * - 'non determined' 表示尚未请求授权,会在微信下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关)
684
- * @supported weapp, h5
684
+ * @supported weapp, h5, harmony_hybrid
685
685
  * @h5 暂未支持设置权限
686
686
  * @example
687
687
  * ```tsx
@@ -113,7 +113,7 @@ declare module '../../../index' {
113
113
  *
114
114
  * **注意**
115
115
  * - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。
116
- * @supported weapp, tt, h5, harmony
116
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
117
117
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html
118
118
  */
119
119
  onUnhandledRejection<T = any>(callback: onUnhandledRejection.Callback<T>): void
@@ -131,13 +131,13 @@ declare module '../../../index' {
131
131
  * - 开发者可以在回调中进行页面重定向,但必须在回调中**同步**处理,异步处理(例如 `setTimeout` 异步执行)无效。
132
132
  * - 若开发者没有调用 [Taro.onPageNotFound](/docs/apis/base/weapp/app-event/onPageNotFound) 绑定监听,也没有声明 `App.onPageNotFound`,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。
133
133
  * - 如果回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再第二次回调。
134
- * @supported weapp, tt, h5
134
+ * @supported weapp, tt, h5, harmony_hybrid
135
135
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onPageNotFound.html
136
136
  */
137
137
  onPageNotFound(callback: onPageNotFound.Callback): void
138
138
 
139
139
  /** 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) 的回调时机与参数一致。
140
- * @supported weapp, tt, h5, harmony
140
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
141
141
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html
142
142
  */
143
143
  onError(callback: onError.Callback): void
@@ -178,7 +178,7 @@ declare module '../../../index' {
178
178
  * **注意**
179
179
  *
180
180
  * 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。
181
- * @supported weapp, tt, h5
181
+ * @supported weapp, tt, h5, harmony_hybrid
182
182
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppShow.html
183
183
  */
184
184
  onAppShow(
@@ -187,7 +187,7 @@ declare module '../../../index' {
187
187
  ): void
188
188
 
189
189
  /** 监听小程序切后台事件。该事件与 [`App.onHide`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onhide) 的回调时机一致。
190
- * @supported weapp, tt, h5
190
+ * @supported weapp, tt, h5, harmony_hybrid
191
191
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppHide.html
192
192
  */
193
193
  onAppHide(
@@ -196,7 +196,7 @@ declare module '../../../index' {
196
196
  ): void
197
197
 
198
198
  /** 取消监听未处理的 Promise 拒绝事件
199
- * @supported weapp, tt, h5, harmony
199
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
200
200
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html
201
201
  */
202
202
  offUnhandledRejection<T = any>(callback: onUnhandledRejection.Callback<T>): void
@@ -208,7 +208,7 @@ declare module '../../../index' {
208
208
  offThemeChange(callback: onThemeChange.Callback): void
209
209
 
210
210
  /** 取消监听小程序要打开的页面不存在事件
211
- * @supported weapp, tt, h5
211
+ * @supported weapp, tt, h5, harmony_hybrid
212
212
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offPageNotFound.html
213
213
  */
214
214
  offPageNotFound(
@@ -217,7 +217,7 @@ declare module '../../../index' {
217
217
  ): void
218
218
 
219
219
  /** 取消监听音频播放错误事件
220
- * @supported weapp, tt, h5, harmony
220
+ * @supported weapp, tt, h5, harmony, harmony_hybrid
221
221
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html
222
222
  */
223
223
 
@@ -245,7 +245,7 @@ declare module '../../../index' {
245
245
  ): void
246
246
 
247
247
  /** 取消监听小程序切前台事件
248
- * @supported weapp, tt, h5
248
+ * @supported weapp, tt, h5, harmony_hybrid
249
249
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppShow.html
250
250
  */
251
251
  offAppShow(
@@ -254,7 +254,7 @@ declare module '../../../index' {
254
254
  ): void
255
255
 
256
256
  /** 取消监听小程序切后台事件
257
- * @supported weapp, tt, h5
257
+ * @supported weapp, tt, h5, harmony_hybrid
258
258
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppHide.html
259
259
  */
260
260
  offAppHide(
@@ -137,7 +137,7 @@ declare module '../../../index' {
137
137
  *
138
138
  * **注意**
139
139
  * 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。
140
- * @supported weapp, tt
140
+ * @supported weapp, tt, harmony_hybrid
141
141
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html
142
142
  */
143
143
  getLaunchOptionsSync(): getLaunchOptionsSync.LaunchOptions