@tarojs/taro 3.4.0-beta.2 → 3.4.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.
Files changed (95) hide show
  1. package/package.json +5 -7
  2. package/types/api/ai/face.d.ts +133 -0
  3. package/types/api/ai/visionkit.d.ts +303 -0
  4. package/types/api/base/crypto.d.ts +90 -0
  5. package/types/api/base/debug.d.ts +152 -13
  6. package/types/api/base/env.d.ts +2 -1
  7. package/types/api/base/index.d.ts +10 -2
  8. package/types/api/base/performance.d.ts +195 -0
  9. package/types/api/base/system.d.ts +539 -101
  10. package/types/api/base/update.d.ts +59 -7
  11. package/types/api/base/weapp/app-event.d.ts +49 -26
  12. package/types/api/base/weapp/life-cycle.d.ts +141 -1
  13. package/types/api/canvas/index.d.ts +171 -136
  14. package/types/api/cloud/index.d.ts +2 -2
  15. package/types/api/device/accelerometer.d.ts +3 -3
  16. package/types/api/device/accessibility.d.ts +26 -0
  17. package/types/api/device/battery.d.ts +2 -2
  18. package/types/api/device/{ble.d.ts → bluetooth-ble.d.ts} +228 -62
  19. package/types/api/device/bluetooth-peripheral.d.ts +430 -0
  20. package/types/api/device/bluetooth.d.ts +67 -2
  21. package/types/api/device/calendar.d.ts +88 -0
  22. package/types/api/device/contact.d.ts +74 -50
  23. package/types/api/device/gyroscope.d.ts +5 -5
  24. package/types/api/device/iBeacon.d.ts +33 -19
  25. package/types/api/{ui → device}/keyboard.d.ts +0 -0
  26. package/types/api/device/{performance.d.ts → memory.d.ts} +4 -4
  27. package/types/api/device/motion.d.ts +3 -3
  28. package/types/api/device/network.d.ts +53 -12
  29. package/types/api/device/nfc.d.ts +1089 -13
  30. package/types/api/device/scan.d.ts +1 -1
  31. package/types/api/device/screen.d.ts +40 -12
  32. package/types/api/device/wifi.d.ts +41 -6
  33. package/types/api/files/index.d.ts +371 -184
  34. package/types/api/location/index.d.ts +116 -55
  35. package/types/api/media/audio.d.ts +653 -60
  36. package/types/api/media/background-audio.d.ts +47 -41
  37. package/types/api/media/camera.d.ts +38 -19
  38. package/types/api/media/editor.d.ts +22 -2
  39. package/types/api/media/image.d.ts +54 -105
  40. package/types/api/media/live.d.ts +66 -6
  41. package/types/api/media/map.d.ts +469 -49
  42. package/types/api/media/media-recorder.d.ts +92 -0
  43. package/types/api/media/recorder.d.ts +20 -20
  44. package/types/api/media/video-decoder.d.ts +117 -0
  45. package/types/api/media/video-processing.d.ts +11 -7
  46. package/types/api/media/video.d.ts +327 -39
  47. package/types/api/media/voip.d.ts +290 -0
  48. package/types/api/{open-api/navigate.d.ts → navigate/index.d.ts} +63 -27
  49. package/types/api/network/download.d.ts +39 -16
  50. package/types/api/network/request.d.ts +143 -38
  51. package/types/api/network/tcp.d.ts +181 -0
  52. package/types/api/network/udp.d.ts +154 -83
  53. package/types/api/network/upload.d.ts +41 -25
  54. package/types/api/network/websocket.d.ts +16 -15
  55. package/types/api/open-api/authorize.d.ts +41 -2
  56. package/types/api/open-api/channels.d.ts +178 -0
  57. package/types/api/open-api/customer-service.d.ts +1 -1
  58. package/types/api/open-api/facial.d.ts +3 -0
  59. package/types/api/open-api/favorites.d.ts +100 -0
  60. package/types/api/open-api/group.d.ts +59 -0
  61. package/types/api/open-api/invoice.d.ts +2 -2
  62. package/types/api/open-api/license-plate.d.ts +27 -0
  63. package/types/api/open-api/login.d.ts +21 -0
  64. package/types/api/open-api/redpackage.d.ts +24 -0
  65. package/types/api/open-api/settings.d.ts +76 -14
  66. package/types/api/open-api/soter.d.ts +2 -2
  67. package/types/api/open-api/subscribe-message.d.ts +88 -3
  68. package/types/api/open-api/user-info.d.ts +55 -18
  69. package/types/api/open-api/werun.d.ts +33 -6
  70. package/types/api/payment/index.d.ts +119 -0
  71. package/types/api/route/index.d.ts +13 -9
  72. package/types/api/share/index.d.ts +192 -9
  73. package/types/api/storage/index.d.ts +29 -83
  74. package/types/api/swan/index.d.ts +1 -1
  75. package/types/api/ui/animation.d.ts +84 -70
  76. package/types/api/ui/background.d.ts +4 -2
  77. package/types/api/ui/custom-component.d.ts +1 -1
  78. package/types/api/ui/fonts.d.ts +27 -31
  79. package/types/api/ui/navigation-bar.d.ts +1 -0
  80. package/types/api/ui/scroll.d.ts +73 -7
  81. package/types/api/ui/sticky.d.ts +4 -4
  82. package/types/api/ui/tab-bar.d.ts +7 -7
  83. package/types/api/ui/window.d.ts +22 -2
  84. package/types/api/worker/index.d.ts +9 -1
  85. package/types/api/wxml/index.d.ts +143 -105
  86. package/types/compile.d.ts +111 -106
  87. package/types/global.d.ts +142 -111
  88. package/types/taro.api.d.ts +79 -62
  89. package/types/taro.component.d.ts +82 -60
  90. package/types/taro.config.d.ts +174 -170
  91. package/types/taro.extend.d.ts +0 -17
  92. package/types/taro.hooks.d.ts +12 -12
  93. package/types/taro.lifecycle.d.ts +7 -0
  94. package/h5.js +0 -4
  95. package/types/api/open-api/payment.d.ts +0 -61
