@tarojs/taro 3.5.0-canary.1 → 3.5.0
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/html.css +50 -14
- package/html5.css +167 -64
- package/index.js +3 -4
- package/package.json +21 -11
- package/types/api/ad/index.d.ts +2 -2
- package/types/api/ai/face.d.ts +133 -0
- package/types/api/ai/visionkit.d.ts +303 -0
- package/types/api/base/crypto.d.ts +90 -0
- package/types/api/base/debug.d.ts +152 -13
- package/types/api/base/env.d.ts +2 -1
- package/types/api/base/index.d.ts +11 -3
- package/types/api/base/performance.d.ts +195 -0
- package/types/api/base/system.d.ts +541 -103
- package/types/api/base/update.d.ts +60 -8
- package/types/api/base/weapp/app-event.d.ts +99 -37
- package/types/api/base/weapp/life-cycle.d.ts +142 -2
- package/types/api/canvas/index.d.ts +151 -137
- package/types/api/cloud/index.d.ts +17 -2
- package/types/api/data-analysis/index.d.ts +1 -1
- package/types/api/device/accelerometer.d.ts +6 -6
- package/types/api/device/accessibility.d.ts +26 -0
- package/types/api/device/battery.d.ts +2 -2
- package/types/api/device/{ble.d.ts → bluetooth-ble.d.ts} +228 -62
- package/types/api/device/bluetooth-peripheral.d.ts +430 -0
- package/types/api/device/bluetooth.d.ts +67 -2
- package/types/api/device/calendar.d.ts +88 -0
- package/types/api/device/clipboard.d.ts +2 -2
- package/types/api/device/compass.d.ts +3 -3
- package/types/api/device/contact.d.ts +74 -50
- package/types/api/device/gyroscope.d.ts +6 -6
- package/types/api/device/iBeacon.d.ts +33 -19
- package/types/api/{ui → device}/keyboard.d.ts +1 -1
- package/types/api/device/{performance.d.ts → memory.d.ts} +5 -5
- package/types/api/device/motion.d.ts +3 -3
- package/types/api/device/network.d.ts +56 -15
- package/types/api/device/nfc.d.ts +1089 -13
- 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 +42 -14
- package/types/api/device/vibrate.d.ts +6 -2
- package/types/api/device/wifi.d.ts +44 -9
- package/types/api/ext/index.d.ts +2 -2
- package/types/api/files/index.d.ts +392 -205
- package/types/api/framework/index.d.ts +5 -4
- package/types/api/location/index.d.ts +156 -53
- package/types/api/media/audio.d.ts +629 -38
- package/types/api/media/background-audio.d.ts +9 -9
- package/types/api/media/camera.d.ts +41 -22
- package/types/api/media/editor.d.ts +22 -2
- package/types/api/media/image.d.ts +64 -35
- package/types/api/media/live.d.ts +66 -6
- package/types/api/media/map.d.ts +474 -54
- package/types/api/media/media-recorder.d.ts +92 -0
- package/types/api/media/recorder.d.ts +21 -21
- package/types/api/media/video-decoder.d.ts +117 -0
- package/types/api/media/video-processing.d.ts +11 -7
- package/types/api/media/video.d.ts +47 -18
- package/types/api/media/voip.d.ts +290 -0
- package/types/api/{open-api/navigate.d.ts → navigate/index.d.ts} +65 -27
- package/types/api/network/download.d.ts +61 -19
- package/types/api/network/request.d.ts +129 -41
- package/types/api/network/tcp.d.ts +181 -0
- package/types/api/network/udp.d.ts +154 -83
- package/types/api/network/upload.d.ts +55 -28
- package/types/api/network/websocket.d.ts +20 -19
- package/types/api/open-api/address.d.ts +1 -1
- package/types/api/open-api/authorize.d.ts +42 -3
- package/types/api/open-api/channels.d.ts +178 -0
- package/types/api/open-api/facial.d.ts +3 -0
- package/types/api/open-api/favorites.d.ts +100 -0
- package/types/api/open-api/group.d.ts +59 -0
- package/types/api/open-api/invoice.d.ts +2 -2
- package/types/api/open-api/license-plate.d.ts +27 -0
- package/types/api/open-api/login.d.ts +21 -0
- package/types/api/open-api/redpackage.d.ts +24 -0
- package/types/api/open-api/settings.d.ts +82 -17
- package/types/api/open-api/soter.d.ts +2 -2
- package/types/api/open-api/subscribe-message.d.ts +89 -4
- package/types/api/open-api/user-info.d.ts +56 -19
- package/types/api/open-api/werun.d.ts +33 -6
- package/types/api/payment/index.d.ts +119 -0
- package/types/api/route/index.d.ts +18 -14
- package/types/api/share/index.d.ts +192 -9
- package/types/api/storage/index.d.ts +38 -92
- package/types/api/swan/index.d.ts +1 -1
- package/types/api/ui/animation.d.ts +105 -155
- package/types/api/ui/background.d.ts +4 -2
- package/types/api/ui/custom-component.d.ts +1 -1
- package/types/api/ui/fonts.d.ts +27 -31
- 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 +6 -5
- package/types/api/ui/pull-down-refresh.d.ts +2 -2
- package/types/api/ui/scroll.d.ts +75 -7
- package/types/api/ui/sticky.d.ts +4 -4
- package/types/api/ui/tab-bar.d.ts +8 -8
- package/types/api/ui/window.d.ts +22 -2
- package/types/api/worker/index.d.ts +9 -1
- package/types/api/wxml/index.d.ts +116 -112
- package/types/compile.d.ts +57 -6
- package/types/global.d.ts +142 -111
- package/types/taro.api.d.ts +79 -62
- package/types/taro.component.d.ts +21 -65
- package/types/taro.config.d.ts +31 -0
- package/types/taro.extend.d.ts +31 -18
- package/types/taro.hooks.d.ts +55 -3
- package/types/taro.lifecycle.d.ts +21 -14
- package/LICENSE +0 -21
- package/types/api/open-api/payment.d.ts +0 -61
|
@@ -51,14 +51,68 @@ declare module '../../index' {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
namespace
|
|
54
|
+
namespace showShareImageMenu {
|
|
55
55
|
interface Option {
|
|
56
|
+
/** 要分享的图片地址,必须为本地路径或临时路径 */
|
|
57
|
+
path: string
|
|
58
|
+
/** 接口调用成功的回调函数 */
|
|
59
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
60
|
+
/** 接口调用失败的回调函数 */
|
|
61
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
56
62
|
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
57
63
|
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
namespace shareVideoMessage {
|
|
68
|
+
interface Option {
|
|
69
|
+
/** 要分享的视频地址,必须为本地路径或临时路径 */
|
|
70
|
+
videoPath: string
|
|
71
|
+
/** 缩略图路径,若留空则使用视频首帧 */
|
|
72
|
+
thumbPath?: string
|
|
73
|
+
/** 接口调用成功的回调函数 */
|
|
74
|
+
success?: (res: TaroGeneral.CallbackResult) => void
|
|
58
75
|
/** 接口调用失败的回调函数 */
|
|
59
76
|
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
77
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
78
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
namespace shareFileMessage {
|
|
83
|
+
interface Option {
|
|
84
|
+
/** 要分享的视频地址,必须为本地路径或临时路径 */
|
|
85
|
+
filePath: string
|
|
86
|
+
/** 自定义文件名,若留空则使用 filePath 中的文件名 */
|
|
87
|
+
fileName?: string
|
|
60
88
|
/** 接口调用成功的回调函数 */
|
|
61
89
|
success?: (res: TaroGeneral.CallbackResult) => void
|
|
90
|
+
/** 接口调用失败的回调函数 */
|
|
91
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
92
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
93
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
namespace onCopyUrl {
|
|
97
|
+
/** 用户点击右上角菜单的「复制链接」按钮时触发的事件的回调函数 */
|
|
98
|
+
type Callback = (result: CallbackResult) => void
|
|
99
|
+
|
|
100
|
+
interface CallbackResult {
|
|
101
|
+
/** 用短链打开小程序时当前页面携带的查询字符串。小程序中使用时,应在进入页面时调用 `Taro.onCopyUrl` 自定义 `query`,退出页面时调用 `Taro.offCopyUrl`,防止影响其它页面。 */
|
|
102
|
+
query: string
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
namespace hideShareMenu {
|
|
107
|
+
interface Option {
|
|
108
|
+
/** 本接口为 Beta 版本,暂只在 Android 平台支持。需要隐藏的转发按钮名称列表,默认['shareAppMessage', 'shareTimeline']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 */
|
|
109
|
+
menus?: string[]
|
|
110
|
+
/** 接口调用成功的回调函数 */
|
|
111
|
+
success?: (result: TaroGeneral.CallbackResult) => void
|
|
112
|
+
/** 接口调用失败的回调函数 */
|
|
113
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
114
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
115
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
62
116
|
}
|
|
63
117
|
}
|
|
64
118
|
|
|
@@ -66,14 +120,38 @@ declare module '../../index' {
|
|
|
66
120
|
interface Option {
|
|
67
121
|
/** shareTicket */
|
|
68
122
|
shareTicket: string
|
|
69
|
-
/**
|
|
70
|
-
|
|
123
|
+
/** 超时时间,单位 ms */
|
|
124
|
+
timeout?: number
|
|
125
|
+
/** 接口调用成功的回调函数 */
|
|
126
|
+
success?: (result: SuccessCallbackResult) => void
|
|
71
127
|
/** 接口调用失败的回调函数 */
|
|
72
128
|
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
129
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
130
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
134
|
+
/** 敏感数据对应的云 ID,开通[云开发](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html)的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#method-cloud) */
|
|
135
|
+
cloudID?: string
|
|
136
|
+
/** 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */
|
|
137
|
+
encryptedData: string
|
|
138
|
+
/** 错误信息 */
|
|
139
|
+
errMsg: string
|
|
140
|
+
/** 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */
|
|
141
|
+
iv: string
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
namespace authPrivateMessage {
|
|
146
|
+
interface Option {
|
|
147
|
+
/** shareTicket */
|
|
148
|
+
shareTicket: string
|
|
73
149
|
/** 接口调用成功的回调函数 */
|
|
74
150
|
success?: (result: SuccessCallbackResult) => void
|
|
75
|
-
/**
|
|
76
|
-
|
|
151
|
+
/** 接口调用失败的回调函数 */
|
|
152
|
+
fail?: (res: TaroGeneral.CallbackResult) => void
|
|
153
|
+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
|
|
154
|
+
complete?: (res: TaroGeneral.CallbackResult) => void
|
|
77
155
|
}
|
|
78
156
|
|
|
79
157
|
interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
|
|
@@ -103,7 +181,7 @@ declare module '../../index' {
|
|
|
103
181
|
updateShareMenu(option: updateShareMenu.Option): Promise<TaroGeneral.CallbackResult>
|
|
104
182
|
|
|
105
183
|
/** 显示当前页面的转发按钮
|
|
106
|
-
* @supported weapp
|
|
184
|
+
* @supported weapp, qq, tt
|
|
107
185
|
* @example
|
|
108
186
|
* ```tsx
|
|
109
187
|
* Taro.showShareMenu({
|
|
@@ -114,8 +192,88 @@ declare module '../../index' {
|
|
|
114
192
|
*/
|
|
115
193
|
showShareMenu(option: showShareMenu.Option): Promise<TaroGeneral.CallbackResult>
|
|
116
194
|
|
|
117
|
-
/**
|
|
195
|
+
/** 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载
|
|
196
|
+
* @supported weapp
|
|
197
|
+
* @example
|
|
198
|
+
* ```tsx
|
|
199
|
+
* Taro.downloadFile({
|
|
200
|
+
* url: 'https://res.wx.qq.com/wxdoc/dist/assets/img/demo.ef5c5bef.jpg',
|
|
201
|
+
* success: (res) => {
|
|
202
|
+
* wx.showShareImageMenu({
|
|
203
|
+
* path: res.tempFilePath
|
|
204
|
+
* })
|
|
205
|
+
* }
|
|
206
|
+
* })
|
|
207
|
+
* ```
|
|
208
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareImageMenu.html
|
|
209
|
+
*/
|
|
210
|
+
showShareImageMenu(option: showShareImageMenu.Option): Promise<TaroGeneral.CallbackResult>
|
|
211
|
+
|
|
212
|
+
/** 转发视频到聊天
|
|
213
|
+
* @supported weapp
|
|
214
|
+
* @example
|
|
215
|
+
* callback 写法
|
|
216
|
+
*
|
|
217
|
+
* ```tsx
|
|
218
|
+
* Taro.downloadFile({
|
|
219
|
+
* url: URL, // 下载url
|
|
220
|
+
* success (res) {
|
|
221
|
+
* // 下载完成后转发
|
|
222
|
+
* Taro.shareVideoMessage({
|
|
223
|
+
* videoPath: res.tempFilePath,
|
|
224
|
+
* success() {},
|
|
225
|
+
* fail: console.error,
|
|
226
|
+
* })
|
|
227
|
+
* },
|
|
228
|
+
* fail: console.error,
|
|
229
|
+
* })
|
|
230
|
+
* ```
|
|
231
|
+
*
|
|
232
|
+
* async await 写法
|
|
233
|
+
*
|
|
234
|
+
* ```tsx
|
|
235
|
+
* const { tempFilePath } = await Taro.downloadFile({
|
|
236
|
+
* url: URL, // 下载url
|
|
237
|
+
* })
|
|
238
|
+
* // 下载完成后转发
|
|
239
|
+
* await Taro.shareVideoMessage({
|
|
240
|
+
* videoPath: res.tempFilePath,
|
|
241
|
+
* })
|
|
242
|
+
* ```
|
|
243
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.shareVideoMessage.html
|
|
244
|
+
*/
|
|
245
|
+
shareVideoMessage(option: shareVideoMessage.Option): Promise<TaroGeneral.CallbackResult>
|
|
246
|
+
|
|
247
|
+
/** 转发文件到聊天
|
|
248
|
+
* @supported weapp
|
|
249
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.shareFileMessage.html
|
|
250
|
+
*/
|
|
251
|
+
shareFileMessage(option: shareFileMessage.Option): Promise<TaroGeneral.CallbackResult>
|
|
252
|
+
|
|
253
|
+
/** 监听用户点击右上角菜单的「复制链接」按钮时触发的事件
|
|
254
|
+
*
|
|
255
|
+
* > 本接口为 Beta 版本,暂只在 Android 平台支持。
|
|
256
|
+
* @supported weapp
|
|
257
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.onCopyUrl.html
|
|
258
|
+
*/
|
|
259
|
+
onCopyUrl(
|
|
260
|
+
/** 用户点击右上角菜单的「复制链接」按钮时触发的事件的回调函数 */
|
|
261
|
+
callback: onCopyUrl.Callback,
|
|
262
|
+
): void
|
|
263
|
+
|
|
264
|
+
/** 取消监听用户点击右上角菜单的「复制链接」按钮时触发的事件
|
|
265
|
+
*
|
|
266
|
+
* > 本接口为 Beta 版本,暂只在 Android 平台支持。
|
|
118
267
|
* @supported weapp
|
|
268
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.offCopyUrl.html
|
|
269
|
+
*/
|
|
270
|
+
offCopyUrl(
|
|
271
|
+
/** 用户点击右上角菜单的「复制链接」按钮时触发的事件的回调函数 */
|
|
272
|
+
callback: onCopyUrl.Callback,
|
|
273
|
+
): void
|
|
274
|
+
|
|
275
|
+
/** 隐藏当前页面的转发按钮
|
|
276
|
+
* @supported weapp, tt
|
|
119
277
|
* @example
|
|
120
278
|
* ```tsx
|
|
121
279
|
* Taro.hideShareMenu()
|
|
@@ -127,10 +285,10 @@ declare module '../../index' {
|
|
|
127
285
|
/** 获取转发详细信息
|
|
128
286
|
*
|
|
129
287
|
* **Tips**
|
|
130
|
-
* - 如需要展示群名称,可以使用[开放数据组件](
|
|
288
|
+
* - 如需要展示群名称,可以使用[开放数据组件](/docs/components/open/open-data)
|
|
131
289
|
* @supported weapp
|
|
132
290
|
* @example
|
|
133
|
-
* 敏感数据有两种获取方式,一是使用 [加密数据解密算法](
|
|
291
|
+
* 敏感数据有两种获取方式,一是使用 [加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#%E5%8A%A0%E5%AF%86%E6%95%B0%E6%8D%AE%E8%A7%A3%E5%AF%86%E7%AE%97%E6%B3%95) 。
|
|
134
292
|
* 获取得到的开放数据为以下 json 结构(其中 openGId 为当前群的唯一标识):
|
|
135
293
|
* ```json
|
|
136
294
|
* {
|
|
@@ -140,5 +298,30 @@ declare module '../../index' {
|
|
|
140
298
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.getShareInfo.html
|
|
141
299
|
*/
|
|
142
300
|
getShareInfo(option: getShareInfo.Option): Promise<getShareInfo.SuccessCallbackResult>
|
|
301
|
+
|
|
302
|
+
/** 验证私密消息
|
|
303
|
+
* @supported weapp
|
|
304
|
+
* @example
|
|
305
|
+
* ```tsx
|
|
306
|
+
* Taro.authPrivateMessage({
|
|
307
|
+
* shareTicket: 'xxxxxx',
|
|
308
|
+
* success(res) {
|
|
309
|
+
* console.log('authPrivateMessage success', res)
|
|
310
|
+
* // res
|
|
311
|
+
* // {
|
|
312
|
+
* // errMsg: 'authPrivateMessage:ok'
|
|
313
|
+
* // valid: true
|
|
314
|
+
* // iv: 'xxxx',
|
|
315
|
+
* // encryptedData: 'xxxxxx'
|
|
316
|
+
* // }
|
|
317
|
+
* },
|
|
318
|
+
* fail(res) {
|
|
319
|
+
* console.log('authPrivateMessage fail', res)
|
|
320
|
+
* }
|
|
321
|
+
* })
|
|
322
|
+
* ```
|
|
323
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.authPrivateMessage.html
|
|
324
|
+
*/
|
|
325
|
+
authPrivateMessage(option: authPrivateMessage.Option): Promise<authPrivateMessage.SuccessCallbackResult>
|
|
143
326
|
}
|
|
144
327
|
}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import Taro from '../../index'
|
|
2
2
|
|
|
3
3
|
declare module '../../index' {
|
|
4
|
+
/** @ignore */
|
|
5
|
+
type TypedArray =
|
|
6
|
+
| Int8Array
|
|
7
|
+
| Uint8Array
|
|
8
|
+
| Uint8ClampedArray
|
|
9
|
+
| Int16Array
|
|
10
|
+
| Uint16Array
|
|
11
|
+
| Int32Array
|
|
12
|
+
| Uint32Array
|
|
13
|
+
| Float32Array
|
|
14
|
+
| Float64Array
|
|
15
|
+
|
|
4
16
|
namespace setStorage {
|
|
5
17
|
interface Option {
|
|
6
18
|
/** 需要存储的内容。只支持原生类型、Date、及能够通过`JSON.stringify`序列化的对象。 */
|
|
@@ -92,7 +104,7 @@ declare module '../../index' {
|
|
|
92
104
|
|
|
93
105
|
interface TaroStatic {
|
|
94
106
|
/** Taro.setStorage 的同步版本
|
|
95
|
-
* @supported weapp, h5
|
|
107
|
+
* @supported weapp, h5, tt
|
|
96
108
|
* @example
|
|
97
109
|
* ```tsx
|
|
98
110
|
* Taro.setStorage({
|
|
@@ -116,7 +128,7 @@ declare module '../../index' {
|
|
|
116
128
|
): void
|
|
117
129
|
|
|
118
130
|
/** 将数据存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。
|
|
119
|
-
* @supported weapp, h5, rn
|
|
131
|
+
* @supported weapp, h5, rn, tt
|
|
120
132
|
* @example
|
|
121
133
|
* ```tsx
|
|
122
134
|
* Taro.setStorage({
|
|
@@ -133,33 +145,19 @@ declare module '../../index' {
|
|
|
133
145
|
*/
|
|
134
146
|
setStorage(option: setStorage.Option): Promise<TaroGeneral.CallbackResult>
|
|
135
147
|
|
|
136
|
-
/**
|
|
137
|
-
*
|
|
138
|
-
* @
|
|
139
|
-
* @example
|
|
140
|
-
* ```tsx
|
|
141
|
-
* try {
|
|
142
|
-
* Taro.removeStorageSync('key')
|
|
143
|
-
* } catch (e) {
|
|
144
|
-
* // Do something when catch error
|
|
145
|
-
* }
|
|
146
|
-
* ```
|
|
147
|
-
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.removeStorageSync.html
|
|
148
|
+
/** 根据 URL 销毁存在内存中的数据
|
|
149
|
+
* @supported weapp
|
|
150
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.revokeBufferURL.html
|
|
148
151
|
*/
|
|
149
|
-
|
|
152
|
+
revokeBufferURL(
|
|
153
|
+
/** 需要销毁的二进制数据 URL */
|
|
154
|
+
url: string
|
|
155
|
+
): void
|
|
150
156
|
|
|
151
157
|
/** Taro.removeStorage 的同步版本
|
|
158
|
+
* @supported weapp, h5, tt
|
|
152
159
|
* @example
|
|
153
160
|
* ```tsx
|
|
154
|
-
* Taro.removeStorage({
|
|
155
|
-
* key: 'key',
|
|
156
|
-
* success: function (res) {
|
|
157
|
-
* console.log(res)
|
|
158
|
-
* }
|
|
159
|
-
* })
|
|
160
|
-
* ```
|
|
161
|
-
*
|
|
162
|
-
* ```tsx
|
|
163
161
|
* try {
|
|
164
162
|
* Taro.removeStorageSync('key')
|
|
165
163
|
* } catch (e) {
|
|
@@ -174,7 +172,7 @@ declare module '../../index' {
|
|
|
174
172
|
): void
|
|
175
173
|
|
|
176
174
|
/** 从本地缓存中移除指定 key
|
|
177
|
-
* @supported weapp, h5, rn
|
|
175
|
+
* @supported weapp, h5, rn, tt
|
|
178
176
|
* @example
|
|
179
177
|
* ```tsx
|
|
180
178
|
* Taro.removeStorage({
|
|
@@ -184,31 +182,14 @@ declare module '../../index' {
|
|
|
184
182
|
* }
|
|
185
183
|
* })
|
|
186
184
|
* ```
|
|
187
|
-
*
|
|
188
|
-
* ```tsx
|
|
189
|
-
* try {
|
|
190
|
-
* Taro.removeStorageSync('key')
|
|
191
|
-
* } catch (e) {
|
|
192
|
-
* // Do something when catch error
|
|
193
|
-
* }
|
|
194
|
-
* ```
|
|
195
185
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.removeStorage.html
|
|
196
186
|
*/
|
|
197
187
|
removeStorage(option: removeStorage.Option): Promise<TaroGeneral.CallbackResult>
|
|
198
188
|
|
|
199
189
|
/** Taro.getStorage 的同步版本
|
|
200
|
-
* @supported weapp, h5
|
|
190
|
+
* @supported weapp, h5, tt
|
|
201
191
|
* @example
|
|
202
192
|
* ```tsx
|
|
203
|
-
* Taro.getStorage({
|
|
204
|
-
* key: 'key',
|
|
205
|
-
* success: function (res) {
|
|
206
|
-
* console.log(res.data)
|
|
207
|
-
* }
|
|
208
|
-
* })
|
|
209
|
-
* ```
|
|
210
|
-
*
|
|
211
|
-
* ```tsx
|
|
212
193
|
* try {
|
|
213
194
|
* var value = Taro.getStorageSync('key')
|
|
214
195
|
* if (value) {
|
|
@@ -226,19 +207,9 @@ declare module '../../index' {
|
|
|
226
207
|
): T
|
|
227
208
|
|
|
228
209
|
/** Taro.getStorageInfo 的同步版本
|
|
229
|
-
* @supported weapp, h5
|
|
210
|
+
* @supported weapp, h5, rn, tt
|
|
230
211
|
* @example
|
|
231
212
|
* ```tsx
|
|
232
|
-
* Taro.getStorageInfo({
|
|
233
|
-
* success: function (res) {
|
|
234
|
-
* console.log(res.keys)
|
|
235
|
-
* console.log(res.currentSize)
|
|
236
|
-
* console.log(res.limitSize)
|
|
237
|
-
* }
|
|
238
|
-
* })
|
|
239
|
-
* ```
|
|
240
|
-
*
|
|
241
|
-
* ```tsx
|
|
242
213
|
* try {
|
|
243
214
|
* const res = Taro.getStorageInfoSync()
|
|
244
215
|
* console.log(res.keys)
|
|
@@ -253,7 +224,7 @@ declare module '../../index' {
|
|
|
253
224
|
getStorageInfoSync(): getStorageInfoSync.Option
|
|
254
225
|
|
|
255
226
|
/** 异步获取当前storage的相关信息
|
|
256
|
-
* @supported weapp, h5, rn
|
|
227
|
+
* @supported weapp, h5, rn, tt
|
|
257
228
|
* @example
|
|
258
229
|
* ```tsx
|
|
259
230
|
* Taro.getStorageInfo({
|
|
@@ -264,23 +235,12 @@ declare module '../../index' {
|
|
|
264
235
|
* }
|
|
265
236
|
* })
|
|
266
237
|
* ```
|
|
267
|
-
*
|
|
268
|
-
* ```tsx
|
|
269
|
-
* try {
|
|
270
|
-
* const res = Taro.getStorageInfoSync()
|
|
271
|
-
* console.log(res.keys)
|
|
272
|
-
* console.log(res.currentSize)
|
|
273
|
-
* console.log(res.limitSize)
|
|
274
|
-
* } catch (e) {
|
|
275
|
-
* // Do something when catch error
|
|
276
|
-
* }
|
|
277
|
-
* ```
|
|
278
238
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageInfo.html
|
|
279
239
|
*/
|
|
280
240
|
getStorageInfo(option?: getStorageInfo.Option): Promise<TaroGeneral.CallbackResult>
|
|
281
241
|
|
|
282
242
|
/** 从本地缓存中异步获取指定 key 的内容
|
|
283
|
-
* @supported weapp, h5, rn
|
|
243
|
+
* @supported weapp, h5, rn, tt
|
|
284
244
|
* @example
|
|
285
245
|
* ```tsx
|
|
286
246
|
* Taro.getStorage({
|
|
@@ -290,29 +250,23 @@ declare module '../../index' {
|
|
|
290
250
|
* }
|
|
291
251
|
* })
|
|
292
252
|
* ```
|
|
293
|
-
*
|
|
294
|
-
* ```tsx
|
|
295
|
-
* try {
|
|
296
|
-
* var value = Taro.getStorageSync('key')
|
|
297
|
-
* if (value) {
|
|
298
|
-
* // Do something with return value
|
|
299
|
-
* }
|
|
300
|
-
* } catch (e) {
|
|
301
|
-
* // Do something when catch error
|
|
302
|
-
* }
|
|
303
|
-
* ```
|
|
304
253
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorage.html
|
|
305
254
|
*/
|
|
306
255
|
getStorage<T = any>(option: getStorage.Option<T>): Promise<getStorage.SuccessCallbackResult<T>>
|
|
307
256
|
|
|
257
|
+
/** 根据传入的 buffer 创建一个唯一的 URL 存在内存中
|
|
258
|
+
* @supported weapp
|
|
259
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.createBufferURL.html
|
|
260
|
+
*/
|
|
261
|
+
createBufferURL(
|
|
262
|
+
/** 需要存入内存的二进制数据 */
|
|
263
|
+
buffer: ArrayBuffer | TypedArray
|
|
264
|
+
): void
|
|
265
|
+
|
|
308
266
|
/** Taro.clearStorage 的同步版本
|
|
309
|
-
* @supported weapp, h5
|
|
267
|
+
* @supported weapp, h5, tt
|
|
310
268
|
* @example
|
|
311
269
|
* ```tsx
|
|
312
|
-
* Taro.clearStorage()
|
|
313
|
-
* ```
|
|
314
|
-
*
|
|
315
|
-
* ```tsx
|
|
316
270
|
* try {
|
|
317
271
|
* Taro.clearStorageSync()
|
|
318
272
|
* } catch(e) {
|
|
@@ -324,19 +278,11 @@ declare module '../../index' {
|
|
|
324
278
|
clearStorageSync(): void
|
|
325
279
|
|
|
326
280
|
/** 清理本地数据缓存
|
|
327
|
-
* @supported weapp, h5, rn
|
|
281
|
+
* @supported weapp, h5, rn, tt
|
|
328
282
|
* @example
|
|
329
283
|
* ```tsx
|
|
330
284
|
* Taro.clearStorage()
|
|
331
285
|
* ```
|
|
332
|
-
*
|
|
333
|
-
* ```tsx
|
|
334
|
-
* try {
|
|
335
|
-
* Taro.clearStorageSync()
|
|
336
|
-
* } catch(e) {
|
|
337
|
-
* // Do something when catch error
|
|
338
|
-
* }
|
|
339
|
-
* ```
|
|
340
286
|
* @see https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorage.html
|
|
341
287
|
*/
|
|
342
288
|
clearStorage(option?: clearStorage.Option): Promise<TaroGeneral.CallbackResult>
|
|
@@ -67,7 +67,7 @@ declare module '../../index' {
|
|
|
67
67
|
* articleTitle: '晒元宵节活动红包,爱奇艺60张年卡、600张季卡等你拿!',
|
|
68
68
|
* releaseDate: '2019-01-02 12:01:30',
|
|
69
69
|
* image: [
|
|
70
|
-
* '
|
|
70
|
+
* 'https://c.hiphotos.baidu.com/forum/w%3D480/sign=73c62dda83b1cb133e693d1bed5456da/f33725109313b07e8dee163d02d7912396dd8cfe.jpg',
|
|
71
71
|
* 'https://hiphotos.baidu.com/fex/%70%69%63/item/43a7d933c895d143e7b745607ef082025baf07ab.jpg'
|
|
72
72
|
* ],
|
|
73
73
|
* video: [{
|