UNPKG

wx-updata

Version:

微信小程序官方 setData 替代品

1,457 lines (1,451 loc) 692 kB
/*! ***************************************************************************** Copyright (c) 2020 Tencent, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ***************************************************************************** */ declare namespace WechatMiniprogram { interface AccessFailCallbackResult { /** 错误信息 * * 可选值: * - 'fail no such file or directory ${path}': 文件/目录不存在; */ errMsg: string } interface AccessOption { /** 要判断是否存在的文件/目录路径 (本地路径) */ path: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: AccessCompleteCallback /** 接口调用失败的回调函数 */ fail?: AccessFailCallback /** 接口调用成功的回调函数 */ success?: AccessSuccessCallback } /** 帐号信息 */ interface AccountInfo { /** 小程序帐号信息 */ miniProgram: MiniProgram /** 插件帐号信息(仅在插件中调用时包含这一项) */ plugin: Plugin } interface AddCardOption { /** 需要添加的卡券列表 */ cardList: AddCardRequestInfo[] /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: AddCardCompleteCallback /** 接口调用失败的回调函数 */ fail?: AddCardFailCallback /** 接口调用成功的回调函数 */ success?: AddCardSuccessCallback } /** 需要添加的卡券列表 */ interface AddCardRequestInfo { /** 卡券的扩展参数。需将 CardExt 对象 JSON 序列化为**字符串**传入 */ cardExt: string /** 卡券 ID */ cardId: string } /** 卡券添加结果列表 */ interface AddCardResponseInfo { /** 卡券的扩展参数,结构请参考下文 */ cardExt: string /** 用户领取到卡券的 ID */ cardId: string /** 加密 code,为用户领取到卡券的code加密后的字符串,解密请参照:[code 解码接口](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V) */ code: string /** 是否成功 */ isSuccess: boolean } interface AddCardSuccessCallbackResult { /** 卡券添加结果列表 */ cardList: AddCardResponseInfo[] errMsg: string } interface AddPhoneContactOption { /** 名字 */ firstName: string /** 联系地址城市 */ addressCity?: string /** 联系地址国家 */ addressCountry?: string /** 联系地址邮政编码 */ addressPostalCode?: string /** 联系地址省份 */ addressState?: string /** 联系地址街道 */ addressStreet?: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: AddPhoneContactCompleteCallback /** 电子邮件 */ email?: string /** 接口调用失败的回调函数 */ fail?: AddPhoneContactFailCallback /** 住宅地址城市 */ homeAddressCity?: string /** 住宅地址国家 */ homeAddressCountry?: string /** 住宅地址邮政编码 */ homeAddressPostalCode?: string /** 住宅地址省份 */ homeAddressState?: string /** 住宅地址街道 */ homeAddressStreet?: string /** 住宅传真 */ homeFaxNumber?: string /** 住宅电话 */ homePhoneNumber?: string /** 公司电话 */ hostNumber?: string /** 姓氏 */ lastName?: string /** 中间名 */ middleName?: string /** 手机号 */ mobilePhoneNumber?: string /** 昵称 */ nickName?: string /** 公司 */ organization?: string /** 头像本地文件路径 */ photoFilePath?: string /** 备注 */ remark?: string /** 接口调用成功的回调函数 */ success?: AddPhoneContactSuccessCallback /** 职位 */ title?: string /** 网站 */ url?: string /** 微信号 */ weChatNumber?: string /** 工作地址城市 */ workAddressCity?: string /** 工作地址国家 */ workAddressCountry?: string /** 工作地址邮政编码 */ workAddressPostalCode?: string /** 工作地址省份 */ workAddressState?: string /** 工作地址街道 */ workAddressStreet?: string /** 工作传真 */ workFaxNumber?: string /** 工作电话 */ workPhoneNumber?: string } /** 动画效果 */ interface AnimationOption { /** 动画变化时间,单位 ms */ duration?: number /** 动画变化方式 * * 可选值: * - 'linear': 动画从头到尾的速度是相同的; * - 'easeIn': 动画以低速开始; * - 'easeOut': 动画以低速结束; * - 'easeInOut': 动画以低速开始和结束; */ timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' } interface AppendFileFailCallbackResult { /** 错误信息 * * 可选值: * - 'fail no such file or directory, open ${filePath}': 指定的 filePath 文件不存在; * - 'fail illegal operation on a directory, open "${filePath}"': 指定的 filePath 是一个已经存在的目录; * - 'fail permission denied, open ${dirPath}': 指定的 filePath 路径没有写权限; * - 'fail sdcard not mounted': 指定的 filePath 是一个已经存在的目录; */ errMsg: string } interface AppendFileOption { /** 要追加的文本或二进制数据 */ data: string | ArrayBuffer /** 要追加内容的文件路径 (本地路径) */ filePath: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: AppendFileCompleteCallback /** 指定写入文件的字符编码 * * 可选值: * - 'ascii': ; * - 'base64': ; * - 'binary': ; * - 'hex': ; * - 'ucs2': 以小端序读取; * - 'ucs-2': 以小端序读取; * - 'utf16le': 以小端序读取; * - 'utf-16le': 以小端序读取; * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ encoding?: | 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'ucs-2' | 'utf16le' | 'utf-16le' | 'utf-8' | 'utf8' | 'latin1' /** 接口调用失败的回调函数 */ fail?: AppendFileFailCallback /** 接口调用成功的回调函数 */ success?: AppendFileSuccessCallback } /** 用户授权设置信息,详情参考[权限](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) */ interface AuthSetting { /** 是否授权通讯地址,对应接口 [wx.chooseAddress](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/address/wx.chooseAddress.html) */ 'scope.address'?: boolean /** 是否授权摄像头,对应[[camera](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html)](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html) 组件 */ 'scope.camera'?: boolean /** 是否授权获取发票,对应接口 [wx.chooseInvoice](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoice.html) */ 'scope.invoice'?: boolean /** 是否授权发票抬头,对应接口 [wx.chooseInvoiceTitle](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoiceTitle.html) */ 'scope.invoiceTitle'?: boolean /** 是否授权录音功能,对应接口 [wx.startRecord](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.startRecord.html) */ 'scope.record'?: boolean /** 是否授权用户信息,对应接口 [wx.getUserInfo](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html) */ 'scope.userInfo'?: boolean /** 是否授权地理位置,对应接口 [wx.getLocation](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html), [wx.chooseLocation](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.chooseLocation.html) */ 'scope.userLocation'?: boolean /** 是否授权微信运动步数,对应接口 [wx.getWeRunData](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/werun/wx.getWeRunData.html) */ 'scope.werun'?: boolean /** 是否授权保存到相册 [wx.saveImageToPhotosAlbum](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.saveImageToPhotosAlbum.html), [wx.saveVideoToPhotosAlbum](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.saveVideoToPhotosAlbum.html) */ 'scope.writePhotosAlbum'?: boolean } interface AuthorizeOption { /** 需要获取权限的 scope,详见 [scope 列表]((authorize#scope-列表)) */ scope: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: AuthorizeCompleteCallback /** 接口调用失败的回调函数 */ fail?: AuthorizeFailCallback /** 接口调用成功的回调函数 */ success?: AuthorizeSuccessCallback } /** 设备特征值列表 */ interface BLECharacteristic { /** 该特征值支持的操作类型 */ properties: Properties /** 蓝牙设备特征值的 uuid */ uuid: string } /** 设备服务列表 */ interface BLEService { /** 该服务是否为主服务 */ isPrimary: boolean /** 蓝牙设备服务的 uuid */ uuid: string } /** BackgroundAudioManager 实例,可通过 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 获取。 * * **示例代码** * * * ```js const backgroundAudioManager = wx.getBackgroundAudioManager() backgroundAudioManager.title = '此时此刻' backgroundAudioManager.epname = '此时此刻' backgroundAudioManager.singer = '许巍' backgroundAudioManager.coverImgUrl = 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000' // 设置了 src 之后会自动播放 backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E061FF02C31F716658E5C81F5594D561F2E88B854E81CAAB7806D5E4F103E55D33C16F3FAC506D1AB172DE8600B37E43FAD&fromtag=46' ``` */ interface BackgroundAudioManager { /** 音频已缓冲的时间,仅保证当前播放时间点到此时间点内容已缓冲。(只读) */ buffered: number /** 封面图 URL,用于做原生音频播放器背景图。原生音频播放器中的分享功能,分享出去的卡片配图及背景也将使用该图。 */ coverImgUrl: string /** 当前音频的播放位置(单位:s),只有在有合法 src 时返回。(只读) */ currentTime: number /** 当前音频的长度(单位:s),只有在有合法 src 时返回。(只读) */ duration: number /** 专辑名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ epname: string /** 当前是否暂停或停止。(只读) */ paused: boolean /** 音频协议。默认值为 'http',设置 'hls' 可以支持播放 HLS 协议的直播音频。 * * 最低基础库: `1.9.94` */ protocol: string /** 歌手名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ singer: string /** 音频的数据源([2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 开始支持云文件ID)。默认为空字符串,**当设置了新的 src 时,会自动开始播放**,目前支持的格式有 m4a, aac, mp3, wav。 */ src: string /** 音频开始播放的位置(单位:s)。 */ startTime: number /** 音频标题,用于原生音频播放器音频标题(必填)。原生音频播放器中的分享功能,分享出去的卡片标题,也将使用该值。 */ title: string /** 页面链接,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ webUrl: string } /** 搜索到的设备列表 */ interface BluetoothDeviceInfo { /** 用于区分设备的 id */ deviceId: string /** 蓝牙设备名称,某些设备可能没有 */ name: string } interface BlurOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: BlurCompleteCallback /** 接口调用失败的回调函数 */ fail?: BlurFailCallback /** 接口调用成功的回调函数 */ success?: BlurSuccessCallback } interface BoundingClientRectCallbackResult { /** 节点的下边界坐标 */ bottom: number /** 节点的 dataset */ dataset: IAnyObject /** 节点的高度 */ height: number /** 节点的 ID */ id: string /** 节点的左边界坐标 */ left: number /** 节点的右边界坐标 */ right: number /** 节点的上边界坐标 */ top: number /** 节点的宽度 */ width: number } /** 目标边界 */ interface BoundingClientRectResult { /** 下边界 */ bottom: number /** 高度 */ height: number /** 左边界 */ left: number /** 右边界 */ right: number /** 上边界 */ top: number /** 宽度 */ width: number } /** 新搜索到的设备列表 */ interface CallbackResultBlueToothDevice { /** 当前蓝牙设备的信号强度 */ RSSI: number /** 当前蓝牙设备的广播数据段中的 ManufacturerData 数据段。 */ advertisData: ArrayBuffer /** 当前蓝牙设备的广播数据段中的 ServiceUUIDs 数据段 */ advertisServiceUUIDs: string[] /** 用于区分设备的 id */ deviceId: string /** 当前蓝牙设备的广播数据段中的 LocalName 数据段 */ localName: string /** 蓝牙设备名称,某些设备可能没有 */ name: string /** 当前蓝牙设备的广播数据段中的 ServiceData 数据段 */ serviceData: IAnyObject } interface CameraContextStartRecordOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CameraContextStartRecordCompleteCallback /** 接口调用失败的回调函数 */ fail?: CameraContextStartRecordFailCallback /** 接口调用成功的回调函数 */ success?: CameraContextStartRecordSuccessCallback /** 超过30s或页面 `onHide` 时会结束录像 */ timeoutCallback?: StartRecordTimeoutCallback } interface CameraContextStopRecordOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CameraContextStopRecordCompleteCallback /** 启动视频压缩,压缩效果同`chooseVideo` */ compressed?: boolean /** 接口调用失败的回调函数 */ fail?: CameraContextStopRecordFailCallback /** 接口调用成功的回调函数 */ success?: CameraContextStopRecordSuccessCallback } interface CameraFrameListenerStartOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CameraFrameListenerStartCompleteCallback /** 接口调用失败的回调函数 */ fail?: CameraFrameListenerStartFailCallback /** 接口调用成功的回调函数 */ success?: CameraFrameListenerStartSuccessCallback } interface CameraFrameListenerStopOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CameraFrameListenerStopCompleteCallback /** 接口调用失败的回调函数 */ fail?: CameraFrameListenerStopFailCallback /** 接口调用成功的回调函数 */ success?: CameraFrameListenerStopSuccessCallback } /** Canvas 实例,可通过 [SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) 获取。 * * **示例代码** * * * * 2D Canvas 示例 * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/SHfgCmmq7UcM) * * WebGL 示例 * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/qEGUOqmf7T8z) * * 最低基础库: `2.7.0` */ interface Canvas { /** 画布高度 */ height: number /** 画布宽度 */ width: number } /** canvas 组件的绘图上下文 */ interface CanvasContext { /** 填充颜色。用法同 [CanvasContext.setFillStyle()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setFillStyle.html)。 * * 最低基础库: `1.9.90` */ fillStyle: string | CanvasGradient /** 当前字体样式的属性。符合 [CSS font 语法](https://developer.mozilla.org/zh-CN/docs/Web/CSS/font) 的 DOMString 字符串,至少需要提供字体大小和字体族名。默认值为 10px sans-serif。 * * 最低基础库: `1.9.90` */ font: string /** 全局画笔透明度。范围 0-1,0 表示完全透明,1 表示完全不透明。 */ globalAlpha: number /** 在绘制新形状时应用的合成操作的类型。目前安卓版本只适用于 `fill` 填充块的合成,用于 `stroke` 线段的合成效果都是 `source-over`。 * * 目前支持的操作有 * - 安卓:xor, source-over, source-atop, destination-out, lighter, overlay, darken, lighten, hard-light * - iOS:xor, source-over, source-atop, destination-over, destination-out, lighter, multiply, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, saturation, luminosity * * 最低基础库: `1.9.90` */ globalCompositeOperation: string /** 线条的端点样式。用法同 [CanvasContext.setLineCap()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineCap.html)。 * * 最低基础库: `1.9.90` */ lineCap: string /** 虚线偏移量,初始值为0 * * 最低基础库: `1.9.90` */ lineDashOffset: number /** 线条的交点样式。用法同 [CanvasContext.setLineJoin()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineJoin.html)。 * * 可选值: * - 'bevel': 斜角; * - 'round': 圆角; * - 'miter': 尖角; * * 最低基础库: `1.9.90` */ lineJoin: 'bevel' | 'round' | 'miter' /** 线条的宽度。用法同 [CanvasContext.setLineWidth()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineWidth.html)。 * * 最低基础库: `1.9.90` */ lineWidth: number /** 最大斜接长度。用法同 [CanvasContext.setMiterLimit()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setMiterLimit.html)。 * * 最低基础库: `1.9.90` */ miterLimit: number /** 阴影的模糊级别 * * 最低基础库: `1.9.90` */ shadowBlur: number /** 阴影的颜色 * * 最低基础库: `1.9.90` */ shadowColor: number /** 阴影相对于形状在水平方向的偏移 * * 最低基础库: `1.9.90` */ shadowOffsetX: number /** 阴影相对于形状在竖直方向的偏移 * * 最低基础库: `1.9.90` */ shadowOffsetY: number /** 边框颜色。用法同 [CanvasContext.setStrokeStyle()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setStrokeStyle.html)。 * * 最低基础库: `1.9.90` */ strokeStyle: string | CanvasGradient } interface CanvasGetImageDataOption { /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 `canvas-id` 属性。 */ canvasId: string /** 将要被提取的图像数据矩形区域的高度 */ height: number /** 将要被提取的图像数据矩形区域的宽度 */ width: number /** 将要被提取的图像数据矩形区域的左上角横坐标 */ x: number /** 将要被提取的图像数据矩形区域的左上角纵坐标 */ y: number /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CanvasGetImageDataCompleteCallback /** 接口调用失败的回调函数 */ fail?: CanvasGetImageDataFailCallback /** 接口调用成功的回调函数 */ success?: CanvasGetImageDataSuccessCallback } interface CanvasGetImageDataSuccessCallbackResult { /** 图像像素点数据,一维数组,每四项表示一个像素点的 rgba */ data: Uint8ClampedArray /** 图像数据矩形的高度 */ height: number /** 图像数据矩形的宽度 */ width: number errMsg: string } interface CanvasPutImageDataOption { /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 canvas-id 属性。 */ canvasId: string /** 图像像素点数据,一维数组,每四项表示一个像素点的 rgba */ data: Uint8ClampedArray /** 源图像数据矩形区域的高度 */ height: number /** 源图像数据矩形区域的宽度 */ width: number /** 源图像数据在目标画布中的位置偏移量(x 轴方向的偏移量) */ x: number /** 源图像数据在目标画布中的位置偏移量(y 轴方向的偏移量) */ y: number /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CanvasPutImageDataCompleteCallback /** 接口调用失败的回调函数 */ fail?: CanvasPutImageDataFailCallback /** 接口调用成功的回调函数 */ success?: CanvasPutImageDataSuccessCallback } interface CanvasToTempFilePathOption { /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件实例 (canvas type="2d" 时使用该属性)。 */ canvas?: string /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 canvas-id */ canvasId?: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CanvasToTempFilePathCompleteCallback /** 输出的图片的高度 * * 最低基础库: `1.2.0` */ destHeight?: number /** 输出的图片的宽度 * * 最低基础库: `1.2.0` */ destWidth?: number /** 接口调用失败的回调函数 */ fail?: CanvasToTempFilePathFailCallback /** 目标文件的类型 * * 可选值: * - 'jpg': jpg 图片; * - 'png': png 图片; * * 最低基础库: `1.7.0` */ fileType?: 'jpg' | 'png' /** 指定的画布区域的高度 * * 最低基础库: `1.2.0` */ height?: number /** 图片的质量,目前仅对 jpg 有效。取值范围为 (0, 1],不在范围内时当作 1.0 处理。 * * 最低基础库: `1.7.0` */ quality?: number /** 接口调用成功的回调函数 */ success?: CanvasToTempFilePathSuccessCallback /** 指定的画布区域的宽度 * * 最低基础库: `1.2.0` */ width?: number /** 指定的画布区域的左上角横坐标 * * 最低基础库: `1.2.0` */ x?: number /** 指定的画布区域的左上角纵坐标 * * 最低基础库: `1.2.0` */ y?: number } interface CanvasToTempFilePathSuccessCallbackResult { /** 生成文件的临时路径 (本地路径) */ tempFilePath: string errMsg: string } interface CheckIsSoterEnrolledInDeviceOption { /** 认证方式 * * 可选值: * - 'fingerPrint': 指纹识别; * - 'facial': 人脸识别; * - 'speech': 声纹识别(暂未支持); */ checkAuthMode: 'fingerPrint' | 'facial' | 'speech' /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CheckIsSoterEnrolledInDeviceCompleteCallback /** 接口调用失败的回调函数 */ fail?: CheckIsSoterEnrolledInDeviceFailCallback /** 接口调用成功的回调函数 */ success?: CheckIsSoterEnrolledInDeviceSuccessCallback } interface CheckIsSoterEnrolledInDeviceSuccessCallbackResult { /** 错误信息 */ errMsg: string /** 是否已录入信息 */ isEnrolled: boolean } interface CheckIsSupportSoterAuthenticationOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CheckIsSupportSoterAuthenticationCompleteCallback /** 接口调用失败的回调函数 */ fail?: CheckIsSupportSoterAuthenticationFailCallback /** 接口调用成功的回调函数 */ success?: CheckIsSupportSoterAuthenticationSuccessCallback } interface CheckIsSupportSoterAuthenticationSuccessCallbackResult { /** 该设备支持的可被SOTER识别的生物识别方式 * * 可选值: * - 'fingerPrint': 指纹识别; * - 'facial': 人脸识别; * - 'speech': 声纹识别(暂未支持); */ supportMode: Array<'fingerPrint' | 'facial' | 'speech'> errMsg: string } interface CheckSessionOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CheckSessionCompleteCallback /** 接口调用失败的回调函数 */ fail?: CheckSessionFailCallback /** 接口调用成功的回调函数 */ success?: CheckSessionSuccessCallback } interface ChooseAddressOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ChooseAddressCompleteCallback /** 接口调用失败的回调函数 */ fail?: ChooseAddressFailCallback /** 接口调用成功的回调函数 */ success?: ChooseAddressSuccessCallback } interface ChooseAddressSuccessCallbackResult { /** 国标收货地址第二级地址 */ cityName: string /** 国标收货地址第三级地址 */ countyName: string /** 详细收货地址信息 */ detailInfo: string /** 错误信息 */ errMsg: string /** 收货地址国家码 */ nationalCode: string /** 邮编 */ postalCode: string /** 国标收货地址第一级地址 */ provinceName: string /** 收货人手机号码 */ telNumber: string /** 收货人姓名 */ userName: string } /** 返回选择的文件的本地临时文件对象数组 */ interface ChooseFile { /** 选择的文件名称 */ name: string /** 本地临时文件路径 (本地路径) */ path: string /** 本地临时文件大小,单位 B */ size: number /** 选择的文件的会话发送时间,Unix时间戳,工具暂不支持此属性 */ time: number /** 选择的文件类型 * * 可选值: * - 'video': 选择了视频文件; * - 'image': 选择了图片文件; * - 'file': 选择了除图片和视频的文件; */ type: 'video' | 'image' | 'file' } interface ChooseImageOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ChooseImageCompleteCallback /** 最多可以选择的图片张数 */ count?: number /** 接口调用失败的回调函数 */ fail?: ChooseImageFailCallback /** 所选的图片的尺寸 * * 可选值: * - 'original': 原图; * - 'compressed': 压缩图; */ sizeType?: Array<'original' | 'compressed'> /** 选择图片的来源 * * 可选值: * - 'album': 从相册选图; * - 'camera': 使用相机; */ sourceType?: Array<'album' | 'camera'> /** 接口调用成功的回调函数 */ success?: ChooseImageSuccessCallback } interface ChooseImageSuccessCallbackResult { /** 图片的本地临时文件路径列表 (本地路径) */ tempFilePaths: string[] /** 图片的本地临时文件列表 * * 最低基础库: `1.2.0` */ tempFiles: ImageFile[] errMsg: string } interface ChooseInvoiceOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ChooseInvoiceCompleteCallback /** 接口调用失败的回调函数 */ fail?: ChooseInvoiceFailCallback /** 接口调用成功的回调函数 */ success?: ChooseInvoiceSuccessCallback } interface ChooseInvoiceSuccessCallbackResult { /** 用户选中的发票信息,格式为一个 JSON 字符串,包含三个字段: card_id:所选发票卡券的 cardId,encrypt_code:所选发票卡券的加密 code,报销方可以通过 cardId 和 encryptCode 获得报销发票的信息,app_id: 发票方的 appId。 */ invoiceInfo: string errMsg: string } interface ChooseInvoiceTitleOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ChooseInvoiceTitleCompleteCallback /** 接口调用失败的回调函数 */ fail?: ChooseInvoiceTitleFailCallback /** 接口调用成功的回调函数 */ success?: ChooseInvoiceTitleSuccessCallback } interface ChooseInvoiceTitleSuccessCallbackResult { /** 银行账号 */ bankAccount: string /** 银行名称 */ bankName: string /** 单位地址 */ companyAddress: string /** 错误信息 */ errMsg: string /** 抬头税号 */ taxNumber: string /** 手机号码 */ telephone: string /** 抬头名称 */ title: string /** 抬头类型 * * 可选值: * - 0: 单位; * - 1: 个人; */ type: 0 | 1 } interface ChooseLocationOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ChooseLocationCompleteCallback /** 接口调用失败的回调函数 */ fail?: ChooseLocationFailCallback /** 目标地纬度 * * 最低基础库: `2.9.0` */ latitude?: number /** 目标地经度 * * 最低基础库: `2.9.0` */ longitude?: number /** 接口调用成功的回调函数 */ success?: ChooseLocationSuccessCallback } interface ChooseLocationSuccessCallbackResult { /** 详细地址 */ address: string /** 纬度,浮点数,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系 */ latitude: string /** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */ longitude: string /** 位置名称 */ name: string errMsg: string } interface ChooseMediaOption { /** 仅在 sourceType 为 camera 时生效,使用前置或后置摄像头 * * 可选值: * - 'back': 使用后置摄像头; * - 'front': 使用前置摄像头; */ camera?: 'back' | 'front' /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ChooseMediaCompleteCallback /** 最多可以选择的文件个数 */ count?: number /** 接口调用失败的回调函数 */ fail?: ChooseMediaFailCallback /** 拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 30s 之间 */ maxDuration?: number /** 文件类型 * * 可选值: * - 'image': 只能拍摄图片或从相册选择图片; * - 'video': 只能拍摄视频或从相册选择视频; */ mediaType?: Array<'image' | 'video'> /** 仅对 mediaType 为 image 时有效,是否压缩所选文件 */ sizeType?: string[] /** 图片和视频选择的来源 * * 可选值: * - 'album': 从相册选择; * - 'camera': 使用相机拍摄; */ sourceType?: Array<'album' | 'camera'> /** 接口调用成功的回调函数 */ success?: ChooseMediaSuccessCallback } interface ChooseMediaSuccessCallbackResult { /** 本地临时文件列表 */ tempFiles: MediaFile[] /** 文件类型,有效值有 image 、video */ type: string errMsg: string } interface ChooseMessageFileOption { /** 最多可以选择的文件个数,可以 0~100 */ count: number /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ChooseMessageFileCompleteCallback /** 根据文件拓展名过滤,仅 type==file 时有效。每一项都不能是空字符串。默认不过滤。 * * 最低基础库: `2.6.0` */ extension?: string[] /** 接口调用失败的回调函数 */ fail?: ChooseMessageFileFailCallback /** 接口调用成功的回调函数 */ success?: ChooseMessageFileSuccessCallback /** 所选的文件的类型 * * 可选值: * - 'all': 从所有文件选择; * - 'video': 只能选择视频文件; * - 'image': 只能选择图片文件; * - 'file': 可以选择除了图片和视频之外的其它的文件; */ type?: 'all' | 'video' | 'image' | 'file' } interface ChooseMessageFileSuccessCallbackResult { /** 返回选择的文件的本地临时文件对象数组 */ tempFiles: ChooseFile[] errMsg: string } interface ChooseVideoOption { /** 默认拉起的是前置或者后置摄像头。部分 Android 手机下由于系统 ROM 不支持无法生效 * * 可选值: * - 'back': 默认拉起后置摄像头; * - 'front': 默认拉起前置摄像头; */ camera?: 'back' | 'front' /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ChooseVideoCompleteCallback /** 是否压缩所选择的视频文件 * * 最低基础库: `1.6.0` */ compressed?: boolean /** 接口调用失败的回调函数 */ fail?: ChooseVideoFailCallback /** 拍摄视频最长拍摄时间,单位秒 */ maxDuration?: number /** 视频选择的来源 * * 可选值: * - 'album': 从相册选择视频; * - 'camera': 使用相机拍摄视频; */ sourceType?: Array<'album' | 'camera'> /** 接口调用成功的回调函数 */ success?: ChooseVideoSuccessCallback } interface ChooseVideoSuccessCallbackResult { /** 选定视频的时间长度 */ duration: number /** 返回选定视频的高度 */ height: number /** 选定视频的数据量大小 */ size: number /** 选定视频的临时文件路径 (本地路径) */ tempFilePath: string /** 返回选定视频的宽度 */ width: number errMsg: string } interface ClearOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ClearCompleteCallback /** 接口调用失败的回调函数 */ fail?: ClearFailCallback /** 接口调用成功的回调函数 */ success?: ClearSuccessCallback } interface ClearStorageOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ClearStorageCompleteCallback /** 接口调用失败的回调函数 */ fail?: ClearStorageFailCallback /** 接口调用成功的回调函数 */ success?: ClearStorageSuccessCallback } interface CloseBLEConnectionOption { /** 用于区分设备的 id */ deviceId: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CloseBLEConnectionCompleteCallback /** 接口调用失败的回调函数 */ fail?: CloseBLEConnectionFailCallback /** 接口调用成功的回调函数 */ success?: CloseBLEConnectionSuccessCallback } interface CloseBluetoothAdapterOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CloseBluetoothAdapterCompleteCallback /** 接口调用失败的回调函数 */ fail?: CloseBluetoothAdapterFailCallback /** 接口调用成功的回调函数 */ success?: CloseBluetoothAdapterSuccessCallback } interface CloseOption { /** 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 */ code?: number /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CloseCompleteCallback /** 接口调用失败的回调函数 */ fail?: CloseFailCallback /** 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。 */ reason?: string /** 接口调用成功的回调函数 */ success?: CloseSuccessCallback } interface CloseSocketOption { /** 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 */ code?: number /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CloseSocketCompleteCallback /** 接口调用失败的回调函数 */ fail?: CloseSocketFailCallback /** 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。 */ reason?: string /** 接口调用成功的回调函数 */ success?: CloseSocketSuccessCallback } /** 颜色。可以用以下几种方式来表示 canvas 中使用的颜色: * * - RGB 颜色: 如 `'rgb(255, 0, 0)'` * - RGBA 颜色:如 `'rgba(255, 0, 0, 0.3)'` * - 16 进制颜色: 如 `'#FF0000'` * - 预定义的颜色: 如 `'red'` * * 其中预定义颜色有以下148个: * *注意**: Color Name 大小写不敏感 * * | Color Name | HEX | * | -------------------- | ------- | * | AliceBlue | #F0F8FF | * | AntiqueWhite | #FAEBD7 | * | Aqua | #00FFFF | * | Aquamarine | #7FFFD4 | * | Azure | #F0FFFF | * | Beige | #F5F5DC | * | Bisque | #FFE4C4 | * | Black | #000000 | * | BlanchedAlmond | #FFEBCD | * | Blue | #0000FF | * | BlueViolet | #8A2BE2 | * | Brown | #A52A2A | * | BurlyWood | #DEB887 | * | CadetBlue | #5F9EA0 | * | Chartreuse | #7FFF00 | * | Chocolate | #D2691E | * | Coral | #FF7F50 | * | CornflowerBlue | #6495ED | * | Cornsilk | #FFF8DC | * | Crimson | #DC143C | * | Cyan | #00FFFF | * | DarkBlue | #00008B | * | DarkCyan | #008B8B | * | DarkGoldenRod | #B8860B | * | DarkGray | #A9A9A9 | * | DarkGrey | #A9A9A9 | * | DarkGreen | #006400 | * | DarkKhaki | #BDB76B | * | DarkMagenta | #8B008B | * | DarkOliveGreen | #556B2F | * | DarkOrange | #FF8C00 | * | DarkOrchid | #9932CC | * | DarkRed | #8B0000 | * | DarkSalmon | #E9967A | * | DarkSeaGreen | #8FBC8F | * | DarkSlateBlue | #483D8B | * | DarkSlateGray | #2F4F4F | * | DarkSlateGrey | #2F4F4F | * | DarkTurquoise | #00CED1 | * | DarkViolet | #9400D3 | * | DeepPink | #FF1493 | * | DeepSkyBlue | #00BFFF | * | DimGray | #696969 | * | DimGrey | #696969 | * | DodgerBlue | #1E90FF | * | FireBrick | #B22222 | * | FloralWhite | #FFFAF0 | * | ForestGreen | #228B22 | * | Fuchsia | #FF00FF | * | Gainsboro | #DCDCDC | * | GhostWhite | #F8F8FF | * | Gold | #FFD700 | * | GoldenRod | #DAA520 | * | Gray | #808080 | * | Grey | #808080 | * | Green | #008000 | * | GreenYellow | #ADFF2F | * | HoneyDew | #F0FFF0 | * | HotPink | #FF69B4 | * | IndianRed | #CD5C5C | * | Indigo | #4B0082 | * | Ivory | #FFFFF0 | * | Khaki | #F0E68C | * | Lavender | #E6E6FA | * | LavenderBlush | #FFF0F5 | * | LawnGreen | #7CFC00 | * | LemonChiffon | #FFFACD | * | LightBlue | #ADD8E6 | * | LightCoral | #F08080 | * | LightCyan | #E0FFFF | * | LightGoldenRodYellow | #FAFAD2 | * | LightGray | #D3D3D3 | * | LightGrey | #D3D3D3 | * | LightGreen | #90EE90 | * | LightPink | #FFB6C1 | * | LightSalmon | #FFA07A | * | LightSeaGreen | #20B2AA | * | LightSkyBlue | #87CEFA | * | LightSlateGray | #778899 | * | LightSlateGrey | #778899 | * | LightSteelBlue | #B0C4DE | * | LightYellow | #FFFFE0 | * | Lime | #00FF00 | * | LimeGreen | #32CD32 | * | Linen | #FAF0E6 | * | Magenta | #FF00FF | * | Maroon | #800000 | * | MediumAquaMarine | #66CDAA | * | MediumBlue | #0000CD | * | MediumOrchid | #BA55D3 | * | MediumPurple | #9370DB | * | MediumSeaGreen | #3CB371 | * | MediumSlateBlue | #7B68EE | * | MediumSpringGreen | #00FA9A | * | MediumTurquoise | #48D1CC | * | MediumVioletRed | #C71585 | * | MidnightBlue | #191970 | * | MintCream | #F5FFFA | * | MistyRose | #FFE4E1 | * | Moccasin | #FFE4B5 | * | NavajoWhite | #FFDEAD | * | Navy | #000080 | * | OldLace | #FDF5E6 | * | Olive | #808000 | * | OliveDrab | #6B8E23 | * | Orange | #FFA500 | * | OrangeRed | #FF4500 | * | Orchid | #DA70D6 | * | PaleGoldenRod | #EEE8AA | * | PaleGreen | #98FB98 | * | PaleTurquoise | #AFEEEE | * | PaleVioletRed | #DB7093 | * | PapayaWhip | #FFEFD5 | * | PeachPuff | #FFDAB9 | * | Peru | #CD853F | * | Pink | #FFC0CB | * | Plum | #DDA0DD | * | PowderBlue | #B0E0E6 | * | Purple | #800080 | * | RebeccaPurple | #663399 | * | Red | #FF0000 | * | RosyBrown | #BC8F8F | * | RoyalBlue | #4169E1 | * | SaddleBrown | #8B4513 | * | Salmon | #FA8072 | * | SandyBrown | #F4A460 | * | SeaGreen | #2E8B57 | * | SeaShell | #FFF5EE | * | Sienna | #A0522D | * | Silver | #C0C0C0 | * | SkyBlue | #87CEEB | * | SlateBlue | #6A5ACD | * | SlateGray | #708090 | * | SlateGrey | #708090 | * | Snow | #FFFAFA | * | SpringGreen | #00FF7F | * | SteelBlue | #4682B4 | * | Tan | #D2B48C | * | Teal | #008080 | * | Thistle | #D8BFD8 | * | Tomato | #FF6347 | * | Turquoise | #40E0D0 | * | Violet | #EE82EE | * | Wheat | #F5DEB3 | * | White | #FFFFFF | * | WhiteSmoke | #F5F5F5 | * | Yellow | #FFFF00 | * | YellowGreen | #9ACD32 | */ interface Color { } interface CompressImageOption { /** 图片路径,图片的路径,支持本地路径、代码包路径 */ src: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CompressImageCompleteCallback /** 接口调用失败的回调函数 */ fail?: CompressImageFailCallback /** 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)。 */ quality?: number /** 接口调用成功的回调函数 */ success?: CompressImageSuccessCallback } interface CompressImageSuccessCallbackResult { /** 压缩后图片的临时文件路径 (本地路径) */ tempFilePath: string errMsg: string } interface ConnectSocketOption { /** 开发者服务器 wss 接口地址 */ url: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ConnectSocketCompleteCallback /** 接口调用失败的回调函数 */ fail?: ConnectSocketFailCallback /** HTTP Header,Header 中不能设置 Referer */ header?: IAnyObject /** 是否开启压缩扩展 * * 最低基础库: `2.8.0` */ perMessageDeflate?: boolean /** 子协议数组 * * 最低基础库: `1.4.0` */ protocols?: string[] /** 接口调用成功的回调函数 */ success?: ConnectSocketSuccessCallback /** 建立 TCP 连接的时候的 TCP_NODELAY 设置 * * 最低基础库: `2.4.0` */ tcpNoDelay?: boolean /** 超时时间,单位为毫秒 * * 最低基础库: `2.10.0` */ timeout?: number } interface ConnectWifiOption { /** Wi-Fi 设备 SSID */ SSID: string /** Wi-Fi 设备密码 */ password: string /** Wi-Fi 设备 BSSID */ BSSID?: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ConnectWifiCompleteCallback /** 接口调用失败的回调函数 */ fail?: ConnectWifiFailCallback /** 接口调用成功的回调函数 */ success?: ConnectWifiSuccessCallback } interface ContextCallbackResult { /** 节点对应的 Context 对象 */ context: IAnyObject } interface CopyFileFailCallbackResult { /** 错误信息 * * 可选值: * - 'fail permission denied, copyFile ${srcPath} -> ${destPath}': 指定目标文件路径没有写权限; * - 'fail no such file or directory, copyFile ${srcPath} -> ${destPath}': 源文件不存在,或目标文件路径的上层目录不存在; * - 'fail the maximum size of the file storage limit is exceeded': 存储空间不足; */ errMsg: string } interface CopyFileOption { /** 目标文件路径,支持本地路径 */ destPath: string /** 源文件路径,支持本地路径 */ srcPath: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CopyFileCompleteCallback /** 接口调用失败的回调函数 */ fail?: CopyFileFailCallback /** 接口调用成功的回调函数 */ success?: CopyFileSuccessCallback } interface CreateAnimationOption { /** 动画延迟时间,单位 ms */ delay?: number /** 动画持续时间,单位 ms */ duration?: number /** 动画的效果 * * 可选值: * - 'linear': 动画从头到尾的速度是相同的; * - 'ease': 动画以低速开始,然后加快,在结束前变慢; * - 'ease-in': 动画以低速开始; * - 'ease-in-out': 动画以低速开始和结束; * - 'ease-out': 动画以低速结束; * - 'step-start': 动画第一帧就跳至结束状态直到结束; * - 'step-end': 动画一直保持开始状态,最后一帧跳到结束状态; */ timingFunction?: | 'linear' | 'ease' | 'ease-in' | 'ease-in-out' | 'ease-out' | 'step-start' | 'step-end' transformOrigin?: string } interface CreateBLEConnectionOption { /** 用于区分设备的 id */ deviceId: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: CreateBLEConnectionCompleteCallback /** 接口调用失败的回调函数 */ fail?: CreateBLEConnectionFailCallback /** 接口调用成功的回调函数 */ success?: CreateBLEConnectionSuccessCallback /** 超时时间,单位ms,不填表示不会超时 */ timeout?: number } /** 选项 */ interface CreateIntersectionObserverOption { /** 初始的相交比例,如果调用时检测到的相交比例与这个值不相等且达到阈值,则会触发一次监听器的回调函数。 */ initialRatio?: number /** 是否同时观测多个目标节点(而非一个),如果设为 true ,observe 的 targetSelector 将选中多个节点(注意:同时选中过多节点将影响渲染性能) * * 最低基础库: `2.0.0` */ observeAll?: boolean /** 一个数值数组,包含所有阈值。 */ thresholds?: number[] } interface CreateInterstitialAdOption { /** 广告单元 id */ adUnitId: string } interface CreateRewardedVideoAdOption { /** 广告单元 id */ adUnitId: string /** 是否启用多例模式,默认为false * * 最低基础库: `2.8.0` */ multiton?: boolean } /** 弹幕内容 */ interface Danmu { /** 弹幕文字 */ text: string /** 弹幕颜色 */ color?: string } /** 可选的字体描述符 */ interface DescOption { /** 字体样式,可选值为 normal / italic / oblique */ style?: string /** 设置小型大写字母的字体显示文本,可选值为 normal / small-caps / inherit */ variant?: string /** 字体粗细,可选值为 normal / bold / 100 / 200../ 900 */ weight?: string } /** 指定 marker 移动到的目标点 */ interface DestinationOption { /** 纬度 */ latitude: number /** 经度 */ longitude: number } interface DownloadFileOption { /** 下载资源的 url */ url: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: DownloadFileCompleteCallback /** 接口调用失败的回调函数 */ fail?: DownloadFileFailCallback /** 指定文件下载后存储的路径 (本地路径) * * 最低基础库: `1.8.0` */ filePath?: string /** HTTP 请求的 Header,Header 中不能设置 Referer */ header?: IAnyObject /** 接口调用成功的回调函数 */ success?: DownloadFileSuccessCallback /** 超时时间,单位为毫秒 * * 最低基础库: `2.10.0` */ timeout?: number } interface DownloadFileSuccessCallbackResult { /** 用户文件路径 (本地路径)。传入 filePath 时会返回,跟传入的 filePath 一致 */ filePath: string /** 开发者服务器返回的 HTTP 状态码 */ statusCode: number /** 临时文件路径 (本地路径)。没传入 filePath 指定文件存储路径时会返回,下载后的文件会存储到一个临时文件 */ tempFilePath: string errMsg: string } interface DownloadTaskOnHeadersReceivedCallbackResult { /** 开发者服务器返回的 HTTP Response Header */ header: IAnyObject } interface DownloadTaskOnProgressUpdateCallbackResult { /** 下载进度百分比 */ progress: number /** 预期需要下载的数据总长度,单位 Bytes */ totalBytesExpectedToWrite: number /** 已经下载的数据长度,单位 Bytes */ totalBytesWritten: number } interface ExitFullScreenOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: ExitFullScreenCompleteCallback /** 接口调用失败的回调函数 */ fail?: ExitFullScreenFailCallback /** 接口调用成功的回调函数 */ success?: ExitFullScreenSuccessCallback } interface ExtractDataSourceOption { /** 视频源地址,只支持本地文件 */ source: string } interface Fields { /** 指定样式名列表,返回节点对应样式名的当前值 * * 最低基础库: `2.1.0` */ computedStyle?: string[] /** 是否返回节点对应的 Context 对象 * * 最低基础库: `2.4.2` */ context?: boolean /** 是否返回节点 dataset */ dataset?: boolean /** 是否返回节点 id */ id?: boolean /** 是否返回节点 mark */ mark?: boolean /** 是否返回节点对应的 Node 实例 * * 最低基础库: `2.7.0` */ node?: boolean /** 指定属性名列表,返回节点对应属性名的当前属性值(只能获得组件文档中标注的常规属性值,id class style 和事件绑定的属性值不可获取) */ properties?: string[] /** 是否返回节点布局位置(`left` `right` `top` `bottom`) */ rect?: boolean /** 否 是否返回节点的 `scrollLeft` `scrollTop`,节点必须是 `scroll-view` 或者 `viewport` */ scrollOffset?: boolean /** 是否返回节点尺寸(`width` `height`) */ size?: boolean } interface FileSystemManagerGetFileInfoOption { /** 要读取的文件路径 (本地路径) */ filePath: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: FileSystemManagerGetFileInfoCompleteCallback /** 接口调用失败的回调函数 */ fail?: FileSystemManagerGetFileInfoFailCallback /** 接口调用成功的回调函数 */ success?: FileSystemManagerGetFileInfoSuccessCallback } interface FileSystemManagerGetFileInfoSuccessCallbackResult { /** 文件大小,以字节为单位 */ size: number errMsg: string } interface FileSystemManagerGetSavedFileListOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: FileSystemManagerGetSavedFileListCompleteCallback /** 接口调用失败的回调函数 */ fail?: FileSystemManagerGetSavedFileListFailCallback /** 接口调用成功的回调函数 */ success?: FileSystemManagerGetSavedFileListSuccessCallback } interface FileSystemManagerGetSavedFileListSuccessCallbackResult { /** 文件数组 */ fileList: FileSystemManagerGetSavedFileListSuccessCallbackResultFileItem[] errMsg: string } /** 文件数组 */ interface FileSystemManagerGetSavedFileListSuccessCallbackResultFileItem { /** 文件保存时的时间戳,从1970/01/01 08:00:00 到当前时间的秒数 */ createTime: number /** 文件路径 (本地路径) */ filePath: string /** 本地文件大小,以字节为单位 */ size: number } interface FileSystemManagerRemoveSavedFileOption { /** 需要删除的文件路径 (本地路径) */ filePath: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: FileSystemManagerRemoveSavedFileCompleteCallback /** 接口调用失败的回调函数 */ fail?: FileSystemManagerRemoveSavedFileFailCallback /** 接口调用成功的回调函数 */ success?: FileSystemManagerRemoveSavedFileSuccessCallback } interface FileSystemManagerSaveFileOption { /** 临时存储文件路径 (本地路径) */ tempFilePath: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: FileSystemManagerSaveFileCompleteCallback /** 接口调用失败的回调函数 */ fail?: FileSystemManagerSaveFileFailCallback /** 要存储的文件路径 (本地路径) */ filePath?: string /** 接口调用成功的回调函数 */ success?: FileSystemManagerSaveFileSuccessCallback } interface FileSystemManagerSaveFileSuccessCallbackResult { /** 存储后的文件路径 (本地路径) */ savedFilePath: string errMsg: string } interface GetAvailableAudioSourcesOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: GetAvailableAudioSourcesCompleteCallback /** 接口调用失败的回调函数 */ fail?: GetAvailableAudioSourcesFailCallback /** 接口调用成功的回调函数 */ success?: GetAvailableAudioSourcesSuccessCallback } interface GetAvailableAudioSourcesSuccessCallbackResult { /** 支持的音频输入源列表,可在 [RecorderManager.start()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.start.html) 接口中使用。返回值定义参考 https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource * * 可选值: * - 'auto': 自动设置,默认使用手机麦克风,插上耳麦后自动切换使用耳机麦克风,所有平台适用; * - 'buildInMic': 手机麦克风,仅限 iOS; * - 'headsetMic': 耳机麦克风,仅限 iOS; * - 'mic': 麦克风(没插耳麦时是手机麦克风,插耳麦时是耳机麦克风),仅限 Android; * - 'camcorder': 同 mic,适用于录制音视频内容,仅限 Android; * - 'voice_communication': 同 mic,适用于实时沟通,仅限 Android; * - 'voice_recognition': 同 mic,适用于语音识别,仅限 Android; */ audioSources: Array< | 'auto' | 'buildInMic' | 'headsetMic' | 'mic' | 'camcorder' | 'voice_communication' | 'voice_recognition'> errMsg: string } interface GetBLEDeviceCharacteristicsOption { /** 蓝牙设备 id */ deviceId: string /** 蓝牙服务 uuid,需要使用 `getBLEDeviceServices` 获取 */ serviceId: string /** 接口调用结束的回调函数(调用成功、失败都会执行) */ complete?: GetBLEDeviceCharacteristicsCompleteCallback /** 接口调用失败的回调函数 */ fail?: GetBLEDeviceCharacteristicsFailCallback /** 接口调用成功的回调函数 */