@@ -1,6 +1,17 @@
1
1
  import Taro from '../../index'
2
2
 
3
3
  declare module '../../index' {
4
+ namespace updateWeChatApp {
5
+ interface Option {
6
+ /** 接口调用成功的回调函数 */
7
+ success?: (res: TaroGeneral.CallbackResult) => void
8
+ /** 接口调用失败的回调函数 */
9
+ fail?: (res: TaroGeneral.CallbackResult) => void
10
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
11
+ complete?: (res: TaroGeneral.CallbackResult) => void
12
+ }
13
+ }
14
+
4
15
  namespace UpdateManager {
5
16
  /** 向微信后台请求检查更新结果事件的回调函数 */
6
17
  type OnCheckForUpdateCallback = (
@@ -13,37 +24,78 @@ declare module '../../index' {
13
24
  }
14
25
 
15
26
  /** UpdateManager 对象,用来管理更新,可通过 Taro.getUpdateManager 接口获取实例。
27
+ *
28
+ * **Tips**
29
+ * - 微信开发者工具上可以通过「编译模式」下的「下次编译模拟更新」开关来调试
30
+ * - 小程序开发版/体验版没有「版本」概念,所以无法在开发版/体验版上测试更版本更新情况
31
+ * @supported weapp
32
+ * @example
33
+ * ```tsx
34
+ * const updateManager = Taro.getUpdateManager()
35
+ *
36
+ * updateManager.onCheckForUpdate(function (res) {
37
+ * // 请求完新版本信息的回调
38
+ * console.log(res.hasUpdate)
39
+ * })
40
+ *
41
+ * updateManager.onUpdateReady(function () {
42
+ * wx.showModal({
43
+ * title: '更新提示',
44
+ * content: '新版本已经准备好,是否重启应用?',
45
+ * success: function (res) {
46
+ * if (res.confirm) {
47
+ * // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
48
+ * updateManager.applyUpdate()
49
+ * }
50
+ * }
51
+ * })
52
+ * })
53
+ *
54
+ * updateManager.onUpdateFailed(function () {
55
+ * // 新版本下载失败
56
+ * })
57
+ * ```
16
58
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html
17
59
  */
18
60
  interface UpdateManager {
19
61
  /** 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 `onUpdateReady` 回调)调用。
62
+ * @supported weapp
20
63
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.applyUpdate.html
21
64
  */
22
65
  applyUpdate(): void
23
66
  /** 监听向微信后台请求检查更新结果事件。微信在小程序冷启动时自动检查更新,不需由开发者主动触发。
67
+ * @supported weapp
24
68
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onCheckForUpdate.html
25
69
  */
26
70
  onCheckForUpdate(
27
71
  /** 向微信后台请求检查更新结果事件的回调函数 */
28
72
  callback: UpdateManager.OnCheckForUpdateCallback,
29
73
  ): void
30
- /** 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调
31
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateFailed.html
32
- */
33
- onUpdateFailed(
34
- /** 小程序更新失败事件的回调函数 */
35
- callback: (res: TaroGeneral.CallbackResult) => void,
36
- ): void
37
74
  /** 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调
75
+ * @supported weapp
38
76
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateReady.html
39
77
  */
40
78
  onUpdateReady(
41
79
  /** 小程序有版本更新事件的回调函数 */
42
80
  callback: (res: TaroGeneral.CallbackResult) => void,
43
81
  ): void
82
+ /** 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调
83
+ * @supported weapp
84
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateFailed.html
85
+ */
86
+ onUpdateFailed(
87
+ /** 小程序更新失败事件的回调函数 */
88
+ callback: (res: TaroGeneral.CallbackResult) => void,
89
+ ): void
44
90
  }
45
91
 
46
92
  interface TaroStatic {
93
+ /** 更新客户端版本。当判断用户小程序所在客户端版本过低时,可使用该接口跳转到更新微信页面。
94
+ * @supported weapp
95
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/wx.updateWeChatApp.html
96
+ */
97
+ updateWeChatApp(option: updateWeChatApp.Option): Promise<TaroGeneral.CallbackResult>
98
+
47
99
  /**
48
100
  * 获取**全局唯一**的版本更新管理器,用于管理小程序更新。
49
101
  * 关于小程序的更新机制,可以查看[运行机制](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/operating-mechanism.html)文档。
@@ -9,7 +9,7 @@ declare module '../../../index' {
9
9
  path: string
10
10
  /** 打开不存在页面的 query 参数 */
11
11
  query: TaroGeneral.IAnyObject
12
- }
12
+ }
13
13
  /** 小程序要打开的页面不存在事件的回调函数 */
14
14
  type Callback = (res: Result) => void
15
15
  }
@@ -44,30 +44,53 @@ declare module '../../../index' {
44
44
  }
45
45
  }
