@tarojs/taro 3.5.0-beta.0 → 3.5.0-beta.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/index.js +3 -4
- package/package.json +4 -4
- package/types/api/base/debug.d.ts +1 -1
- package/types/api/base/index.d.ts +3 -3
- package/types/api/base/performance.d.ts +5 -5
- package/types/api/base/system.d.ts +2 -2
- package/types/api/base/update.d.ts +6 -6
- package/types/api/base/weapp/app-event.d.ts +10 -10
- package/types/api/base/weapp/life-cycle.d.ts +1 -1
- package/types/api/data-analysis/index.d.ts +1 -1
- package/types/api/device/accelerometer.d.ts +3 -3
- package/types/api/device/calendar.d.ts +1 -1
- package/types/api/device/clipboard.d.ts +2 -2
- package/types/api/device/compass.d.ts +3 -3
- package/types/api/device/gyroscope.d.ts +4 -4
- package/types/api/device/keyboard.d.ts +1 -1
- package/types/api/device/memory.d.ts +1 -1
- package/types/api/device/network.d.ts +2 -2
- 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 +5 -5
- package/types/api/device/vibrate.d.ts +2 -2
- package/types/api/device/wifi.d.ts +3 -3
- package/types/api/ext/index.d.ts +2 -2
- package/types/api/files/index.d.ts +32 -32
- package/types/api/framework/index.d.ts +1 -1
- package/types/api/location/index.d.ts +9 -9
- package/types/api/media/audio.d.ts +1 -1
- package/types/api/media/background-audio.d.ts +1 -1
- package/types/api/media/camera.d.ts +8 -8
- package/types/api/media/image.d.ts +5 -5
- package/types/api/media/map.d.ts +15 -15
- package/types/api/media/recorder.d.ts +9 -9
- package/types/api/media/video.d.ts +2 -2
- package/types/api/navigate/index.d.ts +2 -2
- package/types/api/network/download.d.ts +5 -5
- package/types/api/network/request.d.ts +3 -3
- package/types/api/network/upload.d.ts +5 -5
- package/types/api/network/websocket.d.ts +6 -6
- package/types/api/open-api/address.d.ts +1 -1
- package/types/api/open-api/authorize.d.ts +1 -1
- package/types/api/open-api/settings.d.ts +2 -2
- package/types/api/open-api/subscribe-message.d.ts +2 -2
- package/types/api/open-api/user-info.d.ts +2 -2
- package/types/api/route/index.d.ts +5 -5
- package/types/api/share/index.d.ts +2 -2
- package/types/api/storage/index.d.ts +10 -10
- package/types/api/ui/animation.d.ts +32 -32
- package/types/api/ui/interaction.d.ts +6 -6
- package/types/api/ui/menu.d.ts +1 -1
- package/types/api/ui/navigation-bar.d.ts +5 -5
- package/types/api/ui/pull-down-refresh.d.ts +2 -2
- package/types/api/ui/scroll.d.ts +4 -2
- package/types/api/ui/tab-bar.d.ts +8 -8
- package/types/api/wxml/index.d.ts +16 -16
package/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { hooks } = require('@tarojs/runtime')
|
|
2
2
|
const taro = require('@tarojs/api').default
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
hooks.initNativeApi(taro)
|
|
4
|
+
if (hooks.isExist('initNativeApi')) {
|
|
5
|
+
hooks.call('initNativeApi', taro)
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
module.exports = taro
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/taro",
|
|
3
|
-
"version": "3.5.0-beta.
|
|
3
|
+
"version": "3.5.0-beta.1",
|
|
4
4
|
"description": "Taro framework",
|
|
5
5
|
"homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
|
|
6
6
|
"main": "index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"author": "O2Team",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@tarojs/api": "3.5.0-beta.
|
|
28
|
-
"@tarojs/runtime": "3.5.0-beta.
|
|
27
|
+
"@tarojs/api": "3.5.0-beta.1",
|
|
28
|
+
"@tarojs/runtime": "3.5.0-beta.1"
|
|
29
29
|
},
|
|
30
30
|
"peerDependenciesMeta": {
|
|
31
31
|
"@types/react": {
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"optional": true
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "ba9d945ccebb86f06edb7f845110526d92dc7b00"
|
|
45
45
|
}
|
|
@@ -3,7 +3,7 @@ import Taro from '../../index'
|
|
|
3
3
|
declare module '../../index' {
|
|
4
4
|
interface TaroStatic {
|
|
5
5
|
/** 判断小程序的 API,回调,参数,组件等是否在当前版本可用。
|
|
6
|
-
* @supported weapp
|
|
6
|
+
* @supported weapp, tt
|
|
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
|
|
47
|
+
* @supported weapp, h5, rn, tt
|
|
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
|
|
62
|
+
* @supported weapp, h5, rn, tt
|
|
63
63
|
* @example
|
|
64
64
|
* ```tsx
|
|
65
65
|
* const arrayBuffer = new Uint8Array([11, 22, 33])
|
|
@@ -24,7 +24,7 @@ declare module '../../index' {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/** Performance 对象,用于获取性能数据及创建性能监听器
|
|
27
|
-
* @supported weapp
|
|
27
|
+
* @supported weapp, tt
|
|
28
28
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.html
|
|
29
29
|
*/
|
|
30
30
|
interface Performance {
|
|
@@ -34,17 +34,17 @@ declare module '../../index' {
|
|
|
34
34
|
*/
|
|
35
35
|
createObserver(callback: Function): PerformanceObserver
|
|
36
36
|
/** 该方法返回当前缓冲区中的所有性能数据
|
|
37
|
-
* @supported weapp
|
|
37
|
+
* @supported weapp, tt
|
|
38
38
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.getEntries.html
|
|
39
39
|
*/
|
|
40
40
|
getEntries(): PerformanceEntry[]
|
|
41
41
|
/** 获取当前缓冲区中所有名称为 [name] 且类型为 [entryType] 的性能数据
|
|
42
|
-
* @supported weapp
|
|
42
|
+
* @supported weapp, tt
|
|
43
43
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.getEntriesByName.html
|
|
44
44
|
*/
|
|
45
45
|
getEntriesByName(name: string, entryType: string): PerformanceEntry[]
|
|
46
46
|
/** 获取当前缓冲区中所有类型为 [entryType] 的性能数据
|
|
47
|
-
* @supported weapp
|
|
47
|
+
* @supported weapp, tt
|
|
48
48
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.getEntriesByType.html
|
|
49
49
|
*/
|
|
50
50
|
getEntriesByType(entryType: string): PerformanceEntry[]
|
|
@@ -179,7 +179,7 @@ declare module '../../index' {
|
|
|
179
179
|
* **注意**
|
|
180
180
|
* - 目前,当开启代码 [按需注入](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/lazyload.html) `时,evaluateScript` 将仅包含公有部分代码,页面和组件的代码注入的时间会包含在 `firstRender` 中(因为页面和组件的代码注入过程成为了首次渲染过程的一部分)。因此开启按需注入后,脚本耗时降低,渲染时间提高属于正常现象,优化效果可以关注整体启动耗时(`appLaunch`)来评估。
|
|
181
181
|
* - `firstPaint` 和 `firstContentfulPaint` 指标在开启 `vconsole` 的情况下,由于绘制 `vconsoel` 的面板,会导致数据提前。
|
|
182
|
-
* @supported weapp
|
|
182
|
+
* @supported weapp, tt
|
|
183
183
|
* @example
|
|
184
184
|
* ```tsx
|
|
185
185
|
* const performance = Taro.getPerformance()
|
|
@@ -498,7 +498,7 @@ declare module '../../index' {
|
|
|
498
498
|
getSystemSetting(): getSystemSetting.Result
|
|
499
499
|
|
|
500
500
|
/** [Taro.getSystemInfo](./getSystemInfo) 的同步版本
|
|
501
|
-
* @supported weapp, h5, rn
|
|
501
|
+
* @supported weapp, h5, rn, tt
|
|
502
502
|
* @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
|
|
503
503
|
* @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
|
|
504
504
|
* @example
|
|
@@ -543,7 +543,7 @@ declare module '../../index' {
|
|
|
543
543
|
getSystemInfoAsync(res?: getSystemInfoAsync.Option): Promise<getSystemInfo.Result>
|
|
544
544
|
|
|
545
545
|
/** 获取系统信息,支持 `Promise` 化使用。
|
|
546
|
-
* @supported weapp, h5, rn
|
|
546
|
+
* @supported weapp, h5, rn, tt
|
|
547
547
|
* @h5 不支持 version、statusBarHeight、fontSizeSetting、SDKVersion
|
|
548
548
|
* @weapp 小程序可以在微信和企业微信中调用此接口,但是在企业微信中调用此接口时,会额外返回一个 environment 字段(微信中不返回),如此字段值为 wxwork,则表示当前小程序运行在企业微信环境中。
|
|
549
549
|
* @example
|
|
@@ -28,7 +28,7 @@ declare module '../../index' {
|
|
|
28
28
|
* **Tips**
|
|
29
29
|
* - 微信开发者工具上可以通过「编译模式」下的「下次编译模拟更新」开关来调试
|
|
30
30
|
* - 小程序开发版/体验版没有「版本」概念,所以无法在开发版/体验版上测试更版本更新情况
|
|
31
|
-
* @supported weapp
|
|
31
|
+
* @supported weapp, tt
|
|
32
32
|
* @example
|
|
33
33
|
* ```tsx
|
|
34
34
|
* const updateManager = Taro.getUpdateManager()
|
|
@@ -59,12 +59,12 @@ declare module '../../index' {
|
|
|
59
59
|
*/
|
|
60
60
|
interface UpdateManager {
|
|
61
61
|
/** 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 `onUpdateReady` 回调)调用。
|
|
62
|
-
* @supported weapp
|
|
62
|
+
* @supported weapp, tt
|
|
63
63
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.applyUpdate.html
|
|
64
64
|
*/
|
|
65
65
|
applyUpdate(): void
|
|
66
66
|
/** 监听向微信后台请求检查更新结果事件。微信在小程序冷启动时自动检查更新,不需由开发者主动触发。
|
|
67
|
-
* @supported weapp
|
|
67
|
+
* @supported weapp, tt
|
|
68
68
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onCheckForUpdate.html
|
|
69
69
|
*/
|
|
70
70
|
onCheckForUpdate(
|
|
@@ -72,7 +72,7 @@ declare module '../../index' {
|
|
|
72
72
|
callback: UpdateManager.OnCheckForUpdateCallback,
|
|
73
73
|
): void
|
|
74
74
|
/** 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调
|
|
75
|
-
* @supported weapp
|
|
75
|
+
* @supported weapp, tt
|
|
76
76
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateReady.html
|
|
77
77
|
*/
|
|
78
78
|
onUpdateReady(
|
|
@@ -80,7 +80,7 @@ declare module '../../index' {
|
|
|
80
80
|
callback: (res: TaroGeneral.CallbackResult) => void,
|
|
81
81
|
): void
|
|
82
82
|
/** 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调
|
|
83
|
-
* @supported weapp
|
|
83
|
+
* @supported weapp, tt
|
|
84
84
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateFailed.html
|
|
85
85
|
*/
|
|
86
86
|
onUpdateFailed(
|
|
@@ -122,7 +122,7 @@ declare module '../../index' {
|
|
|
122
122
|
* // 新的版本下载失败
|
|
123
123
|
* })
|
|
124
124
|
* ```
|
|
125
|
-
* @supported weapp
|
|
125
|
+
* @supported weapp, tt
|
|
126
126
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/update/wx.getUpdateManager.html
|
|
127
127
|
*/
|
|
128
128
|
getUpdateManager(): UpdateManager
|
|
@@ -74,7 +74,7 @@ declare module '../../../index' {
|
|
|
74
74
|
*
|
|
75
75
|
* **注意**
|
|
76
76
|
* - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。
|
|
77
|
-
* @supported weapp
|
|
77
|
+
* @supported weapp, tt
|
|
78
78
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html
|
|
79
79
|
*/
|
|
80
80
|
onUnhandledRejection<T = any>(callback: onUnhandledRejection.Callback<T>): void
|
|
@@ -92,13 +92,13 @@ declare module '../../../index' {
|
|
|
92
92
|
* - 开发者可以在回调中进行页面重定向,但必须在回调中**同步**处理,异步处理(例如 `setTimeout` 异步执行)无效。
|
|
93
93
|
* - 若开发者没有调用 [Taro.onPageNotFound](/docs/apis/base/weapp/app-event/onPageNotFound) 绑定监听,也没有声明 `App.onPageNotFound`,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。
|
|
94
94
|
* - 如果回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再第二次回调。
|
|
95
|
-
* @supported weapp, h5
|
|
95
|
+
* @supported weapp, h5, tt
|
|
96
96
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onPageNotFound.html
|
|
97
97
|
*/
|
|
98
98
|
onPageNotFound(callback: onPageNotFound.Callback): void
|
|
99
99
|
|
|
100
100
|
/** 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) 的回调时机与参数一致。
|
|
101
|
-
* @supported weapp
|
|
101
|
+
* @supported weapp, tt
|
|
102
102
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html
|
|
103
103
|
*/
|
|
104
104
|
onError(callback: onError.Callback): void
|
|
@@ -139,7 +139,7 @@ declare module '../../../index' {
|
|
|
139
139
|
* **注意**
|
|
140
140
|
*
|
|
141
141
|
* 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。
|
|
142
|
-
* @supported weapp
|
|
142
|
+
* @supported weapp, tt
|
|
143
143
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppShow.html
|
|
144
144
|
*/
|
|
145
145
|
onAppShow(
|
|
@@ -148,7 +148,7 @@ declare module '../../../index' {
|
|
|
148
148
|
): void
|
|
149
149
|
|
|
150
150
|
/** 监听小程序切后台事件。该事件与 [`App.onHide`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onhide) 的回调时机一致。
|
|
151
|
-
* @supported weapp
|
|
151
|
+
* @supported weapp, tt
|
|
152
152
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppHide.html
|
|
153
153
|
*/
|
|
154
154
|
onAppHide(
|
|
@@ -157,7 +157,7 @@ declare module '../../../index' {
|
|
|
157
157
|
): void
|
|
158
158
|
|
|
159
159
|
/** 取消监听未处理的 Promise 拒绝事件
|
|
160
|
-
* @supported weapp
|
|
160
|
+
* @supported weapp, tt
|
|
161
161
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html
|
|
162
162
|
*/
|
|
163
163
|
offUnhandledRejection<T = any>(callback: onUnhandledRejection.Callback<T>): void
|
|
@@ -169,7 +169,7 @@ declare module '../../../index' {
|
|
|
169
169
|
offThemeChange(callback: onThemeChange.Callback): void
|
|
170
170
|
|
|
171
171
|
/** 取消监听小程序要打开的页面不存在事件
|
|
172
|
-
* @supported weapp
|
|
172
|
+
* @supported weapp, tt
|
|
173
173
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offPageNotFound.html
|
|
174
174
|
*/
|
|
175
175
|
offPageNotFound(
|
|
@@ -178,7 +178,7 @@ declare module '../../../index' {
|
|
|
178
178
|
): void
|
|
179
179
|
|
|
180
180
|
/** 取消监听音频播放错误事件
|
|
181
|
-
* @supported weapp
|
|
181
|
+
* @supported weapp, tt
|
|
182
182
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html
|
|
183
183
|
*/
|
|
184
184
|
|
|
@@ -206,7 +206,7 @@ declare module '../../../index' {
|
|
|
206
206
|
): void
|
|
207
207
|
|
|
208
208
|
/** 取消监听小程序切前台事件
|
|
209
|
-
* @supported weapp
|
|
209
|
+
* @supported weapp, tt
|
|
210
210
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppShow.html
|
|
211
211
|
*/
|
|
212
212
|
offAppShow(
|
|
@@ -215,7 +215,7 @@ declare module '../../../index' {
|
|
|
215
215
|
): void
|
|
216
216
|
|
|
217
217
|
/** 取消监听小程序切后台事件
|
|
218
|
-
* @supported weapp
|
|
218
|
+
* @supported weapp, tt
|
|
219
219
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppHide.html
|
|
220
220
|
*/
|
|
221
221
|
offAppHide(
|
|
@@ -137,7 +137,7 @@ declare module '../../../index' {
|
|
|
137
137
|
*
|
|
138
138
|
* **注意**
|
|
139
139
|
* 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。
|
|
140
|
-
* @supported weapp
|
|
140
|
+
* @supported weapp, tt
|
|
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
|
|
@@ -56,7 +56,7 @@ declare module '../../index' {
|
|
|
56
56
|
* ```tsx
|
|
57
57
|
* Taro.startAccelerometer({ interval: 'game' })
|
|
58
58
|
* ```
|
|
59
|
-
* @supported weapp, h5, rn
|
|
59
|
+
* @supported weapp, h5, rn, tt
|
|
60
60
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html
|
|
61
61
|
*/
|
|
62
62
|
startAccelerometer (res?: startAccelerometer.Option): Promise<TaroGeneral.CallbackResult>
|
|
@@ -67,14 +67,14 @@ declare module '../../index' {
|
|
|
67
67
|
* ```tsx
|
|
68
68
|
* Taro.stopAccelerometer()
|
|
69
69
|
* ```
|
|
70
|
-
* @supported weapp, h5, rn
|
|
70
|
+
* @supported weapp, h5, rn, tt
|
|
71
71
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html
|
|
72
72
|
*/
|
|
73
73
|
stopAccelerometer (res?: stopAccelerometer.Option): Promise<TaroGeneral.CallbackResult>
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* 监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用 `Taro.stopAccelerometer` 停止监听。
|
|
77
|
-
* @supported weapp, h5, rn
|
|
77
|
+
* @supported weapp, h5, rn, tt
|
|
78
78
|
* @example
|
|
79
79
|
* ```tsx
|
|
80
80
|
* Taro.onAccelerometerChange(res => {
|
|
@@ -80,7 +80,7 @@ declare module '../../index' {
|
|
|
80
80
|
*/
|
|
81
81
|
addPhoneRepeatCalendar(option: addPhoneRepeatCalendar.Option): Promise<TaroGeneral.CallbackResult>
|
|
82
82
|
/** 向系统日历添加事件
|
|
83
|
-
* @supported weapp
|
|
83
|
+
* @supported weapp, tt
|
|
84
84
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/calendar/wx.addPhoneCalendar.html
|
|
85
85
|
*/
|
|
86
86
|
addPhoneCalendar(option: addPhoneCalendar.Option): Promise<TaroGeneral.CallbackResult>
|
|
@@ -43,7 +43,7 @@ declare module '../../index' {
|
|
|
43
43
|
|
|
44
44
|
interface TaroStatic {
|
|
45
45
|
/** 设置系统剪贴板的内容。调用成功后,会弹出 toast 提示"内容已复制",持续 1.5s
|
|
46
|
-
* @supported weapp, h5, rn
|
|
46
|
+
* @supported weapp, h5, rn, tt
|
|
47
47
|
* @h5 部分实现
|
|
48
48
|
* @example
|
|
49
49
|
* ```tsx
|
|
@@ -64,7 +64,7 @@ declare module '../../index' {
|
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* 获取系统剪贴板内容
|
|
67
|
-
* @supported weapp, h5, rn
|
|
67
|
+
* @supported weapp, h5, rn, tt
|
|
68
68
|
* @h5 部分实现
|
|
69
69
|
* @example
|
|
70
70
|
* ```tsx
|
|
@@ -59,7 +59,7 @@ declare module '../../index' {
|
|
|
59
59
|
|
|
60
60
|
interface TaroStatic {
|
|
61
61
|
/** 停止监听罗盘数据
|
|
62
|
-
* @supported weapp, h5
|
|
62
|
+
* @supported weapp, h5, tt
|
|
63
63
|
* @example
|
|
64
64
|
* ```tsx
|
|
65
65
|
* Taro.stopCompass()
|
|
@@ -69,7 +69,7 @@ declare module '../../index' {
|
|
|
69
69
|
stopCompass(option?: stopCompass.Option): Promise<TaroGeneral.CallbackResult>
|
|
70
70
|
|
|
71
71
|
/** 开始监听罗盘数据
|
|
72
|
-
* @supported weapp, h5
|
|
72
|
+
* @supported weapp, h5, tt
|
|
73
73
|
* @example
|
|
74
74
|
* ```js
|
|
75
75
|
* Taro.startCompass()
|
|
@@ -79,7 +79,7 @@ declare module '../../index' {
|
|
|
79
79
|
startCompass(option?: startCompass.Option): Promise<TaroGeneral.CallbackResult>
|
|
80
80
|
|
|
81
81
|
/** 监听罗盘数据变化事件。频率:5 次/秒,接口调用后会自动开始监听,可使用 Taro.stopCompass 停止监听。
|
|
82
|
-
* @supported weapp, h5
|
|
82
|
+
* @supported weapp, h5, tt
|
|
83
83
|
* @example
|
|
84
84
|
* ```tsx
|
|
85
85
|
* Taro.onCompassChange(function (res) {
|
|
@@ -53,19 +53,19 @@ declare module '../../index' {
|
|
|
53
53
|
|
|
54
54
|
interface TaroStatic {
|
|
55
55
|
/** 停止监听陀螺仪数据。
|
|
56
|
-
* @supported weapp, rn
|
|
56
|
+
* @supported weapp, rn, tt
|
|
57
57
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.stopGyroscope.html
|
|
58
58
|
*/
|
|
59
59
|
stopGyroscope(option?: stopGyroscope.Option): Promise<TaroGeneral.CallbackResult>
|
|
60
60
|
|
|
61
61
|
/** 开始监听陀螺仪数据。
|
|
62
|
-
* @supported weapp, rn
|
|
62
|
+
* @supported weapp, rn, tt
|
|
63
63
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.startGyroscope.html
|
|
64
64
|
*/
|
|
65
65
|
startGyroscope(option: startGyroscope.Option): Promise<TaroGeneral.CallbackResult>
|
|
66
66
|
|
|
67
67
|
/** 监听陀螺仪数据变化事件。频率根据 Taro.startGyroscope() 的 interval 参数。可以使用 Taro.stopGyroscope() 停止监听。
|
|
68
|
-
* @supported weapp, rn
|
|
68
|
+
* @supported weapp, rn, tt
|
|
69
69
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.onGyroscopeChange.html
|
|
70
70
|
*/
|
|
71
71
|
onGyroscopeChange(
|
|
@@ -74,7 +74,7 @@ declare module '../../index' {
|
|
|
74
74
|
): void
|
|
75
75
|
|
|
76
76
|
/** 取消监听陀螺仪数据变化事件。
|
|
77
|
-
* @supported weapp, rn
|
|
77
|
+
* @supported weapp, rn, tt
|
|
78
78
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.offGyroscopeChange.html
|
|
79
79
|
*/
|
|
80
80
|
offGyroscopeChange(
|
|
@@ -26,7 +26,7 @@ declare module '../../index' {
|
|
|
26
26
|
/** 监听内存不足告警事件。
|
|
27
27
|
*
|
|
28
28
|
* 当 iOS/Android 向小程序进程发出内存警告时,触发该事件。触发该事件不意味小程序被杀,大部分情况下仅仅是告警,开发者可在收到通知后回收一些不必要资源避免进一步加剧内存紧张。
|
|
29
|
-
* @supported weapp
|
|
29
|
+
* @supported weapp, tt
|
|
30
30
|
* @example
|
|
31
31
|
* ```tsx
|
|
32
32
|
* Taro.onMemoryWarning(function () {
|
|
@@ -101,7 +101,7 @@ declare module '../../index' {
|
|
|
101
101
|
): void
|
|
102
102
|
|
|
103
103
|
/** 监听网络状态变化。
|
|
104
|
-
* @supported weapp, h5, rn
|
|
104
|
+
* @supported weapp, h5, rn, tt
|
|
105
105
|
* @example
|
|
106
106
|
* ```tsx
|
|
107
107
|
* Taro.onNetworkStatusChange(function (res) {
|
|
@@ -135,7 +135,7 @@ declare module '../../index' {
|
|
|
135
135
|
): void
|
|
136
136
|
|
|
137
137
|
/** 获取网络类型。
|
|
138
|
-
* @supported weapp, h5, rn
|
|
138
|
+
* @supported weapp, h5, rn, tt
|
|
139
139
|
* @example
|
|
140
140
|
* ```tsx
|
|
141
141
|
* Taro.getNetworkType({
|
|
@@ -77,7 +77,7 @@ declare module '../../index' {
|
|
|
77
77
|
setVisualEffectOnCapture(option: setVisualEffectOnCapture.Option): Promise<TaroGeneral.CallbackResult>
|
|
78
78
|
|
|
79
79
|
/** 设置屏幕亮度。
|
|
80
|
-
* @supported weapp, rn
|
|
80
|
+
* @supported weapp, rn, tt
|
|
81
81
|
* @example
|
|
82
82
|
* ```tsx
|
|
83
83
|
* Taro.setScreenBrightness(params).then(...)
|
|
@@ -88,7 +88,7 @@ declare module '../../index' {
|
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* 设置是否保持常亮状态。仅在当前小程序生效,离开小程序后设置失效。
|
|
91
|
-
* @supported weapp, rn
|
|
91
|
+
* @supported weapp, rn, tt
|
|
92
92
|
* @example
|
|
93
93
|
* ```tsx
|
|
94
94
|
* // 保持屏幕常亮
|
|
@@ -102,7 +102,7 @@ declare module '../../index' {
|
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* 监听用户主动截屏事件,用户使用系统截屏按键截屏时触发此事件
|
|
105
|
-
* @supported weapp
|
|
105
|
+
* @supported weapp, tt
|
|
106
106
|
* @example
|
|
107
107
|
* ```tsx
|
|
108
108
|
* Taro.onUserCaptureScreen(function (res) {
|
|
@@ -117,7 +117,7 @@ declare module '../../index' {
|
|
|
117
117
|
): void
|
|
118
118
|
|
|
119
119
|
/** 用户主动截屏事件。取消事件监听。
|
|
120
|
-
* @supported weapp
|
|
120
|
+
* @supported weapp, tt
|
|
121
121
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offUserCaptureScreen.html
|
|
122
122
|
*/
|
|
123
123
|
offUserCaptureScreen(
|
|
@@ -130,7 +130,7 @@ declare module '../../index' {
|
|
|
130
130
|
*
|
|
131
131
|
* **说明**
|
|
132
132
|
* - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。
|
|
133
|
-
* @supported weapp, rn
|
|
133
|
+
* @supported weapp, rn, tt
|
|
134
134
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html
|
|
135
135
|
*/
|
|
136
136
|
getScreenBrightness(
|
|
@@ -25,7 +25,7 @@ declare module '../../index' {
|
|
|
25
25
|
|
|
26
26
|
interface TaroStatic {
|
|
27
27
|
/** 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效
|
|
28
|
-
* @supported weapp, h5, rn
|
|
28
|
+
* @supported weapp, h5, rn, tt
|
|
29
29
|
* @example
|
|
30
30
|
* ```tsx
|
|
31
31
|
* Taro.vibrateShort(params).then(...)
|
|
@@ -35,7 +35,7 @@ declare module '../../index' {
|
|
|
35
35
|
vibrateShort(option?: vibrateShort.Option): Promise<TaroGeneral.CallbackResult>
|
|
36
36
|
|
|
37
37
|
/** 使手机发生较长时间的振动(400ms)
|
|
38
|
-
* @supported weapp, h5, rn
|
|
38
|
+
* @supported weapp, h5, rn, tt
|
|
39
39
|
* @example
|
|
40
40
|
* ```tsx
|
|
41
41
|
* Taro.vibrateLong(params).then(...)
|
|
@@ -218,7 +218,7 @@ declare module '../../index' {
|
|
|
218
218
|
): void
|
|
219
219
|
|
|
220
220
|
/** 监听获取到 Wi-Fi 列表数据事件
|
|
221
|
-
* @supported weapp
|
|
221
|
+
* @supported weapp, tt
|
|
222
222
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onGetWifiList.html
|
|
223
223
|
*/
|
|
224
224
|
onGetWifiList(
|
|
@@ -247,7 +247,7 @@ declare module '../../index' {
|
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
249
|
* 取消监听获取到 Wi-Fi 列表数据事件。
|
|
250
|
-
* @supported weapp
|
|
250
|
+
* @supported weapp, tt
|
|
251
251
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offGetWifiList.html
|
|
252
252
|
*/
|
|
253
253
|
offGetWifiList(
|
|
@@ -258,7 +258,7 @@ declare module '../../index' {
|
|
|
258
258
|
/** 请求获取 Wi-Fi 列表。在 `onGetWifiList` 注册的回调中返回 `wifiList` 数据。 **Android 调用前需要 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.userLocation。**
|
|
259
259
|
*
|
|
260
260
|
* iOS 将跳转到系统的 Wi-Fi 界面,Android 不会跳转。 iOS 11.0 及 iOS 11.1 两个版本因系统问题,该方法失效。但在 iOS 11.2 中已修复。
|
|
261
|
-
* @supported weapp
|
|
261
|
+
* @supported weapp, tt
|
|
262
262
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getWifiList.html
|
|
263
263
|
*/
|
|
264
264
|
getWifiList(option?: getWifiList.Option): Promise<TaroGeneral.WifiError>
|
package/types/api/ext/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ declare module '../../index' {
|
|
|
31
31
|
*
|
|
32
32
|
* **Tips**
|
|
33
33
|
* 1. 本接口暂时无法通过 Taro.canIUse 判断是否兼容,开发者需要自行判断 Taro.getExtConfigSync 是否存在来兼容
|
|
34
|
-
* @supported weapp
|
|
34
|
+
* @supported weapp, tt
|
|
35
35
|
* @example
|
|
36
36
|
* ```tsx
|
|
37
37
|
* let extConfig = Taro.getExtConfigSync? Taro.getExtConfigSync(): {}
|
|
@@ -46,7 +46,7 @@ declare module '../../index' {
|
|
|
46
46
|
*
|
|
47
47
|
* **Tips**
|
|
48
48
|
* 1. 本接口暂时无法通过 Taro.canIUse 判断是否兼容,开发者需要自行判断 Taro.getExtConfig 是否存在来兼容
|
|
49
|
-
* @supported weapp
|
|
49
|
+
* @supported weapp, tt
|
|
50
50
|
* @example
|
|
51
51
|
* ```tsx
|
|
52
52
|
* if(Taro.getExtConfig) {
|