46
46
 
47
- namespace themeChange {
47
+ namespace onUnhandledRejection {
48
+ type Callback<T = any> = (res: Result<T>) => void
49
+ type Result<T = any> = {
50
+ /** 拒绝原因,一般是一个 Error 对象 */
51
+ reason: string | Error
52
+ /** 被拒绝的 Promise 对象 */
53
+ promise: Promise<T>
54
+ }
55
+ }
56
+
57
+ namespace onThemeChange {
58
+ /** 系统主题改变事件的回调函数 */
59
+ type Callback = (res: Result) => void
60
+ interface Result {
61
+ /** 系统当前的主题,取值为`light`或`dark` */
62
+ theme: keyof ITheme
63
+ }
48
64
  interface ITheme {
49
65
  /** 浅色主题 */
50
66
  light
51
67
  /** 深色主题 */
52
68
  dark
53
69
  }
54
- interface onThemeChangeResult {
55
- /** 系统当前的主题,取值为`light`或`dark` */
56
- theme: keyof ITheme
57
- }
58
- /** 系统主题改变事件的回调函数 */
59
- type onThemeChangeCallback = (res: onThemeChangeResult) => void
60
- /** 系统主题改变事件的回调函数 */
61
- type offThemeChangeCallback = (res: TaroGeneral.CallbackResult) => void
62
70
  }
63
71
 
64
72
  interface TaroStatic {
73
+ /** 监听未处理的 Promise 拒绝事件。该事件与 [`App.onUnhandledRejection`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onUnhandledRejection-Object-object) 的回调时机与参数一致。
74
+ *
75
+ * **注意**
76
+ * - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。
77
+ * @supported weapp
78
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html
79
+ */
80
+ onUnhandledRejection<T = any>(callback: onUnhandledRejection.Callback<T>): void
81
+
82
+ /** 监听系统主题改变事件。该事件与 [`App.onThemeChange`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onThemeChange-Object-object) 的回调时机一致。
83
+ * @supported weapp
84
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onThemeChange.html
85
+ */
86
+ onThemeChange(callback: onThemeChange.Callback): void
87
+
65
88
  /**
66
89
  * 监听小程序要打开的页面不存在事件。该事件与 [`App.onPageNotFound`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onpagenotfoundobject-object) 的回调时机一致。
67
90
  *
68
91
  * **注意**
69
92
  * - 开发者可以在回调中进行页面重定向,但必须在回调中**同步**处理,异步处理(例如 `setTimeout` 异步执行)无效。
70
- * - 若开发者没有调用 [Taro.onPageNotFound](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onPageNotFound.html) 绑定监听,也没有声明 `App.onPageNotFound`,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。
93
+ * - 若开发者没有调用 [Taro.onPageNotFound](/docs/apis/base/weapp/app-event/onPageNotFound) 绑定监听,也没有声明 `App.onPageNotFound`,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。
71
94
  * - 如果回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再第二次回调。
72
95
  * @supported weapp, h5
73
96
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onPageNotFound.html
@@ -130,16 +153,28 @@ declare module '../../../index' {
130
153
  */
131
154
  onAppHide(
132
155
  /** 小程序切后台事件的回调函数 */
133
- callback: (res: TaroGeneral.CallbackResult) => void,
156
+ callback: (res: onAppShow.CallbackResult) => void,
134
157
  ): void
135
158
 
159
+ /** 取消监听未处理的 Promise 拒绝事件
160
+ * @supported weapp
161
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html
162
+ */
163
+ offUnhandledRejection<T = any>(callback: onUnhandledRejection.Callback<T>): void
164
+
165
+ /** 取消监听系统主题改变事件
166
+ * @supported weapp
167
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offThemeChange.html
168
+ */
169
+ offThemeChange(callback: onThemeChange.Callback): void
170
+
136
171
  /** 取消监听小程序要打开的页面不存在事件
137
172
  * @supported weapp
138
173
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offPageNotFound.html
139
174
  */
140
175
  offPageNotFound(
141
176
  /** 小程序要打开的页面不存在事件的回调函数 */
142
- callback: (res: TaroGeneral.CallbackResult) => void,
177
+ callback: (res: onPageNotFound.Callback) => void,
143
178
  ): void
144
179
 
145
180
  /** 取消监听音频播放错误事件
@@ -149,7 +184,7 @@ declare module '../../../index' {
149
184
 
150
185
  offError(
151
186
  /** 音频播放错误事件的回调函数 */
152
- callback: (res: TaroGeneral.CallbackResult) => void,
187
+ callback: (res: onError.Callback) => void,
153
188
  ): void
154
189
 
155
190
  /** 取消监听音频中断结束事件
@@ -187,17 +222,5 @@ declare module '../../../index' {
187
222
  /** 小程序切后台事件的回调函数 */
188
223
  callback: (res: TaroGeneral.CallbackResult) => void,
189
224
  ): void
190
-
191
- /** 监听系统主题改变事件。该事件与 [`App.onThemeChange`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onThemeChange-Object-object) 的回调时机一致。
192
- * @supported weapp
193
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onThemeChange.html
194
- */
195
- onThemeChange(callback: themeChange.onThemeChangeCallback): void
196
-
197
- /** 取消监听系统主题改变事件
198
- * @supported weapp
199
- * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offThemeChange.html
200
- */
201
- offThemeChange(callback: themeChange.offThemeChangeCallback): void
202
225
  }
203
226
  }
@@ -1,6 +1,136 @@
1
1
  import Taro from '../../../index'
2
2
 
3
3
  declare module '../../../index' {
4
+ namespace getLaunchOptionsSync {
5
+ /** 启动参数 */
6
+ interface LaunchOptions {
7
+ /** 启动小程序的路径 */
8
+ path: string
9
+ /** 启动小程序的 query 参数 */
10
+ query: TaroGeneral.IAnyObject
11
+ /** 启动小程序的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */
12
+ scene: number
13
+ /** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */
14
+ shareTicket: string
15
+ /** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */
16
+ referrerInfo: LaunchOptions.ReferrerInfo
17
+ /** 打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数 */
18
+ forwardMaterials?: LaunchOptions.ForwardMaterial[]
19
+ /** 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 */
20
+ chatType?: keyof LaunchOptions.ChatType
21
+ /** API 类别 */
22
+ apiCategory?: keyof LaunchOptions.ApiCategory
23
+ }
24
+
25
+ namespace LaunchOptions {
26
+ /** 来源信息 */
27
+ interface ReferrerInfo {
28
+ /** 来源小程序、公众号或 App 的 appId */
29
+ appId: string
30
+ /** 来源小程序传过来的数据,scene=1037或1038时支持 */
31
+ extraData: TaroGeneral.IAnyObject
32
+ }
33
+ /** ChatType 类型合法值 */
34
+ interface ForwardMaterial {
35
+ /** 文件的mimetype类型 */
36
+ type: string
37
+ /** 文件名 */
38
+ name: string
39
+ /** 文件路径(如果是webview则是url) */
40
+ path: string
41
+ /** 文件大小 */
42
+ size: number
43
+ }
44
+ /** ChatType 类型合法值 */
45
+ interface ChatType {
46
+ /** 微信联系人单聊 */
47
+ 1
48
+ /** 企业微信联系人单聊 */
49
+ 2
50
+ /** 普通微信群聊 */
51
+ 3
52
+ /** 企业微信互通群聊 */
53
+ 4
54
+ }
55
+ /** API 类别合法值 */
56
+ interface ApiCategory {
57
+ /** 默认类别 */
58
+ default
59
+ /** 原生功能化,视频号直播商品、商品橱窗等场景打开的小程序 */
60
+ nativeFunctionalized
61
+ /** 仅浏览,朋友圈快照页等场景打开的小程序 */
62
+ browseOnly
63
+ /** 内嵌,通过打开半屏小程序能力打开的小程序 */
64
+ embedded
65
+ }
66
+ }
67
+ }
68
+
69
+ namespace getEnterOptionsSync {
70
+ /** 启动参数 */
71
+ interface EnterOptions {
72
+ /** 启动小程序的路径 */
73
+ path: string
74
+ /** 启动小程序的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */
75
+ scene: number
76
+ /** 启动小程序的 query 参数 */
77
+ query: TaroGeneral.IAnyObject
78
+ /** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */
79
+ shareTicket: string
80
+ /** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */
81
+ referrerInfo: EnterOptions.ReferrerInfo
82
+ /** 打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数 */
83
+ forwardMaterials?: EnterOptions.ForwardMaterial[]
84
+ /** 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 */
85
+ chatType?: keyof EnterOptions.ChatType
86
+ /** API 类别 */
87
+ apiCategory?: keyof EnterOptions.ApiCategory
88
+ }
89
+
90
+ namespace EnterOptions {
91
+ /** 来源信息 */
92
+ interface ReferrerInfo {
93
+ /** 来源小程序、公众号或 App 的 appId */
94
+ appId: string
95
+ /** 来源小程序传过来的数据,scene=1037或1038时支持 */
96
+ extraData: TaroGeneral.IAnyObject
97
+ }
98
+ /** ChatType 类型合法值 */
99
+ interface ForwardMaterial {
100
+ /** 文件的mimetype类型 */
101
+ type: string
102
+ /** 文件名 */
103
+ name: string
104
+ /** 文件路径(如果是webview则是url) */
105
+ path: string
106
+ /** 文件大小 */
107
+ size: number
108
+ }
109
+ /** ChatType 类型合法值 */
110
+ interface ChatType {
111
+ /** 微信联系人单聊 */
112
+ 1
113
+ /** 企业微信联系人单聊 */
114
+ 2
115
+ /** 普通微信群聊 */
116
+ 3
117
+ /** 企业微信互通群聊 */
118
+ 4
119
+ }
120
+ /** API 类别合法值 */
121
+ interface ApiCategory {
122
+ /** 默认类别 */
123
+ default
124
+ /** 原生功能化,视频号直播商品、商品橱窗等场景打开的小程序 */
125
+ nativeFunctionalized
126
+ /** 仅浏览,朋友圈快照页等场景打开的小程序 */
127
+ browseOnly
128
+ /** 内嵌,通过打开半屏小程序能力打开的小程序 */
129
+ embedded
130
+ }
131
+ }
132
+ }
133
+
4
134
  interface TaroStatic {
5
135
  /**
6
136
  * 获取小程序启动时的参数。与 [`App.onLaunch`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onlaunchobject-object) 的回调参数一致。
@@ -10,6 +140,16 @@ declare module '../../../index' {
10
140
  * @supported weapp
11
141
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html
12
142
  */
13
- getLaunchOptionsSync(): TaroGeneral.LaunchOptionsApp
143
+ getLaunchOptionsSync(): getLaunchOptionsSync.LaunchOptions
144
+
145
+ /**
146
+ * 获取本次小程序启动时的参数。如果当前是冷启动,则返回值与 [`App.onLaunch`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onLaunch-Object-object) 的回调参数一致;如果当前是热启动,则返回值与 [`App.onShow`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onShow-Object-object) 一致。
147
+ *
148
+ * **注意**
149
+ * 部分版本在无 `referrerInfo` 的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。
150
+ * @supported weapp
151
+ * @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getEnterOptionsSync.html
152
+ */
153
+ getEnterOptionsSync(): getEnterOptionsSync.EnterOptions
14
154
  }
15
155
  }