diff --git a/miniprogram/demoPages/textPaint2/textPaint.ts b/miniprogram/demoPages/textPaint2/textPaint.ts index dcaf2f8..6b6f4c8 100644 --- a/miniprogram/demoPages/textPaint2/textPaint.ts +++ b/miniprogram/demoPages/textPaint2/textPaint.ts @@ -1,6 +1,6 @@ Page({ - canvas: null as WechatMiniprogram.Canvas | null, - ctx: null as CanvasRenderingContext2D | null, + canvas: null as Canvas | null, + ctx: null as RenderingContext | null, data: { characters: ['鱼', '鸟', '牛', '羊'] as const, // 固定汉字类型 colorMap: new Map([ @@ -60,8 +60,8 @@ Page({ }, // 绘制完整游戏界面 - drawGameBoard(ctx?: CanvasRenderingContext2D) { - ctx = ctx || (this.ctx as CanvasRenderingContext2D); + drawGameBoard(ctx?: RenderingContext) { + ctx = ctx || (this.ctx as RenderingContext); ctx.clearRect(0, 0, 2480, 3508); // 绘制标题 @@ -77,7 +77,7 @@ Page({ }, // 绘制颜色示例 - drawColorLegend(ctx: CanvasRenderingContext2D, y: number) { + drawColorLegend(ctx: RenderingContext, y: number) { let x = 500; this.data.characters.forEach((char) => { ctx.beginPath(); @@ -92,7 +92,7 @@ Page({ }, // 绘制汉字矩阵(6列x7行) - drawCharacterMatrix(ctx: CanvasRenderingContext2D, startY: number) { + drawCharacterMatrix(ctx: RenderingContext, startY: number) { const cols = 6; const cellSize = 350; // 每个单元格大小 @@ -137,9 +137,7 @@ Page({ const index = e.currentTarget.dataset.index; if (!this.data.selectedColor) return; - const matrix = this.data.matrix.map((char, i) => - i === index ? this.data.selectedChar : char, - ); + const matrix = this.data.matrix.map((char, i) => (i === index ? this.data.selectedChar : char)); this.setData({ matrix }, () => { this.drawGameBoard(); diff --git a/tsconfig.json b/tsconfig.json index ef72f80..309f3f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,7 @@ "strict": true, "strictPropertyInitialization": true, "lib": ["ES2020"], - "typeRoots": ["./typings"] + "typeRoots": ["./node_modules/@types", "./typings"] }, "include": ["./**/*.ts"], "exclude": ["node_modules"] diff --git a/typings/global.d.ts b/typings/global.d.ts new file mode 100644 index 0000000..4f91b2b --- /dev/null +++ b/typings/global.d.ts @@ -0,0 +1,3 @@ +// 全局声明 +type Canvas = WechatMiniprogram.Canvas; +type RenderingContext = WechatMiniprogram.CanvasRenderingContext; diff --git a/typings/index.d.ts b/typings/index.d.ts index 3ee60c8..6007efa 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -1,8 +1,7 @@ -/// - +/// interface IAppOption { - globalData: { - userInfo?: WechatMiniprogram.UserInfo, - } - userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback, -} \ No newline at end of file + globalData: { + userInfo?: WechatMiniprogram.UserInfo; + }; + userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback; +} diff --git a/typings/types/wx/lib.wx.api.d.ts b/typings/types/wx/lib.wx.api.d.ts index 70a18f6..b1469ac 100644 --- a/typings/types/wx/lib.wx.api.d.ts +++ b/typings/types/wx/lib.wx.api.d.ts @@ -25,249 +25,249 @@ SOFTWARE. declare namespace WechatMiniprogram { interface AccessOption { /** 要判断是否存在的文件/目录路径 (本地路径) */ - path: string + path: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AccessCompleteCallback + complete?: AccessCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AccessFailCallback + fail?: AccessFailCallback; /** 接口调用成功的回调函数 */ - success?: AccessSuccessCallback + success?: AccessSuccessCallback; } /** 账号信息 */ interface AccountInfo { /** 小程序账号信息 */ - miniProgram: MiniProgram + miniProgram: MiniProgram; /** 插件账号信息(仅在插件中调用时包含这一项) */ - plugin: Plugin + plugin: Plugin; } interface AddArcOption { /** 终点 */ - end: MapPostion + end: MapPostion; /** 圆弧 id */ - id: number + id: number; /** 起始点 */ - start: MapPostion + start: MapPostion; /** 夹角角度 */ - angle?: number + angle?: number; /** 线的颜色 */ - color?: number + color?: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddArcCompleteCallback + complete?: AddArcCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddArcFailCallback + fail?: AddArcFailCallback; /** 途经点 */ - pass?: MapPostion + pass?: MapPostion; /** 接口调用成功的回调函数 */ - success?: AddArcSuccessCallback + success?: AddArcSuccessCallback; /** 线宽 */ - width?: number + width?: number; } interface AddCardOption { /** 需要添加的卡券列表 */ - cardList: AddCardRequestInfo[] + cardList: AddCardRequestInfo[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddCardCompleteCallback + complete?: AddCardCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddCardFailCallback + fail?: AddCardFailCallback; /** 接口调用成功的回调函数 */ - success?: AddCardSuccessCallback + success?: AddCardSuccessCallback; } /** 需要添加的卡券列表 */ interface AddCardRequestInfo { /** 卡券的扩展参数。需将 CardExt 对象 JSON 序列化为**字符串**传入 */ - cardExt: string + cardExt: string; /** 卡券 ID */ - cardId: string + cardId: string; } /** 卡券添加结果列表 */ interface AddCardResponseInfo { /** 卡券的扩展参数,结构请参考下文 */ - cardExt: string + cardExt: string; /** 用户领取到卡券的 ID */ - cardId: string + cardId: string; /** 加密 code,为用户领取到卡券的code加密后的字符串,解密请参照:[code 解码接口](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V) */ - code: string + code: string; /** 是否成功 */ - isSuccess: boolean + isSuccess: boolean; } interface AddCardSuccessCallbackResult { /** 卡券添加结果列表 */ - cardList: AddCardResponseInfo[] - errMsg: string + cardList: AddCardResponseInfo[]; + errMsg: string; } interface AddCustomLayerOption { /** 个性化图层id */ - layerId: string + layerId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddCustomLayerCompleteCallback + complete?: AddCustomLayerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddCustomLayerFailCallback + fail?: AddCustomLayerFailCallback; /** 接口调用成功的回调函数 */ - success?: AddCustomLayerSuccessCallback + success?: AddCustomLayerSuccessCallback; } interface AddFileToFavoritesOption { /** 要收藏的文件地址,必须为本地路径或临时路径 */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddFileToFavoritesCompleteCallback + complete?: AddFileToFavoritesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddFileToFavoritesFailCallback + fail?: AddFileToFavoritesFailCallback; /** 自定义文件名,若留空则使用filePath中的文件名 */ - fileName?: string + fileName?: string; /** 接口调用成功的回调函数 */ - success?: AddFileToFavoritesSuccessCallback + success?: AddFileToFavoritesSuccessCallback; } interface AddGroundOverlayOption { /** 图片覆盖的经纬度范围 */ - bounds: MapBounds + bounds: MapBounds; /** 图片图层 id */ - id: string + id: string; /** 图片路径,支持网络图片、临时路径、代码包路径 */ - src: string + src: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddGroundOverlayCompleteCallback + complete?: AddGroundOverlayCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddGroundOverlayFailCallback + fail?: AddGroundOverlayFailCallback; /** 图层透明度 */ - opacity?: number + opacity?: number; /** 接口调用成功的回调函数 */ - success?: AddGroundOverlaySuccessCallback + success?: AddGroundOverlaySuccessCallback; /** 是否可见 */ - visible?: boolean + visible?: boolean; /** 图层绘制顺序 */ - zIndex?: number + zIndex?: number; } interface AddMarkersOption { /** 同传入 map 组件的 marker 属性 */ - markers: any[] + markers: any[]; /** 是否先清空地图上所有 marker */ - clear?: boolean + clear?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddMarkersCompleteCallback + complete?: AddMarkersCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddMarkersFailCallback + fail?: AddMarkersFailCallback; /** 接口调用成功的回调函数 */ - success?: AddMarkersSuccessCallback + success?: AddMarkersSuccessCallback; } interface AddPhoneCalendarOption { /** 开始时间的 unix 时间戳 */ - startTime: number + startTime: number; /** 日历事件标题 */ - title: string + title: string; /** 是否提醒,默认 true */ - alarm?: boolean + alarm?: boolean; /** 提醒提前量,单位秒,默认 0 表示开始时提醒 */ - alarmOffset?: number + alarmOffset?: number; /** 是否全天事件,默认 false */ - allDay?: boolean + allDay?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddPhoneCalendarCompleteCallback + complete?: AddPhoneCalendarCompleteCallback; /** 事件说明 */ - description?: string + description?: string; /** 结束时间的 unix 时间戳,默认与开始时间相同 */ - endTime?: string + endTime?: string; /** 接口调用失败的回调函数 */ - fail?: AddPhoneCalendarFailCallback + fail?: AddPhoneCalendarFailCallback; /** 事件位置 */ - location?: string + location?: string; /** 接口调用成功的回调函数 */ - success?: AddPhoneCalendarSuccessCallback + success?: AddPhoneCalendarSuccessCallback; } interface AddPhoneContactOption { /** 名字 */ - firstName: string + firstName: string; /** 联系地址城市 */ - addressCity?: string + addressCity?: string; /** 联系地址国家 */ - addressCountry?: string + addressCountry?: string; /** 联系地址邮政编码 */ - addressPostalCode?: string + addressPostalCode?: string; /** 联系地址省份 */ - addressState?: string + addressState?: string; /** 联系地址街道 */ - addressStreet?: string + addressStreet?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddPhoneContactCompleteCallback + complete?: AddPhoneContactCompleteCallback; /** 电子邮件 */ - email?: string + email?: string; /** 接口调用失败的回调函数 */ - fail?: AddPhoneContactFailCallback + fail?: AddPhoneContactFailCallback; /** 住宅地址城市 */ - homeAddressCity?: string + homeAddressCity?: string; /** 住宅地址国家 */ - homeAddressCountry?: string + homeAddressCountry?: string; /** 住宅地址邮政编码 */ - homeAddressPostalCode?: string + homeAddressPostalCode?: string; /** 住宅地址省份 */ - homeAddressState?: string + homeAddressState?: string; /** 住宅地址街道 */ - homeAddressStreet?: string + homeAddressStreet?: string; /** 住宅传真 */ - homeFaxNumber?: string + homeFaxNumber?: string; /** 住宅电话 */ - homePhoneNumber?: string + homePhoneNumber?: string; /** 公司电话 */ - hostNumber?: string + hostNumber?: string; /** 姓氏 */ - lastName?: string + lastName?: string; /** 中间名 */ - middleName?: string + middleName?: string; /** 手机号 */ - mobilePhoneNumber?: string + mobilePhoneNumber?: string; /** 昵称 */ - nickName?: string + nickName?: string; /** 公司 */ - organization?: string + organization?: string; /** 头像本地文件路径 */ - photoFilePath?: string + photoFilePath?: string; /** 备注 */ - remark?: string + remark?: string; /** 接口调用成功的回调函数 */ - success?: AddPhoneContactSuccessCallback + success?: AddPhoneContactSuccessCallback; /** 职位 */ - title?: string + title?: string; /** 网站 */ - url?: string + url?: string; /** 微信号 */ - weChatNumber?: string + weChatNumber?: string; /** 工作地址城市 */ - workAddressCity?: string + workAddressCity?: string; /** 工作地址国家 */ - workAddressCountry?: string + workAddressCountry?: string; /** 工作地址邮政编码 */ - workAddressPostalCode?: string + workAddressPostalCode?: string; /** 工作地址省份 */ - workAddressState?: string + workAddressState?: string; /** 工作地址街道 */ - workAddressStreet?: string + workAddressStreet?: string; /** 工作传真 */ - workFaxNumber?: string + workFaxNumber?: string; /** 工作电话 */ - workPhoneNumber?: string + workPhoneNumber?: string; } interface AddPhoneRepeatCalendarOption { /** 开始时间的 unix 时间戳 (1970年1月1日开始所经过的秒数) */ - startTime: number + startTime: number; /** 日历事件标题 */ - title: string + title: string; /** 是否提醒,默认 true */ - alarm?: boolean + alarm?: boolean; /** 提醒提前量,单位秒,默认 0 表示开始时提醒 */ - alarmOffset?: number + alarmOffset?: number; /** 是否全天事件,默认 false */ - allDay?: boolean + allDay?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddPhoneRepeatCalendarCompleteCallback + complete?: AddPhoneRepeatCalendarCompleteCallback; /** 事件说明 */ - description?: string + description?: string; /** 结束时间的 unix 时间戳,默认与开始时间相同 */ - endTime?: string + endTime?: string; /** 接口调用失败的回调函数 */ - fail?: AddPhoneRepeatCalendarFailCallback + fail?: AddPhoneRepeatCalendarFailCallback; /** 事件位置 */ - location?: string + location?: string; /** 重复周期结束时间的 unix 时间戳,不填表示一直重复 */ - repeatEndTime?: number + repeatEndTime?: number; /** 重复周期,默认 month 每月重复 * * 可选值: @@ -275,89 +275,89 @@ declare namespace WechatMiniprogram { * - 'week': 每周重复; * - 'month': 每月重复。该模式日期不能大于 28 日; * - 'year': 每年重复; */ - repeatInterval?: 'day' | 'week' | 'month' | 'year' + repeatInterval?: 'day' | 'week' | 'month' | 'year'; /** 接口调用成功的回调函数 */ - success?: AddPhoneRepeatCalendarSuccessCallback + success?: AddPhoneRepeatCalendarSuccessCallback; } interface AddServiceOption { /** 描述service的Object */ - service: BLEPeripheralService + service: BLEPeripheralService; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddServiceCompleteCallback + complete?: AddServiceCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddServiceFailCallback + fail?: AddServiceFailCallback; /** 接口调用成功的回调函数 */ - success?: AddServiceSuccessCallback + success?: AddServiceSuccessCallback; } interface AddVideoToFavoritesOption { /** 要收藏的视频地址,必须为本地路径或临时路径 */ - videoPath: string + videoPath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddVideoToFavoritesCompleteCallback + complete?: AddVideoToFavoritesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddVideoToFavoritesFailCallback + fail?: AddVideoToFavoritesFailCallback; /** 接口调用成功的回调函数 */ - success?: AddVideoToFavoritesSuccessCallback + success?: AddVideoToFavoritesSuccessCallback; /** 缩略图路径,若留空则使用视频首帧 */ - thumbPath?: string + thumbPath?: string; } interface AddVisualLayerOption { /** 可视化图层id([创建图层指引](https://lbs.qq.com/dev/console/layers/layerEdit)) */ - layerId: string + layerId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AddVisualLayerCompleteCallback + complete?: AddVisualLayerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AddVisualLayerFailCallback + fail?: AddVisualLayerFailCallback; /** 刷新周期,单位秒 */ - interval?: number + interval?: number; /** 图层透明度 */ - opacity?: number + opacity?: number; /** 接口调用成功的回调函数 */ - success?: AddVisualLayerSuccessCallback + success?: AddVisualLayerSuccessCallback; /** 图层绘制顺序 */ - zIndex?: number + zIndex?: number; } /** 广播自定义参数 */ interface AdvertiseReqObj { /** 需要基础库: `2.20.1` * * 以 beacon 设备形式广播的参数。 */ - beacon?: BeaconInfoObj + beacon?: BeaconInfoObj; /** 当前设备是否可连接 */ - connectable?: boolean + connectable?: boolean; /** 广播中 deviceName 字段,默认为空 */ - deviceName?: string + deviceName?: string; /** 广播的制造商信息。仅安卓支持,iOS 因系统限制无法定制。 */ - manufacturerData?: ManufacturerData[] + manufacturerData?: ManufacturerData[]; /** 要广播的服务 UUID 列表。使用 16/32 位 UUID 时请参考注意事项。 */ - serviceUuids?: string[] + serviceUuids?: string[]; } /** 订单金额信息。 */ interface Amount { /** 订单总需支付金额,也即是真正下单总金额,单位为分。示例值:1300 */ - order_amount: number + order_amount: number; /** 货币类型。示例值:CNY * * 可选值: * - 'CNY': 人民币; */ - currency?: 'CNY' + currency?: 'CNY'; /** 订单总计优惠金额,单位为分。示例值:500 */ - discount?: number + discount?: number; /** 订单运费,单位为分。示例值:200 */ - freight?: number + freight?: number; /** 订单其他费用总金额,单位为分。示例值:600 */ - other_fee?: number + other_fee?: number; /** 订单所有商品的原价总和,单位为分。示例值:1000 */ - product_amount?: number + product_amount?: number; } /** animationData */ interface AnimationExportResult { - actions: IAnyObject[] + actions: IAnyObject[]; } /** 动画效果 */ interface AnimationOption { /** 动画变化时间,单位 ms */ - duration?: number + duration?: number; /** 动画变化方式 * * 可选值: @@ -365,68 +365,68 @@ declare namespace WechatMiniprogram { * - 'easeIn': 动画以低速开始; * - 'easeOut': 动画以低速结束; * - 'easeInOut': 动画以低速开始和结束; */ - timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' + timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut'; } interface AppAuthorizeSetting { /** 允许微信使用相册的开关(仅 iOS 有效) */ - albumAuthorized: 'authorized' | 'denied' | 'not determined' + albumAuthorized: 'authorized' | 'denied' | 'not determined'; /** 允许微信使用蓝牙的开关(安卓基础库 3.5.0 以上有效) */ - bluetoothAuthorized: 'authorized' | 'denied' | 'not determined' + bluetoothAuthorized: 'authorized' | 'denied' | 'not determined'; /** 允许微信使用摄像头的开关 */ - cameraAuthorized: 'authorized' | 'denied' | 'not determined' + cameraAuthorized: 'authorized' | 'denied' | 'not determined'; /** 允许微信使用定位的开关 */ - locationAuthorized: 'authorized' | 'denied' | 'not determined' + locationAuthorized: 'authorized' | 'denied' | 'not determined'; /** 定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 有效) */ - locationReducedAccuracy: boolean + locationReducedAccuracy: boolean; /** 允许微信使用麦克风的开关 */ - microphoneAuthorized: 'authorized' | 'denied' | 'not determined' + microphoneAuthorized: 'authorized' | 'denied' | 'not determined'; /** 允许微信通知带有提醒的开关(仅 iOS 有效) */ - notificationAlertAuthorized: 'authorized' | 'denied' | 'not determined' + notificationAlertAuthorized: 'authorized' | 'denied' | 'not determined'; /** 允许微信通知的开关 */ - notificationAuthorized: 'authorized' | 'denied' | 'not determined' + notificationAuthorized: 'authorized' | 'denied' | 'not determined'; /** 允许微信通知带有标记的开关(仅 iOS 有效) */ - notificationBadgeAuthorized: 'authorized' | 'denied' | 'not determined' + notificationBadgeAuthorized: 'authorized' | 'denied' | 'not determined'; /** 允许微信通知带有声音的开关(仅 iOS 有效) */ - notificationSoundAuthorized: 'authorized' | 'denied' | 'not determined' + notificationSoundAuthorized: 'authorized' | 'denied' | 'not determined'; /** 允许微信读写日历的开关 */ - phoneCalendarAuthorized: 'authorized' | 'denied' | 'not determined' + phoneCalendarAuthorized: 'authorized' | 'denied' | 'not determined'; } interface AppBaseInfo { /** 客户端基础库版本 */ - SDKVersion: string + SDKVersion: string; /** 是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。 */ - enableDebug: boolean + enableDebug: boolean; /** 微信字体大小缩放比例 */ - fontSizeScaleFactor: number + fontSizeScaleFactor: number; /** 需要基础库: `2.23.4` * * 微信字体大小,单位px */ - fontSizeSetting: number + fontSizeSetting: number; /** 当前小程序运行的宿主环境 */ - host: AppBaseInfoHost + host: AppBaseInfoHost; /** 微信设置的语言 */ - language: string + language: string; /** 微信版本号 */ - version: string + version: string; /** 系统当前主题,取值为`light`或`dark`,全局配置`"darkmode":true`时才能获取,否则为 undefined (不支持小游戏) * * 可选值: * - 'dark': 深色主题; * - 'light': 浅色主题; */ - theme?: 'dark' | 'light' + theme?: 'dark' | 'light'; } /** 当前小程序运行的宿主环境 */ interface AppBaseInfoHost { /** 宿主 app(第三方App) 对应的 appId (当小程序运行在第三方App环境时才返回) */ - appId: string + appId: string; } interface AppendFileOption { /** 要追加的文本或二进制数据 */ - data: string | ArrayBuffer + data: string | ArrayBuffer; /** 要追加内容的文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AppendFileCompleteCallback + complete?: AppendFileCompleteCallback; /** 指定写入文件的字符编码 * * 可选值: @@ -441,144 +441,133 @@ declare namespace WechatMiniprogram { * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | '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 + fail?: AppendFileFailCallback; /** 接口调用成功的回调函数 */ - success?: AppendFileSuccessCallback + success?: AppendFileSuccessCallback; } interface ApplyBlusherStickMakeupOption { /** 上色程度 0-1 */ - alpha: number - blendMode: string + alpha: number; + blendMode: string; /** 左腮红资源路径 */ - path: string + path: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ApplyBlusherStickMakeupCompleteCallback + complete?: ApplyBlusherStickMakeupCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ApplyBlusherStickMakeupFailCallback + fail?: ApplyBlusherStickMakeupFailCallback; /** 接口调用成功的回调函数 */ - success?: ApplyBlusherStickMakeupSuccessCallback + success?: ApplyBlusherStickMakeupSuccessCallback; } interface ApplyEyeBrowMakeupOption { /** 上色程度 0-1 */ - alpha: number - blendMode: string - path: string - shrinkRate: number + alpha: number; + blendMode: string; + path: string; + shrinkRate: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ApplyEyeBrowMakeupCompleteCallback + complete?: ApplyEyeBrowMakeupCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ApplyEyeBrowMakeupFailCallback + fail?: ApplyEyeBrowMakeupFailCallback; /** 接口调用成功的回调函数 */ - success?: ApplyEyeBrowMakeupSuccessCallback + success?: ApplyEyeBrowMakeupSuccessCallback; } interface ApplyEyeShadowMakeupOption { /** 上色程度 0-1 */ - alpha: number - blendMode: string + alpha: number; + blendMode: string; /** 眼影资源路径 */ - path: string + path: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ApplyEyeShadowMakeupCompleteCallback + complete?: ApplyEyeShadowMakeupCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ApplyEyeShadowMakeupFailCallback + fail?: ApplyEyeShadowMakeupFailCallback; /** 细致效果图片资源路径 */ - shimmerPosition?: string + shimmerPosition?: string; /** 细致效果图片资源 md5 */ - shimmerPositionMD5?: string + shimmerPositionMD5?: string; /** 接口调用成功的回调函数 */ - success?: ApplyEyeShadowMakeupSuccessCallback + success?: ApplyEyeShadowMakeupSuccessCallback; } interface ApplyFaceContourMakeupOption { - alpha: number + alpha: number; /** 高光资源路径 */ - path: string + path: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ApplyFaceContourMakeupCompleteCallback + complete?: ApplyFaceContourMakeupCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ApplyFaceContourMakeupFailCallback + fail?: ApplyFaceContourMakeupFailCallback; /** 接口调用成功的回调函数 */ - success?: ApplyFaceContourMakeupSuccessCallback + success?: ApplyFaceContourMakeupSuccessCallback; } interface ApplyFilterOption { /** 滤镜效果透明度,范围是 0-1 */ - alpha: number + alpha: number; /** 滤镜资源路径 */ - path: string + path: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ApplyFilterCompleteCallback + complete?: ApplyFilterCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ApplyFilterFailCallback + fail?: ApplyFilterFailCallback; /** 滤镜资源 md5 */ - md5?: string + md5?: string; /** 接口调用成功的回调函数 */ - success?: ApplyFilterSuccessCallback + success?: ApplyFilterSuccessCallback; } interface ApplyLipStickMakeupOption { /** 上色程度 0-1 */ - alpha: number - blendMode: string - faceModel: string - path: string - shimmerPath: string - shimmerType: string + alpha: number; + blendMode: string; + faceModel: string; + path: string; + shimmerPath: string; + shimmerType: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ApplyLipStickMakeupCompleteCallback + complete?: ApplyLipStickMakeupCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ApplyLipStickMakeupFailCallback + fail?: ApplyLipStickMakeupFailCallback; /** 接口调用成功的回调函数 */ - success?: ApplyLipStickMakeupSuccessCallback + success?: ApplyLipStickMakeupSuccessCallback; } interface ApplyStickerOption { /** 贴纸类型 */ - stickers: Sticker[] + stickers: Sticker[]; /** 贴纸类型 */ - type: string + type: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ApplyStickerCompleteCallback + complete?: ApplyStickerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ApplyStickerFailCallback + fail?: ApplyStickerFailCallback; /** 接口调用成功的回调函数 */ - success?: ApplyStickerSuccessCallback - templateTransSet?: IAnyObject + success?: ApplyStickerSuccessCallback; + templateTransSet?: IAnyObject; } interface Asset { - src: string + src: string; /** 可选值: * - 'font': 字体; * - 'image': 图片; */ - type: 'font' | 'image' + type: 'font' | 'image'; } /** 需要基础库: `2.19.0` * * AudioBuffer接口表示存在内存里的一段短小的音频资源,利用[WebAudioContext.decodeAudioData](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.decodeAudioData.html)方法从一个音频文件构建,或者利用 [WebAudioContext.createBuffer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createBuffer.html)从原始数据构建。把音频放入AudioBuffer后,可以传入到一个 AudioBufferSourceNode进行播放。 */ interface AudioBuffer { /** 返回存储在缓存区的PCM数据的时长(单位为秒) */ - duration: number + duration: number; /** 返回存储在缓存区的PCM数据的采样帧率 */ - length: number + length: number; /** 储存在缓存区的PCM数据的通道数 */ - numberOfChannels: number + numberOfChannels: number; /** 存储在缓存区的PCM数据的采样率(单位为sample/s) */ - sampleRate: number + sampleRate: number; /** [AudioBuffer.copyFromChannel()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.copyFromChannel.html) * * 在插件中使用:不支持 * * 从AudioBuffer的指定频道复制到数组终端。 */ - copyFromChannel(): void + copyFromChannel(): void; /** [AudioBuffer.copyToChannel(Float32Array source, number channelNumber, number startInChannel)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.copyToChannel.html) * * 在插件中使用:不支持 @@ -594,8 +583,8 @@ declare namespace WechatMiniprogram { /** 需要复制到的目的通道号 */ channelNumber: number, /** 复制偏移数据量 */ - startInChannel: number - ): void + startInChannel: number, + ): void; /** [Float32Array AudioBuffer.getChannelData(number channel)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.getChannelData.html) * * 在插件中使用:不支持 @@ -603,95 +592,95 @@ declare namespace WechatMiniprogram { * 返回一个 Float32Array,包含了带有频道的PCM数据,由频道参数定义(有0代表第一个频道) */ getChannelData( /** 要获取特定通道数据的索引 */ - channel: number - ): Float32Array + channel: number, + ): Float32Array; } /** 空间音频监听器,代表在一个音频场景内唯一的位置和方向信息。 */ interface AudioListener { /** 表示监听器的前向系统在同一笛卡尔坐标系中的水平位置,作为位置(位置x,位置和位置和位置)值。 */ - forwardX: number + forwardX: number; /** 表示听众的前向方向在同一笛卡尔坐标系中作为位置(位置x,位置和位置和位置)值的垂直位置。 */ - forwardY: number + forwardY: number; /** 表示与position (positionX、positionY和positionZ)值在同一笛卡尔坐标系下的听者前进方向的纵向(前后)位置。 */ - forwardZ: number + forwardZ: number; /** 右手笛卡尔坐标系中X轴的位置。 */ - positionX: number + positionX: number; /** 右手笛卡尔坐标系中Y轴的位置。 */ - positionY: number + positionY: number; /** 右手笛卡尔坐标系中Z轴的位置。 */ - positionZ: number + positionZ: number; /** 设置监听器的方向 */ - setOrientation: (...args: any[]) => any + setOrientation: (...args: any[]) => any; /** 设置监听器的位置 */ - setPosition: (...args: any[]) => any + setPosition: (...args: any[]) => any; /** 表示在与position (positionX、positionY和positionZ)值相同的笛卡尔坐标系中侦听器向前方向的水平位置。 */ - upX: number + upX: number; /** 表示在与position (positionX、positionY和positionZ)值相同的笛卡尔坐标系中侦听器向上方向的水平位置。 */ - upY: number + upY: number; /** 表示在与position (positionX、positionY和positionZ)值相同的笛卡尔坐标系中侦听器向后方向的水平位置。 */ - upZ: number + upZ: number; } /** 需要基础库: `2.19.0` * * AudioParam 接口代表音频相关的参数,通常是 AudioNode(例如 GainNode.gain)的参数 */ interface AudioParam { /** 代表被具体的 AudioNode 创建的 AudioParam 的属性的初始值(只读) */ - defaultValue: number + defaultValue: number; /** 代表参数有效范围的最大可能值(只读) */ - maxValue: number + maxValue: number; /** 代表参数有效范围的最小可能值(只读) */ - minValue: number + minValue: number; /** 当前属性的值(比如音量值或播放倍速值)(可读可写) */ - value: number + value: number; } interface AuthPrivateMessageOption { /** shareTicket。可以从 wx.getEnterOptionsSync 中获取。详情 [shareTicket](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ - shareTicket: string + shareTicket: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AuthPrivateMessageCompleteCallback + complete?: AuthPrivateMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AuthPrivateMessageFailCallback + fail?: AuthPrivateMessageFailCallback; /** 接口调用成功的回调函数 */ - success?: AuthPrivateMessageSuccessCallback + success?: AuthPrivateMessageSuccessCallback; } interface AuthPrivateMessageSuccessCallbackResult { /** 经过加密的activityId,解密后可得到原始的activityId。若解密后得到的activityId可以与开发者后台的活动id对应上则验证通过,否则表明valid字段不可靠(被篡改) 详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ - encryptedData: string + encryptedData: string; /** 错误信息 */ - errMsg: string + errMsg: string; /** 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ - iv: string + iv: string; /** 验证是否通过 */ - valid: boolean + valid: boolean; } /** 用户授权设置信息,详情参考[权限](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) */ interface AuthSetting { /** 是否授权系统日历,对应接口 [wx.addPhoneRepeatCalendar](https://developers.weixin.qq.com/miniprogram/dev/api/device/calendar/wx.addPhoneRepeatCalendar.html)、[wx.addPhoneCalendar](https://developers.weixin.qq.com/miniprogram/dev/api/device/calendar/wx.addPhoneCalendar.html) */ - 'scope.addPhoneCalendar'?: boolean + 'scope.addPhoneCalendar'?: boolean; /** 是否添加通讯录联系人,对应接口 [wx.addPhoneContact](https://developers.weixin.qq.com/miniprogram/dev/api/device/contact/wx.addPhoneContact.html) */ - 'scope.addPhoneContact'?: boolean + 'scope.addPhoneContact'?: boolean; /** 是否授权通讯地址,已取消此项授权,会默认返回true */ - 'scope.address'?: boolean + 'scope.address'?: boolean; /** 是否授权蓝牙,对应接口 [wx.openBluetoothAdapter](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.openBluetoothAdapter.html)、[wx.createBLEPeripheralServer](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/wx.createBLEPeripheralServer.html) */ - 'scope.bluetooth'?: boolean + 'scope.bluetooth'?: 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 + 'scope.camera'?: boolean; /** 是否授权获取发票,已取消此项授权,会默认返回true */ - 'scope.invoice'?: boolean + 'scope.invoice'?: boolean; /** 是否授权发票抬头,已取消此项授权,会默认返回true */ - 'scope.invoiceTitle'?: boolean + 'scope.invoiceTitle'?: boolean; /** 是否授权录音功能,对应接口 [wx.startRecord](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.startRecord.html) */ - 'scope.record'?: boolean + 'scope.record'?: boolean; /** 是否授权模糊地理位置,对应接口 [wx.getFuzzyLocation](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getFuzzyLocation.html) */ - 'scope.userFuzzyLocation'?: boolean + 'scope.userFuzzyLocation'?: boolean; /** 是否授权用户信息,对应接口 [wx.getUserInfo](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html) */ - 'scope.userInfo'?: boolean + '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 + 'scope.userLocation'?: boolean; /** 是否授权微信运动步数,对应接口 [wx.getWeRunData](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/werun/wx.getWeRunData.html) */ - 'scope.werun'?: boolean + '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 + 'scope.writePhotosAlbum'?: boolean; } interface AuthorizeForMiniProgramOption { /** 需要获取权限的 scope,详见 [scope 列表](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html#scope-列表) @@ -700,67 +689,67 @@ declare namespace WechatMiniprogram { * - 'scope.record': ; * - 'scope.writePhotosAlbum': ; * - 'scope.camera': ; */ - scope: 'scope.record' | 'scope.writePhotosAlbum' | 'scope.camera' + scope: 'scope.record' | 'scope.writePhotosAlbum' | 'scope.camera'; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AuthorizeForMiniProgramCompleteCallback + complete?: AuthorizeForMiniProgramCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AuthorizeForMiniProgramFailCallback + fail?: AuthorizeForMiniProgramFailCallback; /** 接口调用成功的回调函数 */ - success?: AuthorizeForMiniProgramSuccessCallback + success?: AuthorizeForMiniProgramSuccessCallback; } interface AuthorizeOption { /** 需要获取权限的 scope,详见 [scope 列表](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html#scope-列表) */ - scope: string + scope: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: AuthorizeCompleteCallback + complete?: AuthorizeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: AuthorizeFailCallback + fail?: AuthorizeFailCallback; /** 接口调用成功的回调函数 */ - success?: AuthorizeSuccessCallback + success?: AuthorizeSuccessCallback; } /** 设备特征列表 */ interface BLECharacteristic { /** 该特征支持的操作类型 */ - properties: BLECharacteristicProperties + properties: BLECharacteristicProperties; /** 蓝牙设备特征的 UUID */ - uuid: string + uuid: string; } /** 该特征支持的操作类型 */ interface BLECharacteristicProperties { /** 该特征是否支持 indicate 操作 */ - indicate: boolean + indicate: boolean; /** 该特征是否支持 notify 操作 */ - notify: boolean + notify: boolean; /** 该特征是否支持 read 操作 */ - read: boolean + read: boolean; /** 该特征是否支持 write 操作 */ - write: boolean + write: boolean; /** 该特征是否支持有回复写操作 */ - writeDefault: boolean + writeDefault: boolean; /** 该特征是否支持无回复写操作 */ - writeNoResponse: boolean + writeNoResponse: boolean; } interface BLEPeripheralServerCloseOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SocketTaskCloseCompleteCallback + complete?: SocketTaskCloseCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SocketTaskCloseFailCallback + fail?: SocketTaskCloseFailCallback; /** 接口调用成功的回调函数 */ - success?: SocketTaskCloseSuccessCallback + success?: SocketTaskCloseSuccessCallback; } /** 描述service的Object */ interface BLEPeripheralService { /** characteristics列表 */ - characteristics: Characteristic[] + characteristics: Characteristic[]; /** 蓝牙服务的 UUID */ - uuid: string + uuid: string; } /** 设备服务列表 */ interface BLEService { /** 该服务是否为主服务 */ - isPrimary: boolean + isPrimary: boolean; /** 蓝牙设备服务的 UUID */ - uuid: string + uuid: string; } /** BackgroundAudioManager 实例,可通过 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 获取。 * @@ -780,45 +769,45 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb /** 需要基础库: `3.4.8` * * 音频类型。可设置 "audio" 和 "music" 两种值,默认为 "audio"。不同音频类型对应的播放器样式不一样(实验特性,目前仅iOS和Android端支持) */ - audioType: string + audioType: string; /** 音频已缓冲的时间,仅保证当前播放时间点到此时间点内容已缓冲。(只读) */ - buffered: number + buffered: number; /** 封面图 URL,用于做原生音频播放器背景图。原生音频播放器中的分享功能,分享出去的卡片配图及背景也将使用该图。 */ - coverImgUrl: string + coverImgUrl: string; /** 当前音频的播放位置(单位:s),只有在有合法 src 时返回。(只读) */ - currentTime: number + currentTime: number; /** 当前音频的长度(单位:s),只有在有合法 src 时返回。(只读) */ - duration: number + duration: number; /** 专辑名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ - epname: string + epname: string; /** 当前是否暂停或停止。(只读) */ - paused: boolean + paused: boolean; /** 需要基础库: `2.11.0` * * 播放速度。范围 0.5-2.0,默认为 1。(Android 需要 6 及以上版本) */ - playbackRate: number + playbackRate: number; /** 需要基础库: `1.9.94` * * 音频协议。默认值为 'http',设置 'hls' 可以支持播放 HLS 协议的直播音频。 */ - protocol: string + protocol: string; /** 需要基础库: `3.4.8` * * 关联页面路径。设置后,当点击播放器上的小程序跳转链接时,将跳转到这个关联页面路径(实验特性,目前仅Android端支持) */ - referrerPath: string + referrerPath: string; /** 需要基础库: `2.13.0` * * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ - referrerPolicy: string + referrerPolicy: string; /** 歌手名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ - singer: string + singer: string; /** 音频的数据源([2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 开始支持云文件ID)。默认为空字符串,**当设置了新的 src 时,会自动开始播放**,目前支持的格式有 m4a, aac, mp3, wav。 */ - src: string + src: string; /** 音频开始播放的位置(单位:s)。 */ - startTime: number + startTime: number; /** 音频标题,用于原生音频播放器音频标题(必填)。原生音频播放器中的分享功能,分享出去的卡片标题,也将使用该值。 */ - title: string + title: string; /** 页面链接,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ - webUrl: string + webUrl: string; /** [BackgroundAudioManager.onCanplay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onCanplay.html) * * 在插件中使用:支持 @@ -826,8 +815,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频进入可播放状态事件。 但不保证后面可以流畅播放 */ onCanplay( /** 背景音频进入可播放状态事件的监听函数 */ - listener: OnCanplayCallback - ): void + listener: OnCanplayCallback, + ): void; /** [BackgroundAudioManager.onEnded(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onEnded.html) * * 在插件中使用:支持 @@ -835,8 +824,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频自然播放结束事件 */ onEnded( /** 背景音频自然播放结束事件的监听函数 */ - listener: OnEndedCallback - ): void + listener: OnEndedCallback, + ): void; /** [BackgroundAudioManager.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onError.html) * * 在插件中使用:支持 @@ -844,8 +833,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频播放错误事件 */ onError( /** 背景音频播放错误事件的监听函数 */ - listener: BackgroundAudioManagerOnErrorCallback - ): void + listener: BackgroundAudioManagerOnErrorCallback, + ): void; /** [BackgroundAudioManager.onNext(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onNext.html) * * 在插件中使用:支持 @@ -853,8 +842,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听用户在系统音乐播放面板点击下一曲事件 */ onNext( /** 用户在系统音乐播放面板点击下一曲事件的监听函数 */ - listener: OnNextCallback - ): void + listener: OnNextCallback, + ): void; /** [BackgroundAudioManager.onPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onPause.html) * * 在插件中使用:支持 @@ -862,8 +851,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频暂停事件 */ onPause( /** 背景音频暂停事件的监听函数 */ - listener: OnPauseCallback - ): void + listener: OnPauseCallback, + ): void; /** [BackgroundAudioManager.onPlay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onPlay.html) * * 在插件中使用:支持 @@ -871,8 +860,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频播放事件 */ onPlay( /** 背景音频播放事件的监听函数 */ - listener: OnPlayCallback - ): void + listener: OnPlayCallback, + ): void; /** [BackgroundAudioManager.onPrev(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onPrev.html) * * 在插件中使用:支持 @@ -880,8 +869,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听用户在系统音乐播放面板点击上一曲事件 */ onPrev( /** 用户在系统音乐播放面板点击上一曲事件的监听函数 */ - listener: OnPrevCallback - ): void + listener: OnPrevCallback, + ): void; /** [BackgroundAudioManager.onSeeked(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onSeeked.html) * * 在插件中使用:支持 @@ -889,8 +878,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频完成跳转操作事件 */ onSeeked( /** 背景音频完成跳转操作事件的监听函数 */ - listener: OnSeekedCallback - ): void + listener: OnSeekedCallback, + ): void; /** [BackgroundAudioManager.onSeeking(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onSeeking.html) * * 在插件中使用:支持 @@ -898,8 +887,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频开始跳转操作事件 */ onSeeking( /** 背景音频开始跳转操作事件的监听函数 */ - listener: OnSeekingCallback - ): void + listener: OnSeekingCallback, + ): void; /** [BackgroundAudioManager.onStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onStop.html) * * 在插件中使用:支持 @@ -907,8 +896,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频停止事件 */ onStop( /** 背景音频停止事件的监听函数 */ - listener: InnerAudioContextOnStopCallback - ): void + listener: InnerAudioContextOnStopCallback, + ): void; /** [BackgroundAudioManager.onTimeUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onTimeUpdate.html) * * 在插件中使用:支持 @@ -916,8 +905,8 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听背景音频播放进度更新事件,只有小程序在前台时会回调。 */ onTimeUpdate( /** 背景音频播放进度更新事件的监听函数 */ - listener: OnTimeUpdateCallback - ): void + listener: OnTimeUpdateCallback, + ): void; /** [BackgroundAudioManager.onWaiting(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onWaiting.html) * * 在插件中使用:支持 @@ -925,20 +914,20 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 监听音频加载中事件。当音频因为数据不足,需要停下来加载时会触发 */ onWaiting( /** 音频加载中事件的监听函数 */ - listener: OnWaitingCallback - ): void + listener: OnWaitingCallback, + ): void; /** [BackgroundAudioManager.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.pause.html) * * 在插件中使用:支持 * * 暂停音乐 */ - pause(): void + pause(): void; /** [BackgroundAudioManager.play()](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.play.html) * * 在插件中使用:支持 * * 播放音乐 */ - play(): void + play(): void; /** [BackgroundAudioManager.seek(number currentTime)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.seek.html) * * 在插件中使用:支持 @@ -946,43 +935,43 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 跳转到指定位置 */ seek( /** 跳转的位置,单位 s。精确到小数点后 3 位,即支持 ms 级别精确度 */ - currentTime: number - ): void + currentTime: number, + ): void; /** [BackgroundAudioManager.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.stop.html) * * 在插件中使用:支持 * * 停止音乐 */ - stop(): void + stop(): void; } interface BatchGetStorageOption { /** 本地缓存中指定的 keyList */ - keyList: string[] + keyList: string[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: BatchGetStorageCompleteCallback + complete?: BatchGetStorageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: BatchGetStorageFailCallback + fail?: BatchGetStorageFailCallback; /** 接口调用成功的回调函数 */ - success?: BatchGetStorageSuccessCallback + success?: BatchGetStorageSuccessCallback; } interface BatchSetStorageOption { /** [{ key, value }] */ - kvList: any[] + kvList: any[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: BatchSetStorageCompleteCallback + complete?: BatchSetStorageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: BatchSetStorageFailCallback + fail?: BatchSetStorageFailCallback; /** 接口调用成功的回调函数 */ - success?: BatchSetStorageSuccessCallback + success?: BatchSetStorageSuccessCallback; } /** Beacon 设备 */ interface BeaconInfo { /** Beacon 设备的距离,单位 m。iOS 上,proximity 为 0 时,accuracy 为 -1。 */ - accuracy: number + accuracy: number; /** Beacon 设备的主 ID */ - major: number + major: number; /** Beacon 设备的次 ID */ - minor: number + minor: number; /** 表示设备距离的枚举值(仅iOS) * * 可选值: @@ -990,61 +979,61 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * - 1: 十分近; * - 2: 比较近; * - 3: 远; */ - proximity: 0 | 1 | 2 | 3 + proximity: 0 | 1 | 2 | 3; /** 表示设备的信号强度,单位 dBm */ - rssi: number + rssi: number; /** Beacon 设备广播的 UUID */ - uuid: string + uuid: string; } /** 需要基础库: `2.20.1` * * 以 beacon 设备形式广播的参数。 */ interface BeaconInfoObj { /** Beacon 设备的主 ID */ - major: number + major: number; /** Beacon 设备的次 ID */ - minor: number + minor: number; /** Beacon 设备广播的 UUID */ - uuid: string + uuid: string; /** 用于判断距离设备 1 米时 RSSI 大小的参考值 */ - measuredPower?: number + measuredPower?: number; } interface BindWifiOption { /** 当前 wifi 网络的 BSSID ,可通过 wx.getConnectedWifi 获取 */ - BSSID: string + BSSID: string; } interface BlueToothDevice { /** 当前蓝牙设备的信号强度,单位 dBm */ - RSSI: number + RSSI: number; /** 当前蓝牙设备的广播数据段中的 ManufacturerData 数据段。 */ - advertisData: ArrayBuffer + advertisData: ArrayBuffer; /** 当前蓝牙设备的广播数据段中的 ServiceUUIDs 数据段 */ - advertisServiceUUIDs: string[] + advertisServiceUUIDs: string[]; /** 当前蓝牙设备是否可连接( Android 8.0 以下不支持返回该值 ) */ - connectable: boolean + connectable: boolean; /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 当前蓝牙设备的广播数据段中的 LocalName 数据段 */ - localName: string + localName: string; /** 蓝牙设备名称,某些设备可能没有 */ - name: string + name: string; /** 当前蓝牙设备的广播数据段中的 ServiceData 数据段 */ - serviceData: IAnyObject + serviceData: IAnyObject; } /** 搜索到的设备列表 */ interface BluetoothDeviceInfo { /** 用于区分设备的 id */ - deviceId: string + deviceId: string; /** 蓝牙设备名称,某些设备可能没有 */ - name: string + name: string; } interface BlurOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: BlurCompleteCallback + complete?: BlurCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: BlurFailCallback + fail?: BlurFailCallback; /** 接口调用成功的回调函数 */ - success?: BlurSuccessCallback + success?: BlurSuccessCallback; } /** 需要基础库: `2.28.0` * @@ -1057,40 +1046,40 @@ backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb * 可选值: * - 1: 通过摄像头实时检测; * - 2: 静态图片检测; */ - mode: 1 | 2 + mode: 1 | 2; } interface BoundingClientRectCallbackResult { /** 节点的下边界坐标 */ - bottom: number + bottom: number; /** 节点的 dataset */ - dataset: IAnyObject + dataset: IAnyObject; /** 节点的高度 */ - height: number + height: number; /** 节点的 ID */ - id: string + id: string; /** 节点的左边界坐标 */ - left: number + left: number; /** 节点的右边界坐标 */ - right: number + right: number; /** 节点的上边界坐标 */ - top: number + top: number; /** 节点的宽度 */ - width: number + width: number; } /** 目标边界 */ interface BoundingClientRectResult { /** 下边界 */ - bottom: number + bottom: number; /** 高度 */ - height: number + height: number; /** 左边界 */ - left: number + left: number; /** 右边界 */ - right: number + right: number; /** 上边界 */ - top: number + top: number; /** 宽度 */ - width: number + width: number; } /** 音频源节点,通过 [WebAudioContext.createBufferSource](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createBufferSource.html)方法获得。 * @@ -1106,19 +1095,19 @@ source.start() /** [AudioBuffer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.html) * * 是一个 AudioBuffer, 它定义了要播放的音频,当设置它的值为 0 时,它会定义一个静默的单通道。(可读可写) */ - buffer: AudioBuffer + buffer: AudioBuffer; /** 定义音频是否循环播放(可读可写) */ - loop?: boolean + loop?: boolean; /** 定义音频循环播放时,结束播放的位置。单位是秒,默认值是0(可读可写) */ - loopEnd?: number + loopEnd?: number; /** 定义音频循环播放时,开始播放的位置。单位是秒,默认值是0(可读可写) */ - loopStart?: number + loopStart?: number; /** 定义音频播放结束事件回调函数(可读可写) */ - onended?: (...args: any[]) => any + onended?: (...args: any[]) => any; /** [AudioParam](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioParam.html) * * 定义音频的播放倍速,数值越大速度越快,默认速度1.0,有效范围为 0 < playbackRate <= 2.0(可读可写) */ - playbackRate?: AudioParam + playbackRate?: AudioParam; /** [BufferSourceNode.connect(AudioNode|[AudioParam](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioParam.html) destination)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.connect.html) * * 在插件中使用:不支持 @@ -1126,14 +1115,14 @@ source.start() * 连接到一个指定目标。这个指定的目标可能是另一个 AudioNode(从而将音频数据引导到下一个指定节点)或一个AudioParam, 以便上一个节点的输出数据随着时间流逝能自动地对下一个参数值进行改变 */ connect( /** 要建立连接的目标节点 */ - destination: AudioNode | AudioParam - ): void + destination: AudioNode | AudioParam, + ): void; /** [BufferSourceNode.disconnect()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.disconnect.html) * * 在插件中使用:不支持 * * 与已连接的目标节点断开连接 */ - disconnect(): void + disconnect(): void; /** [BufferSourceNode.start(number when, number offset, number duration)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.start.html) * * 在插件中使用:不支持 @@ -1145,8 +1134,8 @@ source.start() /** 音频开始播放的位置,单位是秒。默认值是 0 */ offset?: number, /** 音频播放的持续时间,单位是秒。如果这个参数没有被指定,声音播放到自然结束或者使用stop() 方法结束。使用这个参数的功能与调用 start(when, offset) 和调用 stop(when+duration)效果完全相同 */ - duration?: number - ): void + duration?: number, + ): void; /** [BufferSourceNode.stop(number when)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.stop.html) * * 在插件中使用:不支持 @@ -1154,8 +1143,8 @@ source.start() * 停止播放 */ stop( /** 延迟停止播放的时间,单位是秒。与 AudioContext 使用相同的时间坐标系统。省略此参数、指定值 0 或传递负值会使声音立即停止播放。 */ - when?: number - ): void + when?: number, + ): void; } /** 需要基础库: `2.24.0` * @@ -1170,23 +1159,23 @@ source.start() * > 2. 缓存管理器中的缓存不会占用 storage 空间,但是有大小限制,请勿在非必要的请求上使用缓存。 */ interface CacheManager { /** 全局缓存有效时间 */ - maxAge: number + maxAge: number; /** 当前缓存模式 * * 可选值: * - 'weakNetwork': 默认值,弱网/离线使用缓存返回; * - 'always': 总是使用缓存返回; * - 'none': 不开启,后续可手动开启/停止使用缓存返回; */ - mode: 'weakNetwork' | 'always' | 'none' + mode: 'weakNetwork' | 'always' | 'none'; /** 全局 origin */ - origin: string + origin: string; /** 当前缓存管理器状态 * * 可选值: * - 0: 不使用缓存返回; * - 1: 使用缓存返回; * - 2: 未知; */ - state: 0 | 1 | 2 + state: 0 | 1 | 2; /** [Array.<string> CacheManager.addRules(Object rules)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.addRules.html) * * 需要基础库: `2.24.0` @@ -1196,8 +1185,8 @@ source.start() * 批量添加规则,规则写法可参考 [CacheManager.addRule](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.addRule.html)。 */ addRules( /** 规则列表 */ - rules: IAnyObject - ): string[] + rules: IAnyObject, + ): string[]; /** [CacheManager.clearCaches()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.clearCaches.html) * * 需要基础库: `2.24.0` @@ -1205,7 +1194,7 @@ source.start() * 在插件中使用:不支持 * * 清空所有缓存。 */ - clearCaches(): void + clearCaches(): void; /** [CacheManager.clearRules()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.clearRules.html) * * 需要基础库: `2.24.0` @@ -1213,7 +1202,7 @@ source.start() * 在插件中使用:不支持 * * 清空所有规则,同时会删除对应规则下所有缓存。 */ - clearRules(): void + clearRules(): void; /** [CacheManager.deleteCache(string id)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.deleteCache.html) * * 需要基础库: `2.24.0` @@ -1223,8 +1212,8 @@ source.start() * 删除缓存。 */ deleteCache( /** 缓存 id */ - id: string - ): void + id: string, + ): void; /** [CacheManager.deleteCaches(Array.<string> ids)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.deleteCaches.html) * * 需要基础库: `2.24.0` @@ -1234,8 +1223,8 @@ source.start() * 批量删除缓存。 */ deleteCaches( /** 缓存 id 列表 */ - ids: string[] - ): void + ids: string[], + ): void; /** [CacheManager.deleteRule(string id)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.deleteRule.html) * * 需要基础库: `2.24.0` @@ -1245,8 +1234,8 @@ source.start() * 删除规则,同时会删除对应规则下所有缓存。 */ deleteRule( /** 规则 id */ - id: string - ): void + id: string, + ): void; /** [CacheManager.deleteRules(Array.<string> ids)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.deleteRules.html) * * 需要基础库: `2.24.0` @@ -1256,8 +1245,8 @@ source.start() * 批量删除规则,同时会删除对应规则下所有缓存。 */ deleteRules( /** 规则 id 列表 */ - ids: string[] - ): void + ids: string[], + ): void; /** [CacheManager.off(string eventName, function handler)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.off.html) * * 需要基础库: `2.24.0` @@ -1269,8 +1258,8 @@ source.start() /** 事件名 */ eventName: string, /** 事件句柄 */ - handler: (...args: any[]) => any - ): void + handler: (...args: any[]) => any, + ): void; /** [CacheManager.on(string eventName, function handler)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.on.html) * * 需要基础库: `2.24.0` @@ -1320,8 +1309,8 @@ cacheManager.on('request', handler) * - 'exitWeakNetwork': 离开弱网/离线状态; */ eventName: 'request' | 'enterWeakNetwork' | 'exitWeakNetwork', /** 事件句柄 */ - handler: (...args: any[]) => any - ): void + handler: (...args: any[]) => any, + ): void; /** [CacheManager.start()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.start.html) * * 需要基础库: `2.24.0` @@ -1329,7 +1318,7 @@ cacheManager.on('request', handler) * 在插件中使用:不支持 * * 开启缓存,仅在 mode 为 none 时生效,调用后缓存管理器的 state 会置为 1。 */ - start(): void + start(): void; /** [CacheManager.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.stop.html) * * 需要基础库: `2.24.0` @@ -1337,7 +1326,7 @@ cacheManager.on('request', handler) * 在插件中使用:不支持 * * 关闭缓存,仅在 mode 为 none 时生效,调用后缓存管理器的 state 会置为 0。 */ - stop(): void + stop(): void; /** [Object CacheManager.match(Object evt)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.match.html) * * 需要基础库: `2.24.0` @@ -1364,8 +1353,8 @@ cacheManager.on('request', handler) ``` */ match( /** request 事件对象 */ - evt: IAnyObject - ): MatchCache + evt: IAnyObject, + ): MatchCache; /** [string CacheManager.addRule(Object rule)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.addRule.html) * * 需要基础库: `2.24.0` @@ -1482,60 +1471,60 @@ const ruleId = cacheManager.addRule({ * > 生成缓存 id 时没有使用请求中完整的 query 参数或者请求参数来作为基准,是考虑到很多请求可能会带上 token 或时间戳等参数。因为此参数存在不确定性,会导致每次请求生成的缓存 id 都不同,进而导致缓存命中率下降,故采取规则中声明的 query 参数和 dataSchema 声明的请求参数来作为生成缓存 id 的基准。 */ addRule( /** 规则 */ - rule: IAnyObject - ): string + rule: IAnyObject, + ): string; } interface CameraContextSetZoomOption { /** 缩放级别,范围[1, maxZoom]。zoom 可取小数,精确到小数后一位。maxZoom 可在 bindinitdone 返回值中获取。 */ - zoom: number + zoom: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetZoomCompleteCallback + complete?: SetZoomCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetZoomFailCallback + fail?: SetZoomFailCallback; /** 接口调用成功的回调函数 */ - success?: CameraContextSetZoomSuccessCallback + success?: CameraContextSetZoomSuccessCallback; } interface CameraContextStartRecordOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartRecordCompleteCallback + complete?: StartRecordCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartRecordFailCallback + fail?: StartRecordFailCallback; /** 需要基础库: `2.22.0` * * 是否开启镜像 */ - selfieMirror?: boolean + selfieMirror?: boolean; /** 接口调用成功的回调函数 */ - success?: CameraContextStartRecordSuccessCallback + success?: CameraContextStartRecordSuccessCallback; /** 需要基础库: `2.22.0` * * 录制时长上限,单位为秒,最长不能超过 5 分钟 */ - timeout?: number + timeout?: number; /** 超过录制时长上限时会结束录像并触发此回调,录像异常退出时也会触发此回调 */ - timeoutCallback?: StartRecordTimeoutCallback + timeoutCallback?: StartRecordTimeoutCallback; } interface CameraContextStopRecordOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopRecordCompleteCallback + complete?: StopRecordCompleteCallback; /** 启动视频压缩,压缩效果同`chooseVideo` */ - compressed?: boolean + compressed?: boolean; /** 接口调用失败的回调函数 */ - fail?: StopRecordFailCallback + fail?: StopRecordFailCallback; /** 接口调用成功的回调函数 */ - success?: CameraContextStopRecordSuccessCallback + success?: CameraContextStopRecordSuccessCallback; } interface CameraFrameListenerStartOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartCompleteCallback + complete?: StartCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartFailCallback + fail?: StartFailCallback; /** 接口调用成功的回调函数 */ - success?: StartSuccessCallback + success?: StartSuccessCallback; /** [Worker](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.html) * * 需要基础库: `2.25.1` * * 可选参数。如果需要在 iOS ExperimentalWorker 内监听摄像头帧数据,则需要传入对应 Worker 对象。详情 [Worker.getCameraFrameData](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.getCameraFrameData.html) */ - worker?: Worker + worker?: Worker; } /** 需要基础库: `2.7.0` * @@ -1550,9 +1539,9 @@ const ruleId = cacheManager.addRule({ * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/qEGUOqmf7T8z) */ interface Canvas { /** 画布高度 */ - height: number + height: number; /** 画布宽度 */ - width: number + width: number; /** [Canvas.cancelAnimationFrame(number requestID)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.cancelAnimationFrame.html) * * 需要基础库: `2.7.0` @@ -1560,7 +1549,7 @@ const ruleId = cacheManager.addRule({ * 在插件中使用:支持 * * 取消由 requestAnimationFrame 添加到计划中的动画帧请求。支持在 2D Canvas 和 WebGL Canvas 下使用, 但不支持混用 2D 和 WebGL 的方法。 */ - cancelAnimationFrame(requestID: number): void + cancelAnimationFrame(requestID: number): void; /** [[ImageData](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/ImageData.html) Canvas.createImageData()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.createImageData.html) * * 需要基础库: `2.9.0` @@ -1568,7 +1557,7 @@ const ruleId = cacheManager.addRule({ * 在插件中使用:支持 * * 创建一个 ImageData 对象。仅支持在 2D Canvas 中使用。 */ - createImageData(): ImageData + createImageData(): ImageData; /** [[Image](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Image.html) Canvas.createImage()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.createImage.html) * * 需要基础库: `2.7.0` @@ -1576,7 +1565,7 @@ const ruleId = cacheManager.addRule({ * 在插件中使用:支持 * * 创建一个图片对象。 支持在 2D Canvas 和 WebGL Canvas 下使用, 但不支持混用 2D 和 WebGL 的方法。 */ - createImage(): Image + createImage(): Image; /** [[Path2D](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) Canvas.createPath2D([Path2D](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) path)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.createPath2D.html) * * 需要基础库: `2.11.0` @@ -1586,8 +1575,8 @@ const ruleId = cacheManager.addRule({ * 创建 Path2D 对象 */ createPath2D( /** [Path2D](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) */ - path: Path2D - ): Path2D + path: Path2D, + ): Path2D; /** [[RenderingContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/RenderingContext.html) Canvas.getContext(string contextType)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.getContext.html) * * 需要基础库: `2.7.0` @@ -1604,8 +1593,8 @@ const ruleId = cacheManager.addRule({ * * 参数 contextType 可选值: * - '2d': 2d 绘图上下文; */ - contextType: '2d' - ): CanvasRenderingContext.CanvasRenderingContext2D + contextType: '2d', + ): CanvasRenderingContext.CanvasRenderingContext2D; /** [[RenderingContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/RenderingContext.html) Canvas.getContext(string contextType)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.getContext.html) * * 需要基础库: `2.7.0` @@ -1622,8 +1611,8 @@ const ruleId = cacheManager.addRule({ * * 参数 contextType 可选值: * - 'webgl': webgl 绘图上下文; */ - contextType: 'webgl' - ): CanvasRenderingContext.WebGLRenderingContext + contextType: 'webgl', + ): CanvasRenderingContext.WebGLRenderingContext; /** [[RenderingContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/RenderingContext.html) Canvas.getContext(string contextType)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.getContext.html) * * 需要基础库: `2.7.0` @@ -1640,8 +1629,8 @@ const ruleId = cacheManager.addRule({ * * 参数 contextType 可选值: * - 'webgl2': webgl2 绘图上下文; */ - contextType: 'webgl2' - ): CanvasRenderingContext.WebGL2RenderingContext + contextType: 'webgl2', + ): CanvasRenderingContext.WebGL2RenderingContext; /** [number Canvas.requestAnimationFrame(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.requestAnimationFrame.html) * * 需要基础库: `2.7.0` @@ -1651,8 +1640,8 @@ const ruleId = cacheManager.addRule({ * 在下次进行重绘时执行。 支持在 2D Canvas 和 WebGL Canvas 下使用, 但不支持混用 2D 和 WebGL 的方法。 */ requestAnimationFrame( /** 执行的 callback */ - callback: (...args: any[]) => any - ): number + callback: (...args: any[]) => any, + ): number; /** [string Canvas.toDataURL(string type, number encoderOptions)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.toDataURL.html) * * 需要基础库: `2.11.0` @@ -1664,8 +1653,8 @@ const ruleId = cacheManager.addRule({ /** 图片格式,默认为 image/png */ type: string, /** 在指定图片格式为 image/jpeg 或 image/webp的情况下,可以从 0 到 1 的区间内选择图片的质量。如果超出取值范围,将会使用默认值 0.92。其他参数会被忽略。 */ - encoderOptions: number - ): string + encoderOptions: number, + ): string; } /** @deprecated 基础库版本 [2.9.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [RenderingContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/RenderingContext.html) 替换 * @@ -1674,13 +1663,13 @@ const ruleId = cacheManager.addRule({ /** 需要基础库: `1.9.90` * * 填充颜色。用法同 [CanvasContext.setFillStyle()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setFillStyle.html)。 */ - fillStyle: string | CanvasGradient + fillStyle: string | CanvasGradient; /** 需要基础库: `1.9.90` * * 当前字体样式的属性。符合 [CSS font 语法](https://developer.mozilla.org/zh-CN/docs/Web/CSS/font) 的 DOMString 字符串,至少需要提供字体大小和字体族名。默认值为 10px sans-serif。 */ - font: string + font: string; /** 全局画笔透明度。范围 0-1,0 表示完全透明,1 表示完全不透明。 */ - globalAlpha: number + globalAlpha: number; /** 需要基础库: `1.9.90` * * 在绘制新形状时应用的合成操作的类型。目前安卓版本只适用于 `fill` 填充块的合成,用于 `stroke` 线段的合成效果都是 `source-over`。 @@ -1688,15 +1677,15 @@ const ruleId = cacheManager.addRule({ * 目前支持的操作有 * - 安卓: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 */ - globalCompositeOperation: string + globalCompositeOperation: string; /** 需要基础库: `1.9.90` * * 线条的端点样式。用法同 [CanvasContext.setLineCap()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineCap.html)。 */ - lineCap: string + lineCap: string; /** 需要基础库: `1.9.90` * * 虚线偏移量,初始值为0 */ - lineDashOffset: number + lineDashOffset: number; /** 需要基础库: `1.9.90` * * 线条的交点样式。用法同 [CanvasContext.setLineJoin()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineJoin.html)。 @@ -1705,35 +1694,35 @@ const ruleId = cacheManager.addRule({ * - 'bevel': 斜角; * - 'round': 圆角; * - 'miter': 尖角; */ - lineJoin: 'bevel' | 'round' | 'miter' + lineJoin: 'bevel' | 'round' | 'miter'; /** 需要基础库: `1.9.90` * * 线条的宽度。用法同 [CanvasContext.setLineWidth()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineWidth.html)。 */ - lineWidth: number + lineWidth: number; /** 需要基础库: `1.9.90` * * 最大斜接长度。用法同 [CanvasContext.setMiterLimit()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setMiterLimit.html)。 */ - miterLimit: number + miterLimit: number; /** 需要基础库: `1.9.90` * * 阴影的模糊级别 */ - shadowBlur: number + shadowBlur: number; /** 需要基础库: `1.9.90` * * 阴影的颜色 */ - shadowColor: number + shadowColor: number; /** 需要基础库: `1.9.90` * * 阴影相对于形状在水平方向的偏移 */ - shadowOffsetX: number + shadowOffsetX: number; /** 需要基础库: `1.9.90` * * 阴影相对于形状在竖直方向的偏移 */ - shadowOffsetY: number + shadowOffsetY: number; /** 需要基础库: `1.9.90` * * 边框颜色。用法同 [CanvasContext.setStrokeStyle()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setStrokeStyle.html)。 */ - strokeStyle: string | CanvasGradient + strokeStyle: string | CanvasGradient; /** [CanvasContext.arc(number x, number y, number r, number sAngle, number eAngle, boolean counterclockwise)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.arc.html) * * 在插件中使用:支持 @@ -1815,8 +1804,8 @@ ctx.draw() /** 终止弧度 */ eAngle: number, /** 弧度的方向是否是逆时针 */ - counterclockwise?: boolean - ): void + counterclockwise?: boolean, + ): void; /** [CanvasContext.arcTo(number x1, number y1, number x2, number y2, number radius)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.arcTo.html) * * 需要基础库: `1.9.90` @@ -1837,8 +1826,8 @@ ctx.draw() /** 第二个控制点的 y 轴坐标 */ y2: number, /** 圆弧的半径 */ - radius: number - ): void + radius: number, + ): void; /** [CanvasContext.beginPath()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.beginPath.html) * * 在插件中使用:支持 @@ -1877,7 +1866,7 @@ ctx.draw() ``` * * ![](@program/dev/image/canvas/fill-path.png) */ - beginPath(): void + beginPath(): void; /** [CanvasContext.bezierCurveTo(number cp1x, number cp1y, number cp2x, number cp2y, number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.bezierCurveTo.html) * * 在插件中使用:支持 @@ -1953,8 +1942,8 @@ ctx.draw() /** 结束点的 x 坐标 */ x: number, /** 结束点的 y 坐标 */ - y: number - ): void + y: number, + ): void; /** [CanvasContext.clearRect(number x, number y, number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.clearRect.html) * * 在插件中使用:支持 @@ -1988,8 +1977,8 @@ ctx.draw() /** 矩形路径的宽度 */ width: number, /** 矩形路径的高度 */ - height: number - ): void + height: number, + ): void; /** [CanvasContext.clip()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.clip.html) * * 需要基础库: `1.6.0` @@ -2020,7 +2009,7 @@ wx.downloadFile({ }) ``` * ![](@program/dev/image/canvas/clip.png) */ - clip(): void + clip(): void; /** [CanvasContext.closePath()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.closePath.html) * * 在插件中使用:支持 @@ -2066,7 +2055,7 @@ ctx.draw() ``` * * ![](@program/dev/image/canvas/close-path.png) */ - closePath(): void + closePath(): void; /** [CanvasContext.createPattern(string image, string repetition)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.createPattern.html) * * 需要基础库: `1.9.90` @@ -2087,8 +2076,8 @@ ctx.draw() * - 'repeat-x': 水平方向重复; * - 'repeat-y': 竖直方向重复; * - 'no-repeat': 不重复; */ - repetition: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat' - ): void + repetition: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat', + ): void; /** [CanvasContext.draw(boolean reserve, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.draw.html) * * 在插件中使用:支持 @@ -2131,8 +2120,8 @@ ctx.draw() /** 本次绘制是否接着上一次绘制。即 reserve 参数为 false,则在本次调用绘制之前 native 层会先清空画布再继续绘制;若 reserve 参数为 true,则保留当前画布上的内容,本次调用 drawCanvas 绘制的内容覆盖在上面,默认 false。 */ reserve?: boolean, /** 绘制完成后执行的回调函数 */ - callback?: (...args: any[]) => any - ): void + callback?: (...args: any[]) => any, + ): void; /** [CanvasContext.drawImage(string imageResource, number sx, number sy, number sWidth, number sHeight, number dx, number dy, number dWidth, number dHeight)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html) * * 在插件中使用:支持 @@ -2168,8 +2157,8 @@ wx.chooseImage({ /** imageResource的左上角在目标 canvas 上 x 轴的位置 */ dx: number, /** imageResource的左上角在目标 canvas 上 y 轴的位置 */ - dy: number - ): void + dy: number, + ): void; /** [CanvasContext.drawImage(string imageResource, number sx, number sy, number sWidth, number sHeight, number dx, number dy, number dWidth, number dHeight)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html) * * 在插件中使用:支持 @@ -2209,8 +2198,8 @@ wx.chooseImage({ /** 在目标画布上绘制imageResource的宽度,允许对绘制的imageResource进行缩放 */ dWidth: number, /** 在目标画布上绘制imageResource的高度,允许对绘制的imageResource进行缩放 */ - dHeight: number - ): void + dHeight: number, + ): void; /** [CanvasContext.drawImage(string imageResource, number sx, number sy, number sWidth, number sHeight, number dx, number dy, number dWidth, number dHeight)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html) * * 在插件中使用:支持 @@ -2258,8 +2247,8 @@ wx.chooseImage({ /** 在目标画布上绘制imageResource的宽度,允许对绘制的imageResource进行缩放 */ dWidth: number, /** 在目标画布上绘制imageResource的高度,允许对绘制的imageResource进行缩放 */ - dHeight: number - ): void + dHeight: number, + ): void; /** [CanvasContext.fill()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.fill.html) * * 在插件中使用:支持 @@ -2310,7 +2299,7 @@ ctx.draw() ``` * * ![](@program/dev/image/canvas/fill-path.png) */ - fill(): void + fill(): void; /** [CanvasContext.fillRect(number x, number y, number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.fillRect.html) * * 在插件中使用:支持 @@ -2337,8 +2326,8 @@ ctx.draw() /** 矩形路径的宽度 */ width: number, /** 矩形路径的高度 */ - height: number - ): void + height: number, + ): void; /** [CanvasContext.fillText(string text, number x, number y, number maxWidth)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.fillText.html) * * 在插件中使用:支持 @@ -2368,8 +2357,8 @@ ctx.draw() /** 绘制文本的左上角 y 坐标位置 */ y: number, /** 需要绘制的最大宽度,可选 */ - maxWidth?: number - ): void + maxWidth?: number, + ): void; /** [CanvasContext.lineTo(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.lineTo.html) * * 在插件中使用:支持 @@ -2394,8 +2383,8 @@ ctx.draw() /** 目标位置的 x 坐标 */ x: number, /** 目标位置的 y 坐标 */ - y: number - ): void + y: number, + ): void; /** [CanvasContext.moveTo(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.moveTo.html) * * 在插件中使用:支持 @@ -2422,8 +2411,8 @@ ctx.draw() /** 目标位置的 x 坐标 */ x: number, /** 目标位置的 y 坐标 */ - y: number - ): void + y: number, + ): void; /** [CanvasContext.quadraticCurveTo(number cpx, number cpy, number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.quadraticCurveTo.html) * * 在插件中使用:支持 @@ -2490,8 +2479,8 @@ ctx.draw() /** 结束点的 x 坐标 */ x: number, /** 结束点的 y 坐标 */ - y: number - ): void + y: number, + ): void; /** [CanvasContext.rect(number x, number y, number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.rect.html) * * 在插件中使用:支持 @@ -2519,8 +2508,8 @@ ctx.draw() /** 矩形路径的宽度 */ width: number, /** 矩形路径的高度 */ - height: number - ): void + height: number, + ): void; /** [CanvasContext.restore()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.restore.html) * * 在插件中使用:支持 @@ -2547,7 +2536,7 @@ ctx.fillRect(50, 50, 150, 100) ctx.draw() ``` * ![](@program/dev/image/canvas/save-restore.png) */ - restore(): void + restore(): void; /** [CanvasContext.rotate(number rotate)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.rotate.html) * * 在插件中使用:支持 @@ -2573,8 +2562,8 @@ ctx.draw() * ![](@program/dev/image/canvas/rotate.png) */ rotate( /** 旋转角度,以弧度计 degrees * Math.PI/180;degrees 范围为 0-360 */ - rotate: number - ): void + rotate: number, + ): void; /** [CanvasContext.save()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.save.html) * * 在插件中使用:支持 @@ -2601,7 +2590,7 @@ ctx.fillRect(50, 50, 150, 100) ctx.draw() ``` * ![](@program/dev/image/canvas/save-restore.png) */ - save(): void + save(): void; /** [CanvasContext.scale(number scaleWidth, number scaleHeight)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.scale.html) * * 在插件中使用:支持 @@ -2629,8 +2618,8 @@ ctx.draw() /** 横坐标缩放的倍数 (1 = 100%,0.5 = 50%,2 = 200%) */ scaleWidth: number, /** 纵坐标轴缩放的倍数 (1 = 100%,0.5 = 50%,2 = 200%) */ - scaleHeight: number - ): void + scaleHeight: number, + ): void; /** [CanvasContext.setFillStyle(string|[CanvasGradient](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasGradient.html) color)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setFillStyle.html) * * 在插件中使用:支持 @@ -2651,8 +2640,8 @@ ctx.draw() * ![](@program/dev/image/canvas/fill-rect.png) */ setFillStyle( /** 填充的颜色,默认颜色为 black。 */ - color: string | CanvasGradient - ): void + color: string | CanvasGradient, + ): void; /** [CanvasContext.setFontSize(number fontSize)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setFontSize.html) * * 在插件中使用:支持 @@ -2681,8 +2670,8 @@ ctx.draw() * ![](@program/dev/image/canvas/font-size.png) */ setFontSize( /** 字体的字号 */ - fontSize: number - ): void + fontSize: number, + ): void; /** [CanvasContext.setGlobalAlpha(number alpha)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setGlobalAlpha.html) * * 在插件中使用:支持 @@ -2710,8 +2699,8 @@ ctx.draw() * ![](@program/dev/image/canvas/global-alpha.png) */ setGlobalAlpha( /** 透明度。范围 0-1,0 表示完全透明,1 表示完全不透明。 */ - alpha: number - ): void + alpha: number, + ): void; /** [CanvasContext.setLineCap(string lineCap)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineCap.html) * * 在插件中使用:支持 @@ -2761,8 +2750,8 @@ ctx.draw() * - 'butt': 向线条的每个末端添加平直的边缘。; * - 'round': 向线条的每个末端添加圆形线帽。; * - 'square': 向线条的每个末端添加正方形线帽。; */ - lineCap: 'butt' | 'round' | 'square' - ): void + lineCap: 'butt' | 'round' | 'square', + ): void; /** [CanvasContext.setLineDash(Array.<number> pattern, number offset)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineDash.html) * * 需要基础库: `1.6.0` @@ -2793,8 +2782,8 @@ ctx.draw() /** 一组描述交替绘制线段和间距(坐标空间单位)长度的数字 */ pattern: number[], /** 虚线偏移量 */ - offset: number - ): void + offset: number, + ): void; /** [CanvasContext.setLineJoin(string lineJoin)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineJoin.html) * * 在插件中使用:支持 @@ -2848,8 +2837,8 @@ ctx.draw() * - 'bevel': 斜角; * - 'round': 圆角; * - 'miter': 尖角; */ - lineJoin: 'bevel' | 'round' | 'miter' - ): void + lineJoin: 'bevel' | 'round' | 'miter', + ): void; /** [CanvasContext.setLineWidth(number lineWidth)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineWidth.html) * * 在插件中使用:支持 @@ -2892,8 +2881,8 @@ ctx.draw() * ![](@program/dev/image/canvas/line-width.png) */ setLineWidth( /** 线条的宽度,单位px */ - lineWidth: number - ): void + lineWidth: number, + ): void; /** [CanvasContext.setMiterLimit(number miterLimit)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setMiterLimit.html) * * 在插件中使用:支持 @@ -2948,8 +2937,8 @@ ctx.draw() * ![](@program/dev/image/canvas/miter-limit.png) */ setMiterLimit( /** 最大斜接长度 */ - miterLimit: number - ): void + miterLimit: number, + ): void; /** [CanvasContext.setShadow(number offsetX, number offsetY, number blur, string color)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setShadow.html) * * 在插件中使用:支持 @@ -2977,8 +2966,8 @@ ctx.draw() /** 阴影的模糊级别,数值越大越模糊。范围 0- 100。,默认值为 0。 */ blur: number, /** 阴影的颜色。默认值为 black。 */ - color: string - ): void + color: string, + ): void; /** [CanvasContext.setStrokeStyle(string|[CanvasGradient](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasGradient.html) color)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setStrokeStyle.html) * * 在插件中使用:支持 @@ -2999,8 +2988,8 @@ ctx.draw() * ![](@program/dev/image/canvas/stroke-rect.png) */ setStrokeStyle( /** 描边的颜色,默认颜色为 black。 */ - color: string | CanvasGradient - ): void + color: string | CanvasGradient, + ): void; /** [CanvasContext.setTextAlign(string align)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setTextAlign.html) * * 需要基础库: `1.1.0` @@ -3043,8 +3032,8 @@ ctx.draw() * - 'left': 左对齐; * - 'center': 居中对齐; * - 'right': 右对齐; */ - align: 'left' | 'center' | 'right' - ): void + align: 'left' | 'center' | 'right', + ): void; /** [CanvasContext.setTextBaseline(string textBaseline)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setTextBaseline.html) * * 需要基础库: `1.4.0` @@ -3091,8 +3080,8 @@ ctx.draw() * - 'bottom': 底部对齐; * - 'middle': 居中对齐; * - 'normal': ; */ - textBaseline: 'top' | 'bottom' | 'middle' | 'normal' - ): void + textBaseline: 'top' | 'bottom' | 'middle' | 'normal', + ): void; /** [CanvasContext.setTransform(number scaleX, number skewX, number skewY, number scaleY, number translateX, number translateY)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setTransform.html) * * 需要基础库: `1.9.90` @@ -3115,8 +3104,8 @@ ctx.draw() /** 水平移动 */ translateX: number, /** 垂直移动 */ - translateY: number - ): void + translateY: number, + ): void; /** [CanvasContext.stroke()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.stroke.html) * * 在插件中使用:支持 @@ -3164,7 +3153,7 @@ ctx.draw() ``` * * ![](@program/dev/image/canvas/stroke-path.png) */ - stroke(): void + stroke(): void; /** [CanvasContext.strokeRect(number x, number y, number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.strokeRect.html) * * 在插件中使用:支持 @@ -3191,8 +3180,8 @@ ctx.draw() /** 矩形路径的宽度 */ width: number, /** 矩形路径的高度 */ - height: number - ): void + height: number, + ): void; /** [CanvasContext.strokeText(string text, number x, number y, number maxWidth)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.strokeText.html) * * 需要基础库: `1.9.90` @@ -3211,8 +3200,8 @@ ctx.draw() /** 文本起始点的 y 轴坐标 */ y: number, /** 需要绘制的最大宽度,可选 */ - maxWidth?: number - ): void + maxWidth?: number, + ): void; /** [CanvasContext.transform(number scaleX, number skewX, number skewY, number scaleY, number translateX, number translateY)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.transform.html) * * 需要基础库: `1.9.90` @@ -3235,8 +3224,8 @@ ctx.draw() /** 水平移动 */ translateX: number, /** 垂直移动 */ - translateY: number - ): void + translateY: number, + ): void; /** [CanvasContext.translate(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.translate.html) * * 在插件中使用:支持 @@ -3265,8 +3254,8 @@ ctx.draw() /** 水平坐标平移量 */ x: number, /** 竖直坐标平移量 */ - y: number - ): void + y: number, + ): void; /** [Object CanvasContext.measureText(string text)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.measureText.html) * * 需要基础库: `1.9.90` @@ -3279,8 +3268,8 @@ ctx.draw() * 测量文本尺寸信息。目前仅返回文本宽度。同步接口。 */ measureText( /** 要测量的文本 */ - text: string - ): TextMetrics + text: string, + ): TextMetrics; /** [[CanvasGradient](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasGradient.html) CanvasContext.createCircularGradient(number x, number y, number r)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.createCircularGradient.html) * * 在插件中使用:支持 @@ -3312,8 +3301,8 @@ ctx.draw() /** 圆心的 y 坐标 */ y: number, /** 圆的半径 */ - r: number - ): CanvasGradient + r: number, + ): CanvasGradient; /** [[CanvasGradient](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasGradient.html) CanvasContext.createLinearGradient(number x0, number y0, number x1, number y1)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.createLinearGradient.html) * * 在插件中使用:支持 @@ -3347,73 +3336,73 @@ ctx.draw() /** 终点的 x 坐标 */ x1: number, /** 终点的 y 坐标 */ - y1: number - ): CanvasGradient + y1: number, + ): CanvasGradient; } interface CanvasGetImageDataOption { /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 `canvas-id` 属性。 */ - canvasId: string + canvasId: string; /** 将要被提取的图像数据矩形区域的高度 */ - height: number + height: number; /** 将要被提取的图像数据矩形区域的宽度 */ - width: number + width: number; /** 将要被提取的图像数据矩形区域的左上角横坐标 */ - x: number + x: number; /** 将要被提取的图像数据矩形区域的左上角纵坐标 */ - y: number + y: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CanvasGetImageDataCompleteCallback + complete?: CanvasGetImageDataCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CanvasGetImageDataFailCallback + fail?: CanvasGetImageDataFailCallback; /** 接口调用成功的回调函数 */ - success?: CanvasGetImageDataSuccessCallback + success?: CanvasGetImageDataSuccessCallback; } interface CanvasGetImageDataSuccessCallbackResult { /** 图像像素点数据,一维数组,每四项表示一个像素点的 rgba */ - data: Uint8ClampedArray + data: Uint8ClampedArray; /** 图像数据矩形的高度 */ - height: number + height: number; /** 图像数据矩形的宽度 */ - width: number - errMsg: string + width: number; + errMsg: string; } interface CanvasPutImageDataOption { /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 canvas-id 属性。 */ - canvasId: string + canvasId: string; /** 图像像素点数据,一维数组,每四项表示一个像素点的 rgba */ - data: Uint8ClampedArray + data: Uint8ClampedArray; /** 源图像数据矩形区域的高度 */ - height: number + height: number; /** 源图像数据矩形区域的宽度 */ - width: number + width: number; /** 源图像数据在目标画布中的位置偏移量(x 轴方向的偏移量) */ - x: number + x: number; /** 源图像数据在目标画布中的位置偏移量(y 轴方向的偏移量) */ - y: number + y: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CanvasPutImageDataCompleteCallback + complete?: CanvasPutImageDataCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CanvasPutImageDataFailCallback + fail?: CanvasPutImageDataFailCallback; /** 接口调用成功的回调函数 */ - success?: CanvasPutImageDataSuccessCallback + success?: CanvasPutImageDataSuccessCallback; } interface CanvasToTempFilePathOption { /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件实例 (canvas type="2d" 时使用该属性)。 */ - canvas?: IAnyObject + canvas?: IAnyObject; /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 canvas-id */ - canvasId?: string + canvasId?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CanvasToTempFilePathCompleteCallback + complete?: CanvasToTempFilePathCompleteCallback; /** 需要基础库: `1.2.0` * * 输出的图片的高度 */ - destHeight?: number + destHeight?: number; /** 需要基础库: `1.2.0` * * 输出的图片的宽度 */ - destWidth?: number + destWidth?: number; /** 接口调用失败的回调函数 */ - fail?: CanvasToTempFilePathFailCallback + fail?: CanvasToTempFilePathFailCallback; /** 需要基础库: `1.7.0` * * 目标文件的类型 @@ -3421,106 +3410,106 @@ ctx.draw() * 可选值: * - 'jpg': jpg 图片; * - 'png': png 图片; */ - fileType?: 'jpg' | 'png' + fileType?: 'jpg' | 'png'; /** 需要基础库: `1.2.0` * * 指定的画布区域的高度 */ - height?: number + height?: number; /** 需要基础库: `1.7.0` * * 图片的质量,目前仅对 jpg 有效。取值范围为 (0, 1],不在范围内时当作 1.0 处理。 */ - quality?: number + quality?: number; /** 接口调用成功的回调函数 */ - success?: CanvasToTempFilePathSuccessCallback + success?: CanvasToTempFilePathSuccessCallback; /** 需要基础库: `1.2.0` * * 指定的画布区域的宽度 */ - width?: number + width?: number; /** 需要基础库: `1.2.0` * * 指定的画布区域的左上角横坐标 */ - x?: number + x?: number; /** 需要基础库: `1.2.0` * * 指定的画布区域的左上角纵坐标 */ - y?: number + y?: number; } interface CanvasToTempFilePathSuccessCallbackResult { /** 生成文件的临时路径 (本地路径) */ - tempFilePath: string - errMsg: string + tempFilePath: string; + errMsg: string; } /** characteristics列表 */ interface Characteristic { /** characteristic 的 UUID */ - uuid: string + uuid: string; /** 描述符数据 */ - descriptors?: CharacteristicDescriptor[] + descriptors?: CharacteristicDescriptor[]; /** 特征权限 */ - permission?: CharacteristicPermission + permission?: CharacteristicPermission; /** 特征支持的操作 */ - properties?: CharacteristicProperties + properties?: CharacteristicProperties; /** 特征对应的二进制值 */ - value?: ArrayBuffer + value?: ArrayBuffer; } /** 描述符数据 */ interface CharacteristicDescriptor { /** Descriptor 的 UUID */ - uuid: string + uuid: string; /** 描述符的权限 */ - permission?: DescriptorPermission + permission?: DescriptorPermission; /** 描述符数据 */ - value?: ArrayBuffer + value?: ArrayBuffer; } /** 特征权限 */ interface CharacteristicPermission { /** 加密读请求 */ - readEncryptionRequired?: boolean + readEncryptionRequired?: boolean; /** 可读 */ - readable?: boolean + readable?: boolean; /** 加密写请求 */ - writeEncryptionRequired?: boolean + writeEncryptionRequired?: boolean; /** 可写 */ - writeable?: boolean + writeable?: boolean; } /** 特征支持的操作 */ interface CharacteristicProperties { /** 回包 */ - indicate?: boolean + indicate?: boolean; /** 订阅 */ - notify?: boolean + notify?: boolean; /** 读 */ - read?: boolean + read?: boolean; /** 写 */ - write?: boolean + write?: boolean; /** 无回复写 */ - writeNoResponse?: boolean + writeNoResponse?: boolean; } interface CheckIsAddedToMyMiniProgramOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CheckIsAddedToMyMiniProgramCompleteCallback + complete?: CheckIsAddedToMyMiniProgramCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CheckIsAddedToMyMiniProgramFailCallback + fail?: CheckIsAddedToMyMiniProgramFailCallback; /** 接口调用成功的回调函数 */ - success?: CheckIsAddedToMyMiniProgramSuccessCallback + success?: CheckIsAddedToMyMiniProgramSuccessCallback; } interface CheckIsAddedToMyMiniProgramSuccessCallbackResult { /** 是否被添加至 「我的小程序」 */ - added: boolean - errMsg: string + added: boolean; + errMsg: string; } interface CheckIsOpenAccessibilityOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CheckIsOpenAccessibilityCompleteCallback + complete?: CheckIsOpenAccessibilityCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CheckIsOpenAccessibilityFailCallback + fail?: CheckIsOpenAccessibilityFailCallback; /** 接口调用成功的回调函数 */ - success?: CheckIsOpenAccessibilitySuccessCallback + success?: CheckIsOpenAccessibilitySuccessCallback; } interface CheckIsOpenAccessibilitySuccessCallbackOption { /** iOS 上开启辅助功能旁白,安卓开启 talkback 时返回 true */ - open: boolean - errMsg: string + open: boolean; + errMsg: string; } interface CheckIsSoterEnrolledInDeviceOption { /** 认证方式 @@ -3529,27 +3518,27 @@ ctx.draw() * - 'fingerPrint': 指纹识别; * - 'facial': 人脸识别; * - 'speech': 声纹识别(暂未支持); */ - checkAuthMode: 'fingerPrint' | 'facial' | 'speech' + checkAuthMode: 'fingerPrint' | 'facial' | 'speech'; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CheckIsSoterEnrolledInDeviceCompleteCallback + complete?: CheckIsSoterEnrolledInDeviceCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CheckIsSoterEnrolledInDeviceFailCallback + fail?: CheckIsSoterEnrolledInDeviceFailCallback; /** 接口调用成功的回调函数 */ - success?: CheckIsSoterEnrolledInDeviceSuccessCallback + success?: CheckIsSoterEnrolledInDeviceSuccessCallback; } interface CheckIsSoterEnrolledInDeviceSuccessCallbackResult { /** 错误信息 */ - errMsg: string + errMsg: string; /** 是否已录入信息 */ - isEnrolled: boolean + isEnrolled: boolean; } interface CheckIsSupportSoterAuthenticationOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CheckIsSupportSoterAuthenticationCompleteCallback + complete?: CheckIsSupportSoterAuthenticationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CheckIsSupportSoterAuthenticationFailCallback + fail?: CheckIsSupportSoterAuthenticationFailCallback; /** 接口调用成功的回调函数 */ - success?: CheckIsSupportSoterAuthenticationSuccessCallback + success?: CheckIsSupportSoterAuthenticationSuccessCallback; } interface CheckIsSupportSoterAuthenticationSuccessCallbackResult { /** 该设备支持的可被SOTER识别的生物识别方式 @@ -3558,197 +3547,197 @@ ctx.draw() * - 'fingerPrint': 指纹识别; * - 'facial': 人脸识别; * - 'speech': 声纹识别(暂未支持); */ - supportMode: Array<'fingerPrint' | 'facial' | 'speech'> - errMsg: string + supportMode: Array<'fingerPrint' | 'facial' | 'speech'>; + errMsg: string; } interface CheckSessionOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CheckSessionCompleteCallback + complete?: CheckSessionCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CheckSessionFailCallback + fail?: CheckSessionFailCallback; /** 接口调用成功的回调函数 */ - success?: CheckSessionSuccessCallback + success?: CheckSessionSuccessCallback; } interface ChooseAddressOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseAddressCompleteCallback + complete?: ChooseAddressCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ChooseAddressFailCallback + fail?: ChooseAddressFailCallback; /** 接口调用成功的回调函数 */ - success?: ChooseAddressSuccessCallback + success?: ChooseAddressSuccessCallback; } interface ChooseAddressSuccessCallbackResult { /** 国标收货地址第二级地址 */ - cityName: string + cityName: string; /** 国标收货地址第三级地址 */ - countyName: string + countyName: string; /** 详细收货地址信息(包括街道地址) */ - detailInfo: string + detailInfo: string; /** 新选择器详细收货地址信息 */ - detailInfoNew: string + detailInfoNew: string; /** 错误信息 */ - errMsg: string + errMsg: string; /** 收货地址国家码 */ - nationalCode: string + nationalCode: string; /** 邮编 */ - postalCode: string + postalCode: string; /** 国标收货地址第一级地址 */ - provinceName: string + provinceName: string; /** 国标收货地址第四级地址 */ - streetName: string + streetName: string; /** 收货人手机号码 */ - telNumber: string + telNumber: string; /** 收货人姓名 */ - userName: string + userName: string; } interface ChooseContactOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseContactCompleteCallback + complete?: ChooseContactCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ChooseContactFailCallback + fail?: ChooseContactFailCallback; /** 接口调用成功的回调函数 */ - success?: ChooseContactSuccessCallback + success?: ChooseContactSuccessCallback; } interface ChooseContactSuccessCallbackOption { /** 联系人姓名 */ - displayName: string + displayName: string; /** 手机号 */ - phoneNumber: string + phoneNumber: string; /** 选定联系人的所有手机号(部分 Android 系统只能选联系人而不能选特定手机号) */ - phoneNumberList: string - errMsg: string + phoneNumberList: string; + errMsg: string; } /** 返回选择的文件的本地临时文件对象数组 */ interface ChooseFile { /** 选择的文件名称 */ - name: string + name: string; /** 本地临时文件路径 (本地路径) */ - path: string + path: string; /** 本地临时文件大小,单位 B */ - size: number + size: number; /** 选择的文件的会话发送时间,Unix时间戳,工具暂不支持此属性 */ - time: number + time: number; /** 选择的文件类型 * * 可选值: * - 'video': 选择了视频文件; * - 'image': 选择了图片文件; * - 'file': 选择了除图片和视频的文件; */ - type: 'video' | 'image' | 'file' + type: 'video' | 'image' | 'file'; } interface ChooseImageOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseImageCompleteCallback + complete?: ChooseImageCompleteCallback; /** 最多可以选择的图片张数 */ - count?: number + count?: number; /** 接口调用失败的回调函数 */ - fail?: ChooseImageFailCallback + fail?: ChooseImageFailCallback; /** 所选的图片的尺寸 * * 可选值: * - 'original': 原图; * - 'compressed': 压缩图; */ - sizeType?: Array<'original' | 'compressed'> + sizeType?: Array<'original' | 'compressed'>; /** 选择图片的来源 * * 可选值: * - 'album': 从相册选图; * - 'camera': 使用相机; */ - sourceType?: Array<'album' | 'camera'> + sourceType?: Array<'album' | 'camera'>; /** 接口调用成功的回调函数 */ - success?: ChooseImageSuccessCallback + success?: ChooseImageSuccessCallback; } interface ChooseImageSuccessCallbackResult { /** 图片的本地临时文件路径列表 (本地路径) */ - tempFilePaths: string[] + tempFilePaths: string[]; /** 需要基础库: `1.2.0` * * 图片的本地临时文件列表 */ - tempFiles: ImageFile[] - errMsg: string + tempFiles: ImageFile[]; + errMsg: string; } interface ChooseInvoiceOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseInvoiceCompleteCallback + complete?: ChooseInvoiceCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ChooseInvoiceFailCallback + fail?: ChooseInvoiceFailCallback; /** 接口调用成功的回调函数 */ - success?: ChooseInvoiceSuccessCallback + success?: ChooseInvoiceSuccessCallback; } interface ChooseInvoiceSuccessCallbackResult { /** 用户选中的发票信息,格式为一个 JSON 字符串,包含三个字段: card_id:所选发票卡券的 cardId,encrypt_code:所选发票卡券的加密 code,报销方可以通过 cardId 和 encryptCode 获得报销发票的信息,app_id: 发票方的 appId。 */ - invoiceInfo: string - errMsg: string + invoiceInfo: string; + errMsg: string; } interface ChooseInvoiceTitleOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseInvoiceTitleCompleteCallback + complete?: ChooseInvoiceTitleCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ChooseInvoiceTitleFailCallback + fail?: ChooseInvoiceTitleFailCallback; /** 接口调用成功的回调函数 */ - success?: ChooseInvoiceTitleSuccessCallback + success?: ChooseInvoiceTitleSuccessCallback; } interface ChooseInvoiceTitleSuccessCallbackResult { /** 银行账号 */ - bankAccount: string + bankAccount: string; /** 银行名称 */ - bankName: string + bankName: string; /** 单位地址 */ - companyAddress: string + companyAddress: string; /** 错误信息 */ - errMsg: string + errMsg: string; /** 抬头税号 */ - taxNumber: string + taxNumber: string; /** 手机号码 */ - telephone: string + telephone: string; /** 抬头名称 */ - title: string + title: string; /** 抬头类型 * * 可选值: * - 0: 单位; * - 1: 个人; */ - type: 0 | 1 + type: 0 | 1; } interface ChooseLicensePlateOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseLicensePlateCompleteCallback + complete?: ChooseLicensePlateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ChooseLicensePlateFailCallback + fail?: ChooseLicensePlateFailCallback; /** 接口调用成功的回调函数 */ - success?: ChooseLicensePlateSuccessCallback + success?: ChooseLicensePlateSuccessCallback; } interface ChooseLicensePlateSuccessCallbackResult { /** 用户选择的车牌号 */ - plateNumber: string - errMsg: string + plateNumber: string; + errMsg: string; } interface ChooseLocationOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseLocationCompleteCallback + complete?: ChooseLocationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ChooseLocationFailCallback + fail?: ChooseLocationFailCallback; /** 需要基础库: `2.9.0` * * 目标地纬度 */ - latitude?: number + latitude?: number; /** 需要基础库: `2.9.0` * * 目标地经度 */ - longitude?: number + longitude?: number; /** 接口调用成功的回调函数 */ - success?: ChooseLocationSuccessCallback + success?: ChooseLocationSuccessCallback; } interface ChooseLocationSuccessCallbackResult { /** 详细地址 */ - address: string + address: string; /** 纬度,浮点数,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系 */ - latitude: number + latitude: number; /** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */ - longitude: number + longitude: number; /** 位置名称 */ - name: string - errMsg: string + name: string; + errMsg: string; } interface ChooseMediaOption { /** 仅在 sourceType 为 camera 时生效,使用前置或后置摄像头 @@ -3756,53 +3745,53 @@ ctx.draw() * 可选值: * - 'back': 使用后置摄像头; * - 'front': 使用前置摄像头; */ - camera?: 'back' | 'front' + camera?: 'back' | 'front'; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseMediaCompleteCallback + complete?: ChooseMediaCompleteCallback; /** 最多可以选择的文件个数,基础库2.25.0前,最多可支持9个文件,2.25.0及以后最多可支持20个文件 */ - count?: number + count?: number; /** 接口调用失败的回调函数 */ - fail?: ChooseMediaFailCallback + fail?: ChooseMediaFailCallback; /** 拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 60s 之间。不限制相册。 */ - maxDuration?: number + maxDuration?: number; /** 文件类型 * * 可选值: * - 'image': 只能拍摄图片或从相册选择图片; * - 'video': 只能拍摄视频或从相册选择视频; * - 'mix': 可同时选择图片和视频; */ - mediaType?: Array<'image' | 'video' | 'mix'> + mediaType?: Array<'image' | 'video' | 'mix'>; /** 是否压缩所选文件,基础库2.25.0前仅对 mediaType 为 image 时有效,2.25.0及以后对全量 mediaType 有效 */ - sizeType?: string[] + sizeType?: string[]; /** 图片和视频选择的来源 * * 可选值: * - 'album': 从相册选择; * - 'camera': 使用相机拍摄; */ - sourceType?: Array<'album' | 'camera'> + sourceType?: Array<'album' | 'camera'>; /** 接口调用成功的回调函数 */ - success?: ChooseMediaSuccessCallback + success?: ChooseMediaSuccessCallback; } interface ChooseMediaSuccessCallbackResult { /** 本地临时文件列表 */ - tempFiles: MediaFile[] + tempFiles: MediaFile[]; /** 文件类型,有效值有 image 、video、mix */ - type: string - errMsg: string + type: string; + errMsg: string; } interface ChooseMessageFileOption { /** 最多可以选择的文件个数,可以 0~100 */ - count: number + count: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseMessageFileCompleteCallback + complete?: ChooseMessageFileCompleteCallback; /** 需要基础库: `2.6.0` * * 根据文件拓展名过滤,仅 type==file 时有效。每一项都不能是空字符串。默认不过滤。 */ - extension?: string[] + extension?: string[]; /** 接口调用失败的回调函数 */ - fail?: ChooseMessageFileFailCallback + fail?: ChooseMessageFileFailCallback; /** 接口调用成功的回调函数 */ - success?: ChooseMessageFileSuccessCallback + success?: ChooseMessageFileSuccessCallback; /** 所选的文件的类型 * * 可选值: @@ -3810,35 +3799,35 @@ ctx.draw() * - 'video': 只能选择视频文件; * - 'image': 只能选择图片文件; * - 'file': 可以选择除了图片和视频之外的其它的文件; */ - type?: 'all' | 'video' | 'image' | 'file' + type?: 'all' | 'video' | 'image' | 'file'; } interface ChooseMessageFileSuccessCallbackResult { /** 返回选择的文件的本地临时文件对象数组 */ - tempFiles: ChooseFile[] - errMsg: string + tempFiles: ChooseFile[]; + errMsg: string; } interface ChoosePoiOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChoosePoiCompleteCallback + complete?: ChoosePoiCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ChoosePoiFailCallback + fail?: ChoosePoiFailCallback; /** 接口调用成功的回调函数 */ - success?: ChoosePoiSuccessCallback + success?: ChoosePoiSuccessCallback; } interface ChoosePoiSuccessCallbackResult { /** 详细地址 */ - address: string + address: string; /** 城市名称 */ - city: number + city: number; /** 纬度,浮点数,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系(即将废弃) */ - latitude: number + latitude: number; /** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系(即将废弃) */ - longitude: number + longitude: number; /** 位置名称 */ - name: string + name: string; /** 选择城市时,值为 1,选择精确位置时,值为 2 */ - type: number - errMsg: string + type: number; + errMsg: string; } interface ChooseVideoOption { /** 默认拉起的是前置或者后置摄像头。部分 Android 手机下由于系统 ROM 不支持无法生效 @@ -3846,127 +3835,127 @@ ctx.draw() * 可选值: * - 'back': 默认拉起后置摄像头; * - 'front': 默认拉起前置摄像头; */ - camera?: 'back' | 'front' + camera?: 'back' | 'front'; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ChooseVideoCompleteCallback + complete?: ChooseVideoCompleteCallback; /** 需要基础库: `1.6.0` * * 是否压缩所选择的视频文件 */ - compressed?: boolean + compressed?: boolean; /** 接口调用失败的回调函数 */ - fail?: ChooseVideoFailCallback + fail?: ChooseVideoFailCallback; /** 拍摄视频最长拍摄时间,单位秒 */ - maxDuration?: number + maxDuration?: number; /** 视频选择的来源 * * 可选值: * - 'album': 从相册选择视频; * - 'camera': 使用相机拍摄视频; */ - sourceType?: Array<'album' | 'camera'> + sourceType?: Array<'album' | 'camera'>; /** 接口调用成功的回调函数 */ - success?: ChooseVideoSuccessCallback + success?: ChooseVideoSuccessCallback; } interface ChooseVideoSuccessCallbackResult { /** 选定视频的时间长度 */ - duration: number + duration: number; /** 返回选定视频的高度 */ - height: number + height: number; /** 选定视频的数据量大小 */ - size: number + size: number; /** 选定视频的临时文件路径 (本地路径) */ - tempFilePath: string + tempFilePath: string; /** 返回选定视频的宽度 */ - width: number - errMsg: string + width: number; + errMsg: string; } interface ClearFiltersOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ClearFiltersCompleteCallback + complete?: ClearFiltersCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ClearFiltersFailCallback + fail?: ClearFiltersFailCallback; /** 接口调用成功的回调函数 */ - success?: ClearFiltersSuccessCallback + success?: ClearFiltersSuccessCallback; } interface ClearMakeupsOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ClearMakeupsCompleteCallback + complete?: ClearMakeupsCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ClearMakeupsFailCallback + fail?: ClearMakeupsFailCallback; /** 接口调用成功的回调函数 */ - success?: ClearMakeupsSuccessCallback + success?: ClearMakeupsSuccessCallback; } interface ClearOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ClearCompleteCallback + complete?: ClearCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ClearFailCallback + fail?: ClearFailCallback; /** 接口调用成功的回调函数 */ - success?: ClearSuccessCallback + success?: ClearSuccessCallback; } interface ClearStickersOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ClearStickersCompleteCallback + complete?: ClearStickersCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ClearStickersFailCallback + fail?: ClearStickersFailCallback; /** 接口调用成功的回调函数 */ - success?: ClearStickersSuccessCallback + success?: ClearStickersSuccessCallback; } interface ClearStorageOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ClearStorageCompleteCallback + complete?: ClearStorageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ClearStorageFailCallback + fail?: ClearStorageFailCallback; /** 接口调用成功的回调函数 */ - success?: ClearStorageSuccessCallback + success?: ClearStorageSuccessCallback; } /** 菜单按钮的布局位置信息 */ interface ClientRect { /** 下边界坐标,单位:px */ - bottom: number + bottom: number; /** 高度,单位:px */ - height: number + height: number; /** 左边界坐标,单位:px */ - left: number + left: number; /** 右边界坐标,单位:px */ - right: number + right: number; /** 上边界坐标,单位:px */ - top: number + top: number; /** 宽度,单位:px */ - width: number + width: number; } interface CloseBLEConnectionOption { /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CloseBLEConnectionCompleteCallback + complete?: CloseBLEConnectionCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CloseBLEConnectionFailCallback + fail?: CloseBLEConnectionFailCallback; /** 接口调用成功的回调函数 */ - success?: CloseBLEConnectionSuccessCallback + success?: CloseBLEConnectionSuccessCallback; } interface CloseBluetoothAdapterOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CloseBluetoothAdapterCompleteCallback + complete?: CloseBluetoothAdapterCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CloseBluetoothAdapterFailCallback + fail?: CloseBluetoothAdapterFailCallback; /** 接口调用成功的回调函数 */ - success?: CloseBluetoothAdapterSuccessCallback + success?: CloseBluetoothAdapterSuccessCallback; } interface CloseSocketOption { /** 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 */ - code?: number + code?: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CloseSocketCompleteCallback + complete?: CloseSocketCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CloseSocketFailCallback + fail?: CloseSocketFailCallback; /** 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。 */ - reason?: string + reason?: string; /** 接口调用成功的回调函数 */ - success?: CloseSocketSuccessCallback + success?: CloseSocketSuccessCallback; } interface CloseSyncOption { /** 需要被关闭的文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; } /** 颜色。可以用以下几种方式来表示 canvas 中使用的颜色: * @@ -4131,183 +4120,183 @@ ctx.draw() interface Color {} interface CompressImageOption { /** 图片路径,图片的路径,支持本地路径、代码包路径 */ - src: string + src: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CompressImageCompleteCallback + complete?: CompressImageCompleteCallback; /** 需要基础库: `2.26.0` * * 压缩后图片的高度,单位为px,若不填写则默认以compressedWidth为准等比缩放 */ - compressedHeight?: number + compressedHeight?: number; /** 需要基础库: `2.26.0` * * 压缩后图片的宽度,单位为px,若不填写则默认以compressedHeight为准等比缩放。 */ - compressedWidth?: number + compressedWidth?: number; /** 接口调用失败的回调函数 */ - fail?: CompressImageFailCallback + fail?: CompressImageFailCallback; /** 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)。 */ - quality?: number + quality?: number; /** 接口调用成功的回调函数 */ - success?: CompressImageSuccessCallback + success?: CompressImageSuccessCallback; } interface CompressImageSuccessCallbackResult { /** 压缩后图片的临时文件路径 (本地路径) */ - tempFilePath: string - errMsg: string + tempFilePath: string; + errMsg: string; } interface CompressVideoOption { /** 码率,单位 kbps */ - bitrate: number + bitrate: number; /** 帧率 */ - fps: number + fps: number; /** 相对于原视频的分辨率比例,取值范围(0, 1] */ - resolution: number + resolution: number; /** 视频文件路径,可以是临时文件路径也可以是永久文件路径 */ - src: string + src: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CompressVideoCompleteCallback + complete?: CompressVideoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CompressVideoFailCallback + fail?: CompressVideoFailCallback; /** 压缩质量 * * 可选值: * - 'low': 低; * - 'medium': 中; * - 'high': 高; */ - quality?: 'low' | 'medium' | 'high' + quality?: 'low' | 'medium' | 'high'; /** 接口调用成功的回调函数 */ - success?: CompressVideoSuccessCallback + success?: CompressVideoSuccessCallback; } interface CompressVideoSuccessCallbackResult { /** 压缩后的大小,单位 kB */ - size: string + size: string; /** 压缩后的临时文件地址 */ - tempFilePath: string - errMsg: string + tempFilePath: string; + errMsg: string; } interface ConnectSocketOption { /** 开发者服务器 wss 接口地址 */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ConnectSocketCompleteCallback + complete?: ConnectSocketCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ConnectSocketFailCallback + fail?: ConnectSocketFailCallback; /** 需要基础库: `2.29.0` * * 强制使用蜂窝网络发送请求 */ - forceCellularNetwork?: boolean + forceCellularNetwork?: boolean; /** HTTP Header,Header 中不能设置 Referer */ - header?: IAnyObject + header?: IAnyObject; /** 需要基础库: `2.8.0` * * 是否开启压缩扩展 */ - perMessageDeflate?: boolean + perMessageDeflate?: boolean; /** 需要基础库: `1.4.0` * * 子协议数组 */ - protocols?: string[] + protocols?: string[]; /** 接口调用成功的回调函数 */ - success?: ConnectSocketSuccessCallback + success?: ConnectSocketSuccessCallback; /** 需要基础库: `2.4.0` * * 建立 TCP 连接的时候的 TCP_NODELAY 设置 */ - tcpNoDelay?: boolean + tcpNoDelay?: boolean; /** 需要基础库: `2.10.0` * * 超时时间,单位为毫秒 */ - timeout?: number + timeout?: number; } interface ConnectWifiOption { /** Wi-Fi 设备 SSID */ - SSID: string + SSID: string; /** Wi-Fi 设备密码 */ - password: string + password: string; /** Wi-Fi 设备 BSSID */ - BSSID?: string + BSSID?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ConnectWifiCompleteCallback + complete?: ConnectWifiCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ConnectWifiFailCallback + fail?: ConnectWifiFailCallback; /** 需要基础库: `2.12.0` * * 跳转到系统设置页进行连接 */ - maunal?: boolean + maunal?: boolean; /** 需要基础库: `2.22.0` * * 是否需要返回部分 Wi-Fi 信息,仅安卓生效 */ - partialInfo?: boolean + partialInfo?: boolean; /** 接口调用成功的回调函数 */ - success?: ConnectWifiSuccessCallback + success?: ConnectWifiSuccessCallback; } /** 一个字典对象,用于指定是否禁用规范化(默认启用规范化) */ interface Constraints { /** 如果指定为true则禁用标准化,默认为false */ - disableNormalization?: boolean + disableNormalization?: boolean; } interface ContextCallbackResult { /** 节点对应的 Context 对象 */ - context: IAnyObject + context: IAnyObject; } interface CopyFileOption { /** 目标文件路径,支持本地路径 */ - destPath: string + destPath: string; /** 源文件路径,支持本地路径 */ - srcPath: string + srcPath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CopyFileCompleteCallback + complete?: CopyFileCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CopyFileFailCallback + fail?: CopyFileFailCallback; /** 接口调用成功的回调函数 */ - success?: CopyFileSuccessCallback + success?: CopyFileSuccessCallback; } interface CreateBLEConnectionOption { /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CreateBLEConnectionCompleteCallback + complete?: CreateBLEConnectionCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CreateBLEConnectionFailCallback + fail?: CreateBLEConnectionFailCallback; /** 接口调用成功的回调函数 */ - success?: CreateBLEConnectionSuccessCallback + success?: CreateBLEConnectionSuccessCallback; /** 超时时间,单位 ms,不填表示不会超时 */ - timeout?: number + timeout?: number; } interface CreateBLEPeripheralServerOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CreateBLEPeripheralServerCompleteCallback + complete?: CreateBLEPeripheralServerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CreateBLEPeripheralServerFailCallback + fail?: CreateBLEPeripheralServerFailCallback; /** 接口调用成功的回调函数 */ - success?: CreateBLEPeripheralServerSuccessCallback + success?: CreateBLEPeripheralServerSuccessCallback; } interface CreateBLEPeripheralServerSuccessCallbackResult { /** [BLEPeripheralServer](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.html) * * 外围设备的服务端。 */ - server: BLEPeripheralServer - errMsg: string + server: BLEPeripheralServer; + errMsg: string; } interface CreateCacheManagerOption { /** 额外的缓存处理 */ - extra?: ExtraOption + extra?: ExtraOption; /** 全局缓存有效时间,单位为毫秒,默认为 7 天,最长不超过 30 天 */ - maxAge?: number + maxAge?: number; /** 缓存模式 * * 可选值: * - 'weakNetwork': 弱网/离线使用缓存返回; * - 'always': 总是使用缓存返回; * - 'none': 不开启,后续可手动开启/停止使用缓存返回; */ - mode?: 'weakNetwork' | 'always' | 'none' + mode?: 'weakNetwork' | 'always' | 'none'; /** 全局 origin */ - origin?: string + origin?: string; } interface CreateInferenceSessionOption { /** 模型文件路径,目前只执行后缀为.onnx格式(支持代码包路径,和本地文件系统路径) */ - model: string + model: string; /** 是否使用NPU推理,仅对IOS有效 */ - allowNPU?: boolean + allowNPU?: boolean; /** 是否生成量化模型推理 */ - allowQuantize?: boolean + allowQuantize?: boolean; /** 推理精度,有效值为 0 - 4。一般来说,使用的precesionLevel等级越低,推理速度越快,但可能会损失精度。推荐开发者在开发时,在效果满足需求时优先使用更低精度以提高推理速度,节约能耗。 * * 可选值: @@ -4316,77 +4305,77 @@ ctx.draw() * - 2: 使用fp16 存储浮点,fp32计算,开启 Winograd,开启近似math计算; * - 3: 使用fp32 存储浮点,fp32计算,开启 Winograd,开启近似math计算; * - 4: 使用fp32 存储浮点,fp32计算,开启 Winograd,关闭近似math计算; */ - precesionLevel?: 0 | 1 | 2 | 3 | 4 + precesionLevel?: 0 | 1 | 2 | 3 | 4; /** 输入典型分辨率 */ - typicalShape?: IAnyObject + typicalShape?: IAnyObject; } interface CreateInnerAudioContextOption { /** 需要基础库: `2.19.0` * * 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项。 */ - useWebAudioImplement?: boolean + useWebAudioImplement?: boolean; } /** 选项 */ interface CreateIntersectionObserverOption { /** 初始的相交比例,如果调用时检测到的相交比例与这个值不相等且达到阈值,则会触发一次监听器的回调函数。 */ - initialRatio?: number + initialRatio?: number; /** 需要基础库: `3.5.7` * * 是否使用原生观察器模式。 */ - nativeMode?: boolean + nativeMode?: boolean; /** 需要基础库: `2.0.0` * * 是否同时观测多个目标节点(而非一个),如果设为 true ,observe 的 targetSelector 将选中多个节点(注意:同时选中过多节点将影响渲染性能) */ - observeAll?: boolean + observeAll?: boolean; /** 一个数值数组,包含所有阈值。 */ - thresholds?: number[] + thresholds?: number[]; } interface CreateInterstitialAdOption { /** 广告单元 id */ - adUnitId: string + adUnitId: string; } interface CreateMediaRecorderOption { /** 指定录制的时长(s),到达自动停止。最大 7200,最小 5 */ - duration?: number + duration?: number; /** 视频 fps */ - fps?: number + fps?: number; /** 视频关键帧间隔 */ - gop?: number + gop?: number; /** 画布录制高度 */ - height?: number + height?: number; /** 视频比特率(kbps),最小值 600,最大值 3000 */ - videoBitsPerSecond?: number + videoBitsPerSecond?: number; /** 画布录制宽度 */ - width?: number + width?: number; } interface CreateOffscreenCanvasOption { /** 在自定义组件下,当前组件实例的 this */ - compInst?: Component.TrivialInstance | Page.TrivialInstance + compInst?: Component.TrivialInstance | Page.TrivialInstance; /** 画布高度 */ - height?: number + height?: number; /** 创建的离屏 canvas 类型 * * 可选值: * - 'webgl': webgl类型上下文; * - '2d': 2d类型上下文; */ - type?: 'webgl' | '2d' + type?: 'webgl' | '2d'; /** 画布宽度 */ - width?: number + width?: number; } interface CreateRewardedVideoAdOption { /** 广告单元 id */ - adUnitId: string + adUnitId: string; /** 需要基础库: `2.8.0` * * 是否启用多例模式,默认为false */ - multiton?: boolean + multiton?: boolean; } /** 可选参数 */ interface CreateWorkerOption { /** 需要基础库: `2.13.0` * * 是否使用实验worker。在iOS下,实验worker的JS运行效率比非实验worker提升数倍,如需在worker内进行重度计算的建议开启此选项。同时,实验worker存在极小概率会在系统资源紧张时被系统回收,因此建议配合 worker.onProcessKilled 事件使用,在worker被回收后可重新创建一个。 */ - useExperimentalWorker?: boolean + useExperimentalWorker?: boolean; } interface CropImageOption { /** 裁剪比例 @@ -4399,95 +4388,95 @@ ctx.draw() * - '5:4': 宽高比为5比4; * - '4:5': 宽高比为4比5; * - '1:1': 宽高比为1比1; */ - cropScale: '16:9' | '9:16' | '4:3' | '3:4' | '5:4' | '4:5' | '1:1' + cropScale: '16:9' | '9:16' | '4:3' | '3:4' | '5:4' | '4:5' | '1:1'; /** 图片路径,图片的路径,支持本地路径、代码包路径 */ - src: string + src: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: CropImageCompleteCallback + complete?: CropImageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: CropImageFailCallback + fail?: CropImageFailCallback; /** 接口调用成功的回调函数 */ - success?: CropImageSuccessCallback + success?: CropImageSuccessCallback; } interface CropImageSuccessCallbackResult { /** 编辑后图片的临时文件路径 (本地路径) */ - tempFilePath: string - errMsg: string + tempFilePath: string; + errMsg: string; } interface CurrentState { /** 当前缓存中的日志条数 */ - logCount: number + logCount: number; /** 当前缓存中最大可存日志条数 */ - maxLogCount: number + maxLogCount: number; /** 当前缓存最大可用空间,以字节为单位 */ - maxSize: number + maxSize: number; /** 当前缓存中已使用空间,以字节为单位 */ - size: number + size: number; } /** 自定义路由动画配置 */ interface CustomRouteConfig { /** 遮罩层背景色,支持 `rgba()` 和 `#RRGGBBAA` 写法 */ - barrierColor: string + barrierColor: string; /** 点击遮罩层返回上一页 */ - barrierDismissible: boolean + barrierDismissible: boolean; /** 无障碍语义 */ - barrierLabel: string + barrierLabel: string; /** 是否与前一个页面联动,决定前一个页 `secondaryAnimation` 是否生效 */ - canTransitionFrom: boolean + canTransitionFrom: boolean; /** 是否与下一个页面联动,决定当前页 `secondaryAnimation` 是否生效 */ - canTransitionTo: boolean + canTransitionTo: boolean; /** 是否保持前一个页面状态 */ - maintainState: boolean + maintainState: boolean; /** 下一个页面推入后,不显示前一个页面 */ - opaque: boolean + opaque: boolean; /** 页面推出动画时长,单位 ms */ - reverseTransitionDuration: number + reverseTransitionDuration: number; /** 页面推入动画时长,单位 ms */ - transitionDuration: number + transitionDuration: number; } /** 自定义路由上下文对象 */ interface CustomRouteContext { /** 返回上一级,效果同 `wx.navigateBack`,仅可用于 `worklet` 函数内 */ - didPop: (...args: any[]) => any + didPop: (...args: any[]) => any; /** 动画控制器,影响推入页面的进入和退出过渡效果 */ - primaryAnimation: SharedValue + primaryAnimation: SharedValue; /** 动画控制器状态 */ - primaryAnimationStatus: SharedValue + primaryAnimationStatus: SharedValue; /** 动画控制器,影响栈顶页面的推出过渡效果 */ - secondaryAnimation: SharedValue + secondaryAnimation: SharedValue; /** 动画控制器状态 */ - secondaryAnimationStatus: SharedValue + secondaryAnimationStatus: SharedValue; /** 手势开始控制路由,与共享元素动画有关 */ - startUserGesture: (...args: any[]) => any + startUserGesture: (...args: any[]) => any; /** 手势不再控制路由,与 `startUserGesture` 成对调用 */ - stopUserGesture: (...args: any[]) => any + stopUserGesture: (...args: any[]) => any; /** 当前路由进度由手势控制 */ - userGestureInProgress: SharedValue + userGestureInProgress: SharedValue; } /** 弹幕内容 */ interface Danmu { /** 弹幕文字 */ - text: string + text: string; /** 弹幕颜色 */ - color?: string + color?: string; } /** 动画配置 */ interface DecayOption { /** 边界值,长度为 2 的数组 */ - clamp?: any[] + clamp?: any[]; /** 衰减速率 */ - deceleration?: number + deceleration?: number; /** 初速度 */ - velocity?: number + velocity?: number; } /** 帧深度纹理buffer对象 */ interface DepthBufferRes { /** 深度纹理buffer */ - DepthAddress: ArrayBuffer + DepthAddress: ArrayBuffer; /** 深度纹理高 */ - height: number + height: number; /** 深度纹理宽 */ - width: number + width: number; } /** 需要基础库: `3.0.0` * @@ -4500,241 +4489,241 @@ ctx.draw() * 可选值: * - 1: 通过摄像头实时检测; * - 2: 静态图片检测; */ - mode: 1 | 2 + mode: 1 | 2; } /** 可选的字体描述符 */ interface DescOption { /** 字体样式,可选值为 normal / italic / oblique */ - style?: string + style?: string; /** 设置小型大写字母的字体显示文本,可选值为 normal / small-caps / inherit */ - variant?: string + variant?: string; /** 字体粗细,可选值为 normal / bold / 100 / 200../ 900 */ - weight?: string + weight?: string; } /** 描述符的权限 */ interface DescriptorPermission { /** 读 */ - read?: boolean + read?: boolean; /** 写 */ - write?: boolean + write?: boolean; } /** 指定 marker 移动到的目标点 */ interface DestinationOption { /** 纬度 */ - latitude: number + latitude: number; /** 经度 */ - longitude: number + longitude: number; } interface DetectBodyOption { /** 人脸图像像素点数据,每四项表示一个像素点的 RGBA */ - frameBuffer: ArrayBuffer + frameBuffer: ArrayBuffer; /** 图像高度 */ - height: number + height: number; /** 图像宽度 */ - width: number + width: number; /** 评分阈值。正常情况传入 0.8 即可。 */ - scoreThreshold?: number + scoreThreshold?: number; /** 图像源类型。正常情况传入 1 即可。当输入的图片是来自一个连续视频的每一帧图像时,sourceType 传入 0 会得到更优的效果 * * 可选值: * - 1: 表示输入的图片是随机的图片; * - 0: 表示输入的图片是来自一个连续视频的每一帧图像; */ - sourceType?: 1 | 0 + sourceType?: 1 | 0; } interface DetectDepthOption { /** 需要识别深度的图像像素点数据,每四项表示一个像素点的 RGBA */ - frameBuffer: ArrayBuffer + frameBuffer: ArrayBuffer; /** 图像高度 */ - height: number + height: number; /** 图像宽度 */ - width: number + width: number; } interface DetectFaceOption { /** 人脸图像像素点数据,每四项表示一个像素点的 RGBA */ - frameBuffer: ArrayBuffer + frameBuffer: ArrayBuffer; /** 图像高度 */ - height: number + height: number; /** 图像宽度 */ - width: number + width: number; /** 算法模型类型。正常情况传入 1 即可。0、1、2 分别表示小、中、大模型,模型越大识别准确率越高,但资源占用也越高。建议根据用户设备性能进行选择。 * * 可选值: * - 0: 小模型; * - 1: 中模型; * - 2: 大模型; */ - modelModel?: 0 | 1 | 2 + modelModel?: 0 | 1 | 2; /** 评分阈值。正常情况传入 0.8 即可。 */ - scoreThreshold?: number + scoreThreshold?: number; /** 图像源类型。正常情况传入 1 即可。当输入的图片是来自一个连续视频的每一帧图像时,sourceType 传入 0 会得到更优的效果 * * 可选值: * - 1: 表示输入的图片是随机的图片; * - 0: 表示输入的图片是来自一个连续视频的每一帧图像; */ - sourceType?: 1 | 0 + sourceType?: 1 | 0; } interface DetectHandOption { /** 人脸图像像素点数据,每四项表示一个像素点的 RGBA */ - frameBuffer: ArrayBuffer + frameBuffer: ArrayBuffer; /** 图像高度 */ - height: number + height: number; /** 图像宽度 */ - width: number + width: number; /** 算法检测模式 * * 可选值: * - 0: 检测模式,输出框和点; * - 1: 手势模式,输出框和手势分类; * - 2: 结合0和1模式,输出框、点、手势分类; */ - algoMode?: 0 | 1 | 2 + algoMode?: 0 | 1 | 2; /** 评分阈值。正常情况传入 0.8 即可。 */ - scoreThreshold?: number + scoreThreshold?: number; } interface DeviceInfo { /** 应用(微信APP)二进制接口类型(仅 Android 支持) */ - abi: string + abi: string; /** 设备性能等级(仅 Android 支持)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50)
注意:从基础库3.4.5开始,本返回值停止维护,请使用[wx.getDeviceBenchmarkInfo](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceBenchmarkInfo.html)获取设备性能等级 */ - benchmarkLevel: number + benchmarkLevel: number; /** 设备品牌 */ - brand: string + brand: string; /** 需要基础库: `2.29.0` * * 设备 CPU 型号(仅 Android 支持)(Tips: GPU 型号可通过 WebGLRenderingContext.getExtension('WEBGL_debug_renderer_info') 来获取) */ - cpuType: string + cpuType: string; /** 需要基础库: `2.25.1` * * 设备二进制接口类型(仅 Android 支持) */ - deviceAbi: string + deviceAbi: string; /** 需要基础库: `2.30.0` * * 设备内存大小,单位为 MB */ - memorySize: string + memorySize: string; /** 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。 */ - model: string + model: string; /** 客户端平台 */ - platform: string + platform: string; /** 操作系统及版本 */ - system: string + system: string; } interface DeviceVoIPInfo { /** 需要基础库: `2.30.4` * * 设备组的唯一标识 id(仅设备组时) */ - group_id: string + group_id: string; /** 设备型号 id。通过微信公众平台注册设备获得。(仅单台设备时) */ - model_id: string + model_id: string; /** 设备唯一序列号。(仅单台设备时) */ - sn: string + sn: string; /** 设备(组)授权状态。0:未授权;1:已授权 */ - status: number + status: number; } interface DisableAlertBeforeUnloadOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: DisableAlertBeforeUnloadCompleteCallback + complete?: DisableAlertBeforeUnloadCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: DisableAlertBeforeUnloadFailCallback + fail?: DisableAlertBeforeUnloadFailCallback; /** 接口调用成功的回调函数 */ - success?: DisableAlertBeforeUnloadSuccessCallback + success?: DisableAlertBeforeUnloadSuccessCallback; } interface DownloadFileOption { /** 下载资源的 url */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: DownloadFileCompleteCallback + complete?: DownloadFileCompleteCallback; /** 需要基础库: `2.10.4` * * 是否开启 http2 */ - enableHttp2?: boolean + enableHttp2?: boolean; /** 是否开启 profile,默认开启。开启后可在接口回调的 res.profile 中查看性能调试信息。 */ - enableProfile?: boolean + enableProfile?: boolean; /** 需要基础库: `2.10.4` * * 是否开启 Quic 协议(gQUIC Q43) */ - enableQuic?: boolean + enableQuic?: boolean; /** 接口调用失败的回调函数 */ - fail?: DownloadFileFailCallback + fail?: DownloadFileFailCallback; /** 需要基础库: `1.8.0` * * 指定文件下载后存储的路径 (本地路径) */ - filePath?: string + filePath?: string; /** HTTP 请求的 Header,Header 中不能设置 Referer */ - header?: IAnyObject + header?: IAnyObject; /** 接口调用成功的回调函数 */ - success?: DownloadFileSuccessCallback + success?: DownloadFileSuccessCallback; /** 需要基础库: `2.10.0` * * 超时时间,单位为毫秒,默认值为 60000 即一分钟。 */ - timeout?: number + timeout?: number; /** 需要基础库: `3.4.1` * * 使用高性能模式,暂仅支持 Android,默认关闭。该模式下有更优的网络性能表现。 */ - useHighPerformanceMode?: boolean + useHighPerformanceMode?: boolean; } interface DownloadFileSuccessCallbackResult { /** 用户文件路径 (本地路径)。传入 filePath 时会返回,跟传入的 filePath 一致 */ - filePath: string + filePath: string; /** 需要基础库: `2.10.4` * * 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) */ - profile: RequestProfile + profile: RequestProfile; /** 开发者服务器返回的 HTTP 状态码 */ - statusCode: number + statusCode: number; /** 临时文件路径 (本地路径)。没传入 filePath 指定文件存储路径时会返回,下载后的文件会存储到一个临时文件 */ - tempFilePath: string - errMsg: string + tempFilePath: string; + errMsg: string; } interface DownloadTaskOnHeadersReceivedListenerResult { /** 开发者服务器返回的 HTTP Response Header */ - header: IAnyObject + header: IAnyObject; } interface DownloadTaskOnProgressUpdateListenerResult { /** 下载进度百分比 */ - progress: number + progress: number; /** 预期需要下载的数据总长度,单位 Bytes */ - totalBytesExpectedToWrite: number + totalBytesExpectedToWrite: number; /** 已经下载的数据长度,单位 Bytes */ - totalBytesWritten: number + totalBytesWritten: number; } interface DraggableSheetContextScrollToOption { /** 是否启用滚动动画 */ - animated?: boolean + animated?: boolean; /** 滚动动画时长(ms) */ - duration?: number + duration?: number; /** 缓动函数 */ - easingFunction?: string + easingFunction?: string; /** 绝对目标位置 */ - pixels?: number + pixels?: number; /** 相对目标位置 */ - size?: number + size?: number; } interface EditImageOption { /** 图片路径,图片的路径,支持本地路径、代码包路径 */ - src: string + src: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: EditImageCompleteCallback + complete?: EditImageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: EditImageFailCallback + fail?: EditImageFailCallback; /** 接口调用成功的回调函数 */ - success?: EditImageSuccessCallback + success?: EditImageSuccessCallback; } interface EnableAlertBeforeUnloadOption { /** 询问对话框内容 */ - message: string + message: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: EnableAlertBeforeUnloadCompleteCallback + complete?: EnableAlertBeforeUnloadCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: EnableAlertBeforeUnloadFailCallback + fail?: EnableAlertBeforeUnloadFailCallback; /** 接口调用成功的回调函数 */ - success?: EnableAlertBeforeUnloadSuccessCallback + success?: EnableAlertBeforeUnloadSuccessCallback; } /** 文件读取结果。res.entries 是一个对象,key是文件路径,value是一个对象 FileItem ,表示该文件的读取结果。每个 FileItem 包含 data (文件内容) 和 errMsg (错误信息) 属性。 */ interface EntriesResult { /** 文件路径 */ - [path: string]: ZipFileItem + [path: string]: ZipFileItem; } /** 要读取的压缩包内的文件列表(当传入"all" 时表示读取压缩包内所有文件) */ interface EntryItem { /** 压缩包内文件路径 */ - path: string + path: string; /** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 * * 可选值: @@ -4749,50 +4738,39 @@ ctx.draw() * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | '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'; /** 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */ - length?: number + length?: number; /** 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */ - position?: number + position?: number; } /** 要擦除的线段数组。详见 [polyline 属性](https://developers.weixin.qq.com/miniprogram/dev/component/map.html#polyline)。 */ interface EraseLineOptions { /** 线段的 id。 */ - id: number + id: number; /** 指定线段的某一段,线段起点 index 为 0 */ - index: number + index: number; /** 指定线段某一段中的点 */ - point: MapPostion + point: MapPostion; /** 为 true 时擦除,false 时置灰 */ - clear?: boolean + clear?: boolean; } interface EraseLinesOption { /** 要擦除的线段数组。详见 [polyline 属性](https://developers.weixin.qq.com/miniprogram/dev/component/map.html#polyline)。 */ - lines: EraseLineOptions[] + lines: EraseLineOptions[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: EraseLinesCompleteCallback + complete?: EraseLinesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: EraseLinesFailCallback + fail?: EraseLinesFailCallback; /** 接口调用成功的回调函数 */ - success?: EraseLinesSuccessCallback + success?: EraseLinesSuccessCallback; } /** 错误 */ interface Error { /** 错误 */ - message: string + message: string; /** 错误调用堆栈 */ - stack: string + stack: string; } /** 需要基础库: `3.4.0` * @@ -4801,77 +4779,77 @@ ctx.draw() /** 需要基础库: `3.4.0` * * 异常信息 */ - reasons: TCPExceptionReason[] + reasons: TCPExceptionReason[]; } /** 本次请求底层失败信息,所有失败信息均符合Errno错误码 */ interface ExceptionReason { /** 错误原因 */ - errMsg: string + errMsg: string; /** 错误码 */ - errno: string + errno: string; } interface ExecuteVisualLayerCommandOption { /** 图层指令 */ - command: string + command: string; /** 可视化图层id */ - layerId: string + layerId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ExecuteVisualLayerCommandCompleteCallback + complete?: ExecuteVisualLayerCommandCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ExecuteVisualLayerCommandFailCallback + fail?: ExecuteVisualLayerCommandFailCallback; /** 接口调用成功的回调函数 */ - success?: ExecuteVisualLayerCommandSuccessCallback + success?: ExecuteVisualLayerCommandSuccessCallback; } interface ExecuteVisualLayerCommandSuccessCallbackResult { /** SDK 返回的 JSON 数据 */ - data: string + data: string; /** 调用结果 */ - errMsg: string + errMsg: string; } interface ExitCastingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ExitCastingCompleteCallback + complete?: ExitCastingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ExitCastingFailCallback + fail?: ExitCastingFailCallback; /** 接口调用成功的回调函数 */ - success?: ExitCastingSuccessCallback + success?: ExitCastingSuccessCallback; } interface ExitFullScreenOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ExitFullScreenCompleteCallback + complete?: ExitFullScreenCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ExitFullScreenFailCallback + fail?: ExitFullScreenFailCallback; /** 接口调用成功的回调函数 */ - success?: ExitFullScreenSuccessCallback + success?: ExitFullScreenSuccessCallback; } interface ExitMiniProgramOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ExitMiniProgramCompleteCallback + complete?: ExitMiniProgramCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ExitMiniProgramFailCallback + fail?: ExitMiniProgramFailCallback; /** 接口调用成功的回调函数 */ - success?: ExitMiniProgramSuccessCallback + success?: ExitMiniProgramSuccessCallback; } interface ExitPictureInPictureOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ExitPictureInPictureCompleteCallback + complete?: ExitPictureInPictureCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ExitPictureInPictureFailCallback + fail?: ExitPictureInPictureFailCallback; /** 接口调用成功的回调函数 */ - success?: ExitPictureInPictureSuccessCallback + success?: ExitPictureInPictureSuccessCallback; } interface ExitVoIPChatOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ExitVoIPChatCompleteCallback + complete?: ExitVoIPChatCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ExitVoIPChatFailCallback + fail?: ExitVoIPChatFailCallback; /** 接口调用成功的回调函数 */ - success?: ExitVoIPChatSuccessCallback + success?: ExitVoIPChatSuccessCallback; } /** 客服信息 */ interface ExtInfoOption { /** 客服链接 */ - url: string + url: string; } /** 额外的缓存处理 */ interface ExtraOption { @@ -4881,72 +4859,72 @@ ctx.draw() * - 'wx.login': ; * - 'wx.checkSession': ; * - 'wx.getSetting': ; */ - apiList?: Array<'wx.login' | 'wx.checkSession' | 'wx.getSetting'> + apiList?: Array<'wx.login' | 'wx.checkSession' | 'wx.getSetting'>; } interface ExtractDataSourceOption { /** 视频源地址,只支持本地文件 */ - source: string + source: string; } /** 人脸角度信息,取值范围 [-1, 1],数值越接近 0 表示越正对摄像头 */ interface FaceAngel { /** 仰俯角(点头) */ - pitch: number + pitch: number; /** 翻滚角(左右倾) */ - roll: number + roll: number; /** 偏航角(摇头) */ - yaw: number + yaw: number; } /** 人脸置信度,取值范围 [0, 1],数值越大置信度越高(遮挡越少) */ interface FaceConf { /** 整体可信度 */ - global: number + global: number; /** 左眼可信度 */ - leftEye: number + leftEye: number; /** 嘴巴可信度 */ - mouth: number + mouth: number; /** 鼻子可信度 */ - nose: number + nose: number; /** 右眼可信度 */ - rightEye: number + rightEye: number; } interface FaceDetectOption { /** 图像像素点数据,每四项表示一个像素点的 RGBA */ - frameBuffer: ArrayBuffer + frameBuffer: ArrayBuffer; /** 图像高度 */ - height: number + height: number; /** 图像宽度 */ - width: number + width: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: FaceDetectCompleteCallback + complete?: FaceDetectCompleteCallback; /** 是否返回当前图像的人脸角度信息 */ - enableAngle?: boolean + enableAngle?: boolean; /** 是否返回当前图像的人脸的置信度(可表示器官遮挡情况) */ - enableConf?: boolean + enableConf?: boolean; /** 是否返回多张人脸的信息 */ - enableMultiFace?: boolean + enableMultiFace?: boolean; /** 是否返回当前图像的人脸(106 个点) */ - enablePoint?: boolean + enablePoint?: boolean; /** 接口调用失败的回调函数 */ - fail?: FaceDetectFailCallback + fail?: FaceDetectFailCallback; /** 接口调用成功的回调函数 */ - success?: FaceDetectSuccessCallback + success?: FaceDetectSuccessCallback; } interface FaceDetectSuccessCallbackResult { /** 人脸角度信息,取值范围 [-1, 1],数值越接近 0 表示越正对摄像头 */ - angleArray: FaceAngel + angleArray: FaceAngel; /** 人脸置信度,取值范围 [0, 1],数值越大置信度越高(遮挡越少) */ - confArray: FaceConf + confArray: FaceConf; /** 脸部方框数值,对象包含 height, width, originX, originY 四个属性 (origin 为方框左上角坐标) */ - detectRect: IAnyObject + detectRect: IAnyObject; /** 多人模式(enableMultiFace)下的人脸信息,每个对象包含上述其它属性 */ - faceInfo: IAnyObject[] + faceInfo: IAnyObject[]; /** 标记人脸轮廓的 106 个点位置数组,数组每个对象包含 x 和 y */ - pointArray: IAnyObject[] + pointArray: IAnyObject[]; /** 脸部中心点横坐标,检测不到人脸则为 -1 */ - x: number + x: number; /** 脸部中心点纵坐标,检测不到人脸则为 -1 */ - y: number - errMsg: string + y: number; + errMsg: string; } /** 需要基础库: `2.25.0` * @@ -4959,167 +4937,167 @@ ctx.draw() * 可选值: * - 1: 通过摄像头实时检测; * - 2: 静态图片检测; */ - mode: 1 | 2 + mode: 1 | 2; } interface Fields { /** 需要基础库: `2.1.0` * * 指定样式名列表,返回节点对应样式名的当前值 */ - computedStyle?: string[] + computedStyle?: string[]; /** 需要基础库: `2.4.2` * * 是否返回节点对应的 Context 对象 */ - context?: boolean + context?: boolean; /** 是否返回节点 dataset */ - dataset?: boolean + dataset?: boolean; /** 是否返回节点 id */ - id?: boolean + id?: boolean; /** 是否返回节点 mark */ - mark?: boolean + mark?: boolean; /** 需要基础库: `2.7.0` * * 是否返回节点对应的 Node 实例 */ - node?: boolean + node?: boolean; /** 指定属性名列表,返回节点对应属性名的当前属性值(只能获得组件文档中标注的常规属性值,id class style 和事件绑定的属性值不可获取) */ - properties?: string[] + properties?: string[]; /** 是否返回节点布局位置(`left` `right` `top` `bottom`) */ - rect?: boolean + rect?: boolean; /** 需要基础库: `3.3.0` * * 是否返回节点对应的 Ref 对象,仅 `Skyline` 下支持 */ - ref?: boolean + ref?: boolean; /** 否 是否返回节点的 `scrollLeft` `scrollTop`,节点必须是 `scroll-view` 或者 `viewport` */ - scrollOffset?: boolean + scrollOffset?: boolean; /** 是否返回节点尺寸(`width` `height`) */ - size?: boolean + size?: boolean; } /** 文件数组 */ interface FileItem { /** 文件保存时的时间戳,从1970/01/01 08:00:00 到当前时间的秒数 */ - createTime: number + createTime: number; /** 文件路径 (本地路径) */ - filePath: string + filePath: string; /** 本地文件大小,以字节为单位 */ - size: number + size: number; } /** 每个 FileStats 对象包含 path 和 Stats */ interface FileStats { /** 文件/目录路径 */ - path: string + path: string; /** [Stats](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.html) * * Stats 对象,即描述文件状态的对象 */ - stats: Stats + stats: Stats; } interface FileSystemManagerCloseOption { /** 需要被关闭的文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: FileSystemManagerCloseCompleteCallback + complete?: FileSystemManagerCloseCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: FileSystemManagerCloseFailCallback + fail?: FileSystemManagerCloseFailCallback; /** 接口调用成功的回调函数 */ - success?: FileSystemManagerCloseSuccessCallback + success?: FileSystemManagerCloseSuccessCallback; } /** 打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数 */ interface ForwardMaterials { /** 文件名 */ - name: string + name: string; /** 文件路径(如果是webview则是url) */ - path: string + path: string; /** 文件大小 */ - size: number + size: number; /** 文件的mimetype类型 */ - type: string + type: string; } /** 视频帧数据,若取不到则返回 null。当缓冲区为空的时候可能暂停取不到数据。 */ interface FrameDataOptions { /** 帧数据 */ - data: ArrayBuffer + data: ArrayBuffer; /** 帧数据高度 */ - height: number + height: number; /** 帧原始 dts */ - pkDts: number + pkDts: number; /** 帧原始 pts */ - pkPts: number + pkPts: number; /** 帧数据宽度 */ - width: number + width: number; } interface FromScreenLocationOption { /** x 坐标值 */ - x: number + x: number; /** y 坐标值 */ - y: number + y: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: FromScreenLocationCompleteCallback + complete?: FromScreenLocationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: FromScreenLocationFailCallback + fail?: FromScreenLocationFailCallback; /** 接口调用成功的回调函数 */ - success?: FromScreenLocationSuccessCallback + success?: FromScreenLocationSuccessCallback; } interface FstatOption { /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: FstatCompleteCallback + complete?: FstatCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: FstatFailCallback + fail?: FstatFailCallback; /** 接口调用成功的回调函数 */ - success?: FstatSuccessCallback + success?: FstatSuccessCallback; } interface FstatSuccessCallbackResult { /** [Stats](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.html) * * Stats 对象,包含了文件的状态信息 */ - stats: Stats - errMsg: string + stats: Stats; + errMsg: string; } interface FstatSyncOption { /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; } interface FtruncateOption { /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; /** 截断位置,默认0。如果 length 小于文件长度(单位:字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') */ - length: number + length: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: FtruncateCompleteCallback + complete?: FtruncateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: FtruncateFailCallback + fail?: FtruncateFailCallback; /** 接口调用成功的回调函数 */ - success?: FtruncateSuccessCallback + success?: FtruncateSuccessCallback; } interface FtruncateSyncOption { /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; /** 截断位置,默认0。如果 length 小于文件长度(单位:字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') */ - length: number + length: number; } interface GeneralCallbackResult { /** 错误信息 */ - errMsg: string + errMsg: string; } interface GetAtqaOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetAtqaCompleteCallback + complete?: GetAtqaCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetAtqaFailCallback + fail?: GetAtqaFailCallback; /** 接口调用成功的回调函数 */ - success?: GetAtqaSuccessCallback + success?: GetAtqaSuccessCallback; } interface GetAtqaSuccessCallbackResult { /** 返回 ATQA/SENS_RES 数据 */ - atqa: ArrayBuffer - errMsg: string + atqa: ArrayBuffer; + errMsg: string; } interface GetAvailableAudioSourcesOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetAvailableAudioSourcesCompleteCallback + complete?: GetAvailableAudioSourcesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetAvailableAudioSourcesFailCallback + fail?: GetAvailableAudioSourcesFailCallback; /** 接口调用成功的回调函数 */ - success?: GetAvailableAudioSourcesSuccessCallback + 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 @@ -5132,268 +5110,260 @@ ctx.draw() * - 'camcorder': 同 mic,适用于录制音视频内容,仅限 Android; * - 'voice_communication': 同 mic,适用于实时沟通,仅限 Android; * - 'voice_recognition': 同 mic,适用于语音识别,仅限 Android; */ - audioSources: Array< - | 'auto' - | 'buildInMic' - | 'headsetMic' - | 'mic' - | 'camcorder' - | 'voice_communication' - | 'voice_recognition' - > - errMsg: string + audioSources: Array<'auto' | 'buildInMic' | 'headsetMic' | 'mic' | 'camcorder' | 'voice_communication' | 'voice_recognition'>; + errMsg: string; } interface GetBLEDeviceCharacteristicsOption { /** 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 */ - deviceId: string + deviceId: string; /** 蓝牙服务 UUID。需要先调用 [wx.getBLEDeviceServices](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEDeviceServices.html) 获取 */ - serviceId: string + serviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBLEDeviceCharacteristicsCompleteCallback + complete?: GetBLEDeviceCharacteristicsCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBLEDeviceCharacteristicsFailCallback + fail?: GetBLEDeviceCharacteristicsFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBLEDeviceCharacteristicsSuccessCallback + success?: GetBLEDeviceCharacteristicsSuccessCallback; } interface GetBLEDeviceCharacteristicsSuccessCallbackResult { /** 设备特征列表 */ - characteristics: BLECharacteristic[] - errMsg: string + characteristics: BLECharacteristic[]; + errMsg: string; } interface GetBLEDeviceRSSIOption { /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBLEDeviceRSSICompleteCallback + complete?: GetBLEDeviceRSSICompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBLEDeviceRSSIFailCallback + fail?: GetBLEDeviceRSSIFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBLEDeviceRSSISuccessCallback + success?: GetBLEDeviceRSSISuccessCallback; } interface GetBLEDeviceRSSISuccessCallbackResult { /** 信号强度,单位 dBm */ - RSSI: number - errMsg: string + RSSI: number; + errMsg: string; } interface GetBLEDeviceServicesOption { /** 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 */ - deviceId: string + deviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBLEDeviceServicesCompleteCallback + complete?: GetBLEDeviceServicesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBLEDeviceServicesFailCallback + fail?: GetBLEDeviceServicesFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBLEDeviceServicesSuccessCallback + success?: GetBLEDeviceServicesSuccessCallback; } interface GetBLEDeviceServicesSuccessCallbackResult { /** 设备服务列表 */ - services: BLEService[] - errMsg: string + services: BLEService[]; + errMsg: string; } interface GetBLEMTUOption { /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBLEMTUCompleteCallback + complete?: GetBLEMTUCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBLEMTUFailCallback + fail?: GetBLEMTUFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBLEMTUSuccessCallback + success?: GetBLEMTUSuccessCallback; /** 写模式 (iOS 特有参数) * * 可选值: * - 'write': 有回复写; * - 'writeNoResponse': 无回复写; */ - writeType?: 'write' | 'writeNoResponse' + writeType?: 'write' | 'writeNoResponse'; } interface GetBLEMTUSuccessCallbackResult { /** 最大传输单元 */ - mtu: number - errMsg: string + mtu: number; + errMsg: string; } interface GetBackgroundAudioPlayerStateOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBackgroundAudioPlayerStateCompleteCallback + complete?: GetBackgroundAudioPlayerStateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBackgroundAudioPlayerStateFailCallback + fail?: GetBackgroundAudioPlayerStateFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBackgroundAudioPlayerStateSuccessCallback + success?: GetBackgroundAudioPlayerStateSuccessCallback; } interface GetBackgroundAudioPlayerStateSuccessCallbackResult { /** 选定音频的播放位置(单位:s),只有在音乐播放中时返回 */ - currentPosition: number + currentPosition: number; /** 歌曲数据链接,只有在音乐播放中时返回 */ - dataUrl: string + dataUrl: string; /** 音频的下载进度百分比,只有在音乐播放中时返回 */ - downloadPercent: number + downloadPercent: number; /** 选定音频的长度(单位:s),只有在音乐播放中时返回 */ - duration: number + duration: number; /** 播放状态 * * 可选值: * - 0: 暂停中; * - 1: 播放中; * - 2: 没有音乐播放; */ - status: 0 | 1 | 2 - errMsg: string + status: 0 | 1 | 2; + errMsg: string; } interface GetBackgroundFetchDataOption { /** 缓存数据类别,取值为 periodic 或 pre */ - fetchType: string + fetchType: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBackgroundFetchDataCompleteCallback + complete?: GetBackgroundFetchDataCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBackgroundFetchDataFailCallback + fail?: GetBackgroundFetchDataFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBackgroundFetchDataSuccessCallback + success?: GetBackgroundFetchDataSuccessCallback; } interface GetBackgroundFetchDataSuccessCallbackResult { /** 缓存数据 */ - fetchedData: string + fetchedData: string; /** 小程序页面路径 */ - path: string + path: string; /** 传给页面的 query 参数 */ - query: string + query: string; /** 进入小程序的场景值 */ - scene: number + scene: number; /** 客户端拿到缓存数据的时间戳 ms。(iOS 时间戳存在异常,8.0.27 修复) */ - timeStamp: number - errMsg: string + timeStamp: number; + errMsg: string; } interface GetBackgroundFetchTokenOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBackgroundFetchTokenCompleteCallback + complete?: GetBackgroundFetchTokenCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBackgroundFetchTokenFailCallback + fail?: GetBackgroundFetchTokenFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBackgroundFetchTokenSuccessCallback + success?: GetBackgroundFetchTokenSuccessCallback; } interface GetBackgroundFetchTokenSuccessCallbackResult { /** 接口调用结果 */ - errMsg: string + errMsg: string; /** 自定义的登录态 */ - token: string + token: string; } interface GetBatteryInfoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBatteryInfoCompleteCallback + complete?: GetBatteryInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBatteryInfoFailCallback + fail?: GetBatteryInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBatteryInfoSuccessCallback + success?: GetBatteryInfoSuccessCallback; } interface GetBatteryInfoSuccessCallbackResult { /** 是否正在充电中 */ - isCharging: boolean + isCharging: boolean; /** 需要基础库: `3.4.3` * * 是否处于省电模式,目前仅 iOS 端支持 */ - isLowPowerModeEnabled: boolean + isLowPowerModeEnabled: boolean; /** 设备电量,范围 1 - 100 */ - level: number - errMsg: string + level: number; + errMsg: string; } interface GetBatteryInfoSyncResult { /** 是否正在充电中 */ - isCharging: boolean + isCharging: boolean; /** 需要基础库: `3.4.3` * * 是否处于省电模式,目前仅 iOS 端支持 */ - isLowPowerModeEnabled: boolean + isLowPowerModeEnabled: boolean; /** 设备电量,范围 1 - 100 */ - level: number + level: number; } interface GetBeaconsOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBeaconsCompleteCallback + complete?: GetBeaconsCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBeaconsFailCallback + fail?: GetBeaconsFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBeaconsSuccessCallback + success?: GetBeaconsSuccessCallback; } interface GetBeaconsSuccessCallbackResult { /** Beacon 设备列表 */ - beacons: BeaconInfo[] - errMsg: string + beacons: BeaconInfo[]; + errMsg: string; } interface GetBluetoothAdapterStateOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBluetoothAdapterStateCompleteCallback + complete?: GetBluetoothAdapterStateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBluetoothAdapterStateFailCallback + fail?: GetBluetoothAdapterStateFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBluetoothAdapterStateSuccessCallback + success?: GetBluetoothAdapterStateSuccessCallback; } interface GetBluetoothAdapterStateSuccessCallbackResult { /** 蓝牙适配器是否可用 */ - available: boolean + available: boolean; /** 是否正在搜索设备 */ - discovering: boolean - errMsg: string + discovering: boolean; + errMsg: string; } interface GetBluetoothDevicesOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetBluetoothDevicesCompleteCallback + complete?: GetBluetoothDevicesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetBluetoothDevicesFailCallback + fail?: GetBluetoothDevicesFailCallback; /** 接口调用成功的回调函数 */ - success?: GetBluetoothDevicesSuccessCallback + success?: GetBluetoothDevicesSuccessCallback; } interface GetBluetoothDevicesSuccessCallbackResult { /** UUID 对应的已连接设备列表 */ - devices: BlueToothDevice[] - errMsg: string + devices: BlueToothDevice[]; + errMsg: string; } interface GetCenterLocationOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetCenterLocationCompleteCallback + complete?: GetCenterLocationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetCenterLocationFailCallback + fail?: GetCenterLocationFailCallback; /** 图标路径,支持网络路径、本地路径、代码包路径 */ - iconPath?: string + iconPath?: string; /** 接口调用成功的回调函数 */ - success?: GetCenterLocationSuccessCallback + success?: GetCenterLocationSuccessCallback; } interface GetCenterLocationSuccessCallbackResult { /** 纬度 */ - latitude: number + latitude: number; /** 经度 */ - longitude: number - errMsg: string + longitude: number; + errMsg: string; } interface GetChannelsLiveInfoOption { /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ - finderUserName: string + finderUserName: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetChannelsLiveInfoCompleteCallback + complete?: GetChannelsLiveInfoCompleteCallback; /** 需要基础库: `2.29.0` * * 结束时间,筛选指定时间段的直播。若上传了startTime,未上传endTime,则endTime默认取当前时间 */ - endTime?: number + endTime?: number; /** 接口调用失败的回调函数 */ - fail?: GetChannelsLiveInfoFailCallback + fail?: GetChannelsLiveInfoFailCallback; /** 需要基础库: `2.29.0` * * 起始时间,筛选指定时间段的直播。若上传了endTime,未上传startTime,则startTime默认为0 */ - startTime?: number + startTime?: number; /** 接口调用成功的回调函数 */ - success?: GetChannelsLiveInfoSuccessCallback + success?: GetChannelsLiveInfoSuccessCallback; } interface GetChannelsLiveInfoSuccessCallbackResult { /** 直播主题 */ - description: string + description: string; /** 直播 feedId */ - feedId: string + feedId: string; /** 视频号头像 */ - headUrl: string + headUrl: string; /** 视频号昵称 */ - nickname: string + nickname: string; /** 直播 nonceId */ - nonceId: string + nonceId: string; /** 需要基础库: `2.29.0` * * 除最近的一条直播外,其他的直播列表(注意:每次最多返回按时间戳增序排列的15个直播信息,其中时间最近的那个直播会在接口其他的返回参数中展示,其余的直播会在该字段中展示)。 */ - otherInfos: any[] + otherInfos: any[]; /** 需要基础库: `2.29.0` * * 直播回放状态 @@ -5403,7 +5373,7 @@ ctx.draw() * - 1: 已生成; * - 3: 生成中; * - 6: 已过期; */ - replayStatus: 0 | 1 | 3 | 6 + replayStatus: 0 | 1 | 3 | 6; /** 直播状态 * * 可选值: @@ -5411,285 +5381,285 @@ ctx.draw() * - 2: 直播中; * - 3: 直播已结束; * - 4: 直播准备中(未开播); */ - status: 1 | 2 | 3 | 4 - errMsg: string + status: 1 | 2 | 3 | 4; + errMsg: string; } interface GetChannelsLiveNoticeInfoOption { /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ - finderUserName: string + finderUserName: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetChannelsLiveNoticeInfoCompleteCallback + complete?: GetChannelsLiveNoticeInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetChannelsLiveNoticeInfoFailCallback + fail?: GetChannelsLiveNoticeInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetChannelsLiveNoticeInfoSuccessCallback + success?: GetChannelsLiveNoticeInfoSuccessCallback; } interface GetChannelsLiveNoticeInfoSuccessCallbackResult { /** 直播封面 */ - headUrl: string + headUrl: string; /** 视频号昵称 */ - nickname: string + nickname: string; /** 预告 id */ - noticeId: string + noticeId: string; /** 需要基础库: `2.24.6` * * 除最近的一条预告信息外,其他的预告信息列表(注意:每次最多返回按时间戳增序排列的15个预告信息,其中时间最近的那个预告信息会在接口其他的返回参数中展示,其余的预告信息会在该字段中展示)。 */ - otherInfos: any[] + otherInfos: any[]; /** 是否可预约 */ - reservable: boolean + reservable: boolean; /** 开始时间 */ - startTime: string + startTime: string; /** 预告状态:0可用 1取消 2已用 */ - status: number - errMsg: string + status: number; + errMsg: string; } interface GetChannelsShareKeyOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetChannelsShareKeyCompleteCallback + complete?: GetChannelsShareKeyCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetChannelsShareKeyFailCallback + fail?: GetChannelsShareKeyFailCallback; /** 接口调用成功的回调函数 */ - success?: GetChannelsShareKeySuccessCallback + success?: GetChannelsShareKeySuccessCallback; } interface GetChannelsShareKeySuccessCallbackResult { /** 推广员 */ - promoter: PromoterResult + promoter: PromoterResult; /** 分享者 openid */ - sharerOpenId: string - errMsg: string + sharerOpenId: string; + errMsg: string; } interface GetClipboardDataOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetClipboardDataCompleteCallback + complete?: GetClipboardDataCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetClipboardDataFailCallback + fail?: GetClipboardDataFailCallback; /** 接口调用成功的回调函数 */ - success?: GetClipboardDataSuccessCallback + success?: GetClipboardDataSuccessCallback; } interface GetClipboardDataSuccessCallbackOption { /** 剪贴板的内容 */ - data: string - errMsg: string + data: string; + errMsg: string; } interface GetCommonConfigOption { /** 0:通用配置模式 1:实验模式, 参数与返回结果的使用等效于接口[wx.getExptInfoSync](https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.getExptInfoSync.html) */ - mode: number + mode: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetCommonConfigCompleteCallback + complete?: GetCommonConfigCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetCommonConfigFailCallback + fail?: GetCommonConfigFailCallback; /** 需要获取的数据指标的对象数组,每个string的格式约定:配置类型_分表key */ - keys?: string[] + keys?: string[]; /** 接口调用成功的回调函数 */ - success?: GetCommonConfigSuccessCallback + success?: GetCommonConfigSuccessCallback; } interface GetCommonConfigSuccessCallbackResult { /** 根据conf_type来确定conf内容,conf_type为1时conf是一个json数组, 类似"[{xxx},{xxx}]", 每一项对应表类型每一行配置内容, 其中conf_type为2时conf是一个json对象,类似"{xxxx}" */ - conf: string + conf: string; /** 配置类型, 1-表类型 2-kv类型 */ - conf_type: number + conf_type: number; /** 错误码 */ - errcode: number + errcode: number; /** 错误信息 */ - errmsg: string + errmsg: string; /** 过期时间,单位秒. 0表示当次有效 */ - expire_sec: number - errMsg: string + expire_sec: number; + errMsg: string; } interface GetConnectedBluetoothDevicesOption { /** 蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID) */ - services: string[] + services: string[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetConnectedBluetoothDevicesCompleteCallback + complete?: GetConnectedBluetoothDevicesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetConnectedBluetoothDevicesFailCallback + fail?: GetConnectedBluetoothDevicesFailCallback; /** 接口调用成功的回调函数 */ - success?: GetConnectedBluetoothDevicesSuccessCallback + success?: GetConnectedBluetoothDevicesSuccessCallback; } interface GetConnectedBluetoothDevicesSuccessCallbackResult { /** 搜索到的设备列表 */ - devices: BluetoothDeviceInfo[] - errMsg: string + devices: BluetoothDeviceInfo[]; + errMsg: string; } interface GetConnectedWifiOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetConnectedWifiCompleteCallback + complete?: GetConnectedWifiCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetConnectedWifiFailCallback + fail?: GetConnectedWifiFailCallback; /** 需要基础库: `2.22.0` * * 是否需要返回部分 Wi-Fi 信息 */ - partialInfo?: boolean + partialInfo?: boolean; /** 接口调用成功的回调函数 */ - success?: GetConnectedWifiSuccessCallback + success?: GetConnectedWifiSuccessCallback; } interface GetConnectedWifiSuccessCallbackResult { /** [WifiInfo](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/WifiInfo.html) * * Wi-Fi 信息 */ - wifi: WifiInfo - errMsg: string + wifi: WifiInfo; + errMsg: string; } interface GetContentsOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetContentsCompleteCallback + complete?: GetContentsCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetContentsFailCallback + fail?: GetContentsFailCallback; /** 接口调用成功的回调函数 */ - success?: GetContentsSuccessCallback + success?: GetContentsSuccessCallback; } interface GetContentsSuccessCallbackResult { /** 表示内容的delta对象 */ - delta: IAnyObject + delta: IAnyObject; /** 带标签的HTML内容 */ - html: string + html: string; /** 纯文本内容 */ - text: string - errMsg: string + text: string; + errMsg: string; } interface GetDeviceBenchmarkInfoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetDeviceBenchmarkInfoCompleteCallback + complete?: GetDeviceBenchmarkInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetDeviceBenchmarkInfoFailCallback + fail?: GetDeviceBenchmarkInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetDeviceBenchmarkInfoSuccessCallback + success?: GetDeviceBenchmarkInfoSuccessCallback; } interface GetDeviceBenchmarkInfoSuccessCallbackResult { /** 需要基础库: `3.4.5` * * 设备性能等级。-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不超过50)
注意:设备的benchmarkLevel值不会随着时间的推移而变化 */ - benchmarkLevel: number + benchmarkLevel: number; /** 需要基础库: `3.4.5` * * 设备机型档位。0(档位未知),1(高档机),2(中档机),3(低档机)
注意:设备的机型档位会随着时间的推移而变化,因此在使用时请谨慎对待;若业务逻辑依赖于机型档位,但担心受到机型档位变化的影响,请参考[设备档位映射文档](https://developers.weixin.qq.com/minigame/dev/guide/performance/perf-benchmarkLevel.html)自行判断机型档位 */ - modelLevel: number - errMsg: string + modelLevel: number; + errMsg: string; } interface GetDeviceVoIPListOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetDeviceVoIPListCompleteCallback + complete?: GetDeviceVoIPListCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetDeviceVoIPListFailCallback + fail?: GetDeviceVoIPListFailCallback; /** 接口调用成功的回调函数 */ - success?: GetDeviceVoIPListSuccessCallback + success?: GetDeviceVoIPListSuccessCallback; } interface GetDeviceVoIPListSuccessCallbackResult { - list: DeviceVoIPInfo[] - errMsg: string + list: DeviceVoIPInfo[]; + errMsg: string; } interface GetExtConfigOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetExtConfigCompleteCallback + complete?: GetExtConfigCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetExtConfigFailCallback + fail?: GetExtConfigFailCallback; /** 接口调用成功的回调函数 */ - success?: GetExtConfigSuccessCallback + success?: GetExtConfigSuccessCallback; } interface GetExtConfigSuccessCallbackResult { /** 第三方平台自定义的数据 */ - extConfig: IAnyObject - errMsg: string + extConfig: IAnyObject; + errMsg: string; } interface GetFileInfoOption { /** 要读取的文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetFileInfoCompleteCallback + complete?: GetFileInfoCompleteCallback; /** 计算文件摘要的算法 * * 可选值: * - 'md5': md5 算法; * - 'sha1': sha1 算法; * - 'sha256': sha256 算法; */ - digestAlgorithm?: 'md5' | 'sha1' | 'sha256' + digestAlgorithm?: 'md5' | 'sha1' | 'sha256'; /** 接口调用失败的回调函数 */ - fail?: GetFileInfoFailCallback + fail?: GetFileInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetFileInfoSuccessCallback + success?: GetFileInfoSuccessCallback; } interface GetFileInfoSuccessCallbackResult { /** 按照传入的 digestAlgorithm 计算得出的的文件摘要 */ - digest: string + digest: string; /** 文件大小,以字节为单位 */ - size: number - errMsg: string + size: number; + errMsg: string; } interface GetFuzzyLocationOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetFuzzyLocationCompleteCallback + complete?: GetFuzzyLocationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetFuzzyLocationFailCallback + fail?: GetFuzzyLocationFailCallback; /** 接口调用成功的回调函数 */ - success?: GetFuzzyLocationSuccessCallback + success?: GetFuzzyLocationSuccessCallback; /** 返回的坐标类型 * * 可选值: * - 'wgs84': 返回 gps 坐标; * - 'gcj02': 返回 gcj02 坐标,可用于 wx.openLocation; */ - type?: 'wgs84' | 'gcj02' + type?: 'wgs84' | 'gcj02'; } interface GetFuzzyLocationSuccessCallbackResult { /** 纬度,范围为 -90~90,负数表示南纬 */ - latitude: number + latitude: number; /** 经度,范围为 -180~180,负数表示西经 */ - longitude: number - errMsg: string + longitude: number; + errMsg: string; } interface GetGroupEnterInfoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetGroupEnterInfoCompleteCallback + complete?: GetGroupEnterInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetGroupEnterInfoFailCallback + fail?: GetGroupEnterInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetGroupEnterInfoSuccessCallback + success?: GetGroupEnterInfoSuccessCallback; } interface GetGroupEnterInfoSuccessCallbackResult { /** 需要基础库: `2.7.0` * * 敏感数据对应的云 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) */ - cloudID: string + cloudID: string; /** 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ - encryptedData: string + encryptedData: string; /** 错误信息 */ - errMsg: string + errMsg: string; /** 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ - iv: string + iv: string; } interface GetHCEStateOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetHCEStateCompleteCallback + complete?: GetHCEStateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetHCEStateFailCallback + fail?: GetHCEStateFailCallback; /** 接口调用成功的回调函数 */ - success?: GetHCEStateSuccessCallback + success?: GetHCEStateSuccessCallback; } interface GetHistoricalBytesOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetHistoricalBytesCompleteCallback + complete?: GetHistoricalBytesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetHistoricalBytesFailCallback + fail?: GetHistoricalBytesFailCallback; /** 接口调用成功的回调函数 */ - success?: GetHistoricalBytesSuccessCallback + success?: GetHistoricalBytesSuccessCallback; } interface GetHistoricalBytesSuccessCallbackResult { /** 返回历史二进制数据 */ - histBytes: ArrayBuffer - errMsg: string + histBytes: ArrayBuffer; + errMsg: string; } interface GetImageInfoOption { /** 图片的路径,支持网络路径、本地路径、代码包路径 */ - src: string + src: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetImageInfoCompleteCallback + complete?: GetImageInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetImageInfoFailCallback + fail?: GetImageInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetImageInfoSuccessCallback + success?: GetImageInfoSuccessCallback; } interface GetImageInfoSuccessCallbackResult { /** 图片原始高度,单位px。不考虑旋转。 */ - height: number + height: number; /** 需要基础库: `1.9.90` * * [拍照时设备方向](http://sylvana.net/jpegcrop/exif_orientation.html) @@ -5703,17 +5673,9 @@ ctx.draw() * - 'right': 顺时针旋转90度,对应 Exif 中的 6; * - 'right-mirrored': 同 right,但镜像翻转,对应 Exif 中的 7; * - 'left': 逆时针旋转90度,对应 Exif 中的 8; */ - orientation: - | 'up' - | 'up-mirrored' - | 'down' - | 'down-mirrored' - | 'left-mirrored' - | 'right' - | 'right-mirrored' - | 'left' + orientation: 'up' | 'up-mirrored' | 'down' | 'down-mirrored' | 'left-mirrored' | 'right' | 'right-mirrored' | 'left'; /** 图片的本地路径 */ - path: string + path: string; /** 需要基础库: `1.9.90` * * 图片格式 @@ -5724,149 +5686,149 @@ ctx.draw() * - 'png': png压缩格式; * - 'gif': gif压缩格式; * - 'tiff': tiff压缩格式; */ - type: 'unknown' | 'jpeg' | 'png' | 'gif' | 'tiff' + type: 'unknown' | 'jpeg' | 'png' | 'gif' | 'tiff'; /** 图片原始宽度,单位px。不考虑旋转。 */ - width: number - errMsg: string + width: number; + errMsg: string; } interface GetInferenceEnvInfoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetInferenceEnvInfoCompleteCallback + complete?: GetInferenceEnvInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetInferenceEnvInfoFailCallback + fail?: GetInferenceEnvInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetInferenceEnvInfoSuccessCallback + success?: GetInferenceEnvInfoSuccessCallback; } interface GetInferenceEnvInfoSuccessCallbackResult { /** AI推理引擎版本 */ - ver: string - errMsg: string + ver: string; + errMsg: string; } interface GetLatestUserKeyOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetLatestUserKeyCompleteCallback + complete?: GetLatestUserKeyCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetLatestUserKeyFailCallback + fail?: GetLatestUserKeyFailCallback; /** 接口调用成功的回调函数 */ - success?: GetLatestUserKeySuccessCallback + success?: GetLatestUserKeySuccessCallback; } interface GetLatestUserKeySuccessCallbackResult { /** 用户加密密钥 */ - encryptKey: string + encryptKey: string; /** 密钥过期时间 */ - expireTime: number + expireTime: number; /** 密钥初始向量 */ - iv: string + iv: string; /** 密钥版本 */ - version: number - errMsg: string + version: number; + errMsg: string; } interface GetLocalIPAddressOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetLocalIPAddressCompleteCallback + complete?: GetLocalIPAddressCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetLocalIPAddressFailCallback + fail?: GetLocalIPAddressFailCallback; /** 接口调用成功的回调函数 */ - success?: GetLocalIPAddressSuccessCallback + success?: GetLocalIPAddressSuccessCallback; } interface GetLocalIPAddressSuccessCallbackResult { /** 错误信息 */ - errMsg: string + errMsg: string; /** 本机局域网IP地址 */ - localip: string + localip: string; /** 本机局域网子网掩码,基础库 2.24.0 开始支持 */ - netmask: string + netmask: string; } interface GetLocationOption { /** 需要基础库: `1.6.0` * * 传入 true 会返回高度信息,由于获取高度需要较高精确度,会减慢接口返回速度 */ - altitude?: boolean + altitude?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetLocationCompleteCallback + complete?: GetLocationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetLocationFailCallback + fail?: GetLocationFailCallback; /** 需要基础库: `2.9.0` * * 高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果 */ - highAccuracyExpireTime?: number + highAccuracyExpireTime?: number; /** 需要基础库: `2.9.0` * * 开启高精度定位 */ - isHighAccuracy?: boolean + isHighAccuracy?: boolean; /** 接口调用成功的回调函数 */ - success?: GetLocationSuccessCallback + success?: GetLocationSuccessCallback; /** wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 */ - type?: string + type?: string; } interface GetLocationSuccessCallbackResult { /** 位置的精确度,反应与真实位置之间的接近程度,可以理解成10即与真实位置相差10m,越小越精确 */ - accuracy: number + accuracy: number; /** 需要基础库: `1.2.0` * * 高度,单位 m */ - altitude: number + altitude: number; /** 需要基础库: `1.2.0` * * 水平精度,单位 m */ - horizontalAccuracy: number + horizontalAccuracy: number; /** 纬度,范围为 -90~90,负数表示南纬 */ - latitude: number + latitude: number; /** 经度,范围为 -180~180,负数表示西经 */ - longitude: number + longitude: number; /** 速度,单位 m/s */ - speed: number + speed: number; /** 需要基础库: `1.2.0` * * 垂直精度,单位 m(Android 无法获取,返回 0) */ - verticalAccuracy: number - errMsg: string + verticalAccuracy: number; + errMsg: string; } interface GetLogManagerOption { /** 需要基础库: `2.3.2` * * 取值为0/1,取值为0表示会把 `App`、`Page` 的生命周期函数和 `wx` 命名空间下的函数调用写入日志,取值为1则不会。默认值是 0 */ - level?: number + level?: number; } interface GetMaxTransceiveLengthOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetMaxTransceiveLengthCompleteCallback + complete?: GetMaxTransceiveLengthCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetMaxTransceiveLengthFailCallback + fail?: GetMaxTransceiveLengthFailCallback; /** 接口调用成功的回调函数 */ - success?: GetMaxTransceiveLengthSuccessCallback + success?: GetMaxTransceiveLengthSuccessCallback; } interface GetMaxTransceiveLengthSuccessCallbackResult { /** 最大传输长度 */ - length: number - errMsg: string + length: number; + errMsg: string; } interface GetMaxZoomOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetMaxZoomCompleteCallback + complete?: GetMaxZoomCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetMaxZoomFailCallback + fail?: GetMaxZoomFailCallback; /** 接口调用成功的回调函数 */ - success?: GetMaxZoomSuccessCallback + success?: GetMaxZoomSuccessCallback; } interface GetMaxZoomSuccessCallbackResult { /** 最大放缩级别 */ - maxZoom: string - errMsg: string + maxZoom: string; + errMsg: string; } interface GetNetworkTypeOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetNetworkTypeCompleteCallback + complete?: GetNetworkTypeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetNetworkTypeFailCallback + fail?: GetNetworkTypeFailCallback; /** 接口调用成功的回调函数 */ - success?: GetNetworkTypeSuccessCallback + success?: GetNetworkTypeSuccessCallback; } interface GetNetworkTypeSuccessCallbackResult { /** 需要基础库: `2.22.1` * * 设备是否使用了网络代理 */ - hasSystemProxy: boolean + hasSystemProxy: boolean; /** 网络类型 * * 可选值: @@ -5877,140 +5839,140 @@ ctx.draw() * - '5g': 5g 网络; * - 'unknown': Android 下不常见的网络类型; * - 'none': 无网络; */ - networkType: 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none' + networkType: 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none'; /** 信号强弱,单位 dbm */ - signalStrength: number + signalStrength: number; /** 需要基础库: `3.5.3` * * 是否处于弱网环境 */ - weakNet: boolean - errMsg: string + weakNet: boolean; + errMsg: string; } interface GetPrivacySettingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetPrivacySettingCompleteCallback + complete?: GetPrivacySettingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetPrivacySettingFailCallback + fail?: GetPrivacySettingFailCallback; /** 接口调用成功的回调函数 */ - success?: GetPrivacySettingSuccessCallback + success?: GetPrivacySettingSuccessCallback; } interface GetPrivacySettingSuccessCallbackResult { /** 是否需要用户授权隐私协议(如果开发者没有在「MP后台-设置-服务内容声明-用户隐私保护指引」中声明隐私收集类型则会返回false;如果开发者声明了隐私收集,且用户之前同意过隐私协议则会返回false;如果开发者声明了隐私收集,且用户还没同意过则返回true;如果用户之前同意过、但后来小程序又新增了隐私收集类型也会返回true) */ - needAuthorization: boolean + needAuthorization: boolean; /** 隐私授权协议的名称 */ - privacyContractName: string - errMsg: string + privacyContractName: string; + errMsg: string; } interface GetRandomValuesOption { /** 整数,生成随机数的字节数,最大 1048576 */ - length: number + length: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetRandomValuesCompleteCallback + complete?: GetRandomValuesCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetRandomValuesFailCallback + fail?: GetRandomValuesFailCallback; /** 接口调用成功的回调函数 */ - success?: GetRandomValuesSuccessCallback + success?: GetRandomValuesSuccessCallback; } interface GetRandomValuesSuccessCallbackResult { /** 随机数内容,长度为传入的字节数 */ - randomValues: ArrayBuffer - errMsg: string + randomValues: ArrayBuffer; + errMsg: string; } interface GetRegionOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetRegionCompleteCallback + complete?: GetRegionCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetRegionFailCallback + fail?: GetRegionFailCallback; /** 接口调用成功的回调函数 */ - success?: GetRegionSuccessCallback + success?: GetRegionSuccessCallback; } interface GetRegionSuccessCallbackResult { /** 东北角经纬度 */ - northeast: MapPostion + northeast: MapPostion; /** 西南角经纬度 */ - southwest: MapPostion - errMsg: string + southwest: MapPostion; + errMsg: string; } interface GetRendererUserAgentOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetRendererUserAgentCompleteCallback + complete?: GetRendererUserAgentCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetRendererUserAgentFailCallback + fail?: GetRendererUserAgentFailCallback; /** 接口调用成功的回调函数 */ - success?: GetRendererUserAgentSuccessCallback + success?: GetRendererUserAgentSuccessCallback; } interface GetRotateOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetRotateCompleteCallback + complete?: GetRotateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetRotateFailCallback + fail?: GetRotateFailCallback; /** 接口调用成功的回调函数 */ - success?: GetRotateSuccessCallback + success?: GetRotateSuccessCallback; } interface GetRotateSuccessCallbackResult { /** 旋转角 */ - rotate: number - errMsg: string + rotate: number; + errMsg: string; } interface GetSakOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSakCompleteCallback + complete?: GetSakCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSakFailCallback + fail?: GetSakFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSakSuccessCallback + success?: GetSakSuccessCallback; } interface GetSakSuccessCallbackResult { /** 返回 SAK/SEL_RES 数据 */ - sak: number - errMsg: string + sak: number; + errMsg: string; } interface GetSavedFileListOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSavedFileListCompleteCallback + complete?: GetSavedFileListCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSavedFileListFailCallback + fail?: GetSavedFileListFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSavedFileListSuccessCallback + success?: GetSavedFileListSuccessCallback; } interface GetSavedFileListSuccessCallbackResult { /** 文件数组 */ - fileList: FileItem[] - errMsg: string + fileList: FileItem[]; + errMsg: string; } interface GetScaleOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetScaleCompleteCallback + complete?: GetScaleCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetScaleFailCallback + fail?: GetScaleFailCallback; /** 接口调用成功的回调函数 */ - success?: GetScaleSuccessCallback + success?: GetScaleSuccessCallback; } interface GetScaleSuccessCallbackResult { /** 缩放值 */ - scale: number - errMsg: string + scale: number; + errMsg: string; } interface GetScreenBrightnessOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetScreenBrightnessCompleteCallback + complete?: GetScreenBrightnessCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetScreenBrightnessFailCallback + fail?: GetScreenBrightnessFailCallback; /** 接口调用成功的回调函数 */ - success?: GetScreenBrightnessSuccessCallback + success?: GetScreenBrightnessSuccessCallback; } interface GetScreenBrightnessSuccessCallbackOption { /** 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮 */ - value: number - errMsg: string + value: number; + errMsg: string; } interface GetScreenRecordingStateOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetScreenRecordingStateCompleteCallback + complete?: GetScreenRecordingStateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetScreenRecordingStateFailCallback + fail?: GetScreenRecordingStateFailCallback; /** 接口调用成功的回调函数 */ - success?: GetScreenRecordingStateSuccessCallback + success?: GetScreenRecordingStateSuccessCallback; } interface GetScreenRecordingStateSuccessCallbackResult { /** 录屏状态 @@ -6018,262 +5980,262 @@ ctx.draw() * 可选值: * - 'on': 开启; * - 'off': 关闭; */ - state: 'on' | 'off' - errMsg: string + state: 'on' | 'off'; + errMsg: string; } interface GetSelectedTextRangeOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSelectedTextRangeCompleteCallback + complete?: GetSelectedTextRangeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSelectedTextRangeFailCallback + fail?: GetSelectedTextRangeFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSelectedTextRangeSuccessCallback + success?: GetSelectedTextRangeSuccessCallback; } interface GetSelectedTextRangeSuccessCallbackResult { /** 输入框光标结束位置 */ - end: number + end: number; /** 输入框光标起始位置 */ - start: number - errMsg: string + start: number; + errMsg: string; } interface GetSelectionTextOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSelectionTextCompleteCallback + complete?: GetSelectionTextCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSelectionTextFailCallback + fail?: GetSelectionTextFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSelectionTextSuccessCallback + success?: GetSelectionTextSuccessCallback; } interface GetSelectionTextSuccessCallbackResult { /** 纯文本内容 */ - text: string - errMsg: string + text: string; + errMsg: string; } interface GetSettingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSettingCompleteCallback + complete?: GetSettingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSettingFailCallback + fail?: GetSettingFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSettingSuccessCallback + success?: GetSettingSuccessCallback; /** 需要基础库: `2.10.1` * * 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 */ - withSubscriptions?: boolean + withSubscriptions?: boolean; } interface GetSettingSuccessCallbackResult { /** [AuthSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/AuthSetting.html) * * 用户授权结果 */ - authSetting: AuthSetting + authSetting: AuthSetting; /** [SubscriptionsSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/SubscriptionsSetting.html) * * 需要基础库: `2.10.1` * * 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 */ - subscriptionsSetting: SubscriptionsSetting + subscriptionsSetting: SubscriptionsSetting; /** [AuthSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/AuthSetting.html) * * 在插件中调用时,当前宿主小程序的用户授权结果 */ - miniprogramAuthSetting?: AuthSetting - errMsg: string + miniprogramAuthSetting?: AuthSetting; + errMsg: string; } interface GetShareInfoOption { /** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#获取更多转发信息) */ - shareTicket: string + shareTicket: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetShareInfoCompleteCallback + complete?: GetShareInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetShareInfoFailCallback + fail?: GetShareInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetShareInfoSuccessCallback + success?: GetShareInfoSuccessCallback; /** 需要基础库: `1.9.90` * * 超时时间,单位 ms */ - timeout?: number + timeout?: number; } interface GetSkewOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSkewCompleteCallback + complete?: GetSkewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSkewFailCallback + fail?: GetSkewFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSkewSuccessCallback + success?: GetSkewSuccessCallback; } interface GetSkewSuccessCallbackResult { /** 倾斜角 */ - skew: number - errMsg: string + skew: number; + errMsg: string; } interface GetSkylineInfoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSkylineInfoCompleteCallback + complete?: GetSkylineInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSkylineInfoFailCallback + fail?: GetSkylineInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSkylineInfoSuccessCallback + success?: GetSkylineInfoSuccessCallback; } interface GetStorageInfoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetStorageInfoCompleteCallback + complete?: GetStorageInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetStorageInfoFailCallback + fail?: GetStorageInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetStorageInfoSuccessCallback + success?: GetStorageInfoSuccessCallback; } interface GetStorageInfoSuccessCallbackOption { /** 当前占用的空间大小, 单位 KB */ - currentSize: number + currentSize: number; /** 当前 storage 中所有的 key */ - keys: string[] + keys: string[]; /** 限制的空间大小,单位 KB */ - limitSize: number - errMsg: string + limitSize: number; + errMsg: string; } interface GetStorageInfoSyncOption { /** 当前占用的空间大小, 单位 KB */ - currentSize: number + currentSize: number; /** 当前 storage 中所有的 key */ - keys: string[] + keys: string[]; /** 限制的空间大小,单位 KB */ - limitSize: number + limitSize: number; } interface GetStorageOption { /** 本地缓存中指定的 key */ - key: string + key: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetStorageCompleteCallback + complete?: GetStorageCompleteCallback; /** 需要基础库: `2.21.3` * * 是否开启加密存储。只有异步的 getStorage 接口支持开启加密存储。开启后,将会对 data 使用 AES128 解密,接口回调耗时将会增加。若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true */ - encrypt?: boolean + encrypt?: boolean; /** 接口调用失败的回调函数 */ - fail?: GetStorageFailCallback + fail?: GetStorageFailCallback; /** 接口调用成功的回调函数 */ - success?: GetStorageSuccessCallback + success?: GetStorageSuccessCallback; } interface GetStorageSuccessCallbackResult { /** key对应的内容 */ - data: T - errMsg: string + data: T; + errMsg: string; } interface GetSystemInfoAsyncOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSystemInfoAsyncCompleteCallback + complete?: GetSystemInfoAsyncCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSystemInfoAsyncFailCallback + fail?: GetSystemInfoAsyncFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSystemInfoAsyncSuccessCallback + success?: GetSystemInfoAsyncSuccessCallback; } interface GetSystemInfoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetSystemInfoCompleteCallback + complete?: GetSystemInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetSystemInfoFailCallback + fail?: GetSystemInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetSystemInfoSuccessCallback + success?: GetSystemInfoSuccessCallback; } interface GetUserInfoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetUserInfoCompleteCallback + complete?: GetUserInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetUserInfoFailCallback + fail?: GetUserInfoFailCallback; /** 显示用户信息的语言 * * 可选值: * - 'en': 英文; * - 'zh_CN': 简体中文; * - 'zh_TW': 繁体中文; */ - lang?: 'en' | 'zh_CN' | 'zh_TW' + lang?: 'en' | 'zh_CN' | 'zh_TW'; /** 接口调用成功的回调函数 */ - success?: GetUserInfoSuccessCallback + success?: GetUserInfoSuccessCallback; /** 是否带上登录态信息。当 withCredentials 为 true 时,要求此前有调用过 wx.login 且登录态尚未过期,此时返回的数据会包含 encryptedData, iv 等敏感信息;当 withCredentials 为 false 时,不要求有登录态,返回的数据不包含 encryptedData, iv 等敏感信息。 */ - withCredentials?: boolean + withCredentials?: boolean; } interface GetUserInfoSuccessCallbackResult { /** 需要基础库: `2.7.0` * * 敏感数据对应的云 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) */ - cloudID: string + cloudID: string; /** 包括敏感数据在内的完整用户信息的加密数据,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) */ - encryptedData: string + encryptedData: string; /** 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) */ - iv: string + iv: string; /** 不包括敏感信息的原始数据字符串,用于计算签名 */ - rawData: string + rawData: string; /** 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ - signature: string + signature: string; /** [UserInfo](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/UserInfo.html) * * 用户信息对象,不包含 openid 等敏感信息 */ - userInfo: UserInfo - errMsg: string + userInfo: UserInfo; + errMsg: string; } interface GetUserProfileOption { /** 声明获取用户个人信息后的用途,不超过30个字符 */ - desc: string + desc: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetUserProfileCompleteCallback + complete?: GetUserProfileCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetUserProfileFailCallback + fail?: GetUserProfileFailCallback; /** 显示用户信息的语言 * * 可选值: * - 'en': 英文; * - 'zh_CN': 简体中文; * - 'zh_TW': 繁体中文; */ - lang?: 'en' | 'zh_CN' | 'zh_TW' + lang?: 'en' | 'zh_CN' | 'zh_TW'; /** 接口调用成功的回调函数 */ - success?: GetUserProfileSuccessCallback + success?: GetUserProfileSuccessCallback; } interface GetUserProfileSuccessCallbackResult { /** 需要基础库: `2.10.4` * * 敏感数据对应的云 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) */ - cloudID: string + cloudID: string; /** 需要基础库: `2.10.4` * * 包括敏感数据在内的完整用户信息的加密数据,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) */ - encryptedData: string + encryptedData: string; /** 需要基础库: `2.10.4` * * 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) */ - iv: string + iv: string; /** 需要基础库: `2.10.4` * * 不包括敏感信息的原始数据字符串,用于计算签名 */ - rawData: string + rawData: string; /** 需要基础库: `2.10.4` * * 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ - signature: string + signature: string; /** [UserInfo](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/UserInfo.html) * * 需要基础库: `2.10.4` * * 用户信息对象 */ - userInfo: UserInfo - errMsg: string + userInfo: UserInfo; + errMsg: string; } interface GetVideoInfoOption { /** 视频文件路径,可以是临时文件路径也可以是永久文件路径 */ - src: string + src: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetVideoInfoCompleteCallback + complete?: GetVideoInfoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetVideoInfoFailCallback + fail?: GetVideoInfoFailCallback; /** 接口调用成功的回调函数 */ - success?: GetVideoInfoSuccessCallback + success?: GetVideoInfoSuccessCallback; } interface GetVideoInfoSuccessCallbackResult { /** 视频码率,单位 kbps */ - bitrate: number + bitrate: number; /** 视频长度 */ - duration: number + duration: number; /** 视频帧率 */ - fps: number + fps: number; /** 视频的长,单位 px */ - height: number + height: number; /** 画面方向 * * 可选值: @@ -6285,49 +6247,41 @@ ctx.draw() * - 'down-mirrored': 同down,但水平翻转; * - 'left-mirrored': 同left,但垂直翻转; * - 'right-mirrored': 同right,但垂直翻转; */ - orientation: - | 'up' - | 'down' - | 'left' - | 'right' - | 'up-mirrored' - | 'down-mirrored' - | 'left-mirrored' - | 'right-mirrored' + orientation: 'up' | 'down' | 'left' | 'right' | 'up-mirrored' | 'down-mirrored' | 'left-mirrored' | 'right-mirrored'; /** 视频大小,单位 kB */ - size: number + size: number; /** 视频格式 */ - type: string + type: string; /** 视频的宽,单位 px */ - width: number - errMsg: string + width: number; + errMsg: string; } interface GetWeRunDataOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetWeRunDataCompleteCallback + complete?: GetWeRunDataCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetWeRunDataFailCallback + fail?: GetWeRunDataFailCallback; /** 接口调用成功的回调函数 */ - success?: GetWeRunDataSuccessCallback + success?: GetWeRunDataSuccessCallback; } interface GetWeRunDataSuccessCallbackResult { /** 需要基础库: `2.7.0` * * 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#method-cloud) */ - cloudID: string + cloudID: string; /** 包括敏感数据在内的完整用户信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html)。解密后得到的数据结构见后文 */ - encryptedData: string + encryptedData: string; /** 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ - iv: string - errMsg: string + iv: string; + errMsg: string; } interface GetWifiListOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: GetWifiListCompleteCallback + complete?: GetWifiListCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: GetWifiListFailCallback + fail?: GetWifiListFailCallback; /** 接口调用成功的回调函数 */ - success?: GetWifiListSuccessCallback + success?: GetWifiListSuccessCallback; } /** 需要基础库: `2.28.0` * @@ -6340,92 +6294,92 @@ ctx.draw() * 可选值: * - 1: 通过摄像头实时检测; * - 2: 静态图片检测; */ - mode: 1 | 2 + mode: 1 | 2; } interface HideHomeButtonOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: HideHomeButtonCompleteCallback + complete?: HideHomeButtonCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: HideHomeButtonFailCallback + fail?: HideHomeButtonFailCallback; /** 接口调用成功的回调函数 */ - success?: HideHomeButtonSuccessCallback + success?: HideHomeButtonSuccessCallback; } interface HideKeyboardOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: HideKeyboardCompleteCallback + complete?: HideKeyboardCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: HideKeyboardFailCallback + fail?: HideKeyboardFailCallback; /** 接口调用成功的回调函数 */ - success?: HideKeyboardSuccessCallback + success?: HideKeyboardSuccessCallback; } interface HideLoadingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: HideLoadingCompleteCallback + complete?: HideLoadingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: HideLoadingFailCallback + fail?: HideLoadingFailCallback; /** 需要基础库: `2.22.1` * * 目前 toast 和 loading 相关接口可以相互混用,此参数可用于取消混用特性 */ - noConflict?: boolean + noConflict?: boolean; /** 接口调用成功的回调函数 */ - success?: HideLoadingSuccessCallback + success?: HideLoadingSuccessCallback; } interface HideNavigationBarLoadingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: HideNavigationBarLoadingCompleteCallback + complete?: HideNavigationBarLoadingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: HideNavigationBarLoadingFailCallback + fail?: HideNavigationBarLoadingFailCallback; /** 接口调用成功的回调函数 */ - success?: HideNavigationBarLoadingSuccessCallback + success?: HideNavigationBarLoadingSuccessCallback; } interface HideShareMenuOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: HideShareMenuCompleteCallback + complete?: HideShareMenuCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: HideShareMenuFailCallback + fail?: HideShareMenuFailCallback; /** 需要基础库: `2.11.3` * * 本接口为 Beta 版本,暂只在 Android 平台支持。需要隐藏的转发按钮名称列表,默认['shareAppMessage', 'shareTimeline']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 */ - menus?: string[] + menus?: string[]; /** 接口调用成功的回调函数 */ - success?: HideShareMenuSuccessCallback + success?: HideShareMenuSuccessCallback; } interface HideTabBarOption { /** 是否需要动画效果 */ - animation?: boolean + animation?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: HideTabBarCompleteCallback + complete?: HideTabBarCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: HideTabBarFailCallback + fail?: HideTabBarFailCallback; /** 接口调用成功的回调函数 */ - success?: HideTabBarSuccessCallback + success?: HideTabBarSuccessCallback; } interface HideTabBarRedDotOption { /** tabBar 的哪一项,从左边算起 */ - index: number + index: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: HideTabBarRedDotCompleteCallback + complete?: HideTabBarRedDotCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: HideTabBarRedDotFailCallback + fail?: HideTabBarRedDotFailCallback; /** 接口调用成功的回调函数 */ - success?: HideTabBarRedDotSuccessCallback + success?: HideTabBarRedDotSuccessCallback; } interface HideToastOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: HideToastCompleteCallback + complete?: HideToastCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: HideToastFailCallback + fail?: HideToastFailCallback; /** 需要基础库: `2.22.1` * * 目前 toast 和 loading 相关接口可以相互混用,此参数可用于取消混用特性 */ - noConflict?: boolean + noConflict?: boolean; /** 接口调用成功的回调函数 */ - success?: HideToastSuccessCallback + success?: HideToastSuccessCallback; } /** 检测结果 */ interface HitTestRes { /** 包含位置、旋转、放缩信息的矩阵,以列为主序 */ - transform: Float32Array + transform: Float32Array; } /** 需要基础库: `3.3.0` * @@ -6437,80 +6391,80 @@ ctx.draw() * * 可选值: * - 2: 静态图片检测; */ - mode: 2 + mode: 2; } /** 需要基础库: `2.7.0` * * 图片对象 */ interface Image { /** 图片的真实高度 */ - height: number + height: number; /** 图片加载发生错误后触发的回调函数 */ - onerror: (...args: any[]) => any + onerror: (...args: any[]) => any; /** 图片加载完成后触发的回调函数 */ - onload: (...args: any[]) => any + onload: (...args: any[]) => any; /** 需要基础库: `2.13.0` * * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ - referrerPolicy: string + referrerPolicy: string; /** 图片的 URL。v2.11.0 起支持传递 base64 Data URI */ - src: string + src: string; /** 图片的真实宽度 */ - width: number + width: number; } /** 需要基础库: `2.9.0` * * ImageData 对象 */ interface ImageData { /** 一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示 */ - data: Uint8ClampedArray + data: Uint8ClampedArray; /** 使用像素描述 ImageData 的实际高度 */ - height: number + height: number; /** 使用像素描述 ImageData 的实际宽度 */ - width: number + width: number; } /** 需要基础库: `1.2.0` * * 图片的本地临时文件列表 */ interface ImageFile { /** 本地临时文件路径 (本地路径) */ - path: string + path: string; /** 本地临时文件大小,单位 B */ - size: number + size: number; } interface IncludePointsOption { /** 要显示在可视区域内的坐标点列表 */ - points: MapPostion[] + points: MapPostion[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: IncludePointsCompleteCallback + complete?: IncludePointsCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: IncludePointsFailCallback + fail?: IncludePointsFailCallback; /** 坐标点形成的矩形边缘到地图边缘的距离,单位像素。格式为[上,右,下,左]。开发者工具暂不支持padding参数。 */ - padding?: number[] + padding?: number[]; /** 接口调用成功的回调函数 */ - success?: IncludePointsSuccessCallback + success?: IncludePointsSuccessCallback; } interface InitFaceDetectOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: InitFaceDetectCompleteCallback + complete?: InitFaceDetectCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: InitFaceDetectFailCallback + fail?: InitFaceDetectFailCallback; /** 接口调用成功的回调函数 */ - success?: InitFaceDetectSuccessCallback + success?: InitFaceDetectSuccessCallback; } interface InitMarkerClusterOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: InitMarkerClusterCompleteCallback + complete?: InitMarkerClusterCompleteCallback; /** 启用默认的聚合样式 */ - enableDefaultStyle?: boolean + enableDefaultStyle?: boolean; /** 接口调用失败的回调函数 */ - fail?: InitMarkerClusterFailCallback + fail?: InitMarkerClusterFailCallback; /** 聚合算法的可聚合距离,即距离小于该值的点会聚合至一起,以像素为单位 */ - gridSize?: number + gridSize?: number; /** 接口调用成功的回调函数 */ - success?: InitMarkerClusterSuccessCallback + success?: InitMarkerClusterSuccessCallback; /** 点击已经聚合的标记点时是否实现聚合分离 */ - zoomOnClick?: boolean + zoomOnClick?: boolean; } /** InnerAudioContext 实例,可通过 [wx.createInnerAudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createInnerAudioContext.html) 接口获取实例。注意,音频播放过程中,可能被系统中断,可通过 [wx.onAudioInterruptionBegin](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAudioInterruptionBegin.html)、[wx.onAudioInterruptionEnd](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAudioInterruptionEnd.html)事件来处理这种情况。 * @@ -6547,41 +6501,41 @@ innerAudioContext.onError((res) => { ``` */ interface InnerAudioContext { /** 是否自动开始播放,默认为 `false` */ - autoplay: boolean + autoplay: boolean; /** 音频缓冲的时间点,仅保证当前播放时间点到此时间点内容已缓冲(只读) */ - buffered: number + buffered: number; /** 当前音频的播放位置(单位 s)。只有在当前有合法的 src 时返回,时间保留小数点后 6 位(currentTime 属性在基础库 2.26.2 之前只读,基础库 2.26.2 开始可读可写,改变 currentTime 值等同于调用 seek) */ - currentTime: number + currentTime: number; /** 当前音频的长度(单位 s)。只有在当前有合法的 src 时返回(只读) */ - duration: number + duration: number; /** 是否循环播放,默认为 `false` */ - loop: boolean + loop: boolean; /** 是否遵循系统静音开关,默认为 `true`。当此参数为 `false` 时,即使用户打开了静音开关,也能继续发出声音。从 2.3.0 版本开始此参数不生效,使用 [wx.setInnerAudioOption](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.setInnerAudioOption.html) 接口统一设置。 */ - obeyMuteSwitch: boolean + obeyMuteSwitch: boolean; /** 当前是是否暂停或停止状态(只读) */ - paused: boolean + paused: boolean; /** 需要基础库: `2.11.0` * * 播放速度。范围 0.5-2.0,默认为 1。(Android 需要 6 及以上版本) */ - playbackRate: number + playbackRate: number; /** 需要基础库: `2.13.0` * * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ - referrerPolicy: string + referrerPolicy: string; /** 音频资源的地址,用于直接播放。[2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 开始支持云文件ID */ - src: string + src: string; /** 开始播放的位置(单位:s),默认为 0 */ - startTime: number + startTime: number; /** 需要基础库: `1.9.90` * * 音量。范围 0~1。默认为 1 */ - volume: number + volume: number; /** [InnerAudioContext.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.destroy.html) * * 在插件中使用:支持 * * 销毁当前实例 */ - destroy(): void + destroy(): void; /** [InnerAudioContext.offCanplay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offCanplay.html) * * 需要基础库: `1.9.0` @@ -6600,8 +6554,8 @@ InnerAudioContext.offCanplay(listener) // 需传入与监听时同一个的函 ``` */ offCanplay( /** onCanplay 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffCanplayCallback - ): void + listener?: OffCanplayCallback, + ): void; /** [InnerAudioContext.offEnded(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offEnded.html) * * 需要基础库: `1.9.0` @@ -6620,8 +6574,8 @@ InnerAudioContext.offEnded(listener) // 需传入与监听时同一个的函数 ``` */ offEnded( /** onEnded 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffEndedCallback - ): void + listener?: OffEndedCallback, + ): void; /** [InnerAudioContext.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html) * * 需要基础库: `1.9.0` @@ -6640,8 +6594,8 @@ InnerAudioContext.offError(listener) // 需传入与监听时同一个的函数 ``` */ offError( /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: InnerAudioContextOffErrorCallback - ): void + listener?: InnerAudioContextOffErrorCallback, + ): void; /** [InnerAudioContext.offPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offPause.html) * * 需要基础库: `1.9.0` @@ -6660,8 +6614,8 @@ InnerAudioContext.offPause(listener) // 需传入与监听时同一个的函数 ``` */ offPause( /** onPause 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffPauseCallback - ): void + listener?: OffPauseCallback, + ): void; /** [InnerAudioContext.offPlay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offPlay.html) * * 需要基础库: `1.9.0` @@ -6680,8 +6634,8 @@ InnerAudioContext.offPlay(listener) // 需传入与监听时同一个的函数 ``` */ offPlay( /** onPlay 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffPlayCallback - ): void + listener?: OffPlayCallback, + ): void; /** [InnerAudioContext.offSeeked(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offSeeked.html) * * 需要基础库: `1.9.0` @@ -6700,8 +6654,8 @@ InnerAudioContext.offSeeked(listener) // 需传入与监听时同一个的函数 ``` */ offSeeked( /** onSeeked 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffSeekedCallback - ): void + listener?: OffSeekedCallback, + ): void; /** [InnerAudioContext.offSeeking(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offSeeking.html) * * 需要基础库: `1.9.0` @@ -6720,8 +6674,8 @@ InnerAudioContext.offSeeking(listener) // 需传入与监听时同一个的函 ``` */ offSeeking( /** onSeeking 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffSeekingCallback - ): void + listener?: OffSeekingCallback, + ): void; /** [InnerAudioContext.offStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offStop.html) * * 需要基础库: `1.9.0` @@ -6740,8 +6694,8 @@ InnerAudioContext.offStop(listener) // 需传入与监听时同一个的函数 ``` */ offStop( /** onStop 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffStopCallback - ): void + listener?: OffStopCallback, + ): void; /** [InnerAudioContext.offTimeUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offTimeUpdate.html) * * 需要基础库: `1.9.0` @@ -6760,8 +6714,8 @@ InnerAudioContext.offTimeUpdate(listener) // 需传入与监听时同一个的 ``` */ offTimeUpdate( /** onTimeUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffTimeUpdateCallback - ): void + listener?: OffTimeUpdateCallback, + ): void; /** [InnerAudioContext.offWaiting(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offWaiting.html) * * 需要基础库: `1.9.0` @@ -6780,8 +6734,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 ``` */ offWaiting( /** onWaiting 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffWaitingCallback - ): void + listener?: OffWaitingCallback, + ): void; /** [InnerAudioContext.onCanplay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onCanplay.html) * * 在插件中使用:支持 @@ -6789,8 +6743,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频进入可以播放状态的事件。但不保证后面可以流畅播放 */ onCanplay( /** 音频进入可以播放状态的事件的监听函数 */ - listener: OnCanplayCallback - ): void + listener: OnCanplayCallback, + ): void; /** [InnerAudioContext.onEnded(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onEnded.html) * * 在插件中使用:支持 @@ -6798,8 +6752,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频自然播放至结束的事件 */ onEnded( /** 音频自然播放至结束的事件的监听函数 */ - listener: OnEndedCallback - ): void + listener: OnEndedCallback, + ): void; /** [InnerAudioContext.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onError.html) * * 在插件中使用:支持 @@ -6812,8 +6766,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 2. errCode=100001 时,如若 errMsg 中有 systemErrCode:200333420,请检查文件编码格式和 fileExtension 是否一致 */ onError( /** 音频播放错误事件的监听函数 */ - listener: InnerAudioContextOnErrorCallback - ): void + listener: InnerAudioContextOnErrorCallback, + ): void; /** [InnerAudioContext.onPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onPause.html) * * 在插件中使用:支持 @@ -6821,8 +6775,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频暂停事件 */ onPause( /** 音频暂停事件的监听函数 */ - listener: OnPauseCallback - ): void + listener: OnPauseCallback, + ): void; /** [InnerAudioContext.onPlay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onPlay.html) * * 在插件中使用:支持 @@ -6830,8 +6784,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频播放事件 */ onPlay( /** 音频播放事件的监听函数 */ - listener: OnPlayCallback - ): void + listener: OnPlayCallback, + ): void; /** [InnerAudioContext.onSeeked(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onSeeked.html) * * 在插件中使用:支持 @@ -6839,8 +6793,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频完成跳转操作的事件 */ onSeeked( /** 音频完成跳转操作的事件的监听函数 */ - listener: OnSeekedCallback - ): void + listener: OnSeekedCallback, + ): void; /** [InnerAudioContext.onSeeking(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onSeeking.html) * * 在插件中使用:支持 @@ -6848,8 +6802,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频进行跳转操作的事件 */ onSeeking( /** 音频进行跳转操作的事件的监听函数 */ - listener: OnSeekingCallback - ): void + listener: OnSeekingCallback, + ): void; /** [InnerAudioContext.onStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onStop.html) * * 在插件中使用:支持 @@ -6857,8 +6811,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频停止事件 */ onStop( /** 音频停止事件的监听函数 */ - listener: InnerAudioContextOnStopCallback - ): void + listener: InnerAudioContextOnStopCallback, + ): void; /** [InnerAudioContext.onTimeUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onTimeUpdate.html) * * 在插件中使用:支持 @@ -6866,8 +6820,8 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频播放进度更新事件 */ onTimeUpdate( /** 音频播放进度更新事件的监听函数 */ - listener: OnTimeUpdateCallback - ): void + listener: OnTimeUpdateCallback, + ): void; /** [InnerAudioContext.onWaiting(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onWaiting.html) * * 在插件中使用:支持 @@ -6875,20 +6829,20 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 监听音频加载中事件。当音频因为数据不足,需要停下来加载时会触发 */ onWaiting( /** 音频加载中事件的监听函数 */ - listener: OnWaitingCallback - ): void + listener: OnWaitingCallback, + ): void; /** [InnerAudioContext.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.pause.html) * * 在插件中使用:支持 * * 暂停。暂停后的音频再播放会从暂停处开始播放 */ - pause(): void + pause(): void; /** [InnerAudioContext.play()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.play.html) * * 在插件中使用:支持 * * 播放 */ - play(): void + play(): void; /** [InnerAudioContext.seek(number position)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.seek.html) * * 在插件中使用:支持 @@ -6896,14 +6850,14 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 跳转到指定位置 */ seek( /** 跳转的时间,单位 s。精确到小数点后 3 位,即支持 ms 级别精确度 */ - position: number - ): void + position: number, + ): void; /** [InnerAudioContext.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.stop.html) * * 在插件中使用:支持 * * 停止。停止后的音频再播放会从头开始播放。 */ - stop(): void + stop(): void; } interface InnerAudioContextOnErrorListenerResult { /** 可选值: @@ -6912,79 +6866,79 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * - 10003: 文件错误; * - 10004: 格式错误; * - -1: 未知错误; */ - errCode: 10001 | 10002 | 10003 | 10004 | -1 - errMsg: string + errCode: 10001 | 10002 | 10003 | 10004 | -1; + errMsg: string; } interface InsertDividerOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: InsertDividerCompleteCallback + complete?: InsertDividerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: InsertDividerFailCallback + fail?: InsertDividerFailCallback; /** 接口调用成功的回调函数 */ - success?: InsertDividerSuccessCallback + success?: InsertDividerSuccessCallback; } interface InsertImageOption { /** 图片地址,仅支持 http(s)、base64、云图片(2.8.0)、临时文件(2.8.3)。 */ - src: string + src: string; /** 图像无法显示时的替代文本 */ - alt?: string + alt?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: InsertImageCompleteCallback + complete?: InsertImageCompleteCallback; /** data 被序列化为 name=value;name1=value2 的格式挂在属性 data-custom 上 */ - data?: IAnyObject + data?: IAnyObject; /** 添加到图片 img 标签上的类名 */ - extClass?: string + extClass?: string; /** 接口调用失败的回调函数 */ - fail?: InsertImageFailCallback + fail?: InsertImageFailCallback; /** 图片高度 (pixels/百分比) */ - height?: string + height?: string; /** 插入图片后是否自动换行,默认换行 */ - nowrap?: boolean + nowrap?: boolean; /** 接口调用成功的回调函数 */ - success?: InsertImageSuccessCallback + success?: InsertImageSuccessCallback; /** 图片宽度(pixels/百分比) */ - width?: string + width?: string; } interface InsertTextOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: InsertTextCompleteCallback + complete?: InsertTextCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: InsertTextFailCallback + fail?: InsertTextFailCallback; /** 接口调用成功的回调函数 */ - success?: InsertTextSuccessCallback + success?: InsertTextSuccessCallback; /** 文本内容 */ - text?: string + text?: string; } interface IntersectionObserverObserveCallbackResult { /** 目标边界 */ - boundingClientRect: BoundingClientRectResult + boundingClientRect: BoundingClientRectResult; /** 节点自定义数据属性 */ - dataset: Record + dataset: Record; /** 节点 ID */ - id: string + id: string; /** 相交比例 */ - intersectionRatio: number + intersectionRatio: number; /** 相交区域的边界 */ - intersectionRect: IntersectionRectResult + intersectionRect: IntersectionRectResult; /** 参照区域的边界 */ - relativeRect: RelativeRectResult + relativeRect: RelativeRectResult; /** 相交检测时的时间戳 */ - time: number + time: number; } /** 相交区域的边界 */ interface IntersectionRectResult { /** 下边界 */ - bottom: number + bottom: number; /** 高度 */ - height: number + height: number; /** 左边界 */ - left: number + left: number; /** 右边界 */ - right: number + right: number; /** 上边界 */ - top: number + top: number; /** 宽度 */ - width: number + width: number; } interface InterstitialAdOnErrorListenerResult { /** 错误码 @@ -6999,33 +6953,33 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * - 1006: 广告组件被驳回; * - 1007: 广告组件被封禁; * - 1008: 广告单元已关闭; */ - errCode: 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 + errCode: 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008; /** 错误信息 */ - errMsg: string + errMsg: string; } interface IsBluetoothDevicePairedOption { /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: IsBluetoothDevicePairedCompleteCallback + complete?: IsBluetoothDevicePairedCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: IsBluetoothDevicePairedFailCallback + fail?: IsBluetoothDevicePairedFailCallback; /** 接口调用成功的回调函数 */ - success?: IsBluetoothDevicePairedSuccessCallback + success?: IsBluetoothDevicePairedSuccessCallback; } interface IsConnectedOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: IsConnectedCompleteCallback + complete?: IsConnectedCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: IsConnectedFailCallback + fail?: IsConnectedFailCallback; /** 接口调用成功的回调函数 */ - success?: IsConnectedSuccessCallback + success?: IsConnectedSuccessCallback; } interface Join1v1ChatOption { /** 呼叫方信息 */ - caller: VoIP1v1ChatUser + caller: VoIP1v1ChatUser; /** 接听方信息 */ - listener: VoIP1v1ChatUser + listener: VoIP1v1ChatUser; /** 窗口背景色(音频通话背景以及小窗模式背景) * * 可选值: @@ -7035,65 +6989,65 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * - 3: #3D7257; * - 4: #1485EE; * - 5: #6467F0; */ - backgroundType?: 0 | 1 | 2 | 3 | 4 | 5 + backgroundType?: 0 | 1 | 2 | 3 | 4 | 5; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: Join1v1ChatCompleteCallback + complete?: Join1v1ChatCompleteCallback; /** 不允许切换到语音通话 */ - disableSwitchVoice?: boolean + disableSwitchVoice?: boolean; /** 接口调用失败的回调函数 */ - fail?: Join1v1ChatFailCallback + fail?: Join1v1ChatFailCallback; /** 小窗样式 */ - minWindowType?: number + minWindowType?: number; /** 通话类型 * * 可选值: * - 'voice': 语音通话; * - 'video': 视频通话; */ - roomType?: 'voice' | 'video' + roomType?: 'voice' | 'video'; /** 接口调用成功的回调函数 */ - success?: Join1v1ChatSuccessCallback + success?: Join1v1ChatSuccessCallback; } interface JoinVoIPChatOption { /** 小游戏内此房间/群聊的 ID。同一时刻传入相同 groupId 的用户会进入到同个实时语音房间。 */ - groupId: string + groupId: string; /** 验证所需的随机字符串 */ - nonceStr: string + nonceStr: string; /** 签名,用于验证小游戏的身份 */ - signature: string + signature: string; /** 验证所需的时间戳 */ - timeStamp: number + timeStamp: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: JoinVoIPChatCompleteCallback + complete?: JoinVoIPChatCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: JoinVoIPChatFailCallback + fail?: JoinVoIPChatFailCallback; /** 需要基础库: `2.29.0` * * 开启后,joinVoIPChat 会同时走 Wi-Fi 和蜂窝网络2种网络模式,保证实时通话体验。 */ - forceCellularNetwork?: boolean + forceCellularNetwork?: boolean; /** 静音设置 */ - muteConfig?: MuteConfig + muteConfig?: MuteConfig; /** 房间类型 * * 可选值: * - 'voice': 音频房间,用于语音通话; * - 'video': 视频房间,结合 [voip-room](https://developers.weixin.qq.com/miniprogram/dev/component/voip-room.html) 组件可显示成员画面; */ - roomType?: 'voice' | 'video' + roomType?: 'voice' | 'video'; /** 接口调用成功的回调函数 */ - success?: JoinVoIPChatSuccessCallback + success?: JoinVoIPChatSuccessCallback; } interface JoinVoIPChatSuccessCallbackResult { /** 错误码 */ - errCode: number + errCode: number; /** 调用结果 */ - errMsg: string + errMsg: string; /** 在此通话中的成员 openId 名单 */ - openIdList: string[] + openIdList: string[]; } interface KvList { /** key 本地缓存中指定的 key */ - key: string + key: string; /** data 需要存储的内容。只支持原生类型、Date、及能够通过`JSON.stringify`序列化的对象。 */ - value: any + value: any; } /** 启动参数 */ interface LaunchOptionsApp { @@ -7106,21 +7060,17 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * - 'nativeFunctionalized': 原生功能化,视频号直播商品、商品橱窗等场景打开的小程序; * - 'browseOnly': 仅浏览,朋友圈快照页等场景打开的小程序; * - 'embedded': 内嵌,通过打开半屏小程序能力打开的小程序; */ - apiCategory: - | 'default' - | 'nativeFunctionalized' - | 'browseOnly' - | 'embedded' + apiCategory: 'default' | 'nativeFunctionalized' | 'browseOnly' | 'embedded'; /** 打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数 */ - forwardMaterials: ForwardMaterials[] + forwardMaterials: ForwardMaterials[]; /** 启动小程序的路径 (代码包路径) */ - path: string + path: string; /** 启动小程序的 query 参数 */ - query: Record + query: Record; /** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */ - referrerInfo: ReferrerInfo + referrerInfo: ReferrerInfo; /** 启动小程序的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */ - scene: number + scene: number; /** 从微信群聊/单聊打开小程序时,chatType 表示具体微信群聊/单聊类型 * * 可选值: @@ -7128,39 +7078,39 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * - 2: 企业微信联系人单聊; * - 3: 普通微信群聊; * - 4: 企业微信互通群聊; */ - chatType?: 1 | 2 | 3 | 4 + chatType?: 1 | 2 | 3 | 4; /** shareTicket,详见[获取更多转发信息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html#获取更多转发信息) */ - shareTicket?: string + shareTicket?: string; } /** 帧深度纹理buffer对象,width * height 大小的 深度值(float32) */ interface LegSegmentBufferRes { /** 腿部分割纹理buffer,width * height 大小的 裁剪值(0 为不是脚,越靠近 255 越接近腿部区域)(uint8) */ - DepthAddress: ArrayBuffer + DepthAddress: ArrayBuffer; /** 腿部分割纹理高 */ - height: number + height: number; /** 腿部分割纹理宽 */ - width: number + width: number; } interface LivePlayerContextRequestFullScreenOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestFullScreenCompleteCallback + complete?: RequestFullScreenCompleteCallback; /** 设置全屏时的方向 * * 可选值: * - 0: 正常竖向; * - 90: 屏幕逆时针90度; * - -90: 屏幕顺时针90度; */ - direction?: 0 | 90 | -90 + direction?: 0 | 90 | -90; /** 接口调用失败的回调函数 */ - fail?: RequestFullScreenFailCallback + fail?: RequestFullScreenFailCallback; /** 接口调用成功的回调函数 */ - success?: RequestFullScreenSuccessCallback + success?: RequestFullScreenSuccessCallback; } interface LivePlayerContextSnapshotOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SnapshotCompleteCallback + complete?: SnapshotCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SnapshotFailCallback + fail?: SnapshotFailCallback; /** 需要基础库: `2.10.0` * * 图片的质量 @@ -7168,7 +7118,7 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 可选值: * - 'raw': 原图; * - 'compressed': 压缩图; */ - quality?: 'raw' | 'compressed' + quality?: 'raw' | 'compressed'; /** 需要基础库: `2.25.0` * * 截取的源类型 @@ -7176,34 +7126,34 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 可选值: * - 'stream': 截取视频源; * - 'view': 截取渲染后的画面; */ - sourceType?: 'stream' | 'view' + sourceType?: 'stream' | 'view'; /** 接口调用成功的回调函数 */ - success?: LivePlayerContextSnapshotSuccessCallback + success?: LivePlayerContextSnapshotSuccessCallback; } interface LivePlayerContextSnapshotSuccessCallbackResult { /** 图片的高度 */ - height: string + height: string; /** 图片文件的临时路径 (本地路径) */ - tempImagePath: string + tempImagePath: string; /** 图片的宽度 */ - width: string - errMsg: string + width: string; + errMsg: string; } interface LivePusherContextSetZoomOption { /** 缩放级别,范围[1, maxZoom]。zoom 可取小数,精确到小数后一位。 */ - zoom: number + zoom: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetZoomCompleteCallback + complete?: SetZoomCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetZoomFailCallback + fail?: SetZoomFailCallback; /** 接口调用成功的回调函数 */ - success?: LivePusherContextSetZoomSuccessCallback + success?: LivePusherContextSetZoomSuccessCallback; } interface LivePusherContextSnapshotOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SnapshotCompleteCallback + complete?: SnapshotCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SnapshotFailCallback + fail?: SnapshotFailCallback; /** 需要基础库: `2.10.0` * * 图片的质量 @@ -7211,7 +7161,7 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 可选值: * - 'raw': 原图; * - 'compressed': 压缩图; */ - quality?: 'raw' | 'compressed' + quality?: 'raw' | 'compressed'; /** 需要基础库: `2.25.0` * * 截取的源类型 @@ -7219,140 +7169,140 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * 可选值: * - 'stream': 截取视频源; * - 'view': 截取渲染后的画面; */ - sourceType?: 'stream' | 'view' + sourceType?: 'stream' | 'view'; /** 接口调用成功的回调函数 */ - success?: LivePusherContextSnapshotSuccessCallback + success?: LivePusherContextSnapshotSuccessCallback; } interface LivePusherContextSnapshotSuccessCallbackResult { /** 图片的高度 */ - height: string + height: string; /** 图片文件的临时路径 */ - tempImagePath: string + tempImagePath: string; /** 图片的宽度 */ - width: string - errMsg: string + width: string; + errMsg: string; } interface LivePusherContextStartOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartCompleteCallback + complete?: StartCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartFailCallback + fail?: StartFailCallback; /** 接口调用成功的回调函数 */ - success?: StartSuccessCallback + success?: StartSuccessCallback; } interface LoadFontFaceCompleteCallbackResult { /** 加载字体结果 */ - status: string + status: string; } interface LoadFontFaceOption { /** 定义的字体名称 */ - family: string + family: string; /** 字体资源的地址。建议格式为 TTF 和 WOFF,WOFF2 在低版本的iOS上会不兼容。 */ - source: string + source: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: LoadFontFaceCompleteCallback + complete?: LoadFontFaceCompleteCallback; /** 可选的字体描述符 */ - desc?: DescOption + desc?: DescOption; /** 接口调用失败的回调函数 */ - fail?: LoadFontFaceFailCallback + fail?: LoadFontFaceFailCallback; /** 需要基础库: `2.10.0` * * 是否全局生效 */ - global?: boolean + global?: boolean; /** 字体作用范围,可选值为 webview / native,默认 webview,设置 native 可在 Canvas 2D 下使用 */ - scopes?: any[] + scopes?: any[]; /** 接口调用成功的回调函数 */ - success?: LoadFontFaceSuccessCallback + success?: LoadFontFaceSuccessCallback; } interface LoginOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: LoginCompleteCallback + complete?: LoginCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: LoginFailCallback + fail?: LoginFailCallback; /** 接口调用成功的回调函数 */ - success?: LoginSuccessCallback + success?: LoginSuccessCallback; /** 需要基础库: `1.9.90` * * 超时时间,单位ms */ - timeout?: number + timeout?: number; } interface LoginSuccessCallbackResult { /** 用户登录凭证(有效期五分钟)。开发者需要在开发者服务器后台调用 [code2Session](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-login/code2Session.html),使用 code 换取 openid、unionid、session_key 等信息 */ - code: string - errMsg: string + code: string; + errMsg: string; } interface MakeBluetoothPairOption { /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** pin 码,Base64 格式。 */ - pin: string + pin: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: MakeBluetoothPairCompleteCallback + complete?: MakeBluetoothPairCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: MakeBluetoothPairFailCallback + fail?: MakeBluetoothPairFailCallback; /** 接口调用成功的回调函数 */ - success?: MakeBluetoothPairSuccessCallback + success?: MakeBluetoothPairSuccessCallback; /** 超时时间,单位 ms */ - timeout?: number + timeout?: number; } interface MakePhoneCallOption { /** 需要拨打的电话号码 */ - phoneNumber: string + phoneNumber: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: MakePhoneCallCompleteCallback + complete?: MakePhoneCallCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: MakePhoneCallFailCallback + fail?: MakePhoneCallFailCallback; /** 接口调用成功的回调函数 */ - success?: MakePhoneCallSuccessCallback + success?: MakePhoneCallSuccessCallback; } /** 广播的制造商信息。仅安卓支持,iOS 因系统限制无法定制。 */ interface ManufacturerData { /** 制造商ID,0x 开头的十六进制 */ - manufacturerId: string + manufacturerId: string; /** 制造商信息 */ - manufacturerSpecificData?: ArrayBuffer + manufacturerSpecificData?: ArrayBuffer; } /** 图片覆盖的经纬度范围 */ interface MapBounds { /** 东北角经纬度 */ - northeast: MapPostion + northeast: MapPostion; /** 西南角经纬度 */ - southwest: MapPostion + southwest: MapPostion; } interface MapPostion { /** 纬度 */ - latitude: number + latitude: number; /** 经度 */ - longitude: number + longitude: number; } /** 用来扩展(或收缩)参照节点布局区域的边界 */ interface Margins { /** 节点布局区域的下边界 */ - bottom?: number + bottom?: number; /** 节点布局区域的左边界 */ - left?: number + left?: number; /** 节点布局区域的右边界 */ - right?: number + right?: number; /** 节点布局区域的上边界 */ - top?: number + top?: number; } /** 匹配到的缓存 */ interface MatchCache { /** 缓存 id */ - cacheId: string + cacheId: string; /** 缓存创建时间 */ - createTime: number + createTime: number; /** 缓存内容,会带有 fromCache 标记,方便开发者区分内容是否来自缓存 */ - data: any + data: any; /** 缓存有效时间 */ - maxAge: number + maxAge: number; /** 命中的规则 id */ - ruleId: string + ruleId: string; } /** MediaAudioPlayer 实例,可通过 [wx.createMediaAudioPlayer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createMediaAudioPlayer.html) 接口获取实例。 */ interface MediaAudioPlayer { /** 音量。范围 0~1。默认为 1 */ - volume: number + volume: number; /** [Promise MediaAudioPlayer.addAudioSource([VideoDecoder](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.html) source)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.addAudioSource.html) * * 在插件中使用:支持 @@ -7362,14 +7312,14 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 /** [VideoDecoder](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.html) * * 视频解码器实例。作为音频源添加到音频播放器中 */ - source: VideoDecoder - ): Promise + source: VideoDecoder, + ): Promise; /** [Promise MediaAudioPlayer.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.destroy.html) * * 在插件中使用:支持 * * 销毁播放器 */ - destroy(): Promise + destroy(): Promise; /** [Promise MediaAudioPlayer.removeAudioSource([VideoDecoder](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.html) source)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.removeAudioSource.html) * * 在插件中使用:支持 @@ -7379,58 +7329,58 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 /** [VideoDecoder](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.html) * * 视频解码器实例 */ - source: VideoDecoder - ): Promise + source: VideoDecoder, + ): Promise; /** [Promise MediaAudioPlayer.start()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.start.html) * * 在插件中使用:支持 * * 启动播放器 */ - start(): Promise + start(): Promise; /** [Promise MediaAudioPlayer.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.stop.html) * * 在插件中使用:支持 * * 停止播放器 */ - stop(): Promise + stop(): Promise; } /** 本地临时文件列表 */ interface MediaFile { /** 视频的时间长度 */ - duration: number + duration: number; /** 文件类型 * * 可选值: * - 'image': 图片; * - 'video': 视频; */ - fileType: 'image' | 'video' + fileType: 'image' | 'video'; /** 视频的高度 */ - height: number + height: number; /** 本地临时文件大小,单位 B */ - size: number + size: number; /** 本地临时文件路径 (本地路径) */ - tempFilePath: string + tempFilePath: string; /** 视频缩略图临时文件路径 */ - thumbTempFilePath: string + thumbTempFilePath: string; /** 视频的宽度 */ - width: number + width: number; } interface MediaQueryObserverObserveCallbackResult { /** 页面的当前状态是否满足所指定的 media query */ - matches: boolean + matches: boolean; } /** 需要预览的资源列表 */ interface MediaSource { /** 图片或视频的地址 */ - url: string + url: string; /** 视频的封面图片 */ - poster?: string + poster?: string; /** 资源的类型,默认为图片 * * 可选值: * - 'image': 图片; * - 'video': 视频; */ - type?: 'image' | 'video' + type?: 'image' | 'video'; } /** 需要基础库: `2.9.0` * @@ -7439,20 +7389,20 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * [MediaTrack](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaTrack.html) 音频或视频轨道,可以对轨道进行一些操作 */ interface MediaTrack { /** 轨道长度,只读 */ - duration: number + duration: number; /** 轨道类型,只读 * * 可选值: * - 'audio': 音频轨道; * - 'video': 视频轨道; */ - kind: 'audio' | 'video' + kind: 'audio' | 'video'; /** 音量,音频轨道下有效,可写 */ - volume: number + volume: number; } /** 小程序账号信息 */ interface MiniProgram { /** 小程序 appId */ - appId: string + appId: string; /** 需要基础库: `2.10.0` * * 小程序版本 @@ -7461,79 +7411,79 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函 * - 'develop': 开发版; * - 'trial': 体验版; * - 'release': 正式版; */ - envVersion: 'develop' | 'trial' | 'release' + envVersion: 'develop' | 'trial' | 'release'; /** 需要基础库: `2.10.2` * * 线上小程序版本号 */ - version: string + version: string; } interface MkdirOption { /** 创建的目录路径 (本地路径) */ - dirPath: string + dirPath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: MkdirCompleteCallback + complete?: MkdirCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: MkdirFailCallback + fail?: MkdirFailCallback; /** 需要基础库: `2.3.0` * * 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 */ - recursive?: boolean + recursive?: boolean; /** 接口调用成功的回调函数 */ - success?: MkdirSuccessCallback + success?: MkdirSuccessCallback; } interface MoveAlongOption { /** 平滑移动的时间 */ - duration: number + duration: number; /** 指定 marker */ - markerId: number + markerId: number; /** 移动路径的坐标串,坐标点格式 `{longitude, latitude}` */ - path: any[] + path: any[]; /** 平滑移动触发 map 组件 interpolatepoint 事件的插值精度,单位为 m。默认不触发。 */ - precision: IAnyObject + precision: IAnyObject; /** 根据路径方向自动改变 marker 的旋转角度 */ - autoRotate?: boolean + autoRotate?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: MoveAlongCompleteCallback + complete?: MoveAlongCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: MoveAlongFailCallback + fail?: MoveAlongFailCallback; /** 接口调用成功的回调函数 */ - success?: MoveAlongSuccessCallback + success?: MoveAlongSuccessCallback; } interface MoveToLocationOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: MoveToLocationCompleteCallback + complete?: MoveToLocationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: MoveToLocationFailCallback + fail?: MoveToLocationFailCallback; /** 需要基础库: `2.8.0` * * 纬度 */ - latitude?: number + latitude?: number; /** 需要基础库: `2.8.0` * * 经度 */ - longitude?: number + longitude?: number; /** 接口调用成功的回调函数 */ - success?: MoveToLocationSuccessCallback + success?: MoveToLocationSuccessCallback; } /** 静音设置 */ interface MuteConfig { /** 是否静音耳机 */ - muteEarphone?: boolean + muteEarphone?: boolean; /** 是否静音麦克风 */ - muteMicrophone?: boolean + muteMicrophone?: boolean; } interface MuteOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: MuteCompleteCallback + complete?: MuteCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: MuteFailCallback + fail?: MuteFailCallback; /** 接口调用成功的回调函数 */ - success?: MuteSuccessCallback + success?: MuteSuccessCallback; } /** 需要基础库: `2.11.2` */ interface NFCAdapter { /** 标签类型枚举 */ - tech: TechType + tech: TechType; /** [NFCAdapter.offDiscovered(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.offDiscovered.html) * * 需要基础库: `2.11.2` @@ -7552,8 +7502,8 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 ``` */ offDiscovered( /** onDiscovered 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffDiscoveredCallback - ): void + listener?: OffDiscoveredCallback, + ): void; /** [NFCAdapter.onDiscovered(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.onDiscovered.html) * * 需要基础库: `2.11.2` @@ -7563,20 +7513,20 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 监听 NFC Tag */ onDiscovered( /** 的监听函数 */ - listener: OnDiscoveredCallback - ): void + listener: OnDiscoveredCallback, + ): void; /** [NFCAdapter.startDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.startDiscovery.html) * * 需要基础库: `2.11.2` * * 在插件中使用:支持 */ - startDiscovery(option?: StartDiscoveryOption): void + startDiscovery(option?: StartDiscoveryOption): void; /** [NFCAdapter.stopDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.stopDiscovery.html) * * 需要基础库: `2.11.2` * * 在插件中使用:支持 */ - stopDiscovery(option?: StopDiscoveryOption): void + stopDiscovery(option?: StopDiscoveryOption): void; /** [[IsoDep](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.html) NFCAdapter.getIsoDep()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getIsoDep.html) * * 需要基础库: `2.11.2` @@ -7584,7 +7534,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取IsoDep实例,实例支持ISO-DEP (ISO 14443-4)标准的读写 */ - getIsoDep(): IsoDep + getIsoDep(): IsoDep; /** [[MifareClassic](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.html) NFCAdapter.getMifareClassic()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getMifareClassic.html) * * 需要基础库: `2.11.2` @@ -7592,7 +7542,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取MifareClassic实例,实例支持MIFARE Classic标签的读写 */ - getMifareClassic(): MifareClassic + getMifareClassic(): MifareClassic; /** [[MifareUltralight](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.html) NFCAdapter.getMifareUltralight()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getMifareUltralight.html) * * 需要基础库: `2.11.2` @@ -7600,7 +7550,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取MifareUltralight实例,实例支持MIFARE Ultralight标签的读写 */ - getMifareUltralight(): MifareUltralight + getMifareUltralight(): MifareUltralight; /** [[Ndef](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.html) NFCAdapter.getNdef()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getNdef.html) * * 需要基础库: `2.11.2` @@ -7608,7 +7558,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取Ndef实例,实例支持对NDEF格式的NFC标签上的NDEF数据的读写 */ - getNdef(): Ndef + getNdef(): Ndef; /** [[NfcA](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.html) NFCAdapter.getNfcA()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getNfcA.html) * * 需要基础库: `2.11.2` @@ -7616,7 +7566,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取NfcA实例,实例支持NFC-A (ISO 14443-3A)标准的读写 */ - getNfcA(): NfcA + getNfcA(): NfcA; /** [[NfcB](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.html) NFCAdapter.getNfcB()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getNfcB.html) * * 需要基础库: `2.11.2` @@ -7624,7 +7574,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取NfcB实例,实例支持NFC-B (ISO 14443-3B)标准的读写 */ - getNfcB(): NfcB + getNfcB(): NfcB; /** [[NfcF](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.html) NFCAdapter.getNfcF()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getNfcF.html) * * 需要基础库: `2.11.2` @@ -7632,7 +7582,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取NfcF实例,实例支持NFC-F (JIS 6319-4)标准的读写 */ - getNfcF(): NfcF + getNfcF(): NfcF; /** [[NfcV](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.html) NFCAdapter.getNfcV()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.getNfcV.html) * * 需要基础库: `2.11.2` @@ -7640,121 +7590,121 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取NfcV实例,实例支持NFC-V (ISO 15693)标准的读写 */ - getNfcV(): NfcV + getNfcV(): NfcV; } interface NavigateBackMiniProgramOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: NavigateBackMiniProgramCompleteCallback + complete?: NavigateBackMiniProgramCompleteCallback; /** 需要返回给上一个小程序的数据,上一个小程序可在 `App.onShow` 中获取到这份数据。 [详情](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html)。 */ - extraData?: IAnyObject + extraData?: IAnyObject; /** 接口调用失败的回调函数 */ - fail?: NavigateBackMiniProgramFailCallback + fail?: NavigateBackMiniProgramFailCallback; /** 接口调用成功的回调函数 */ - success?: NavigateBackMiniProgramSuccessCallback + success?: NavigateBackMiniProgramSuccessCallback; } interface NavigateBackOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: NavigateBackCompleteCallback + complete?: NavigateBackCompleteCallback; /** 返回的页面数,如果 delta 大于现有页面数,则返回到首页。 */ - delta?: number + delta?: number; /** 接口调用失败的回调函数 */ - fail?: NavigateBackFailCallback + fail?: NavigateBackFailCallback; /** 接口调用成功的回调函数 */ - success?: NavigateBackSuccessCallback + success?: NavigateBackSuccessCallback; } interface NavigateToMiniProgramOption { /** 要打开的小程序 appId */ - appId?: string + appId?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: NavigateToMiniProgramCompleteCallback + complete?: NavigateToMiniProgramCompleteCallback; /** 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 * * 可选值: * - 'develop': 开发版; * - 'trial': 体验版; * - 'release': 正式版; */ - envVersion?: 'develop' | 'trial' | 'release' + envVersion?: 'develop' | 'trial' | 'release'; /** 需要传递给目标小程序的数据,目标小程序可在 `App.onLaunch`,`App.onShow` 中获取到这份数据。如果跳转的是小游戏,可以在 [wx.onShow](#)、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到这份数据数据。 */ - extraData?: IAnyObject + extraData?: IAnyObject; /** 接口调用失败的回调函数 */ - fail?: NavigateToMiniProgramFailCallback + fail?: NavigateToMiniProgramFailCallback; /** 需要基础库: `2.24.0` * * 不reLaunch目标小程序,直接打开目标跳转的小程序退后台时的页面,需满足以下条件:1. 目标跳转的小程序生命周期未被销毁;2. 且目标当次启动的path、query与上次启动相同,apiCategory以wx.getApiCategory接口的返回结果为准。 */ - noRelaunchIfPathUnchanged?: boolean + noRelaunchIfPathUnchanged?: boolean; /** 打开的页面路径,如果为空则打开首页。path 中 ? 后面的部分会成为 query,在小程序的 `App.onLaunch`、`App.onShow` 和 `Page.onLoad` 的回调函数或小游戏的 [wx.onShow](#) 回调函数、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到 query 数据。对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar"。 */ - path?: string + path?: string; /** 需要基础库: `2.18.1` * * 小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。 */ - shortLink?: string + shortLink?: string; /** 接口调用成功的回调函数 */ - success?: NavigateToMiniProgramSuccessCallback + success?: NavigateToMiniProgramSuccessCallback; } interface NavigateToOption { /** 需要跳转的应用内非 tabBar 的页面的路径 (代码包路径), 路径后可以带参数。参数与路径之间使用 `?` 分隔,参数键与参数值用 `=` 相连,不同参数用 `&` 分隔;如 'path?key=value&key2=value2' */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: NavigateToCompleteCallback + complete?: NavigateToCompleteCallback; /** 页面间通信接口,用于监听被打开页面发送到当前页面的数据。基础库 2.7.3 开始支持。 */ - events?: IAnyObject + events?: IAnyObject; /** 接口调用失败的回调函数 */ - fail?: NavigateToFailCallback + fail?: NavigateToFailCallback; /** 3.4.0 自定义路由配置,相关文档 [自定义路由](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/custom-route.html) */ - routeConfig?: IAnyObject + routeConfig?: IAnyObject; /** 3.4.0 自定义路由参数,相关文档 [自定义路由](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/custom-route.html) */ - routeOptions?: IAnyObject + routeOptions?: IAnyObject; /** 2.29.2 自定义路由类型,相关文档 [自定义路由](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/custom-route.html) */ - routeType?: string + routeType?: string; /** 接口调用成功的回调函数 */ - success?: NavigateToSuccessCallback + success?: NavigateToSuccessCallback; } interface NavigateToSuccessCallbackResult { /** [EventChannel](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.html) * * 和被打开页面进行通信 */ - eventChannel: EventChannel - errMsg: string + eventChannel: EventChannel; + errMsg: string; } interface NdefCloseOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: NdefCloseCompleteCallback + complete?: NdefCloseCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: NdefCloseFailCallback + fail?: NdefCloseFailCallback; /** 接口调用成功的回调函数 */ - success?: NdefCloseSuccessCallback + success?: NdefCloseSuccessCallback; } interface NdefConnectOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ConnectCompleteCallback + complete?: ConnectCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ConnectFailCallback + fail?: ConnectFailCallback; /** 接口调用成功的回调函数 */ - success?: ConnectSuccessCallback + success?: ConnectSuccessCallback; } interface NodeCallbackResult { /** 节点对应的 Node 实例 */ - node: IAnyObject + node: IAnyObject; } interface NotifyBLECharacteristicValueChangeOption { /** 蓝牙特征的 UUID */ - characteristicId: string + characteristicId: string; /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 蓝牙特征对应服务的 UUID */ - serviceId: string + serviceId: string; /** 是否启用 notify */ - state: boolean + state: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: NotifyBLECharacteristicValueChangeCompleteCallback + complete?: NotifyBLECharacteristicValueChangeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: NotifyBLECharacteristicValueChangeFailCallback + fail?: NotifyBLECharacteristicValueChangeFailCallback; /** 接口调用成功的回调函数 */ - success?: NotifyBLECharacteristicValueChangeSuccessCallback + success?: NotifyBLECharacteristicValueChangeSuccessCallback; /** 需要基础库: `2.4.0` * * 设置特征订阅类型,有效值有 `notification` 和 `indication` */ - type?: string + type?: string; } /** 需要基础库: `2.27.0` * @@ -7767,45 +7717,45 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 1: 通过摄像头实时检测; * - 2: 静态图片检测; */ - mode: 1 | 2 + mode: 1 | 2; } /** media query 描述符 */ interface ObserveDescriptor { /** 页面高度( px 为单位) */ - height: number + height: number; /** 页面最大高度( px 为单位) */ - maxHeight: number + maxHeight: number; /** 页面最大宽度( px 为单位) */ - maxWidth: number + maxWidth: number; /** 页面最小高度( px 为单位) */ - minHeight: number + minHeight: number; /** 页面最小宽度( px 为单位) */ - minWidth: number + minWidth: number; /** 屏幕方向( `landscape` 或 `portrait` ) */ - orientation: string + orientation: string; /** 页面宽度( px 为单位) */ - width: number + width: number; } /** 设置 type 监听单个类型的指标,设置 entryTypes 监听多个类型指标。 */ interface ObserveOption { /** 指标类型列表。不能和 type 同时使用。 */ - entryTypes?: string[] + entryTypes?: string[]; /** 指标类型。不能和 entryTypes 同时使用 * * 可选值: * - 'navigation': 路由; * - 'render': 渲染; * - 'script': 脚本; */ - type?: 'navigation' | 'render' | 'script' + type?: 'navigation' | 'render' | 'script'; } /** 需要基础库: `2.7.0` * * 离屏 canvas 实例,可通过 [wx.createOffscreenCanvas](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) 创建。 */ interface OffscreenCanvas { /** 画布高度 */ - height: number + height: number; /** 画布宽度 */ - width: number + width: number; /** [[Image](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Image.html) OffscreenCanvas.createImage()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/OffscreenCanvas.createImage.html) * * 需要基础库: `2.7.3` @@ -7817,7 +7767,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * **** * * 注意不允许混用 webgl 和 2d 画布创建的图片对象,使用时请注意尽量使用 canvas 自身的 `createImage` 创建图片对象。 */ - createImage(): Image + createImage(): Image; /** [[RenderingContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/RenderingContext.html) OffscreenCanvas.getContext(string contextType)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/OffscreenCanvas.getContext.html) * * 需要基础库: `2.7.0` @@ -7835,16 +7785,16 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 参数 contextType 可选值: * - 'webgl': webgl类型上下文; * - '2d': 2d类型上下文; */ - contextType: 'webgl' | '2d' - ): any + contextType: 'webgl' | '2d', + ): any; } interface OnAccelerometerChangeListenerResult { /** X 轴 */ - x: number + x: number; /** Y 轴 */ - y: number + y: number; /** Z 轴 */ - z: number + z: number; } interface OnAfterPageLoadListenerResult { /** 组件框架 @@ -7852,23 +7802,23 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'exparser': 旧版小程序组件框架; * - 'glass-easel': 新版小程序组件框架; */ - componentFramework: 'exparser' | 'glass-easel' + componentFramework: 'exparser' | 'glass-easel'; /** 路由打开类型 */ - openType: string + openType: string; /** 页面实例 */ - page: IAnyObject + page: IAnyObject; /** 页面路径 */ - path: string + path: string; /** 路由参数 */ - query: IAnyObject + query: IAnyObject; /** 路由事件 id */ - routeEventId: string + routeEventId: string; } interface OnAfterPageUnloadListenerResult { /** 页面路径 */ - path: string + path: string; /** 路由事件 id */ - routeEventId: string + routeEventId: string; } interface OnApiCategoryChangeListenerResult { /** API 类别 @@ -7878,139 +7828,135 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'nativeFunctionalized': 原生功能化,视频号直播商品、商品橱窗等场景打开的小程序; * - 'browseOnly': 仅浏览,朋友圈快照页等场景打开的小程序; * - 'embedded': 内嵌,通过打开半屏小程序能力打开的小程序; */ - apiCategory: - | 'default' - | 'nativeFunctionalized' - | 'browseOnly' - | 'embedded' + apiCategory: 'default' | 'nativeFunctionalized' | 'browseOnly' | 'embedded'; } interface OnAppRouteDoneListenerResult { /** 路由打开类型 */ - openType: string + openType: string; /** 页面路径 */ - path: string + path: string; /** 路由参数 */ - query: IAnyObject + query: IAnyObject; /** 路由事件 id */ - routeEventId: string + routeEventId: string; /** 路由下发的时间戳 */ - timeStamp: number + timeStamp: number; /** 当前页面 id */ - webviewId: number + webviewId: number; } interface OnAppRouteListenerResult { /** 是否未找到页面 */ - notFound: boolean + notFound: boolean; /** 路由打开类型 */ - openType: string + openType: string; /** 当前打开页面的相关配置 */ - page: IAnyObject + page: IAnyObject; /** 页面路径 */ - path: string + path: string; /** 可选值: * - 'min': 视频页面缩小为小窗; * - 'max': 视频小窗还原为页面; */ - pipMode: 'min' | 'max' + pipMode: 'min' | 'max'; /** 路由参数 */ - query: IAnyObject + query: IAnyObject; /** 渲染引擎 * * 可选值: * - 'webview': Webview 渲染引擎; * - 'skyline': Skyline 渲染引擎; * - 'xr-frame': xr-frame 解决方案; */ - renderer: 'webview' | 'skyline' | 'xr-frame' + renderer: 'webview' | 'skyline' | 'xr-frame'; /** 路由事件 id */ - routeEventId: string + routeEventId: string; /** 路由下发的时间戳 */ - timeStamp: number + timeStamp: number; /** 当前页面 id */ - webviewId: number + webviewId: number; } interface OnBLECharacteristicValueChangeListenerResult { /** 蓝牙特征的 UUID */ - characteristicId: string + characteristicId: string; /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 蓝牙特征对应服务的 UUID */ - serviceId: string + serviceId: string; /** 特征最新的值 */ - value: ArrayBuffer + value: ArrayBuffer; } interface OnBLEConnectionStateChangeListenerResult { /** 是否处于已连接状态 */ - connected: boolean + connected: boolean; /** 蓝牙设备 id */ - deviceId: string + deviceId: string; } interface OnBLEMTUChangeListenerResult { /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 最大传输单元 */ - mtu: number + mtu: number; } interface OnBLEPeripheralConnectionStateChangedListenerResult { /** 连接目前状态 */ - connected: boolean + connected: boolean; /** 连接状态变化的设备 id */ - deviceId: string + deviceId: string; /** server 的 UUID */ - serverId: string + serverId: string; } interface OnBackgroundFetchDataListenerResult { /** 缓存数据类别,取值为 periodic 或 pre */ - fetchType: string + fetchType: string; /** 缓存数据 */ - fetchedData: string + fetchedData: string; /** 小程序页面路径 */ - path: string + path: string; /** 传给页面的 query 参数 */ - query: string + query: string; /** 进入小程序的场景值 */ - scene: number + scene: number; /** 客户端拿到缓存数据的时间戳 */ - timeStamp: number + timeStamp: number; } interface OnBatteryInfoChangeListenerResult { /** 是否处于省电模式 */ - isLowPowerModeEnabled: boolean + isLowPowerModeEnabled: boolean; } interface OnBeaconServiceChangeListenerResult { /** 服务目前是否可用 */ - available: boolean + available: boolean; /** 目前是否处于搜索状态 */ - discovering: boolean + discovering: boolean; } interface OnBeaconUpdateListenerResult { /** 当前搜寻到的所有 Beacon 设备列表 */ - beacons: BeaconInfo[] + beacons: BeaconInfo[]; } interface OnBeforeAppRouteListenerResult { /** 是否未找到页面 */ - notFound: boolean + notFound: boolean; /** 路由打开类型 */ - openType: string + openType: string; /** 当前打开页面的相关配置 */ - page: IAnyObject + page: IAnyObject; /** 页面路径 */ - path: string + path: string; /** 可选值: * - 'min': 视频页面缩小为小窗; * - 'max': 视频小窗还原为页面; */ - pipMode: 'min' | 'max' + pipMode: 'min' | 'max'; /** 路由参数 */ - query: IAnyObject + query: IAnyObject; /** 渲染引擎 * * 可选值: * - 'webview': Webview 渲染引擎; * - 'skyline': Skyline 渲染引擎; * - 'xr-frame': xr-frame 解决方案; */ - renderer: 'webview' | 'skyline' | 'xr-frame' + renderer: 'webview' | 'skyline' | 'xr-frame'; /** 路由事件 id */ - routeEventId: string + routeEventId: string; /** 当前页面 id */ - webviewId: number + webviewId: number; } interface OnBeforePageLoadListenerResult { /** 组件框架 @@ -8018,99 +7964,99 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'exparser': 旧版小程序组件框架; * - 'glass-easel': 新版小程序组件框架; */ - componentFramework: 'exparser' | 'glass-easel' + componentFramework: 'exparser' | 'glass-easel'; /** 路由打开类型 */ - openType: string + openType: string; /** 页面路径 */ - path: string + path: string; /** 路由参数 */ - query: IAnyObject + query: IAnyObject; /** 路由事件 id */ - routeEventId: string + routeEventId: string; } interface OnBeforePageUnloadListenerResult { /** 页面实例 */ - page: IAnyObject + page: IAnyObject; /** 页面路径 */ - path: string + path: string; /** 路由事件 id */ - routeEventId: string + routeEventId: string; } interface OnBluetoothAdapterStateChangeListenerResult { /** 蓝牙适配器是否可用 */ - available: boolean + available: boolean; /** 蓝牙适配器是否处于搜索状态 */ - discovering: boolean + discovering: boolean; } interface OnBluetoothDeviceFoundListenerResult { /** 新搜索到的设备列表 */ - devices: BlueToothDevice[] + devices: BlueToothDevice[]; } interface OnCameraFrameCallbackResult { /** 图像像素点数据,一维数组,每四项表示一个像素点的 rgba */ - data: ArrayBuffer + data: ArrayBuffer; /** 图像数据矩形的高度 */ - height: number + height: number; /** 图像数据矩形的宽度 */ - width: number + width: number; } interface OnCharacteristicReadRequestListenerResult { /** 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 */ - callbackId: number + callbackId: number; /** 蓝牙特征的 UUID */ - characteristicId: string + characteristicId: string; /** 蓝牙特征对应服务的 UUID */ - serviceId: string + serviceId: string; } interface OnCharacteristicSubscribedListenerResult { /** 蓝牙特征的 UUID */ - characteristicId: string + characteristicId: string; /** 蓝牙特征对应服务的 UUID */ - serviceId: string + serviceId: string; } interface OnCharacteristicWriteRequestListenerResult { /** 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 */ - callbackId: number + callbackId: number; /** 蓝牙特征的 UUID */ - characteristicId: string + characteristicId: string; /** 蓝牙特征对应服务的 UUID */ - serviceId: string + serviceId: string; /** 请求写入特征的二进制数据值 */ - value: ArrayBuffer + value: ArrayBuffer; } interface OnCheckForUpdateListenerResult { /** 是否有新版本 */ - hasUpdate: boolean + hasUpdate: boolean; } interface OnChunkReceivedListenerResult { /** 返回的chunk buffer */ - data: ArrayBuffer + data: ArrayBuffer; } interface OnCompassChangeListenerResult { /** 需要基础库: `2.4.0` * * 精度 */ - accuracy: number | string + accuracy: number | string; /** 面对的方向度数 */ - direction: number + direction: number; } interface OnConnectListenerResult { /** 需要基础库: `3.4.0` * * 网络请求过程中的一些异常信息(例如:TCPSocket.connect 传了 enableHttpDNS: true,但最终未使用 HttpDNS 时,exception 就会说明未使用 HttpDNS 的原因) */ - exception: Exception + exception: Exception; /** 需要基础库: `3.4.1` * * 接收端地址信息(目前仅iOS和Android端支持) */ - localInfo: OnConnectListenerResultLocalInfo + localInfo: OnConnectListenerResultLocalInfo; /** 需要基础库: `3.4.1` * * 发送端地址信息(目前仅iOS和Android端支持) */ - remoteInfo: OnConnectListenerResultRemoteInfo + remoteInfo: OnConnectListenerResultRemoteInfo; /** 需要基础库: `3.4.0` * * 本次连接是否使用了 HttpDNS */ - useHttpDNS: boolean + useHttpDNS: boolean; } /** 需要基础库: `3.4.1` * @@ -8119,15 +8065,15 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 /** 需要基础库: `3.4.1` * * 接收消息的 socket 的地址 */ - address: string + address: string; /** 需要基础库: `3.4.1` * * 使用的协议族,为 IPv4 或者 IPv6 */ - family: string + family: string; /** 需要基础库: `3.4.1` * * 端口号 */ - port: number + port: number; } /** 需要基础库: `3.4.1` * @@ -8136,130 +8082,130 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 /** 需要基础库: `3.4.1` * * 发送消息的 socket 的地址 */ - address: string + address: string; /** 需要基础库: `3.4.1` * * 使用的协议族,为 IPv4 或者 IPv6 */ - family: string + family: string; /** 需要基础库: `3.4.1` * * 端口号 */ - port: number + port: number; } interface OnCopyUrlListenerResult { /** 用短链打开小程序时当前页面携带的查询字符串。小程序中使用时,应在进入页面时调用 `wx.onCopyUrl` 自定义 `query`,退出页面时调用 `wx.offCopyUrl`,防止影响其它页面。 */ - query: string + query: string; } interface OnCustomRendererEventCallbackResult { /** 推流高度 */ - height: number + height: number; /** 推流宽度 */ - width: number + width: number; } interface OnDeviceMotionChangeListenerResult { /** 当 手机坐标 X/Y 和 地球 X/Y 重合时,绕着 Z 轴转动的夹角为 alpha,范围值为 [0, 2*PI)。逆时针转动为正。 */ - alpha: number + alpha: number; /** 当手机坐标 Y/Z 和地球 Y/Z 重合时,绕着 X 轴转动的夹角为 beta。范围值为 [-1*PI, PI) 。顶部朝着地球表面转动为正。也有可能朝着用户为正。 */ - beta: number + beta: number; /** 当手机 X/Z 和地球 X/Z 重合时,绕着 Y 轴转动的夹角为 gamma。范围值为 [-1*PI/2, PI/2)。右边朝着地球表面转动为正。 */ - gamma: number + gamma: number; } interface OnDiscoveredListenerResult { - id: ArrayBuffer + id: ArrayBuffer; /** 可选,NdefMessage 数组,消息格式为 {id: ArrayBuffer, type: ArrayBuffer, payload: ArrayBuffer} */ - messages: any[] + messages: any[]; /** tech 数组,用于匹配NFC卡片具体可以使用什么标准(NfcA等实例)处理 */ - techs: any[] + techs: any[]; } interface OnEmbeddedMiniProgramHeightChangeListenerResult { /** 可视高度 */ - height: number + height: number; /** 半屏小程序初始高度 */ - initialHeight: number + initialHeight: number; } interface OnFrameRecordedListenerResult { /** 录音分片数据 */ - frameBuffer: ArrayBuffer + frameBuffer: ArrayBuffer; /** 当前帧是否正常录音结束前的最后一帧 */ - isLastFrame: boolean + isLastFrame: boolean; } interface OnGetWifiListListenerResult { /** Wi-Fi 列表数据 */ - wifiList: WifiInfo[] + wifiList: WifiInfo[]; } interface OnGyroscopeChangeListenerResult { /** x 轴的角速度 */ - x: number + x: number; /** y 轴的角速度 */ - y: number + y: number; /** z 轴的角速度 */ - z: number + z: number; } interface OnHCEMessageListenerResult { /** `messageType=1` 时 ,客户端接收到 NFC 设备的指令 */ - data: ArrayBuffer + data: ArrayBuffer; /** 消息类型 * * 可选值: * - 1: HCE APDU Command类型,小程序需对此指令进行处理,并调用 sendHCEMessage 接口返回处理指令; * - 2: 设备离场事件类型; */ - messageType: 1 | 2 + messageType: 1 | 2; /** `messageType=2` 时,原因 */ - reason: number + reason: number; } interface OnKeyboardHeightChangeListenerResult { /** 键盘高度 */ - height: number + height: number; } interface OnLazyLoadErrorListenerResult { /** 详细信息 */ - errMsg: string + errMsg: string; /** 异步组件所属的分包 */ - subpackage: any[] + subpackage: any[]; /** 'subpackage' 失败类型 */ - type: string + type: string; } interface OnLocalServiceFoundListenerResult { /** 服务的 ip 地址 */ - ip: string + ip: string; /** 服务的端口 */ - port: number + port: number; /** 服务的名称 */ - serviceName: string + serviceName: string; /** 服务的类型 */ - serviceType: string + serviceType: string; } interface OnLocalServiceLostListenerResult { /** 服务的名称 */ - serviceName: string + serviceName: string; /** 服务的类型 */ - serviceType: string + serviceType: string; } interface OnLocationChangeErrorListenerResult { /** 错误码 */ - errCode: number + errCode: number; } interface OnLocationChangeListenerResult { /** 位置的精确度 */ - accuracy: number + accuracy: number; /** 需要基础库: `1.2.0` * * 高度,单位 m */ - altitude: number + altitude: number; /** 需要基础库: `1.2.0` * * 水平精度,单位 m */ - horizontalAccuracy: number + horizontalAccuracy: number; /** 纬度,范围为 -90~90,负数表示南纬。使用 gcj02 国测局坐标系 */ - latitude: number + latitude: number; /** 经度,范围为 -180~180,负数表示西经。使用 gcj02 国测局坐标系 */ - longitude: number + longitude: number; /** 速度,单位 m/s */ - speed: number + speed: number; /** 需要基础库: `1.2.0` * * 垂直精度,单位 m(Android 无法获取,返回 0) */ - verticalAccuracy: number + verticalAccuracy: number; } interface OnMemoryWarningListenerResult { /** 内存告警等级,只有 Android 才有,对应系统宏定义 @@ -8268,33 +8214,33 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 5: TRIM_MEMORY_RUNNING_MODERATE; * - 10: TRIM_MEMORY_RUNNING_LOW; * - 15: TRIM_MEMORY_RUNNING_CRITICAL; */ - level: 5 | 10 | 15 + level: 5 | 10 | 15; } interface OnMenuButtonBoundingClientRectWeightChangeListenerResult { /** 下边界坐标,单位:px */ - bottom: number + bottom: number; /** 高度,单位:px */ - height: number + height: number; /** 左边界坐标,单位:px */ - left: number + left: number; /** 右边界坐标,单位:px */ - right: number + right: number; /** 上边界坐标,单位:px */ - top: number + top: number; /** 宽度,单位:px */ - width: number + width: number; } interface OnMessageListenerResultLocalInfo { /** 接收消息的 socket 的地址 */ - address: string + address: string; /** 使用的协议族,为 IPv4 或者 IPv6 */ - family: string + family: string; /** 端口号 */ - port: number + port: number; } interface OnNetworkStatusChangeListenerResult { /** 当前是否有网络连接 */ - isConnected: boolean + isConnected: boolean; /** 网络类型 * * 可选值: @@ -8305,31 +8251,31 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - '5g': 5g 网络; * - 'unknown': Android 下不常见的网络类型; * - 'none': 无网络; */ - networkType: 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none' + networkType: 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none'; } interface OnNetworkWeakChangeListenerResult { /** 当前网络类型 */ - networkType: string + networkType: string; /** 当前是否处于弱网状态 */ - weakNet: boolean + weakNet: boolean; } interface OnOpenListenerResult { /** 需要基础库: `2.0.0` * * 连接成功的 HTTP 响应 Header */ - header: IAnyObject + header: IAnyObject; /** 需要基础库: `2.10.4` * * 网络请求过程中一些调试信息 */ - profile: SocketProfile + profile: SocketProfile; } interface OnPageNotFoundListenerResult { /** 是否本次启动的首个页面(例如从分享等入口进来,首个页面是开发者配置的分享页面) */ - isEntryPage: boolean + isEntryPage: boolean; /** 不存在页面的路径 (代码包路径) */ - path: string + path: string; /** 打开不存在页面的 query 参数 */ - query: Record + query: Record; } interface OnScreenRecordingStateChangedListenerResult { /** 录屏状态 @@ -8337,21 +8283,21 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'start': 开始录屏; * - 'stop': 结束录屏; */ - state: 'start' | 'stop' + state: 'start' | 'stop'; } interface OnSocketOpenListenerResult { /** 需要基础库: `2.0.0` * * 连接成功的 HTTP 响应 Header */ - header: IAnyObject + header: IAnyObject; } interface OnStopListenerResult { /** 录音总时长,单位:ms */ - duration: number + duration: number; /** 录音文件大小,单位:Byte */ - fileSize: number + fileSize: number; /** 录音文件的临时路径 (本地路径) */ - tempFilePath: string + tempFilePath: string; } interface OnThemeChangeListenerResult { /** 系统当前的主题,取值为`light`或`dark` @@ -8359,92 +8305,92 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'dark': 深色主题; * - 'light': 浅色主题; */ - theme: 'dark' | 'light' + theme: 'dark' | 'light'; } interface OnUnhandledRejectionListenerResult { /** 被拒绝的 Promise 对象 */ - promise: Promise + promise: Promise; /** 拒绝原因,一般是一个 Error 对象 */ - reason: string + reason: string; } interface OnUserCaptureScreenListenerResult { /** 需要基础库: `3.3.0` * * 如果该参数存在,则其它的参数将会以 resolve 结果为准,如果一秒内不 resolve,分享会使用上面传入的默认参数 */ - promise?: Promise + promise?: Promise; /** 需要基础库: `3.3.0` * * 支持开发者自定义一键打开小程序时的 query */ - query?: string + query?: string; } interface OnVoIPChatInterruptedListenerResult { /** 错误码 */ - errCode: number + errCode: number; /** 调用结果(错误原因) */ - errMsg: string + errMsg: string; } interface OnVoIPChatMembersChangedListenerResult { /** 错误码 */ - errCode: number + errCode: number; /** 调用结果 */ - errMsg: string + errMsg: string; /** 还在实时语音通话中的成员 openId 名单 */ - openIdList: string[] + openIdList: string[]; } interface OnVoIPChatSpeakersChangedListenerResult { /** 错误码 */ - errCode: number + errCode: number; /** 调用结果(错误原因) */ - errMsg: string + errMsg: string; /** 还在实时语音通话中的成员 openId 名单 */ - openIdList: string[] + openIdList: string[]; } interface OnVoIPChatStateChangedListenerResult { /** 事件码 */ - code: number + code: number; /** 附加信息 */ - data: IAnyObject + data: IAnyObject; /** 错误码 */ - errCode: number + errCode: number; /** 调用结果 */ - errMsg: string + errMsg: string; } interface OnVoIPVideoMembersChangedListenerResult { /** 错误码 */ - errCode: number + errCode: number; /** 调用结果 */ - errMsg: string + errMsg: string; /** 开启视频的成员名单 */ - openIdList: string[] + openIdList: string[]; } interface OnWifiConnectedListenerResult { /** [WifiInfo](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/WifiInfo.html) * * Wi-Fi 信息 */ - wifi: WifiInfo + wifi: WifiInfo; } interface OnWifiConnectedWithPartialInfoListenerResult { /** [WifiInfo](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/WifiInfo.html) * * 只包含 SSID 属性的 WifiInfo 对象 */ - wifi: WifiInfo + wifi: WifiInfo; } interface OnWindowResizeListenerResult { - size: Size + size: Size; } interface OpenAppAuthorizeSettingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenAppAuthorizeSettingCompleteCallback + complete?: OpenAppAuthorizeSettingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenAppAuthorizeSettingFailCallback + fail?: OpenAppAuthorizeSettingFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenAppAuthorizeSettingSuccessCallback + success?: OpenAppAuthorizeSettingSuccessCallback; } interface OpenBluetoothAdapterOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenBluetoothAdapterCompleteCallback + complete?: OpenBluetoothAdapterCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenBluetoothAdapterFailCallback + fail?: OpenBluetoothAdapterFailCallback; /** 需要基础库: `2.10.0` * * 蓝牙模式,可作为主/从设备,仅 iOS 需要。 @@ -8452,102 +8398,102 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'central': 主机模式; * - 'peripheral': 从机(外围设备)模式; */ - mode?: 'central' | 'peripheral' + mode?: 'central' | 'peripheral'; /** 接口调用成功的回调函数 */ - success?: OpenBluetoothAdapterSuccessCallback + success?: OpenBluetoothAdapterSuccessCallback; } interface OpenCardOption { /** 需要打开的卡券列表 */ - cardList: OpenCardRequestInfo[] + cardList: OpenCardRequestInfo[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenCardCompleteCallback + complete?: OpenCardCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenCardFailCallback + fail?: OpenCardFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenCardSuccessCallback + success?: OpenCardSuccessCallback; } /** 需要打开的卡券列表 */ interface OpenCardRequestInfo { /** 卡券 ID */ - cardId: string + cardId: string; /** 由 [wx.addCard](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/card/wx.addCard.html) 的返回对象中的加密 code 通过解密后得到,解密请参照:[code 解码接口](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V) */ - code: string + code: string; } interface OpenChannelsActivityOption { /** 视频 feedId */ - feedId: string + feedId: string; /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ - finderUserName: string + finderUserName: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenChannelsActivityCompleteCallback + complete?: OpenChannelsActivityCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenChannelsActivityFailCallback + fail?: OpenChannelsActivityFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenChannelsActivitySuccessCallback + success?: OpenChannelsActivitySuccessCallback; } interface OpenChannelsEventOption { /** 活动 id */ - eventId: string + eventId: string; /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ - finderUserName: string + finderUserName: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenChannelsEventCompleteCallback + complete?: OpenChannelsEventCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenChannelsEventFailCallback + fail?: OpenChannelsEventFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenChannelsEventSuccessCallback + success?: OpenChannelsEventSuccessCallback; } interface OpenChannelsLiveOption { /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ - finderUserName: string + finderUserName: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenChannelsLiveCompleteCallback + complete?: OpenChannelsLiveCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenChannelsLiveFailCallback + fail?: OpenChannelsLiveFailCallback; /** 直播 feedId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) */ - feedId?: string + feedId?: string; /** 直播 nonceId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) */ - nonceId?: string + nonceId?: string; /** 接口调用成功的回调函数 */ - success?: OpenChannelsLiveSuccessCallback + success?: OpenChannelsLiveSuccessCallback; } interface OpenChannelsUserProfileOption { /** 视频号 id */ - finderUserName: string + finderUserName: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenChannelsUserProfileCompleteCallback + complete?: OpenChannelsUserProfileCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenChannelsUserProfileFailCallback + fail?: OpenChannelsUserProfileFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenChannelsUserProfileSuccessCallback + success?: OpenChannelsUserProfileSuccessCallback; } interface OpenCustomerServiceChatOption { /** 企业ID */ - corpId: string + corpId: string; /** 客服信息 */ - extInfo: ExtInfoOption + extInfo: ExtInfoOption; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenCustomerServiceChatCompleteCallback + complete?: OpenCustomerServiceChatCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenCustomerServiceChatFailCallback + fail?: OpenCustomerServiceChatFailCallback; /** 气泡消息图片 */ - sendMessageImg?: string + sendMessageImg?: string; /** 气泡消息小程序路径 */ - sendMessagePath?: string + sendMessagePath?: string; /** 气泡消息标题 */ - sendMessageTitle?: string + sendMessageTitle?: string; /** 是否发送小程序气泡消息 */ - showMessageCard?: boolean + showMessageCard?: boolean; /** 接口调用成功的回调函数 */ - success?: OpenCustomerServiceChatSuccessCallback + success?: OpenCustomerServiceChatSuccessCallback; } interface OpenDocumentOption { /** 文件路径 (本地路径) ,可通过 downloadFile 获得 */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenDocumentCompleteCallback + complete?: OpenDocumentCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenDocumentFailCallback + fail?: OpenDocumentFailCallback; /** 需要基础库: `1.4.0` * * 文件类型,指定文件类型打开文件 @@ -8560,44 +8506,44 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'ppt': ppt 格式; * - 'pptx': pptx 格式; * - 'pdf': pdf 格式; */ - fileType?: 'doc' | 'docx' | 'xls' | 'xlsx' | 'ppt' | 'pptx' | 'pdf' + fileType?: 'doc' | 'docx' | 'xls' | 'xlsx' | 'ppt' | 'pptx' | 'pdf'; /** 需要基础库: `2.11.0` * * 是否显示右上角菜单 */ - showMenu?: boolean + showMenu?: boolean; /** 接口调用成功的回调函数 */ - success?: OpenDocumentSuccessCallback + success?: OpenDocumentSuccessCallback; } interface OpenEmbeddedMiniProgramOption { /** 要打开的小程序 appId */ - appId: string + appId: string; /** 需要基础库: `2.33.0` * * 打开的小程序是否支持全屏 */ - allowFullScreen?: boolean + allowFullScreen?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenEmbeddedMiniProgramCompleteCallback + complete?: OpenEmbeddedMiniProgramCompleteCallback; /** 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 * * 可选值: * - 'develop': 开发版; * - 'trial': 体验版; * - 'release': 正式版; */ - envVersion?: 'develop' | 'trial' | 'release' + envVersion?: 'develop' | 'trial' | 'release'; /** 需要传递给目标小程序的数据,目标小程序可在 `App.onLaunch`,`App.onShow` 中获取到这份数据。如果跳转的是小游戏,可以在 [wx.onShow](#)、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到这份数据数据。 */ - extraData?: IAnyObject + extraData?: IAnyObject; /** 接口调用失败的回调函数 */ - fail?: OpenEmbeddedMiniProgramFailCallback + fail?: OpenEmbeddedMiniProgramFailCallback; /** 需要基础库: `2.24.0` * * 不reLaunch目标小程序,直接打开目标跳转的小程序退后台时的页面,需满足以下条件:1. 目标跳转的小程序生命周期未被销毁;2. 且目标当次启动的path、query与上次启动相同,apiCategory以wx.getApiCategory接口的返回结果为准。 */ - noRelaunchIfPathUnchanged?: boolean + noRelaunchIfPathUnchanged?: boolean; /** 打开的页面路径,如果为空则打开首页。path 中 ? 后面的部分会成为 query,在小程序的 `App.onLaunch`、`App.onShow` 和 `Page.onLoad` 的回调函数或小游戏的 [wx.onShow](#) 回调函数、[wx.getLaunchOptionsSync](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) 中可以获取到 query 数据。对于小游戏,可以只传入 query 部分,来实现传参效果,如:传入 "?foo=bar"。 */ - path?: string + path?: string; /** 小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。仅 verify=binding 支持。 */ - shortLink?: string + shortLink?: string; /** 接口调用成功的回调函数 */ - success?: OpenEmbeddedMiniProgramSuccessCallback + success?: OpenEmbeddedMiniProgramSuccessCallback; /** 需要基础库: `2.24.3` * * 校验方式。 @@ -8605,85 +8551,85 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'binding': 校验小程序管理后台的绑定关系。; * - 'unionProduct': 校验目标打开链接是否为[小程序联盟](https://developers.weixin.qq.com/doc/ministore/union/brief-introduction.html)商品。; */ - verify?: 'binding' | 'unionProduct' + verify?: 'binding' | 'unionProduct'; } interface OpenHKOfflinePayViewOption { /** 随机字符串,长度为32个字符以下 */ - nonceStr: string + nonceStr: string; /** 业务数据包,开发者目前无需感知,直接传空字符串即可 */ - package: string + package: string; /** 签名,具体见微信支付文档 */ - paySign: string + paySign: string; /** 时间戳,从 1970 年 1 月 1 日 00:00:00 至今的秒数,即当前的时间 */ - timeStamp: string + timeStamp: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenHKOfflinePayViewCompleteCallback + complete?: OpenHKOfflinePayViewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenHKOfflinePayViewFailCallback + fail?: OpenHKOfflinePayViewFailCallback; /** 签名算法,应与后台下单时的值一致,目前仅支持 SHA1 * * 可选值: * - 'SHA1': SHA1签名算法; */ - signType?: 'SHA1' + signType?: 'SHA1'; /** 接口调用成功的回调函数 */ - success?: OpenHKOfflinePayViewSuccessCallback + success?: OpenHKOfflinePayViewSuccessCallback; } interface OpenLocationOption { /** 纬度,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系 */ - latitude: number + latitude: number; /** 经度,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */ - longitude: number + longitude: number; /** 地址的详细说明 */ - address?: string + address?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenLocationCompleteCallback + complete?: OpenLocationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenLocationFailCallback + fail?: OpenLocationFailCallback; /** 位置名 */ - name?: string + name?: string; /** 缩放比例,范围5~18 */ - scale?: number + scale?: number; /** 接口调用成功的回调函数 */ - success?: OpenLocationSuccessCallback + success?: OpenLocationSuccessCallback; } interface OpenMapAppOption { /** 目的地名称 */ - destination: string + destination: string; /** 目的地纬度 */ - latitude: number + latitude: number; /** 目的地经度 */ - longitude: number + longitude: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenMapAppCompleteCallback + complete?: OpenMapAppCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenMapAppFailCallback + fail?: OpenMapAppFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenMapAppSuccessCallback + success?: OpenMapAppSuccessCallback; } interface OpenOfficialAccountArticleOption { /** 需要打开的公众号地址 */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenOfficialAccountArticleCompleteCallback + complete?: OpenOfficialAccountArticleCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenOfficialAccountArticleFailCallback + fail?: OpenOfficialAccountArticleFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenOfficialAccountArticleSuccessCallback + success?: OpenOfficialAccountArticleSuccessCallback; } interface OpenOfficialAccountArticleSuccessCallbackResult { /** 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) */ - cancel: boolean + cancel: boolean; /** 为 true 时,表示用户点击了确定按钮 */ - confirm: boolean - errMsg: string + confirm: boolean; + errMsg: string; } interface OpenOption { /** 文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenCompleteCallback + complete?: OpenCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenFailCallback + fail?: OpenFailCallback; /** 文件系统标志,默认值: 'r' * * 可选值: @@ -8699,93 +8645,81 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'wx': 类似于 'w',但如果路径存在,则失败; * - 'w+': 打开文件用于读取和写入。 如果文件不存在则创建文件,如果文件存在则截断文件; * - 'wx+': 类似于 'w+',但如果路径存在,则失败; */ - flag?: - | 'a' - | 'ax' - | 'a+' - | 'ax+' - | 'as' - | 'as+' - | 'r' - | 'r+' - | 'w' - | 'wx' - | 'w+' - | 'wx+' + flag?: 'a' | 'ax' | 'a+' | 'ax+' | 'as' | 'as+' | 'r' | 'r+' | 'w' | 'wx' | 'w+' | 'wx+'; /** 接口调用成功的回调函数 */ - success?: OpenSuccessCallback + success?: OpenSuccessCallback; } interface OpenPrivacyContractOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenPrivacyContractCompleteCallback + complete?: OpenPrivacyContractCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenPrivacyContractFailCallback + fail?: OpenPrivacyContractFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenPrivacyContractSuccessCallback + success?: OpenPrivacyContractSuccessCallback; } interface OpenSettingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenSettingCompleteCallback + complete?: OpenSettingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenSettingFailCallback + fail?: OpenSettingFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenSettingSuccessCallback + success?: OpenSettingSuccessCallback; /** 需要基础库: `2.10.3` * * 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 */ - withSubscriptions?: boolean + withSubscriptions?: boolean; } interface OpenSettingSuccessCallbackResult { /** [AuthSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/AuthSetting.html) * * 用户授权结果 */ - authSetting: AuthSetting + authSetting: AuthSetting; /** [SubscriptionsSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/SubscriptionsSetting.html) * * 需要基础库: `2.10.3` * * 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 */ - subscriptionsSetting: SubscriptionsSetting - errMsg: string + subscriptionsSetting: SubscriptionsSetting; + errMsg: string; } interface OpenSingleStickerViewOption { /** 表情链接,可前往[表情开放平台](https://sticker.weixin.qq.com/cgi-bin/mmemoticon-bin/loginpage?t=login/index),在详情页中的「小程序跳转链接」入口复制 */ - url: IAnyObject + url: IAnyObject; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenSingleStickerViewCompleteCallback + complete?: OpenSingleStickerViewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenSingleStickerViewFailCallback + fail?: OpenSingleStickerViewFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenSingleStickerViewSuccessCallback + success?: OpenSingleStickerViewSuccessCallback; } interface OpenStickerIPViewOption { /** 表情IP合辑链接,可前往[表情开放平台](https://sticker.weixin.qq.com/cgi-bin/mmemoticon-bin/loginpage?t=login/index),在详情页中的「小程序跳转链接」入口复制 */ - url: IAnyObject + url: IAnyObject; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenStickerIPViewCompleteCallback + complete?: OpenStickerIPViewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenStickerIPViewFailCallback + fail?: OpenStickerIPViewFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenStickerIPViewSuccessCallback + success?: OpenStickerIPViewSuccessCallback; } interface OpenStickerSetViewOption { /** 表情专辑链接,可前往[表情开放平台](https://sticker.weixin.qq.com/cgi-bin/mmemoticon-bin/loginpage?t=login/index),在详情页中的「小程序跳转链接」入口复制 */ - url: IAnyObject + url: IAnyObject; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenStickerSetViewCompleteCallback + complete?: OpenStickerSetViewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenStickerSetViewFailCallback + fail?: OpenStickerSetViewFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenStickerSetViewSuccessCallback + success?: OpenStickerSetViewSuccessCallback; } interface OpenSuccessCallbackResult { /** 文件描述符 */ - fd: string - errMsg: string + fd: string; + errMsg: string; } interface OpenSyncOption { /** 文件路径 (本地路径) */ - filePath: string + filePath: string; /** 文件系统标志,默认值: 'r' * * 可选值: @@ -8801,140 +8735,128 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'wx': 类似于 'w',但如果路径存在,则失败; * - 'w+': 打开文件用于读取和写入。 如果文件不存在则创建文件,如果文件存在则截断文件; * - 'wx+': 类似于 'w+',但如果路径存在,则失败; */ - flag?: - | 'a' - | 'ax' - | 'a+' - | 'ax+' - | 'as' - | 'as+' - | 'r' - | 'r+' - | 'w' - | 'wx' - | 'w+' - | 'wx+' + flag?: 'a' | 'ax' | 'a+' | 'ax+' | 'as' | 'as+' | 'r' | 'r+' | 'w' | 'wx' | 'w+' | 'wx+'; } interface OpenSystemBluetoothSettingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenSystemBluetoothSettingCompleteCallback + complete?: OpenSystemBluetoothSettingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenSystemBluetoothSettingFailCallback + fail?: OpenSystemBluetoothSettingFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenSystemBluetoothSettingSuccessCallback + success?: OpenSystemBluetoothSettingSuccessCallback; } interface OpenVideoEditorOption { /** 视频源的路径,只支持本地路径 */ - filePath: string + filePath: string; /** 需要基础库: `2.16.1` * * 视频裁剪的最大长度 */ - maxDuration: string + maxDuration: string; /** 需要基础库: `2.16.1` * * 视频裁剪的最小长度 */ - minDuration: string + minDuration: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: OpenVideoEditorCompleteCallback + complete?: OpenVideoEditorCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: OpenVideoEditorFailCallback + fail?: OpenVideoEditorFailCallback; /** 接口调用成功的回调函数 */ - success?: OpenVideoEditorSuccessCallback + success?: OpenVideoEditorSuccessCallback; } interface OpenVideoEditorSuccessCallbackResult { /** 剪辑后生成的视频文件的时长,单位毫秒(ms) */ - duration: number + duration: number; /** 剪辑后生成的视频文件大小,单位字节数(byte) */ - size: number + size: number; /** 编辑后生成的视频文件的临时路径 */ - tempFilePath: string + tempFilePath: string; /** 编辑后生成的缩略图文件的临时路径 */ - tempThumbPath: string - errMsg: string + tempThumbPath: string; + errMsg: string; } interface PageScrollToOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PageScrollToCompleteCallback + complete?: PageScrollToCompleteCallback; /** 滚动动画的时长,单位 ms */ - duration?: number + duration?: number; /** 接口调用失败的回调函数 */ - fail?: PageScrollToFailCallback + fail?: PageScrollToFailCallback; /** 需要基础库: `2.23.1` * * 偏移距离,需要和 selector 参数搭配使用,可以滚动到 selector 加偏移距离的位置,单位 px */ - offsetTop?: number + offsetTop?: number; /** 滚动到页面的目标位置,单位 px */ - scrollTop?: number + scrollTop?: number; /** 需要基础库: `2.7.3` * * 选择器 */ - selector?: string + selector?: string; /** 接口调用成功的回调函数 */ - success?: PageScrollToSuccessCallback + success?: PageScrollToSuccessCallback; } interface PauseBGMOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PauseBGMCompleteCallback + complete?: PauseBGMCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PauseBGMFailCallback + fail?: PauseBGMFailCallback; /** 接口调用成功的回调函数 */ - success?: PauseBGMSuccessCallback + success?: PauseBGMSuccessCallback; } interface PauseBackgroundAudioOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PauseBackgroundAudioCompleteCallback + complete?: PauseBackgroundAudioCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PauseBackgroundAudioFailCallback + fail?: PauseBackgroundAudioFailCallback; /** 接口调用成功的回调函数 */ - success?: PauseBackgroundAudioSuccessCallback + success?: PauseBackgroundAudioSuccessCallback; } interface PauseOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PauseCompleteCallback + complete?: PauseCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PauseFailCallback + fail?: PauseFailCallback; /** 接口调用成功的回调函数 */ - success?: PauseSuccessCallback + success?: PauseSuccessCallback; } interface PauseVoiceOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PauseVoiceCompleteCallback + complete?: PauseVoiceCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PauseVoiceFailCallback + fail?: PauseVoiceFailCallback; /** 接口调用成功的回调函数 */ - success?: PauseVoiceSuccessCallback + success?: PauseVoiceSuccessCallback; } /** 单条性能数据。具体数据口径请参考[性能数据文档]((performance/perf_data##_1-4-%E9%80%9A%E8%BF%87-wx-getPerformance-%E5%9C%A8%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%86%85%E8%8E%B7%E5%8F%96)) */ interface PerformanceEntry { /** 需要基础库: `2.24.0` * * 解析域名结束时间。仅 resourceTiming 指标有效。 */ - domainLookupEnd: number + domainLookupEnd: number; /** 需要基础库: `2.24.0` * * 解析域名开始时间。仅 resourceTiming 指标有效。 */ - domainLookupStart: number + domainLookupStart: number; /** 耗时 ms。仅对于表示阶段的指标有效。 */ - duration: number + duration: number; /** 指标类型 * * 可选值: * - 'navigation': 路由; * - 'render': 渲染; * - 'script': 脚本; */ - entryType: 'navigation' | 'render' | 'script' + entryType: 'navigation' | 'render' | 'script'; /** 需要基础库: `2.21.2` * * 注入文件列表。仅 evaluateScript 指标有效。 */ - fileList: string[] + fileList: string[]; /** 需要基础库: `2.21.2` * * 首次渲染参数在渲染层收到的时间。仅 firstRender 指标有效。 */ - initDataRecvTime: number + initDataRecvTime: number; /** 需要基础库: `2.21.2` * * 首次渲染参数从逻辑层发出的时间。仅 firstRender 指标有效。 */ - initDataSendTime: number + initDataSendTime: number; /** 需要基础库: `2.24.0` * * 初始化性能条目的资源类型。仅 resourceTiming 指标有效。 @@ -8944,9 +8866,9 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'cover-image': cover-image 组件的图片; * - 'image': 组件的图片; * - 'open-data': 组件的图片; */ - initiatorType: 'audio' | 'cover-image' | 'image' | 'open-data' + initiatorType: 'audio' | 'cover-image' | 'image' | 'open-data'; /** 分包名,主包表示为 __APP__ (2.21.2 开始)。仅 evaluateScript 指标有效。 */ - moduleName: string + moduleName: string; /** 指标名称 * * 可选值: @@ -8959,71 +8881,62 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'evaluateScript': 逻辑层 JS 代码注入耗时。(entryType: script); * - 'downloadPackage': 代码包下载耗时。(entryType: loadPackage); * - 'resourceTiming': 视图层资源加载耗时。(entryType: resource); */ - name: - | 'appLaunch' - | 'route' - | 'firstRender' - | 'firstPaint' - | 'firstContentfulPaint' - | 'largestContentfulPaint' - | 'evaluateScript' - | 'downloadPackage' - | 'resourceTiming' + name: 'appLaunch' | 'route' | 'firstRender' | 'firstPaint' | 'firstContentfulPaint' | 'largestContentfulPaint' | 'evaluateScript' | 'downloadPackage' | 'resourceTiming'; /** 路由真正响应开始时间。仅 navigation 类型指标有效。 */ - navigationStart: number + navigationStart: number; /** 路由详细类型,与小程序路由方法对应。仅 navigation 类型指标有效。 */ - navigationType: string + navigationType: string; /** 需要基础库: `2.24.0` * * 代码包名称。仅 downloadPackage 指标有效。 */ - packageName: string + packageName: string; /** 需要基础库: `2.24.0` * * 代码包大小。仅 downloadPackage 指标有效。 */ - packageSize: number + packageSize: number; /** 需要基础库: `2.23.1` * * path 对应页面实例 Id(随机生成,不保证递增)。仅 render/navigation 指标有效。 */ - pageId: number + pageId: number; /** 页面路径。仅 render 和 navigation 类型指标有效。 */ - path: string + path: string; /** 需要基础库: `2.23.1` * * referrerPath对应页面实例 Id(随机生成,不保证递增)。仅 route 指标有效。 */ - referrerPageId: number + referrerPageId: number; /** 需要基础库: `2.23.1` * * 页面跳转来源页面路径。仅 route 指标有效。 */ - referrerPath: number + referrerPath: number; /** 开始时间,不同指标的具体含义会有差异。 */ - startTime: number + startTime: number; /** 需要基础库: `2.24.0` * * 表示获取资源的大小(以八位字节为单位)的数字。仅 resourceTiming 指标有效。(iOS 不支持) */ - transferSize: number + transferSize: number; /** 需要基础库: `2.24.0` * * 资源路径。仅 resourceTiming 指标有效。 */ - uri: string + uri: string; /** 需要基础库: `2.21.2` * * 渲染层代码注入完成时间。仅 firstRender 指标有效。 */ - viewLayerReadyTime: number + viewLayerReadyTime: number; /** 需要基础库: `2.21.2` * * 渲染层执行渲染结束时间。仅 firstRender 指标有效。 */ - viewLayerRenderEndTime: number + viewLayerRenderEndTime: number; /** 需要基础库: `2.21.2` * * 渲染层执行渲染开始时间。仅 firstRender 指标有效。 */ - viewLayerRenderStartTime: number + viewLayerRenderStartTime: number; } /** 需要基础库: `2.11.0` * * PerformanceObserver 对象,用于监听性能相关事件 */ interface PerformanceObserver { /** 获取当前支持的所有性能指标类型 */ - supportedEntryTypes: any[] + supportedEntryTypes: any[]; /** [PerformanceObserver.disconnect()](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceObserver.disconnect.html) * * 需要基础库: `2.11.0` @@ -9031,7 +8944,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 停止监听 */ - disconnect(): void + disconnect(): void; /** [PerformanceObserver.observe(Object options)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceObserver.observe.html) * * 需要基础库: `2.11.0` @@ -9041,8 +8954,8 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 开始监听 */ observe( /** 设置 type 监听单个类型的指标,设置 entryTypes 监听多个类型指标。 */ - options: ObserveOption - ): void + options: ObserveOption, + ): void; } /** 平面跟踪配置 */ interface PlaneTrack { @@ -9052,259 +8965,259 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 1: 检测横向平面; * - 2: 检测纵向平面,只有 v2 版本支持; * - 3: 检测横向和纵向平面,只有 v2 版本支持; */ - mode: 1 | 2 | 3 + mode: 1 | 2 | 3; } interface PlayBGMOption { /** 加入背景混音的资源地址 */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PlayBGMCompleteCallback + complete?: PlayBGMCompleteCallback; /** 需要基础库: `2.31.0` * * BGM结束播放时间点,单位ms,0代表播放至文件结尾,若入参为负或超过文件长度,则默认播放至文件结尾 */ - endTimeMs?: number + endTimeMs?: number; /** 接口调用失败的回调函数 */ - fail?: PlayBGMFailCallback + fail?: PlayBGMFailCallback; /** 需要基础库: `2.31.0` * * BGM开始播时间点,单位ms,若入参为负或超过文件长度,则默认从文件开头进行播放 */ - startTimeMs?: number + startTimeMs?: number; /** 接口调用成功的回调函数 */ - success?: PlayBGMSuccessCallback + success?: PlayBGMSuccessCallback; } interface PlayBackgroundAudioOption { /** 音乐链接,目前支持的格式有 m4a, aac, mp3, wav */ - dataUrl: string + dataUrl: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PlayBackgroundAudioCompleteCallback + complete?: PlayBackgroundAudioCompleteCallback; /** 封面URL */ - coverImgUrl?: string + coverImgUrl?: string; /** 接口调用失败的回调函数 */ - fail?: PlayBackgroundAudioFailCallback + fail?: PlayBackgroundAudioFailCallback; /** 接口调用成功的回调函数 */ - success?: PlayBackgroundAudioSuccessCallback + success?: PlayBackgroundAudioSuccessCallback; /** 音乐标题 */ - title?: string + title?: string; } interface PlayOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PlayCompleteCallback + complete?: PlayCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PlayFailCallback + fail?: PlayFailCallback; /** 接口调用成功的回调函数 */ - success?: PlaySuccessCallback + success?: PlaySuccessCallback; } interface PlayVoiceOption { /** 需要播放的语音文件的文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PlayVoiceCompleteCallback + complete?: PlayVoiceCompleteCallback; /** 需要基础库: `1.6.0` * * 指定播放时长,到达指定的播放时长后会自动停止播放,单位:秒 */ - duration?: number + duration?: number; /** 接口调用失败的回调函数 */ - fail?: PlayVoiceFailCallback + fail?: PlayVoiceFailCallback; /** 接口调用成功的回调函数 */ - success?: PlayVoiceSuccessCallback + success?: PlayVoiceSuccessCallback; } /** 插件账号信息(仅在插件中调用时包含这一项) */ interface Plugin { /** 插件 appId */ - appId: string + appId: string; /** 插件版本号 */ - version: string + version: string; } interface PluginLoginOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PluginLoginCompleteCallback + complete?: PluginLoginCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PluginLoginFailCallback + fail?: PluginLoginFailCallback; /** 接口调用成功的回调函数 */ - success?: PluginLoginSuccessCallback + success?: PluginLoginSuccessCallback; } interface PluginLoginSuccessCallbackResult { /** 用于换取 openpid 的凭证(有效期五分钟)。插件开发者可以用此 code 在开发者服务器后台调用 [getPluginOpenPId](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/basic-info/getPluginOpenPId.html) 换取 openpid。 */ - code: string - errMsg: string + code: string; + errMsg: string; } interface PostMessageToReferrerMiniProgramOption { /** 要打开的小程序 appId */ - extraData?: IAnyObject + extraData?: IAnyObject; } interface PreDownloadSubpackageOption { /** 分包加载结束回调事件(加载成功、失败都会执行) */ - complete: (...args: any[]) => any + complete: (...args: any[]) => any; /** 分包加载失败回调事件 */ - fail: (...args: any[]) => any + fail: (...args: any[]) => any; /** 分包的类型。目前仅支持填 "workers",表示 workers 分包。 */ - packageType: string + packageType: string; /** 分包加载成功回调事件 */ - success: (...args: any[]) => any + success: (...args: any[]) => any; } interface PreDownloadSubpackageTaskOnProgressUpdateListenerResult { /** 分包下载进度百分比 */ - progress: number + progress: number; /** 预期需要下载的数据总长度,单位 Bytes */ - totalBytesExpectedToWrite: number + totalBytesExpectedToWrite: number; /** 已经下载的数据长度,单位 Bytes */ - totalBytesWritten: number + totalBytesWritten: number; } interface PreloadAssetsOption { - data: Asset[] + data: Asset[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PreloadAssetsCompleteCallback + complete?: PreloadAssetsCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PreloadAssetsFailCallback + fail?: PreloadAssetsFailCallback; /** 接口调用成功的回调函数 */ - success?: PreloadAssetsSuccessCallback + success?: PreloadAssetsSuccessCallback; } interface PreloadSkylineViewOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PreloadSkylineViewCompleteCallback + complete?: PreloadSkylineViewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PreloadSkylineViewFailCallback + fail?: PreloadSkylineViewFailCallback; /** 接口调用成功的回调函数 */ - success?: PreloadSkylineViewSuccessCallback + success?: PreloadSkylineViewSuccessCallback; } interface PreloadWebviewOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PreloadWebviewCompleteCallback + complete?: PreloadWebviewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: PreloadWebviewFailCallback + fail?: PreloadWebviewFailCallback; /** 接口调用成功的回调函数 */ - success?: PreloadWebviewSuccessCallback + success?: PreloadWebviewSuccessCallback; } interface PreviewImageOption { /** 需要预览的图片链接列表。[2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持云文件ID。 */ - urls: string[] + urls: string[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PreviewImageCompleteCallback + complete?: PreviewImageCompleteCallback; /** 当前显示图片的链接 */ - current?: string + current?: string; /** 接口调用失败的回调函数 */ - fail?: PreviewImageFailCallback + fail?: PreviewImageFailCallback; /** 需要基础库: `2.13.0` * * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ - referrerPolicy?: string + referrerPolicy?: string; /** 需要基础库: `2.13.0` * * 是否显示长按菜单。 */ - showmenu?: boolean + showmenu?: boolean; /** 接口调用成功的回调函数 */ - success?: PreviewImageSuccessCallback + success?: PreviewImageSuccessCallback; } interface PreviewMediaOption { /** 需要预览的资源列表 */ - sources: MediaSource[] + sources: MediaSource[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: PreviewMediaCompleteCallback + complete?: PreviewMediaCompleteCallback; /** 当前显示的资源序号 */ - current?: number + current?: number; /** 接口调用失败的回调函数 */ - fail?: PreviewMediaFailCallback + fail?: PreviewMediaFailCallback; /** 需要基础库: `2.13.0` * * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ - referrerPolicy?: string + referrerPolicy?: string; /** 需要基础库: `2.13.0` * * 是否显示长按菜单。 */ - showmenu?: boolean + showmenu?: boolean; /** 接口调用成功的回调函数 */ - success?: PreviewMediaSuccessCallback + success?: PreviewMediaSuccessCallback; } /** 订单详细商品信息列表。 */ interface ProductInfo { /** 商户侧该商品所属的类目。示例值:玩偶 */ - category: string + category: string; /** 商品主图的url,大小建议64*64。示例值:https://mp.weixin.qq.com/123 */ - head_img: string + head_img: string; /** 该商品原价,单位为分。示例值:5000 */ - org_price: number + org_price: number; /** 商户商品详请页小程序路径。示例值:pages/index */ - path: string + path: string; /** 用户购买该商品的数量。示例值:5 */ - quantity: number + quantity: number; /** 该商品售价,单位为分。示例值:4000 */ - sale_price: number + sale_price: number; /** 商户系统内该商品的sku属性。示例值:50cm */ - sku_attr: string + sku_attr: string; /** 商户系统内该商品的skuid。示例值:sku123 */ - sku_id: string + sku_id: string; /** 商户系统内该商品的spuid。示例值:spu123456 */ - spu_id: string + spu_id: string; /** 商品标题。示例值:QQ长鹅 */ - title: string + title: string; } /** 推广员 */ interface PromoterResult { /** 推广员昵称 */ - finderNickname: string + finderNickname: string; /** 推广员 id */ - promoterId: string + promoterId: string; /** 推广员 openid */ - promoterOpenId: string + promoterOpenId: string; } interface ReLaunchOption { /** 需要跳转的应用内页面路径 (代码包路径),路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2' */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ReLaunchCompleteCallback + complete?: ReLaunchCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ReLaunchFailCallback + fail?: ReLaunchFailCallback; /** 接口调用成功的回调函数 */ - success?: ReLaunchSuccessCallback + success?: ReLaunchSuccessCallback; } interface ReadBLECharacteristicValueOption { /** 蓝牙特征的 UUID */ - characteristicId: string + characteristicId: string; /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 蓝牙特征对应服务的 UUID */ - serviceId: string + serviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ReadBLECharacteristicValueCompleteCallback + complete?: ReadBLECharacteristicValueCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ReadBLECharacteristicValueFailCallback + fail?: ReadBLECharacteristicValueFailCallback; /** 接口调用成功的回调函数 */ - success?: ReadBLECharacteristicValueSuccessCallback + success?: ReadBLECharacteristicValueSuccessCallback; } interface ReadCompressedFileOption { /** 文件压缩类型,目前仅支持 'br'。 * * 可选值: * - 'br': brotli压缩文件; */ - compressionAlgorithm: 'br' + compressionAlgorithm: 'br'; /** 要读取的文件的路径 (本地用户文件或代码包文件) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ReadCompressedFileCompleteCallback + complete?: ReadCompressedFileCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ReadCompressedFileFailCallback + fail?: ReadCompressedFileFailCallback; /** 接口调用成功的回调函数 */ - success?: ReadCompressedFileSuccessCallback + success?: ReadCompressedFileSuccessCallback; } interface ReadCompressedFileSuccessCallbackResult { /** 文件内容 */ - data: ArrayBuffer - errMsg: string + data: ArrayBuffer; + errMsg: string; } interface ReadCompressedFileSyncOption { /** 文件压缩类型,目前仅支持 'br'。 * * 可选值: * - 'br': brotli压缩文件; */ - compressionAlgorithm: 'br' + compressionAlgorithm: 'br'; /** 要读取的文件的路径 (本地用户文件或代码包文件) */ - filePath: string + filePath: string; } interface ReadFileOption { /** 要读取的文件的路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ReadFileCompleteCallback + complete?: ReadFileCompleteCallback; /** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 * * 可选值: @@ -9319,87 +9232,76 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | '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?: ReadFileFailCallback + fail?: ReadFileFailCallback; /** 需要基础库: `2.10.0` * * 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */ - length?: number + length?: number; /** 需要基础库: `2.10.0` * * 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */ - position?: number + position?: number; /** 接口调用成功的回调函数 */ - success?: ReadFileSuccessCallback + success?: ReadFileSuccessCallback; } interface ReadFileSuccessCallbackResult { /** 文件内容 */ - data: string | ArrayBuffer - errMsg: string + data: string | ArrayBuffer; + errMsg: string; } interface ReadOption { /** 数据写入的缓冲区,必须是 ArrayBuffer 实例 */ - arrayBuffer: ArrayBuffer + arrayBuffer: ArrayBuffer; /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ReadCompleteCallback + complete?: ReadCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ReadFailCallback + fail?: ReadFailCallback; /** 要从文件中读取的字节数,默认0 */ - length?: number + length?: number; /** 缓冲区中的写入偏移量,默认0 */ - offset?: number + offset?: number; /** 文件读取的起始位置,如不传或传 null,则会从当前文件指针的位置读取。如果 position 是正整数,则文件指针位置会保持不变并从 position 读取文件。 */ - position?: number + position?: number; /** 接口调用成功的回调函数 */ - success?: ReadSuccessCallback + success?: ReadSuccessCallback; } /** 文件读取结果。 通过 [FileSystemManager.readSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readSync.html) 接口返回 */ interface ReadResult { /** 被写入的缓存区的对象,即接口入参的 arrayBuffer */ - arrayBuffer: ArrayBuffer + arrayBuffer: ArrayBuffer; /** 实际读取的字节数 */ - bytesRead: number + bytesRead: number; } interface ReadSuccessCallbackResult { /** 被写入的缓存区的对象,即接口入参的 arrayBuffer */ - arrayBuffer: ArrayBuffer + arrayBuffer: ArrayBuffer; /** 实际读取的字节数 */ - bytesRead: number - errMsg: string + bytesRead: number; + errMsg: string; } interface ReadSyncOption { /** 数据写入的缓冲区,必须是 ArrayBuffer 实例 */ - arrayBuffer: ArrayBuffer + arrayBuffer: ArrayBuffer; /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; /** 要从文件中读取的字节数,默认0 */ - length?: number + length?: number; /** 缓冲区中的写入偏移量,默认0 */ - offset?: number + offset?: number; /** 文件读取的起始位置,如不传或传 null,则会从当前文件指针的位置读取。如果 position 是正整数,则文件指针位置会保持不变并从 position 读取文件。 */ - position?: number + position?: number; } interface ReadZipEntryOption { /** 要读取的压缩包内的文件列表(当传入"all" 时表示读取压缩包内所有文件) */ - entries: EntryItem[] | 'all' + entries: EntryItem[] | 'all'; /** 要读取的压缩包的路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ReadZipEntryCompleteCallback + complete?: ReadZipEntryCompleteCallback; /** 统一指定读取文件的字符编码,只在 entries 值为"all"时有效。如果 entries 值为"all"且不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 * * 可选值: @@ -9414,50 +9316,39 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | '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?: ReadZipEntryFailCallback + fail?: ReadZipEntryFailCallback; /** 接口调用成功的回调函数 */ - success?: ReadZipEntrySuccessCallback + success?: ReadZipEntrySuccessCallback; } interface ReadZipEntrySuccessCallbackResult { /** 文件读取结果。res.entries 是一个对象,key是文件路径,value是一个对象 FileItem ,表示该文件的读取结果。每个 FileItem 包含 data (文件内容) 和 errMsg (错误信息) 属性。 */ - entries: EntriesResult - errMsg: string + entries: EntriesResult; + errMsg: string; } interface ReaddirOption { /** 要读取的目录路径 (本地路径) */ - dirPath: string + dirPath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ReaddirCompleteCallback + complete?: ReaddirCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ReaddirFailCallback + fail?: ReaddirFailCallback; /** 接口调用成功的回调函数 */ - success?: ReaddirSuccessCallback + success?: ReaddirSuccessCallback; } interface ReaddirSuccessCallbackResult { /** 指定目录下的文件名数组。 */ - files: string[] - errMsg: string + files: string[]; + errMsg: string; } interface ReconnectCastingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ReconnectCastingCompleteCallback + complete?: ReconnectCastingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ReconnectCastingFailCallback + fail?: ReconnectCastingFailCallback; /** 接口调用成功的回调函数 */ - success?: ReconnectCastingSuccessCallback + success?: ReconnectCastingSuccessCallback; } interface RecorderManagerStartOption { /** 需要基础库: `2.1.0` @@ -9472,18 +9363,11 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'camcorder': 同 mic,适用于录制音视频内容,仅限 Android; * - 'voice_communication': 同 mic,适用于实时沟通,仅限 Android; * - 'voice_recognition': 同 mic,适用于语音识别,仅限 Android; */ - audioSource?: - | 'auto' - | 'buildInMic' - | 'headsetMic' - | 'mic' - | 'camcorder' - | 'voice_communication' - | 'voice_recognition' + audioSource?: 'auto' | 'buildInMic' | 'headsetMic' | 'mic' | 'camcorder' | 'voice_communication' | 'voice_recognition'; /** 录音的时长,单位 ms,最大值 600000(10 分钟) */ - duration?: number + duration?: number; /** 编码码率,有效值见下表格 */ - encodeBitRate?: number + encodeBitRate?: number; /** 音频格式 * * 可选值: @@ -9491,15 +9375,15 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'aac': aac 格式; * - 'wav': wav 格式; * - 'PCM': pcm 格式; */ - format?: 'mp3' | 'aac' | 'wav' | 'PCM' + format?: 'mp3' | 'aac' | 'wav' | 'PCM'; /** 指定帧大小,单位 KB。传入 frameSize 后,每录制指定帧大小的内容后,会回调录制的文件内容,不指定则不会回调。暂仅支持 mp3、pcm 格式。 */ - frameSize?: number + frameSize?: number; /** 录音通道数 * * 可选值: * - 1: 1 个通道; * - 2: 2 个通道; */ - numberOfChannels?: 1 | 2 + numberOfChannels?: 1 | 2; /** 采样率(pc不支持) * * 可选值: @@ -9512,166 +9396,157 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 32000: 32000 采样率; * - 44100: 44100 采样率; * - 48000: 48000 采样率; */ - sampleRate?: - | 8000 - | 11025 - | 12000 - | 16000 - | 22050 - | 24000 - | 32000 - | 44100 - | 48000 + sampleRate?: 8000 | 11025 | 12000 | 16000 | 22050 | 24000 | 32000 | 44100 | 48000; } interface RedirectToOption { /** 需要跳转的应用内非 tabBar 的页面的路径 (代码包路径), 路径后可以带参数。参数与路径之间使用 `?` 分隔,参数键与参数值用 `=` 相连,不同参数用 `&` 分隔;如 'path?key=value&key2=value2' */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RedirectToCompleteCallback + complete?: RedirectToCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RedirectToFailCallback + fail?: RedirectToFailCallback; /** 接口调用成功的回调函数 */ - success?: RedirectToSuccessCallback + success?: RedirectToSuccessCallback; } interface RedoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RedoCompleteCallback + complete?: RedoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RedoFailCallback + fail?: RedoFailCallback; /** 接口调用成功的回调函数 */ - success?: RedoSuccessCallback + success?: RedoSuccessCallback; } interface RefCallbackResult { /** 节点对应的 Ref 对象 */ - ref: IAnyObject + ref: IAnyObject; } /** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */ interface ReferrerInfo { /** 来源小程序、公众号或 App 的 appId */ - appId: string + appId: string; /** 来源小程序传过来的数据,scene=1037或1038时支持 */ - extraData: IAnyObject + extraData: IAnyObject; } /** 参照区域的边界 */ interface RelativeRectResult { /** 下边界 */ - bottom: number + bottom: number; /** 左边界 */ - left: number + left: number; /** 右边界 */ - right: number + right: number; /** 上边界 */ - top: number + top: number; } interface RemoveArcOption { /** 圆弧 id */ - id: number + id: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveArcCompleteCallback + complete?: RemoveArcCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveArcFailCallback + fail?: RemoveArcFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveArcSuccessCallback + success?: RemoveArcSuccessCallback; } interface RemoveCustomLayerOption { /** 个性化图层id */ - layerId: string + layerId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveCustomLayerCompleteCallback + complete?: RemoveCustomLayerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveCustomLayerFailCallback + fail?: RemoveCustomLayerFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveCustomLayerSuccessCallback + success?: RemoveCustomLayerSuccessCallback; } interface RemoveFormatOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveFormatCompleteCallback + complete?: RemoveFormatCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveFormatFailCallback + fail?: RemoveFormatFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveFormatSuccessCallback + success?: RemoveFormatSuccessCallback; } interface RemoveGroundOverlayOption { /** 图片图层 id */ - id: string + id: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveGroundOverlayCompleteCallback + complete?: RemoveGroundOverlayCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveGroundOverlayFailCallback + fail?: RemoveGroundOverlayFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveGroundOverlaySuccessCallback + success?: RemoveGroundOverlaySuccessCallback; } interface RemoveMarkersOption { /** marker 的 id 集合。 */ - markerIds: any[] + markerIds: any[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveMarkersCompleteCallback + complete?: RemoveMarkersCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveMarkersFailCallback + fail?: RemoveMarkersFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveMarkersSuccessCallback + success?: RemoveMarkersSuccessCallback; } interface RemoveSavedFileOption { /** 需要删除的文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveSavedFileCompleteCallback + complete?: RemoveSavedFileCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveSavedFileFailCallback + fail?: RemoveSavedFileFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveSavedFileSuccessCallback + success?: RemoveSavedFileSuccessCallback; } interface RemoveServiceOption { /** service 的 UUID */ - serviceId: string + serviceId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveServiceCompleteCallback + complete?: RemoveServiceCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveServiceFailCallback + fail?: RemoveServiceFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveServiceSuccessCallback + success?: RemoveServiceSuccessCallback; } interface RemoveStorageOption { /** 本地缓存中指定的 key */ - key: string + key: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveStorageCompleteCallback + complete?: RemoveStorageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveStorageFailCallback + fail?: RemoveStorageFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveStorageSuccessCallback + success?: RemoveStorageSuccessCallback; } interface RemoveTabBarBadgeOption { /** tabBar 的哪一项,从左边算起 */ - index: number + index: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveTabBarBadgeCompleteCallback + complete?: RemoveTabBarBadgeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveTabBarBadgeFailCallback + fail?: RemoveTabBarBadgeFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveTabBarBadgeSuccessCallback + success?: RemoveTabBarBadgeSuccessCallback; } interface RemoveVisualLayerOption { /** 可视化图层id */ - layerId: string + layerId: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RemoveVisualLayerCompleteCallback + complete?: RemoveVisualLayerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RemoveVisualLayerFailCallback + fail?: RemoveVisualLayerFailCallback; /** 接口调用成功的回调函数 */ - success?: RemoveVisualLayerSuccessCallback + success?: RemoveVisualLayerSuccessCallback; } interface RenameOption { /** 新文件路径,支持本地路径 */ - newPath: string + newPath: string; /** 源文件路径,支持本地路径 */ - oldPath: string + oldPath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RenameCompleteCallback + complete?: RenameCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RenameFailCallback + fail?: RenameFailCallback; /** 接口调用成功的回调函数 */ - success?: RenameSuccessCallback + success?: RenameSuccessCallback; } /** Canvas 绘图上下文。 * @@ -9688,47 +9563,47 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 interface RenderingContext {} interface RequestCommonPaymentFailCallbackErr { /** 错误信息 */ - errMsg: string + errMsg: string; /** 错误码 */ - errno: number + errno: number; } interface RequestCommonPaymentOption { /** 支付的类型 * * 可选值: * - 'retail_pay_goods': B2b支付; */ - mode: 'retail_pay_goods' + mode: 'retail_pay_goods'; /** 支付签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) */ - paySig: string + paySig: string; /** 具体支付参数见signData, 该参数需以string形式传递, 例如signData: '{"mchid":"1234567890","out_trade_no":"test1244","description":"测试测试","amount":{"order_amount":1,"currency":"CNY"},"attach":"test_attach","env":1}' */ - signData: RequestCommonPaymentSignData + signData: RequestCommonPaymentSignData; /** 用户态签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) */ - signature: string + signature: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestCommonPaymentCompleteCallback + complete?: RequestCommonPaymentCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestCommonPaymentFailCallback + fail?: RequestCommonPaymentFailCallback; /** 接口调用成功的回调函数 */ - success?: RequestCommonPaymentSuccessCallback + success?: RequestCommonPaymentSuccessCallback; } /** 具体支付参数见signData, 该参数需以string形式传递, 例如signData: '{"mchid":"1234567890","out_trade_no":"test1244","description":"测试测试","amount":{"order_amount":1,"currency":"CNY"},"attach":"test_attach","env":1}' */ interface RequestCommonPaymentSignData { /** 订单金额信息。 */ - amount: Amount + amount: Amount; /** 商品描述。示例值:Image形象店-深圳腾大-QQ公仔 */ - description: string + description: string; /** 下单环境。示例值:0 * * 可选值: * - 0: 生产环境/现网环境; * - 1: 沙箱环境/测试环境; */ - env: 0 | 1 + env: 0 | 1; /** 由微信支付生成并下发的商户号。示例值:1230000109 */ - mchid: string + mchid: string; /** 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一,长度限制为[6,32]。示例值:1217752501201407033233368018 */ - out_trade_no: string + out_trade_no: string; /** 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用,实际情况下只有支付完成状态才会返回该字段。示例值:test_attach */ - attach?: string + attach?: string; /** 配送方式。示例值:2 * * 可选值: @@ -9736,129 +9611,124 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 2: 快递配送; * - 3: 门店自提; * - 4: 无需配送与提货; */ - delivery_type?: 1 | 2 | 3 | 4 + delivery_type?: 1 | 2 | 3 | 4; /** 订单详细商品信息列表。 */ - product_info?: ProductInfo + product_info?: ProductInfo; } interface RequestCommonPaymentSuccessCallbackResult { /** 调用成功信息 */ - errMsg: string + errMsg: string; } interface RequestDeviceVoIPOption { /** 设备名称,将显示在授权弹窗内(长度不超过13)。授权框中「设备名字」= 「deviceName」 + 「modelId 对应设备型号」。 */ - deviceName: string + deviceName: string; /** 需要基础库: `2.30.4` * * 设备组的唯一标识 id 。isGroup 为 true 时只需要传该参数,isGroup 为 false 时不需要传该参数,但需要传 sn、snTicket、modelId、deviceName 。 */ - groupId: string + groupId: string; /** 设备型号 id。通过微信公众平台注册设备获得。 */ - modelId: string + modelId: string; /** 设备唯一序列号。由厂商分配,长度不能超过128字节。字符只接受数字,大小写字母,下划线(_)和连字符(-)。 */ - sn: string + sn: string; /** [设备票据](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/getSnTicket.html),5分钟内有效。 */ - snTicket: string + snTicket: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestDeviceVoIPCompleteCallback + complete?: RequestDeviceVoIPCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestDeviceVoIPFailCallback + fail?: RequestDeviceVoIPFailCallback; /** 需要基础库: `2.30.4` * * 是否为授权设备组,默认 false 。 */ - isGroup?: boolean + isGroup?: boolean; /** 接口调用成功的回调函数 */ - success?: RequestDeviceVoIPSuccessCallback + success?: RequestDeviceVoIPSuccessCallback; } /** 需要基础库: `3.0.0` * * 网络请求过程中的一些异常信息,例如httpdns重试等 */ interface RequestException { /** 本次请求底层失败信息,所有失败信息均符合Errno错误码 */ - reasons: ExceptionReason[] + reasons: ExceptionReason[]; /** 本次请求底层重试次数 */ - retryCount: number + retryCount: number; } interface RequestFailCallbackErr { /** 错误信息 */ - errMsg: string + errMsg: string; /** 需要基础库: `2.24.0` * * errno 错误码,错误码的详细说明参考 [Errno错误码](https://developers.weixin.qq.com/miniprogram/dev/framework/usability/PublicErrno.html) */ - errno: number + errno: number; } interface RequestMerchantTransferOption { /** 商户号 */ - mchId: string + mchId: string; /** 商家转账付款单跳转收款页 pkg 信息,商家转账付款单受理成功时返回给商户 */ - package: string + package: string; /** 商户 appId,普通模式下必填,服务商模式下,appId 和 subAppId 二选一填写 */ - appId?: string + appId?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestMerchantTransferCompleteCallback + complete?: RequestMerchantTransferCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestMerchantTransferFailCallback + fail?: RequestMerchantTransferFailCallback; /** 收款用户 openId, 对应传入的商户 appId 下,某用户的 openId */ - openId?: string + openId?: string; /** 子商户 appId,服务商模式下,appId 和 subAppId 二选一填写 */ - subAppId?: string + subAppId?: string; /** 子商户号,服务商模式下必填 */ - subMchId?: string + subMchId?: string; /** 接口调用成功的回调函数 */ - success?: RequestMerchantTransferSuccessCallback + success?: RequestMerchantTransferSuccessCallback; } - interface RequestOption< - T extends string | IAnyObject | ArrayBuffer = - | string - | IAnyObject - | ArrayBuffer - > { + interface RequestOption { /** 开发者服务器接口地址 */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestCompleteCallback + complete?: RequestCompleteCallback; /** 请求的参数 */ - data?: string | IAnyObject | ArrayBuffer + data?: string | IAnyObject | ArrayBuffer; /** 返回的数据格式 * * 可选值: * - 'json': 返回的数据为 JSON,返回后会对返回的数据进行一次 JSON.parse; * - '其他': 不对返回的内容进行 JSON.parse; */ - dataType?: 'json' | '其他' + dataType?: 'json' | '其他'; /** 需要基础库: `2.10.4` * * 开启 Http 缓存 */ - enableCache?: boolean + enableCache?: boolean; /** 需要基础库: `2.20.2` * * 开启 transfer-encoding chunked。 */ - enableChunked?: boolean + enableChunked?: boolean; /** 需要基础库: `2.10.4` * * 开启 http2 */ - enableHttp2?: boolean + enableHttp2?: boolean; /** 需要基础库: `2.19.1` * * 是否开启 HttpDNS 服务。如开启,需要同时填入 httpDNSServiceId 。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html) */ - enableHttpDNS?: boolean + enableHttpDNS?: boolean; /** 是否开启 profile,默认开启。开启后可在接口回调的 res.profile 中查看性能调试信息。 */ - enableProfile?: boolean + enableProfile?: boolean; /** 需要基础库: `2.10.4` * * 开启 Quic 协议(gQUIC Q43) */ - enableQuic?: boolean + enableQuic?: boolean; /** 接口调用失败的回调函数 */ - fail?: RequestFailCallback + fail?: RequestFailCallback; /** 需要基础库: `2.21.0` * * 强制使用蜂窝网络发送请求 */ - forceCellularNetwork?: boolean + forceCellularNetwork?: boolean; /** 设置请求的 header,header 中不能设置 Referer。 * * `content-type` 默认为 `application/json` */ - header?: IAnyObject + header?: IAnyObject; /** 需要基础库: `2.19.1` * * HttpDNS 服务商 Id。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html) */ - httpDNSServiceId?: string + httpDNSServiceId?: string; /** HTTP 请求方法 * * 可选值: @@ -9870,15 +9740,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'DELETE': HTTP 请求 DELETE; * - 'TRACE': HTTP 请求 TRACE; * - 'CONNECT': HTTP 请求 CONNECT; */ - method?: - | 'OPTIONS' - | 'GET' - | 'HEAD' - | 'POST' - | 'PUT' - | 'DELETE' - | 'TRACE' - | 'CONNECT' + method?: 'OPTIONS' | 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'CONNECT'; /** 需要基础库: `3.2.2` * * 重定向拦截策略。(目前安卓、iOS、开发者工具已支持,PC端将在后续支持) @@ -9886,7 +9748,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'follow': 不拦截重定向,即客户端自动处理重定向; * - 'manual': 拦截重定向。开启后,当 http 状态码为 3xx 时客户端不再自动重定向,而是触发 onHeadersReceived 回调,并结束本次 request 请求。可通过 onHeadersReceived 回调中的 header.Location 获取重定向的 url; */ - redirect?: 'follow' | 'manual' + redirect?: 'follow' | 'manual'; /** 需要基础库: `1.7.0` * * 响应的数据类型 @@ -9894,245 +9756,240 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'text': 响应的数据为文本; * - 'arraybuffer': 响应的数据为 ArrayBuffer; */ - responseType?: 'text' | 'arraybuffer' + responseType?: 'text' | 'arraybuffer'; /** 接口调用成功的回调函数 */ - success?: RequestSuccessCallback + success?: RequestSuccessCallback; /** 需要基础库: `2.10.0` * * 超时时间,单位为毫秒。默认值为 60000 */ - timeout?: number + timeout?: number; /** 需要基础库: `3.3.3` * * 使用高性能模式,暂仅支持 Android,默认关闭。该模式下有更优的网络性能表现,更多信息请查看下方说明。 */ - useHighPerformanceMode?: boolean + useHighPerformanceMode?: boolean; } interface RequestOrderPaymentOption { /** 随机字符串,长度为32个字符以下 */ - nonceStr: string + nonceStr: string; /** 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=*** */ - package: string + package: string; /** 签名,具体见微信支付文档 */ - paySign: string + paySign: string; /** 时间戳,从 1970 年 1 月 1 日 00:00:00 至今的秒数,即当前的时间 */ - timeStamp: string + timeStamp: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestOrderPaymentCompleteCallback + complete?: RequestOrderPaymentCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestOrderPaymentFailCallback + fail?: RequestOrderPaymentFailCallback; /** 签名算法,应与后台下单时的值一致 * * 可选值: * - 'MD5': 仅在 v2 版本接口适用; * - 'HMAC-SHA256': 仅在 v2 版本接口适用; * - 'RSA': 仅在 v3 版本接口适用; */ - signType?: 'MD5' | 'HMAC-SHA256' | 'RSA' + signType?: 'MD5' | 'HMAC-SHA256' | 'RSA'; /** 接口调用成功的回调函数 */ - success?: RequestOrderPaymentSuccessCallback + success?: RequestOrderPaymentSuccessCallback; } interface RequestPaymentOption { /** 随机字符串,长度为32个字符以下 */ - nonceStr: string + nonceStr: string; /** 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=*** */ - package: string + package: string; /** 签名,具体见微信支付文档 */ - paySign: string + paySign: string; /** 时间戳,从 1970 年 1 月 1 日 00:00:00 至今的秒数,即当前的时间 */ - timeStamp: string + timeStamp: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestPaymentCompleteCallback + complete?: RequestPaymentCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestPaymentFailCallback + fail?: RequestPaymentFailCallback; /** 签名算法,应与后台下单时的值一致 * * 可选值: * - 'MD5': 仅在 v2 版本接口适用; * - 'HMAC-SHA256': 仅在 v2 版本接口适用; * - 'RSA': 仅在 v3 版本接口适用; */ - signType?: 'MD5' | 'HMAC-SHA256' | 'RSA' + signType?: 'MD5' | 'HMAC-SHA256' | 'RSA'; /** 接口调用成功的回调函数 */ - success?: RequestPaymentSuccessCallback + success?: RequestPaymentSuccessCallback; } interface RequestPictureInPictureOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestPictureInPictureCompleteCallback + complete?: RequestPictureInPictureCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestPictureInPictureFailCallback + fail?: RequestPictureInPictureFailCallback; /** 接口调用成功的回调函数 */ - success?: RequestPictureInPictureSuccessCallback + success?: RequestPictureInPictureSuccessCallback; } interface RequestPluginPaymentOption { /** 需要显示在页面中的金额,单位为分 */ - fee: number + fee: number; /** 任意数据,传递给功能页中的响应函数 */ - paymentArgs: IAnyObject + paymentArgs: IAnyObject; /** 插件版本 * * 可选值: * - 'develop': 开发版; * - 'trial': 体验版; * - 'release': 正式版; */ - version: 'develop' | 'trial' | 'release' + version: 'develop' | 'trial' | 'release'; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestPluginPaymentCompleteCallback + complete?: RequestPluginPaymentCompleteCallback; /** 需要显示在页面中的货币符号的代码 */ - currencyType?: string + currencyType?: string; /** 接口调用失败的回调函数 */ - fail?: RequestPluginPaymentFailCallback + fail?: RequestPluginPaymentFailCallback; /** 接口调用成功的回调函数 */ - success?: RequestPluginPaymentSuccessCallback + success?: RequestPluginPaymentSuccessCallback; } /** 需要基础库: `2.10.4` * * 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) */ interface RequestProfile { /** SSL建立完成的时间,如果不是安全连接,则值为 0 */ - SSLconnectionEnd: number + SSLconnectionEnd: number; /** SSL建立连接的时间,如果不是安全连接,则值为 0 */ - SSLconnectionStart: number + SSLconnectionStart: number; /** HTTP(TCP) 完成建立连接的时间(完成握手),如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接完成的时间。注意这里握手结束,包括安全连接建立完成、SOCKS 授权通过 */ - connectEnd: number + connectEnd: number; /** HTTP(TCP) 开始建立连接的时间,如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接开始的时间 */ - connectStart: number + connectStart: number; /** DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 */ - domainLookUpEnd: number + domainLookUpEnd: number; /** DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 */ - domainLookUpStart: number + domainLookUpStart: number; /** 评估当前网络下载的kbps */ - downstreamThroughputKbpsEstimate: number + downstreamThroughputKbpsEstimate: number; /** 评估的网络状态 unknown, offline, slow 2g, 2g, 3g, 4g, last/0, 1, 2, 3, 4, 5, 6 */ - estimate_nettype: number + estimate_nettype: number; /** 组件准备好使用 HTTP 请求抓取资源的时间,这发生在检查本地缓存之前 */ - fetchStart: number + fetchStart: number; /** 协议层根据多个请求评估当前网络的 rtt(仅供参考) */ - httpRttEstimate: number + httpRttEstimate: number; /** 当前请求的IP */ - peerIP: string + peerIP: string; /** 当前请求的端口 */ - port: number + port: number; /** 使用协议类型,有效值:http1.1, h2, quic, unknown */ - protocol: string + protocol: string; /** 收到字节数 */ - receivedBytedCount: number + receivedBytedCount: number; /** 最后一个 HTTP 重定向完成时的时间。有跳转且是同域名内部的重定向才算,否则值为 0 */ - redirectEnd: number + redirectEnd: number; /** 第一个 HTTP 重定向发生时的时间。有跳转且是同域名内的重定向才算,否则值为 0 */ - redirectStart: number + redirectStart: number; /** HTTP请求读取真实文档结束的时间 */ - requestEnd: number + requestEnd: number; /** HTTP请求读取真实文档开始的时间(完成建立连接),包括从本地读取缓存。连接错误重连时,这里显示的也是新建立连接的时间 */ - requestStart: number + requestStart: number; /** HTTP 响应全部接收完成的时间(获取到最后一个字节),包括从本地读取缓存 */ - responseEnd: number + responseEnd: number; /** HTTP 开始接收响应的时间(获取到第一个字节),包括从本地读取缓存 */ - responseStart: number + responseStart: number; /** 当次请求连接过程中实时 rtt */ - rtt: number + rtt: number; /** 发送的字节数 */ - sendBytesCount: number + sendBytesCount: number; /** 是否复用连接 */ - socketReused: boolean + socketReused: boolean; /** 当前网络的实际下载kbps */ - throughputKbps: number + throughputKbps: number; /** 传输层根据多个请求评估的当前网络的 rtt(仅供参考) */ - transportRttEstimate: number + transportRttEstimate: number; /** 是否走到了高性能模式。基础库 v3.3.4 起支持。 */ - usingHighPerformanceMode: boolean + usingHighPerformanceMode: boolean; } interface RequestSubscribeDeviceMessageFailCallbackResult { /** 接口调用失败错误码,有可能为空 */ - errCode: number + errCode: number; /** 接口调用失败错误信息 */ - errMsg: string + errMsg: string; } interface RequestSubscribeDeviceMessageOption { /** 设备型号 id 。通过微信公众平台注册设备获得。 */ - modelId: string + modelId: string; /** 设备唯一序列号。由厂商分配,长度不能超过128字节。字符只接受数字,大小写字母,下划线(_)和连字符(-)。 */ - sn: string + sn: string; /** 设备票据,5分钟内有效。 */ - snTicket: string + snTicket: string; /** 需要订阅的消息模板的 id 的集合,一次调用最多可订阅3条消息 */ - tmplIds: any[] + tmplIds: any[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestSubscribeDeviceMessageCompleteCallback + complete?: RequestSubscribeDeviceMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestSubscribeDeviceMessageFailCallback + fail?: RequestSubscribeDeviceMessageFailCallback; /** 接口调用成功的回调函数 */ - success?: RequestSubscribeDeviceMessageSuccessCallback + success?: RequestSubscribeDeviceMessageSuccessCallback; } interface RequestSubscribeDeviceMessageSuccessCallbackResult { /** [TEMPLATE_ID]是动态的键,即模板id,值包括'accept'、'reject'、'ban'、'filter'、'acceptWithAudio'。'accept'表示用户同意订阅该条id对应的模板消息,'reject'表示用户拒绝订阅该条id对应的模板消息,'ban'表示已被后台封禁,'acceptWithAudio' 表示用户接收订阅消息并开启了语音提醒,'filter'表示该模板因为模板标题同名被后台过滤。例如 { errMsg: "requestSubscribeDeviceMessage:ok", zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: "accept"} 表示用户同意订阅zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE这条消息 */ - [TEMPLATE_ID: string]: string + [TEMPLATE_ID: string]: string; /** 接口调用成功时errMsg值为'requestSubscribeDeviceMessage:ok' */ - errMsg: string + errMsg: string; } interface RequestSubscribeMessageFailCallbackResult { /** 接口调用失败错误码 */ - errCode: number + errCode: number; /** 接口调用失败错误信息 */ - errMsg: string + errMsg: string; } interface RequestSubscribeMessageOption { /** 需要订阅的消息模板的id的集合,一次调用最多可订阅3条消息(注意:iOS客户端7.0.6版本、Android客户端7.0.7版本之后的一次性订阅/长期订阅才支持多个模板消息,iOS客户端7.0.5版本、Android客户端7.0.6版本之前的一次订阅只支持一个模板消息)消息模板id在[微信公众平台(mp.weixin.qq.com)-功能-订阅消息]中配置。每个tmplId对应的模板标题需要不相同,否则会被过滤。 */ - tmplIds: any[] + tmplIds: any[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestSubscribeMessageCompleteCallback + complete?: RequestSubscribeMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestSubscribeMessageFailCallback + fail?: RequestSubscribeMessageFailCallback; /** 接口调用成功的回调函数 */ - success?: RequestSubscribeMessageSuccessCallback + success?: RequestSubscribeMessageSuccessCallback; } interface RequestSubscribeMessageSuccessCallbackResult { /** [TEMPLATE_ID]是动态的键,即模板id,值包括'accept'、'reject'、'ban'、'filter'。'accept'表示用户同意订阅该条id对应的模板消息,'reject'表示用户拒绝订阅该条id对应的模板消息,'ban'表示已被后台封禁,'filter'表示该模板因为模板标题同名被后台过滤。例如 { errMsg: "requestSubscribeMessage:ok", zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: "accept"} 表示用户同意订阅zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE这条消息 */ - [TEMPLATE_ID: string]: string + [TEMPLATE_ID: string]: string; /** 接口调用成功时errMsg值为'requestSubscribeMessage:ok' */ - errMsg: string + errMsg: string; } - interface RequestSuccessCallbackResult< - T extends string | IAnyObject | ArrayBuffer = - | string - | IAnyObject - | ArrayBuffer - > { + interface RequestSuccessCallbackResult { /** 需要基础库: `2.10.0` * * 开发者服务器返回的 cookies,格式为字符串数组 */ - cookies: string[] + cookies: string[]; /** 开发者服务器返回的数据 */ - data: T + data: T; /** 需要基础库: `3.0.0` * * 网络请求过程中的一些异常信息,例如httpdns重试等 */ - exception: RequestException + exception: RequestException; /** 需要基础库: `1.2.0` * * 开发者服务器返回的 HTTP Response Header */ - header: IAnyObject + header: IAnyObject; /** 需要基础库: `2.10.4` * * 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) */ - profile: RequestProfile + profile: RequestProfile; /** 开发者服务器返回的 HTTP 状态码 */ - statusCode: number + statusCode: number; /** 需要基础库: `3.4.10` * * 最终请求是否使用了HttpDNS(仅当enableHttpDNS传true时返回此字段) */ - useHttpDNS: boolean - errMsg: string + useHttpDNS: boolean; + errMsg: string; } interface RequestTaskOnHeadersReceivedListenerResult { /** 开发者服务器返回的 cookies,格式为字符串数组 */ - cookies: string[] + cookies: string[]; /** 开发者服务器返回的 HTTP Response Header */ - header: IAnyObject + header: IAnyObject; /** 开发者服务器返回的 HTTP 状态码 (目前开发者工具上不会返回 statusCode 字段,可用真机查看该字段,后续将会支持) */ - statusCode: number + statusCode: number; } interface RequestVirtualPaymentFailCallbackErr { /** 错误码 */ - errCode: number + errCode: number; /** 错误信息 */ - errMsg: string + errMsg: string; } interface RequestVirtualPaymentOption { /** 支付的类型, 不同的支付类型有各自额外要传的附加参数 @@ -10140,63 +9997,63 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * 可选值: * - 'short_series_goods': 道具直购; * - 'short_series_coin': 代币充值; */ - mode: 'short_series_goods' | 'short_series_coin' + mode: 'short_series_goods' | 'short_series_coin'; /** 支付签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) */ - paySig: string + paySig: string; /** 具体支付参数见signData, 该参数需以string形式传递, 例如signData: '{"offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}' */ - signData: SignData + signData: SignData; /** 用户态签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) */ - signature: string + signature: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequestVirtualPaymentCompleteCallback + complete?: RequestVirtualPaymentCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequestVirtualPaymentFailCallback + fail?: RequestVirtualPaymentFailCallback; /** 接口调用成功的回调函数 */ - success?: RequestVirtualPaymentSuccessCallback + success?: RequestVirtualPaymentSuccessCallback; } interface RequirePrivacyAuthorizeOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RequirePrivacyAuthorizeCompleteCallback + complete?: RequirePrivacyAuthorizeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RequirePrivacyAuthorizeFailCallback + fail?: RequirePrivacyAuthorizeFailCallback; /** 接口调用成功的回调函数 */ - success?: RequirePrivacyAuthorizeSuccessCallback + success?: RequirePrivacyAuthorizeSuccessCallback; } interface ReserveChannelsLiveOption { /** 预告 id,通过 getChannelsLiveNoticeInfo 接口获取 */ - noticeId: string + noticeId: string; } interface RestartMiniProgramOption { /** 打开的页面路径,path 中 ? 后面的部分会成为 query */ - path: string + path: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RestartMiniProgramCompleteCallback + complete?: RestartMiniProgramCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RestartMiniProgramFailCallback + fail?: RestartMiniProgramFailCallback; /** 接口调用成功的回调函数 */ - success?: RestartMiniProgramSuccessCallback + success?: RestartMiniProgramSuccessCallback; } interface ResumeBGMOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResumeBGMCompleteCallback + complete?: ResumeBGMCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ResumeBGMFailCallback + fail?: ResumeBGMFailCallback; /** 接口调用成功的回调函数 */ - success?: ResumeBGMSuccessCallback + success?: ResumeBGMSuccessCallback; } interface ResumeOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ResumeCompleteCallback + complete?: ResumeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ResumeFailCallback + fail?: ResumeFailCallback; /** 接口调用成功的回调函数 */ - success?: ResumeSuccessCallback + success?: ResumeSuccessCallback; } interface RewardedVideoAdOnCloseListenerResult { /** 需要基础库: `2.1.0` * * 视频是否是在用户完整观看的情况下被关闭的 */ - isEnded: boolean + isEnded: boolean; } interface RewardedVideoAdOnErrorListenerResult { /** 需要基础库: `2.2.2` @@ -10213,102 +10070,102 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 1006: 广告组件被驳回; * - 1007: 广告组件被封禁; * - 1008: 广告单元已关闭; */ - errCode: 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 + errCode: 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008; /** 错误信息 */ - errMsg: string + errMsg: string; } interface RmdirOption { /** 要删除的目录路径 (本地路径) */ - dirPath: string + dirPath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: RmdirCompleteCallback + complete?: RmdirCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: RmdirFailCallback + fail?: RmdirFailCallback; /** 需要基础库: `2.3.0` * * 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 */ - recursive?: boolean + recursive?: boolean; /** 接口调用成功的回调函数 */ - success?: RmdirSuccessCallback + success?: RmdirSuccessCallback; } interface RunOCROption { /** 待识别图像的像素点数据,每四项表示一个像素点的 RGBA */ - frameBuffer: ArrayBuffer + frameBuffer: ArrayBuffer; /** 图像高度 */ - height: number + height: number; /** 图像宽度 */ - width: number + width: number; } interface SafeArea { /** 安全区域右下角纵坐标 */ - bottom: number + bottom: number; /** 安全区域的高度,单位逻辑像素 */ - height: number + height: number; /** 安全区域左上角横坐标 */ - left: number + left: number; /** 安全区域右下角横坐标 */ - right: number + right: number; /** 安全区域左上角纵坐标 */ - top: number + top: number; /** 安全区域的宽度,单位逻辑像素 */ - width: number + width: number; } interface SaveFileOption { /** 临时存储文件路径 (本地路径) */ - tempFilePath: string + tempFilePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SaveFileCompleteCallback + complete?: SaveFileCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SaveFileFailCallback + fail?: SaveFileFailCallback; /** 要存储的文件路径 (本地路径) */ - filePath?: string + filePath?: string; /** 接口调用成功的回调函数 */ - success?: SaveFileSuccessCallback + success?: SaveFileSuccessCallback; } interface SaveFileSuccessCallbackResult { /** 存储后的文件路径 (本地路径) */ - savedFilePath: string - errMsg: string + savedFilePath: string; + errMsg: string; } interface SaveFileToDiskOption { /** 待保存文件路径 */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SaveFileToDiskCompleteCallback + complete?: SaveFileToDiskCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SaveFileToDiskFailCallback + fail?: SaveFileToDiskFailCallback; /** 接口调用成功的回调函数 */ - success?: SaveFileToDiskSuccessCallback + success?: SaveFileToDiskSuccessCallback; } interface SaveImageToPhotosAlbumOption { /** 图片文件路径,可以是临时文件路径或永久文件路径 (本地路径) ,不支持网络路径 */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SaveImageToPhotosAlbumCompleteCallback + complete?: SaveImageToPhotosAlbumCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SaveImageToPhotosAlbumFailCallback + fail?: SaveImageToPhotosAlbumFailCallback; /** 接口调用成功的回调函数 */ - success?: SaveImageToPhotosAlbumSuccessCallback + success?: SaveImageToPhotosAlbumSuccessCallback; } interface SaveVideoToPhotosAlbumOption { /** 视频文件路径,可以是临时文件路径也可以是永久文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SaveVideoToPhotosAlbumCompleteCallback + complete?: SaveVideoToPhotosAlbumCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SaveVideoToPhotosAlbumFailCallback + fail?: SaveVideoToPhotosAlbumFailCallback; /** 接口调用成功的回调函数 */ - success?: SaveVideoToPhotosAlbumSuccessCallback + success?: SaveVideoToPhotosAlbumSuccessCallback; } interface ScanCodeOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ScanCodeCompleteCallback + complete?: ScanCodeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ScanCodeFailCallback + fail?: ScanCodeFailCallback; /** 需要基础库: `1.2.0` * * 是否只能从相机扫码,不允许从相册选择图片 */ - onlyFromCamera?: boolean + onlyFromCamera?: boolean; /** 需要基础库: `1.7.0` * * 扫码类型 @@ -10318,19 +10175,19 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 * - 'qrCode': 二维码; * - 'datamatrix': Data Matrix 码; * - 'pdf417': PDF417 条码; */ - scanType?: Array<'barCode' | 'qrCode' | 'datamatrix' | 'pdf417'> + scanType?: Array<'barCode' | 'qrCode' | 'datamatrix' | 'pdf417'>; /** 接口调用成功的回调函数 */ - success?: ScanCodeSuccessCallback + success?: ScanCodeSuccessCallback; } interface ScanCodeSuccessCallbackResult { /** 所扫码的字符集 */ - charSet: string + charSet: string; /** 当所扫的码为当前小程序二维码时,会返回此字段,内容为二维码携带的 path */ - path: string + path: string; /** 原始数据,base64编码 */ - rawData: string + rawData: string; /** 所扫码的内容 */ - result: string + result: string; /** 所扫码的类型 * * 可选值: @@ -10372,18 +10229,18 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对 | 'UPC_E' | 'UPC_EAN_EXTENSION' | 'WX_CODE' - | 'CODE_25' - errMsg: string + | 'CODE_25'; + errMsg: string; } interface ScrollOffsetCallbackResult { /** 节点的 dataset */ - dataset: IAnyObject + dataset: IAnyObject; /** 节点的 ID */ - id: string + id: string; /** 节点的水平滚动位置 */ - scrollLeft: number + scrollLeft: number; /** 节点的竖直滚动位置 */ - scrollTop: number + scrollTop: number; } /** 需要基础库: `2.14.4` * @@ -10402,17 +10259,17 @@ wx.createSelectorQuery() ``` */ interface ScrollViewContext { /** 设置滚动边界弹性 (仅在 iOS 下生效) */ - bounces: boolean + bounces: boolean; /** 取消滚动惯性 (仅在 iOS 下生效) */ - decelerationDisabled: boolean + decelerationDisabled: boolean; /** 设置滚动减速速率 (仅在 iOS 下生效) */ - fastDeceleration: boolean + fastDeceleration: boolean; /** 分页滑动开关 */ - pagingEnabled: boolean + pagingEnabled: boolean; /** 滚动开关 */ - scrollEnabled: boolean + scrollEnabled: boolean; /** 设置是否显示滚动条 */ - showScrollbar: boolean + showScrollbar: boolean; /** [ScrollViewContext.closeRefresh()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.closeRefresh.html) * * 需要基础库: `3.0.0` @@ -10420,7 +10277,7 @@ wx.createSelectorQuery() * 在插件中使用:支持 * * 关闭下拉刷新。 */ - closeRefresh(): void + closeRefresh(): void; /** [ScrollViewContext.closeTwoLevel(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.closeTwoLevel.html) * * 需要基础库: `3.0.0` @@ -10428,7 +10285,7 @@ wx.createSelectorQuery() * 在插件中使用:支持 * * 关闭下拉二级。 */ - closeTwoLevel(option: TriggerRefreshOption): void + closeTwoLevel(option: TriggerRefreshOption): void; /** [ScrollViewContext.scrollIntoView(string selector, object ScrollIntoViewOptions)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.scrollIntoView.html) * * 需要基础库: `2.14.4` @@ -10442,8 +10299,8 @@ wx.createSelectorQuery() /** 需要基础库: `3.1.0` * * 配置项,仅 Skyine 模式支持 */ - ScrollIntoViewOptions: IAnyObject - ): void + ScrollIntoViewOptions: IAnyObject, + ): void; /** [ScrollViewContext.scrollTo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.scrollTo.html) * * 需要基础库: `2.14.4` @@ -10451,7 +10308,7 @@ wx.createSelectorQuery() * 在插件中使用:支持 * * 滚动至指定位置 */ - scrollTo(option: ScrollViewContextScrollToOption): void + scrollTo(option: ScrollViewContextScrollToOption): void; /** [ScrollViewContext.triggerRefresh(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.triggerRefresh.html) * * 需要基础库: `3.0.0` @@ -10459,7 +10316,7 @@ wx.createSelectorQuery() * 在插件中使用:支持 * * 触发下拉刷新。 */ - triggerRefresh(option: TriggerRefreshOption): void + triggerRefresh(option: TriggerRefreshOption): void; /** [ScrollViewContext.triggerTwoLevel(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.triggerTwoLevel.html) * * 需要基础库: `3.0.0` @@ -10467,126 +10324,126 @@ wx.createSelectorQuery() * 在插件中使用:支持 * * 触发下拉二级。 */ - triggerTwoLevel(option: TriggerRefreshOption): void + triggerTwoLevel(option: TriggerRefreshOption): void; } interface ScrollViewContextScrollToOption { /** 是否启用滚动动画 */ - animated?: boolean + animated?: boolean; /** 滚动动画时长 (仅在 iOS 下生效) */ - duration?: number + duration?: number; /** 左边界距离 */ - left?: number + left?: number; /** 顶部距离 */ - top?: number + top?: number; /** 初始速度 (仅在 iOS 下生效) */ - velocity?: number + velocity?: number; } interface SeekBackgroundAudioOption { /** 音乐位置,单位:秒 */ - position: number + position: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SeekBackgroundAudioCompleteCallback + complete?: SeekBackgroundAudioCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SeekBackgroundAudioFailCallback + fail?: SeekBackgroundAudioFailCallback; /** 接口调用成功的回调函数 */ - success?: SeekBackgroundAudioSuccessCallback + success?: SeekBackgroundAudioSuccessCallback; } interface SendHCEMessageOption { /** 二进制数据 */ - data: ArrayBuffer + data: ArrayBuffer; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SendHCEMessageCompleteCallback + complete?: SendHCEMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SendHCEMessageFailCallback + fail?: SendHCEMessageFailCallback; /** 接口调用成功的回调函数 */ - success?: SendHCEMessageSuccessCallback + success?: SendHCEMessageSuccessCallback; } interface SendMessageOption { /** SEI消息 */ - msg: string + msg: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SendMessageCompleteCallback + complete?: SendMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SendMessageFailCallback + fail?: SendMessageFailCallback; /** 接口调用成功的回调函数 */ - success?: SendMessageSuccessCallback + success?: SendMessageSuccessCallback; } interface SendSmsOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SendSmsCompleteCallback + complete?: SendSmsCompleteCallback; /** 预填到发送短信面板的内容 */ - content?: string + content?: string; /** 接口调用失败的回调函数 */ - fail?: SendSmsFailCallback + fail?: SendSmsFailCallback; /** 预填到发送短信面板的手机号 */ - phoneNumber?: string + phoneNumber?: string; /** 接口调用成功的回调函数 */ - success?: SendSmsSuccessCallback + success?: SendSmsSuccessCallback; } interface SendSocketMessageOption { /** 需要发送的内容 */ - data: string | ArrayBuffer + data: string | ArrayBuffer; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SendSocketMessageCompleteCallback + complete?: SendSocketMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SendSocketMessageFailCallback + fail?: SendSocketMessageFailCallback; /** 接口调用成功的回调函数 */ - success?: SendSocketMessageSuccessCallback + success?: SendSocketMessageSuccessCallback; } interface SetBGMVolumeOption { /** 音量大小,范围是 0-1 */ - volume: string + volume: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetBGMVolumeCompleteCallback + complete?: SetBGMVolumeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetBGMVolumeFailCallback + fail?: SetBGMVolumeFailCallback; /** 接口调用成功的回调函数 */ - success?: SetBGMVolumeSuccessCallback + success?: SetBGMVolumeSuccessCallback; } interface SetBLEMTUFailCallbackResult { /** 最终协商的 MTU 值。如果协商失败则无此参数。安卓客户端 8.0.9 开始支持。 */ - mtu: number + mtu: number; } interface SetBLEMTUOption { /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 最大传输单元。设置范围为 (22,512) 区间内,单位 bytes */ - mtu: number + mtu: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetBLEMTUCompleteCallback + complete?: SetBLEMTUCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetBLEMTUFailCallback + fail?: SetBLEMTUFailCallback; /** 接口调用成功的回调函数 */ - success?: SetBLEMTUSuccessCallback + success?: SetBLEMTUSuccessCallback; } interface SetBLEMTUSuccessCallbackResult { /** 最终协商的 MTU 值,与传入参数一致。安卓客户端 8.0.9 开始支持。 */ - mtu: number - errMsg: string + mtu: number; + errMsg: string; } interface SetBackgroundColorOption { /** 窗口的背景色,必须为十六进制颜色值 */ - backgroundColor?: string + backgroundColor?: string; /** 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 */ - backgroundColorBottom?: string + backgroundColorBottom?: string; /** 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 */ - backgroundColorTop?: string + backgroundColorTop?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetBackgroundColorCompleteCallback + complete?: SetBackgroundColorCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetBackgroundColorFailCallback + fail?: SetBackgroundColorFailCallback; /** 接口调用成功的回调函数 */ - success?: SetBackgroundColorSuccessCallback + success?: SetBackgroundColorSuccessCallback; } interface SetBackgroundFetchTokenOption { /** 自定义的登录态 */ - token: string + token: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetBackgroundFetchTokenCompleteCallback + complete?: SetBackgroundFetchTokenCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetBackgroundFetchTokenFailCallback + fail?: SetBackgroundFetchTokenFailCallback; /** 接口调用成功的回调函数 */ - success?: SetBackgroundFetchTokenSuccessCallback + success?: SetBackgroundFetchTokenSuccessCallback; } interface SetBackgroundTextStyleOption { /** 下拉背景字体、loading 图的样式。 @@ -10594,61 +10451,61 @@ wx.createSelectorQuery() * 可选值: * - 'dark': dark 样式; * - 'light': light 样式; */ - textStyle: 'dark' | 'light' + textStyle: 'dark' | 'light'; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetBackgroundTextStyleCompleteCallback + complete?: SetBackgroundTextStyleCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetBackgroundTextStyleFailCallback + fail?: SetBackgroundTextStyleFailCallback; /** 接口调用成功的回调函数 */ - success?: SetBackgroundTextStyleSuccessCallback + success?: SetBackgroundTextStyleSuccessCallback; } interface SetBoundaryOption { /** 东北角经纬度 */ - northeast: MapPostion + northeast: MapPostion; /** 西南角经纬度 */ - southwest: MapPostion + southwest: MapPostion; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetBoundaryCompleteCallback + complete?: SetBoundaryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetBoundaryFailCallback + fail?: SetBoundaryFailCallback; /** 接口调用成功的回调函数 */ - success?: SetBoundarySuccessCallback + success?: SetBoundarySuccessCallback; } interface SetCenterOffsetOption { /** 偏移量,两位数组 */ - offset: number[] + offset: number[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetCenterOffsetCompleteCallback + complete?: SetCenterOffsetCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetCenterOffsetFailCallback + fail?: SetCenterOffsetFailCallback; /** 接口调用成功的回调函数 */ - success?: SetCenterOffsetSuccessCallback + success?: SetCenterOffsetSuccessCallback; } interface SetClipboardDataOption { /** 剪贴板的内容 */ - data: string + data: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetClipboardDataCompleteCallback + complete?: SetClipboardDataCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetClipboardDataFailCallback + fail?: SetClipboardDataFailCallback; /** 接口调用成功的回调函数 */ - success?: SetClipboardDataSuccessCallback + success?: SetClipboardDataSuccessCallback; } interface SetContentsOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetContentsCompleteCallback + complete?: SetContentsCompleteCallback; /** 表示内容的delta对象 */ - delta?: IAnyObject + delta?: IAnyObject; /** 接口调用失败的回调函数 */ - fail?: SetContentsFailCallback + fail?: SetContentsFailCallback; /** 带标签的HTML内容 */ - html?: string + html?: string; /** 接口调用成功的回调函数 */ - success?: SetContentsSuccessCallback + success?: SetContentsSuccessCallback; } interface SetEnable1v1ChatOption { /** 是否开启 */ - enable: boolean + enable: boolean; /** 窗口背景色(音频通话背景以及小窗模式背景) * * 可选值: @@ -10658,254 +10515,254 @@ wx.createSelectorQuery() * - 3: #3D7257; * - 4: #1485EE; * - 5: #6467F0; */ - backgroundType?: 0 | 1 | 2 | 3 | 4 | 5 + backgroundType?: 0 | 1 | 2 | 3 | 4 | 5; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetEnable1v1ChatCompleteCallback + complete?: SetEnable1v1ChatCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetEnable1v1ChatFailCallback + fail?: SetEnable1v1ChatFailCallback; /** 小窗样式 */ - minWindowType?: number + minWindowType?: number; /** 接口调用成功的回调函数 */ - success?: SetEnable1v1ChatSuccessCallback + success?: SetEnable1v1ChatSuccessCallback; } interface SetEnableDebugOption { /** 是否打开调试 */ - enableDebug: boolean + enableDebug: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetEnableDebugCompleteCallback + complete?: SetEnableDebugCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetEnableDebugFailCallback + fail?: SetEnableDebugFailCallback; /** 接口调用成功的回调函数 */ - success?: SetEnableDebugSuccessCallback + success?: SetEnableDebugSuccessCallback; } interface SetInnerAudioOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetInnerAudioOptionCompleteCallback + complete?: SetInnerAudioOptionCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetInnerAudioOptionFailCallback + fail?: SetInnerAudioOptionFailCallback; /** 是否与其他音频混播,设置为 true 之后,不会终止其他应用或微信内的音乐 */ - mixWithOther?: boolean + mixWithOther?: boolean; /** (仅在 iOS 生效)是否遵循静音开关,设置为 false 之后,即使是在静音模式下,也能播放声音 */ - obeyMuteSwitch?: boolean + obeyMuteSwitch?: boolean; /** true 代表用扬声器播放,false 代表听筒播放,默认值为 true。 */ - speakerOn?: boolean + speakerOn?: boolean; /** 接口调用成功的回调函数 */ - success?: SetInnerAudioOptionSuccessCallback + success?: SetInnerAudioOptionSuccessCallback; } interface SetKeepScreenOnOption { /** 是否保持屏幕常亮 */ - keepScreenOn: boolean + keepScreenOn: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetKeepScreenOnCompleteCallback + complete?: SetKeepScreenOnCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetKeepScreenOnFailCallback + fail?: SetKeepScreenOnFailCallback; /** 接口调用成功的回调函数 */ - success?: SetKeepScreenOnSuccessCallback + success?: SetKeepScreenOnSuccessCallback; } interface SetLocMarkerIconOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetLocMarkerIconCompleteCallback + complete?: SetLocMarkerIconCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetLocMarkerIconFailCallback + fail?: SetLocMarkerIconFailCallback; /** 图标路径,支持网络路径、本地路径、代码包路径 */ - iconPath?: string + iconPath?: string; /** 接口调用成功的回调函数 */ - success?: SetLocMarkerIconSuccessCallback + success?: SetLocMarkerIconSuccessCallback; } interface SetMICVolumeOption { /** 音量大小,范围是 0.0-1.0 */ - volume: number + volume: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetMICVolumeCompleteCallback + complete?: SetMICVolumeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetMICVolumeFailCallback + fail?: SetMICVolumeFailCallback; /** 接口调用成功的回调函数 */ - success?: SetMICVolumeSuccessCallback + success?: SetMICVolumeSuccessCallback; } interface SetNavigationBarColorOption { /** 背景颜色值,有效值为十六进制颜色 */ - backgroundColor: string + backgroundColor: string; /** 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 */ - frontColor: string + frontColor: string; /** 动画效果 */ - animation?: AnimationOption + animation?: AnimationOption; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetNavigationBarColorCompleteCallback + complete?: SetNavigationBarColorCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetNavigationBarColorFailCallback + fail?: SetNavigationBarColorFailCallback; /** 接口调用成功的回调函数 */ - success?: SetNavigationBarColorSuccessCallback + success?: SetNavigationBarColorSuccessCallback; } interface SetNavigationBarTitleOption { /** 页面标题 */ - title: string + title: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetNavigationBarTitleCompleteCallback + complete?: SetNavigationBarTitleCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetNavigationBarTitleFailCallback + fail?: SetNavigationBarTitleFailCallback; /** 接口调用成功的回调函数 */ - success?: SetNavigationBarTitleSuccessCallback + success?: SetNavigationBarTitleSuccessCallback; } interface SetScreenBrightnessOption { /** 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮。在安卓端支持传入特殊值 -1,表示屏幕亮度跟随系统变化 */ - value: number + value: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetScreenBrightnessCompleteCallback + complete?: SetScreenBrightnessCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetScreenBrightnessFailCallback + fail?: SetScreenBrightnessFailCallback; /** 接口调用成功的回调函数 */ - success?: SetScreenBrightnessSuccessCallback + success?: SetScreenBrightnessSuccessCallback; } interface SetStorageOption { /** 需要存储的内容。只支持原生类型、Date、及能够通过`JSON.stringify`序列化的对象。 */ - data: T + data: T; /** 本地缓存中指定的 key */ - key: string + key: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetStorageCompleteCallback + complete?: SetStorageCompleteCallback; /** 需要基础库: `2.21.3` * * 是否开启加密存储。只有异步的 setStorage 接口支持开启加密存储。开启后,将会对 data 使用 AES128 加密,接口回调耗时将会增加。若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true。此外,由于加密后的数据会比原始数据膨胀1.4倍,因此开启 encrypt 的情况下,单个 key 允许存储的最大数据长度为 0.7MB,所有数据存储上限为 7.1MB */ - encrypt?: boolean + encrypt?: boolean; /** 接口调用失败的回调函数 */ - fail?: SetStorageFailCallback + fail?: SetStorageFailCallback; /** 接口调用成功的回调函数 */ - success?: SetStorageSuccessCallback + success?: SetStorageSuccessCallback; } interface SetTabBarBadgeOption { /** tabBar 的哪一项,从左边算起 */ - index: number + index: number; /** 显示的文本,超过 4 个字符则显示成 ... */ - text: string + text: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetTabBarBadgeCompleteCallback + complete?: SetTabBarBadgeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetTabBarBadgeFailCallback + fail?: SetTabBarBadgeFailCallback; /** 接口调用成功的回调函数 */ - success?: SetTabBarBadgeSuccessCallback + success?: SetTabBarBadgeSuccessCallback; } interface SetTabBarItemOption { /** tabBar 的哪一项,从左边算起 */ - index: number + index: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetTabBarItemCompleteCallback + complete?: SetTabBarItemCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetTabBarItemFailCallback + fail?: SetTabBarItemFailCallback; /** 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效 */ - iconPath?: string + iconPath?: string; /** 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效 */ - selectedIconPath?: string + selectedIconPath?: string; /** 接口调用成功的回调函数 */ - success?: SetTabBarItemSuccessCallback + success?: SetTabBarItemSuccessCallback; /** tab 上的按钮文字 */ - text?: string + text?: string; } interface SetTabBarStyleOption { /** tab 的背景色,HexColor */ - backgroundColor?: string + backgroundColor?: string; /** tabBar上边框的颜色, 仅支持 black/white */ - borderStyle?: string + borderStyle?: string; /** tab 上的文字默认颜色,HexColor */ - color?: string + color?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetTabBarStyleCompleteCallback + complete?: SetTabBarStyleCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetTabBarStyleFailCallback + fail?: SetTabBarStyleFailCallback; /** tab 上的文字选中时的颜色,HexColor */ - selectedColor?: string + selectedColor?: string; /** 接口调用成功的回调函数 */ - success?: SetTabBarStyleSuccessCallback + success?: SetTabBarStyleSuccessCallback; } interface SetTimeoutOption { /** 设置超时时间 (ms) */ - timeout: number + timeout: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetTimeoutCompleteCallback + complete?: SetTimeoutCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetTimeoutFailCallback + fail?: SetTimeoutFailCallback; /** 接口调用成功的回调函数 */ - success?: SetTimeoutSuccessCallback + success?: SetTimeoutSuccessCallback; } interface SetTopBarTextOption { /** 置顶栏文字 */ - text: string + text: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetTopBarTextCompleteCallback + complete?: SetTopBarTextCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetTopBarTextFailCallback + fail?: SetTopBarTextFailCallback; /** 接口调用成功的回调函数 */ - success?: SetTopBarTextSuccessCallback + success?: SetTopBarTextSuccessCallback; } interface SetVisualEffectOnCaptureOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetVisualEffectOnCaptureCompleteCallback + complete?: SetVisualEffectOnCaptureCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetVisualEffectOnCaptureFailCallback + fail?: SetVisualEffectOnCaptureFailCallback; /** 接口调用成功的回调函数 */ - success?: SetVisualEffectOnCaptureSuccessCallback + success?: SetVisualEffectOnCaptureSuccessCallback; /** 截屏/录屏时的表现,仅支持 none / hidden,传入 hidden 则表示在截屏/录屏时隐藏屏幕 */ - visualEffect?: string + visualEffect?: string; } interface SetWifiListOption { /** 提供预设的 Wi-Fi 信息列表 */ - wifiList: WifiData[] + wifiList: WifiData[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetWifiListCompleteCallback + complete?: SetWifiListCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetWifiListFailCallback + fail?: SetWifiListFailCallback; /** 接口调用成功的回调函数 */ - success?: SetWifiListSuccessCallback + success?: SetWifiListSuccessCallback; } interface SetWindowSizeOption { /** 窗口高度,以像素为单位 */ - height: number + height: number; /** 窗口宽度,以像素为单位 */ - width: number + width: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SetWindowSizeCompleteCallback + complete?: SetWindowSizeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SetWindowSizeFailCallback + fail?: SetWindowSizeFailCallback; /** 接口调用成功的回调函数 */ - success?: SetWindowSizeSuccessCallback + success?: SetWindowSizeSuccessCallback; } interface SetZoomSuccessCallbackResult { /** 实际设置的缩放级别。由于系统限制,某些机型可能无法设置成指定值,会改用最接近的可设值。 */ - zoom: number - errMsg: string + zoom: number; + errMsg: string; } interface ShareFileMessageOption { /** 要分享的文件地址,必须为本地路径或临时路径 */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShareFileMessageCompleteCallback + complete?: ShareFileMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShareFileMessageFailCallback + fail?: ShareFileMessageFailCallback; /** 自定义文件名,若留空则使用filePath中的文件名 */ - fileName?: string + fileName?: string; /** 接口调用成功的回调函数 */ - success?: ShareFileMessageSuccessCallback + success?: ShareFileMessageSuccessCallback; } interface ShareToWeRunOption { /** 运动数据列表 */ - recordList: WxaSportRecord[] + recordList: WxaSportRecord[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShareToWeRunCompleteCallback + complete?: ShareToWeRunCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShareToWeRunFailCallback + fail?: ShareToWeRunFailCallback; /** 接口调用成功的回调函数 */ - success?: ShareToWeRunSuccessCallback + success?: ShareToWeRunSuccessCallback; } interface ShareVideoMessageOption { /** 要分享的视频地址,必须为本地路径或临时路径 */ - videoPath: string + videoPath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShareVideoMessageCompleteCallback + complete?: ShareVideoMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShareVideoMessageFailCallback + fail?: ShareVideoMessageFailCallback; /** 接口调用成功的回调函数 */ - success?: ShareVideoMessageSuccessCallback + success?: ShareVideoMessageSuccessCallback; /** 缩略图路径,若留空则使用视频首帧 */ - thumbPath?: string + thumbPath?: string; } /** 需要基础库: `3.2.1` * @@ -10917,165 +10774,165 @@ wx.createSelectorQuery() * * 可选值: * - 1: 通过摄像头实时检测; */ - mode: 1 + mode: 1; } interface ShowActionSheetOption { /** 按钮的文字数组,数组长度最大为 6 */ - itemList: string[] + itemList: string[]; /** 需要基础库: `2.14.0` * * 警示文案 */ - alertText?: string + alertText?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowActionSheetCompleteCallback + complete?: ShowActionSheetCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShowActionSheetFailCallback + fail?: ShowActionSheetFailCallback; /** 按钮的文字颜色 */ - itemColor?: string + itemColor?: string; /** 接口调用成功的回调函数 */ - success?: ShowActionSheetSuccessCallback + success?: ShowActionSheetSuccessCallback; } interface ShowActionSheetSuccessCallbackResult { /** 用户点击的按钮序号,从上到下的顺序,从0开始 */ - tapIndex: number - errMsg: string + tapIndex: number; + errMsg: string; } interface ShowLoadingOption { /** 提示的内容 */ - title: string + title: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowLoadingCompleteCallback + complete?: ShowLoadingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShowLoadingFailCallback + fail?: ShowLoadingFailCallback; /** 是否显示透明蒙层,防止触摸穿透 */ - mask?: boolean + mask?: boolean; /** 接口调用成功的回调函数 */ - success?: ShowLoadingSuccessCallback + success?: ShowLoadingSuccessCallback; } interface ShowModalOption { /** 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 */ - cancelColor?: string + cancelColor?: string; /** 取消按钮的文字,最多 4 个字符 */ - cancelText?: string + cancelText?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowModalCompleteCallback + complete?: ShowModalCompleteCallback; /** 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 */ - confirmColor?: string + confirmColor?: string; /** 确认按钮的文字,最多 4 个字符 */ - confirmText?: string + confirmText?: string; /** 提示的内容 */ - content?: string + content?: string; /** 需要基础库: `2.17.1` * * 是否显示输入框 */ - editable?: boolean + editable?: boolean; /** 接口调用失败的回调函数 */ - fail?: ShowModalFailCallback + fail?: ShowModalFailCallback; /** 需要基础库: `2.17.1` * * 显示输入框时的提示文本 */ - placeholderText?: string + placeholderText?: string; /** 是否显示取消按钮 */ - showCancel?: boolean + showCancel?: boolean; /** 接口调用成功的回调函数 */ - success?: ShowModalSuccessCallback + success?: ShowModalSuccessCallback; /** 提示的标题 */ - title?: string + title?: string; } interface ShowModalSuccessCallbackResult { /** 需要基础库: `1.1.0` * * 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) */ - cancel: boolean + cancel: boolean; /** 为 true 时,表示用户点击了确定按钮 */ - confirm: boolean + confirm: boolean; /** editable 为 true 时,用户输入的文本 */ - content: string - errMsg: string + content: string; + errMsg: string; } interface ShowNavigationBarLoadingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowNavigationBarLoadingCompleteCallback + complete?: ShowNavigationBarLoadingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShowNavigationBarLoadingFailCallback + fail?: ShowNavigationBarLoadingFailCallback; /** 接口调用成功的回调函数 */ - success?: ShowNavigationBarLoadingSuccessCallback + success?: ShowNavigationBarLoadingSuccessCallback; } interface ShowRedPackageOption { /** 封面地址 */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowRedPackageCompleteCallback + complete?: ShowRedPackageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShowRedPackageFailCallback + fail?: ShowRedPackageFailCallback; /** 接口调用成功的回调函数 */ - success?: ShowRedPackageSuccessCallback + success?: ShowRedPackageSuccessCallback; } interface ShowShareImageMenuOption { /** 要分享的图片地址,必须为本地路径或临时路径 */ - path: string + path: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowShareImageMenuCompleteCallback + complete?: ShowShareImageMenuCompleteCallback; /** 需要基础库: `3.2.0` * * 从消息小程序入口打开小程序的路径,如果当前页面允许分享给朋友,则默认为当前页面路径,否则默认为小程序首页 */ - entrancePath?: string + entrancePath?: string; /** 接口调用失败的回调函数 */ - fail?: ShowShareImageMenuFailCallback + fail?: ShowShareImageMenuFailCallback; /** 需要基础库: `3.2.0` * * 分享的图片消息是否要带小程序入口 (仅部分小程序类目可用) */ - needShowEntrance?: boolean + needShowEntrance?: boolean; /** 需要基础库: `3.2.0` * * 分享样式,小程序可选 v2 */ - style?: string + style?: string; /** 接口调用成功的回调函数 */ - success?: ShowShareImageMenuSuccessCallback + success?: ShowShareImageMenuSuccessCallback; } interface ShowShareMenuOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowShareMenuCompleteCallback + complete?: ShowShareMenuCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShowShareMenuFailCallback + fail?: ShowShareMenuFailCallback; /** 需要基础库: `2.11.3` * * 本接口为 Beta 版本,暂只在 Android 平台支持。需要显示的转发按钮名称列表,默认['shareAppMessage']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 */ - menus?: string[] + menus?: string[]; /** 接口调用成功的回调函数 */ - success?: ShowShareMenuSuccessCallback + success?: ShowShareMenuSuccessCallback; /** 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ - withShareTicket?: boolean + withShareTicket?: boolean; } interface ShowTabBarOption { /** 是否需要动画效果 */ - animation?: boolean + animation?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowTabBarCompleteCallback + complete?: ShowTabBarCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShowTabBarFailCallback + fail?: ShowTabBarFailCallback; /** 接口调用成功的回调函数 */ - success?: ShowTabBarSuccessCallback + success?: ShowTabBarSuccessCallback; } interface ShowTabBarRedDotOption { /** tabBar 的哪一项,从左边算起 */ - index: number + index: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowTabBarRedDotCompleteCallback + complete?: ShowTabBarRedDotCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ShowTabBarRedDotFailCallback + fail?: ShowTabBarRedDotFailCallback; /** 接口调用成功的回调函数 */ - success?: ShowTabBarRedDotSuccessCallback + success?: ShowTabBarRedDotSuccessCallback; } interface ShowToastOption { /** 提示的内容 */ - title: string + title: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ShowToastCompleteCallback + complete?: ShowToastCompleteCallback; /** 提示的延迟时间 */ - duration?: number + duration?: number; /** 接口调用失败的回调函数 */ - fail?: ShowToastFailCallback + fail?: ShowToastFailCallback; /** 图标 * * 可选值: @@ -11083,50 +10940,50 @@ wx.createSelectorQuery() * - 'error': 显示失败图标,此时 title 文本最多显示 7 个汉字长度; * - 'loading': 显示加载图标,此时 title 文本最多显示 7 个汉字长度; * - 'none': 不显示图标,此时 title 文本最多可显示两行,[1.9.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)及以上版本支持; */ - icon?: 'success' | 'error' | 'loading' | 'none' + icon?: 'success' | 'error' | 'loading' | 'none'; /** 需要基础库: `1.1.0` * * 自定义图标的本地路径,image 的优先级高于 icon */ - image?: string + image?: string; /** 是否显示透明蒙层,防止触摸穿透 */ - mask?: boolean + mask?: boolean; /** 接口调用成功的回调函数 */ - success?: ShowToastSuccessCallback + success?: ShowToastSuccessCallback; } /** 具体支付参数见signData, 该参数需以string形式传递, 例如signData: '{"offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}' */ interface SignData { /** 透传数据, 发货通知时会透传给开发者 */ - attach: string + attach: string; /** 购买数量 */ - buyQuantity: number + buyQuantity: number; /** 币种 * * 可选值: * - 'CNY': 人民币; */ - currencyType: 'CNY' + currencyType: 'CNY'; /** 在米大师侧申请的应用 id, mp-支付基础配置中的offerid */ - offerId: string + offerId: string; /** 业务订单号, 每个订单号只能使用一次, 重复使用会失败(极端情况不保证唯一, 不建议业务强依赖唯一性). 要求8-32个字符内, 只能是数字、大小写字母、符号 _-|*@组成, 不能以下划线(_)开头 */ - outTradeNo: string + outTradeNo: string; /** 环境配置, 0 米大师正式环境, 1 米大师沙箱环境, 默认为 0 */ - env?: number + env?: number; /** 道具单价(分), **该字段仅mode=short_series_goods时需要必填**, 用来校验价格与后台道具价格是否一致, 避免用户在业务商城页看到的价格与实际价格不一致导致投诉 */ - goodsPrice?: number + goodsPrice?: number; /** 道具ID, **该字段仅mode=short_series_goods时需要必填** */ - productId?: string + productId?: string; } interface Size { /** 变化后的窗口高度,单位 px */ - windowHeight: number + windowHeight: number; /** 变化后的窗口宽度,单位 px */ - windowWidth: number + windowWidth: number; } /** 当前运行环境对于 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的支持情况 */ interface SkylineInfo { /** 当前运行环境是否支持 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) */ - isSupported: boolean + isSupported: boolean; /** 当前运行环境 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的版本号,形如 `0.9.7` */ - version: string + version: string; /** 当前运行环境不支持 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的原因,仅在 `isSupported` 为 `false` 时出现 * * 可选值: @@ -11134,11 +10991,7 @@ wx.createSelectorQuery() * - 'baselib not supported': 当前基础库不支持 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html),基础库会自动更新到当前客户端所能支持的最新的版本,基础库不支持时也可以尝试通过升级微信客户端解决; * - 'a-b test not enabled': 命中了 _We 分析_ 平台上的 AB 实验关闭的情况。详细可以查看 [Skyline 起步 > 配置 We 分析 AB 实验]((skyline/migration#%E9%85%8D%E7%BD%AE-We-%E5%88%86%E6%9E%90-AB-%E5%AE%9E%E9%AA%8C)) 一节; * - 'SwitchRender option set to webview': 本地调试的快捷切换入口被设置为了强制使用 Webview. 详情可以查看 [Skyline 起步 > 快捷切换入口](#) 一节; */ - reason?: - | 'client not supported' - | 'baselib not supported' - | 'a-b test not enabled' - | 'SwitchRender option set to webview' + reason?: 'client not supported' | 'baselib not supported' | 'a-b test not enabled' | 'SwitchRender option set to webview'; } /** Snapshot 实例,可通过 [SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) 获取。 * @@ -11149,9 +11002,9 @@ wx.createSelectorQuery() * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/jdkplEm17hJP) */ interface Snapshot { /** 画布高度 */ - height: number + height: number; /** 画布宽度 */ - width: number + width: number; /** [Snapshot.takeSnapshot(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/skyline/Snapshot.takeSnapshot.html) * * 需要基础库: `3.0.0` @@ -11159,83 +11012,83 @@ wx.createSelectorQuery() * 在插件中使用:支持 * * 对 snapshot 组件子树进行截图 */ - takeSnapshot(option: TakeSnapshotOption): void + takeSnapshot(option: TakeSnapshotOption): void; } /** 需要基础库: `2.10.4` * * 网络请求过程中一些调试信息 */ interface SocketProfile { /** 完成建立连接的时间(完成握手),如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接完成的时间。注意这里握手结束,包括安全连接建立完成、SOCKS 授权通过 */ - connectEnd: number + connectEnd: number; /** 开始建立连接的时间,如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接开始的时间 */ - connectStart: number + connectStart: number; /** 上层请求到返回的耗时 */ - cost: number + cost: number; /** DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 */ - domainLookUpEnd: number + domainLookUpEnd: number; /** DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 */ - domainLookUpStart: number + domainLookUpStart: number; /** 组件准备好使用 SOCKET 建立请求的时间,这发生在检查本地缓存之前 */ - fetchStart: number + fetchStart: number; /** 握手耗时 */ - handshakeCost: number + handshakeCost: number; /** 单次连接的耗时,包括 connect ,tls */ - rtt: number + rtt: number; } interface SocketTaskCloseOption { /** 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 */ - code?: number + code?: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SocketTaskCloseCompleteCallback + complete?: SocketTaskCloseCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SocketTaskCloseFailCallback + fail?: SocketTaskCloseFailCallback; /** 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。 */ - reason?: string + reason?: string; /** 接口调用成功的回调函数 */ - success?: SocketTaskCloseSuccessCallback + success?: SocketTaskCloseSuccessCallback; } interface SocketTaskOnCloseListenerResult { /** 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 */ - code: number + code: number; /** 一个可读的字符串,表示连接被关闭的原因。 */ - reason: string + reason: string; } interface SocketTaskOnMessageListenerResult { /** 服务器返回的消息 */ - data: string | ArrayBuffer + data: string | ArrayBuffer; } interface SocketTaskSendOption { /** 需要发送的内容 */ - data: string | ArrayBuffer + data: string | ArrayBuffer; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SendCompleteCallback + complete?: SendCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SendFailCallback + fail?: SendFailCallback; /** 接口调用成功的回调函数 */ - success?: SendSuccessCallback + success?: SendSuccessCallback; } /** 动画配置 */ interface SpringOption { /** 阻尼系数 */ - damping?: number + damping?: number; /** 重量系数,值越大移动越慢 */ - mass?: number + mass?: number; /** 动画是否可以在指定值上反弹 */ - overshootClamping?: boolean + overshootClamping?: boolean; /** 弹簧静止时的位移 */ - restDisplacementThreshold?: number + restDisplacementThreshold?: number; /** 弹簧静止的速度 */ - restSpeedThreshold?: number + restSpeedThreshold?: number; /** 弹性系数 */ - stiffness?: number + stiffness?: number; /** 速度 */ - velocity?: number + velocity?: number; } interface StartAccelerometerOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartAccelerometerCompleteCallback + complete?: StartAccelerometerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartAccelerometerFailCallback + fail?: StartAccelerometerFailCallback; /** 需要基础库: `2.1.0` * * 监听加速度数据回调函数的执行频率 @@ -11244,123 +11097,123 @@ wx.createSelectorQuery() * - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; * - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; * - 'normal': 普通的回调频率,在 200ms/次 左右; */ - interval?: 'game' | 'ui' | 'normal' + interval?: 'game' | 'ui' | 'normal'; /** 接口调用成功的回调函数 */ - success?: StartAccelerometerSuccessCallback + success?: StartAccelerometerSuccessCallback; } interface StartAdvertisingObject { /** 广播自定义参数 */ - advertiseRequest: AdvertiseReqObj + advertiseRequest: AdvertiseReqObj; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartAdvertisingCompleteCallback + complete?: StartAdvertisingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartAdvertisingFailCallback + fail?: StartAdvertisingFailCallback; /** 广播功率 * * 可选值: * - 'low': 功率低; * - 'medium': 功率适中; * - 'high': 功率高; */ - powerLevel?: 'low' | 'medium' | 'high' + powerLevel?: 'low' | 'medium' | 'high'; /** 接口调用成功的回调函数 */ - success?: StartAdvertisingSuccessCallback + success?: StartAdvertisingSuccessCallback; } interface StartBeaconDiscoveryOption { /** Beacon 设备广播的 UUID 列表 */ - uuids: string[] + uuids: string[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartBeaconDiscoveryCompleteCallback + complete?: StartBeaconDiscoveryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartBeaconDiscoveryFailCallback + fail?: StartBeaconDiscoveryFailCallback; /** 是否校验蓝牙开关,仅在 iOS 下有效。iOS 11 起,控制面板里关掉蓝牙,还是能继续使用 Beacon 服务。 */ - ignoreBluetoothAvailable?: boolean + ignoreBluetoothAvailable?: boolean; /** 接口调用成功的回调函数 */ - success?: StartBeaconDiscoverySuccessCallback + success?: StartBeaconDiscoverySuccessCallback; } interface StartBluetoothDevicesDiscoveryOption { /** 是否允许重复上报同一设备。如果允许重复上报,则 [wx.onBlueToothDeviceFound](#) 方法会多次上报同一设备,但是 RSSI 值会有不同。 */ - allowDuplicatesKey?: boolean + allowDuplicatesKey?: boolean; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartBluetoothDevicesDiscoveryCompleteCallback + complete?: StartBluetoothDevicesDiscoveryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartBluetoothDevicesDiscoveryFailCallback + fail?: StartBluetoothDevicesDiscoveryFailCallback; /** 上报设备的间隔,单位 ms。0 表示找到新设备立即上报,其他数值根据传入的间隔上报。 */ - interval?: number + interval?: number; /** 扫描模式,越高扫描越快,也越耗电。仅安卓微信客户端 7.0.12 及以上支持。 * * 可选值: * - 'low': 低; * - 'medium': 中; * - 'high': 高; */ - powerLevel?: 'low' | 'medium' | 'high' + powerLevel?: 'low' | 'medium' | 'high'; /** 要搜索的蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID)。某些蓝牙设备会广播自己的主 service 的 UUID。如果设置此参数,则只搜索广播包有对应 UUID 的主服务的蓝牙设备。建议通过该参数过滤掉周边不需要处理的其他蓝牙设备。 */ - services?: string[] + services?: string[]; /** 接口调用成功的回调函数 */ - success?: StartBluetoothDevicesDiscoverySuccessCallback + success?: StartBluetoothDevicesDiscoverySuccessCallback; } interface StartCastingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartCastingCompleteCallback + complete?: StartCastingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartCastingFailCallback + fail?: StartCastingFailCallback; /** 接口调用成功的回调函数 */ - success?: StartCastingSuccessCallback + success?: StartCastingSuccessCallback; } interface StartCompassOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartCompassCompleteCallback + complete?: StartCompassCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartCompassFailCallback + fail?: StartCompassFailCallback; /** 接口调用成功的回调函数 */ - success?: StartCompassSuccessCallback + success?: StartCompassSuccessCallback; } interface StartDeviceMotionListeningOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartDeviceMotionListeningCompleteCallback + complete?: StartDeviceMotionListeningCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartDeviceMotionListeningFailCallback + fail?: StartDeviceMotionListeningFailCallback; /** 监听设备方向的变化回调函数的执行频率 * * 可选值: * - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; * - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; * - 'normal': 普通的回调频率,在 200ms/次 左右; */ - interval?: 'game' | 'ui' | 'normal' + interval?: 'game' | 'ui' | 'normal'; /** 接口调用成功的回调函数 */ - success?: StartDeviceMotionListeningSuccessCallback + success?: StartDeviceMotionListeningSuccessCallback; } interface StartDiscoveryOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartDiscoveryCompleteCallback + complete?: StartDiscoveryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartDiscoveryFailCallback + fail?: StartDiscoveryFailCallback; /** 接口调用成功的回调函数 */ - success?: StartDiscoverySuccessCallback + success?: StartDiscoverySuccessCallback; } interface StartGyroscopeOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartGyroscopeCompleteCallback + complete?: StartGyroscopeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartGyroscopeFailCallback + fail?: StartGyroscopeFailCallback; /** 监听陀螺仪数据回调函数的执行频率 * * 可选值: * - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; * - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; * - 'normal': 普通的回调频率,在 200ms/次 左右; */ - interval?: 'game' | 'ui' | 'normal' + interval?: 'game' | 'ui' | 'normal'; /** 接口调用成功的回调函数 */ - success?: StartGyroscopeSuccessCallback + success?: StartGyroscopeSuccessCallback; } interface StartHCEOption { /** 需要注册到系统的 AID 列表 */ - aid_list: string[] + aid_list: string[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartHCECompleteCallback + complete?: StartHCECompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartHCEFailCallback + fail?: StartHCEFailCallback; /** 接口调用成功的回调函数 */ - success?: StartHCESuccessCallback + success?: StartHCESuccessCallback; } interface StartLocalServiceDiscoveryFailCallbackResult { /** 错误信息 @@ -11368,153 +11221,153 @@ wx.createSelectorQuery() * 可选值: * - 'invalid param': serviceType 为空; * - 'scan task already exist': 在当前 startLocalServiceDiscovery 发起的搜索未停止的情况下,再次调用 startLocalServiceDiscovery; */ - errMsg: string + errMsg: string; } interface StartLocalServiceDiscoveryOption { /** 要搜索的服务类型 */ - serviceType: string + serviceType: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartLocalServiceDiscoveryCompleteCallback + complete?: StartLocalServiceDiscoveryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartLocalServiceDiscoveryFailCallback + fail?: StartLocalServiceDiscoveryFailCallback; /** 接口调用成功的回调函数 */ - success?: StartLocalServiceDiscoverySuccessCallback + success?: StartLocalServiceDiscoverySuccessCallback; } interface StartLocationUpdateBackgroundOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartLocationUpdateBackgroundCompleteCallback + complete?: StartLocationUpdateBackgroundCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartLocationUpdateBackgroundFailCallback + fail?: StartLocationUpdateBackgroundFailCallback; /** 接口调用成功的回调函数 */ - success?: StartLocationUpdateBackgroundSuccessCallback + success?: StartLocationUpdateBackgroundSuccessCallback; /** wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 */ - type?: string + type?: string; } interface StartLocationUpdateOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartLocationUpdateCompleteCallback + complete?: StartLocationUpdateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartLocationUpdateFailCallback + fail?: StartLocationUpdateFailCallback; /** 接口调用成功的回调函数 */ - success?: StartLocationUpdateSuccessCallback + success?: StartLocationUpdateSuccessCallback; /** wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 */ - type?: string + type?: string; } interface StartPreviewOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartPreviewCompleteCallback + complete?: StartPreviewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartPreviewFailCallback + fail?: StartPreviewFailCallback; /** 接口调用成功的回调函数 */ - success?: StartPreviewSuccessCallback + success?: StartPreviewSuccessCallback; } interface StartPullDownRefreshOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartPullDownRefreshCompleteCallback + complete?: StartPullDownRefreshCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartPullDownRefreshFailCallback + fail?: StartPullDownRefreshFailCallback; /** 接口调用成功的回调函数 */ - success?: StartPullDownRefreshSuccessCallback + success?: StartPullDownRefreshSuccessCallback; } interface StartRecordSuccessCallbackResult { /** 录音文件的临时路径 (本地路径) */ - tempFilePath: string - errMsg: string + tempFilePath: string; + errMsg: string; } interface StartRecordTimeoutCallbackResult { /** 封面图片文件的临时路径 (本地路径) */ - tempThumbPath: string + tempThumbPath: string; /** 视频的文件的临时路径 (本地路径) */ - tempVideoPath: string + tempVideoPath: string; } interface StartSoterAuthenticationOption { /** 挑战因子。挑战因子为调用者为此次生物鉴权准备的用于签名的字符串关键识别信息,将作为 `resultJSON` 的一部分,供调用者识别本次请求。例如:如果场景为请求用户对某订单进行授权确认,则可以将订单号填入此参数。 */ - challenge: string + challenge: string; /** 请求使用的可接受的生物认证方式 * * 可选值: * - 'fingerPrint': 指纹识别; * - 'facial': 人脸识别; * - 'speech': 声纹识别(暂未支持); */ - requestAuthModes: Array<'fingerPrint' | 'facial' | 'speech'> + requestAuthModes: Array<'fingerPrint' | 'facial' | 'speech'>; /** 验证描述,即识别过程中显示在界面上的对话框提示内容 */ - authContent?: string + authContent?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartSoterAuthenticationCompleteCallback + complete?: StartSoterAuthenticationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartSoterAuthenticationFailCallback + fail?: StartSoterAuthenticationFailCallback; /** 接口调用成功的回调函数 */ - success?: StartSoterAuthenticationSuccessCallback + success?: StartSoterAuthenticationSuccessCallback; } interface StartSoterAuthenticationSuccessCallbackResult { /** 生物认证方式 */ - authMode: string + authMode: string; /** 错误码 */ - errCode: number + errCode: number; /** 错误信息 */ - errMsg: string + errMsg: string; /** 在设备安全区域(TEE)内获得的本机安全信息(如TEE名称版本号等以及防重放参数)以及本次认证信息(仅Android支持,本次认证的指纹ID)。具体说明见下文 */ - resultJSON: string + resultJSON: string; /** 用SOTER安全密钥对 `resultJSON` 的签名(SHA256 with RSA/PSS, saltlen=20) */ - resultJSONSignature: string + resultJSONSignature: string; } interface StartWifiOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartWifiCompleteCallback + complete?: StartWifiCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartWifiFailCallback + fail?: StartWifiFailCallback; /** 接口调用成功的回调函数 */ - success?: StartWifiSuccessCallback + success?: StartWifiSuccessCallback; } interface StatOption { /** 文件/目录路径 (本地路径) */ - path: string + path: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StatCompleteCallback + complete?: StatCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StatFailCallback + fail?: StatFailCallback; /** 需要基础库: `2.3.0` * * 是否递归获取目录下的每个文件的 Stats 信息 */ - recursive?: boolean + recursive?: boolean; /** 接口调用成功的回调函数 */ - success?: StatSuccessCallback + success?: StatSuccessCallback; } interface StatSuccessCallbackResult { /** [Stats](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.html)|Array.<[FileStats](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileStats.html)> * * 当 recursive 为 false 时,res.stats 是一个 Stats 对象。当 recursive 为 true 且 path 是一个目录的路径时,res.stats 是一个 Array,数组的每一项是一个对象,每个对象包含 path 和 stats。 */ - stats: Stats | FileStats[] - errMsg: string + stats: Stats | FileStats[]; + errMsg: string; } /** 描述文件状态的对象 */ interface Stats { /** 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime */ - lastAccessedTime: number + lastAccessedTime: number; /** 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime */ - lastModifiedTime: number + lastModifiedTime: number; /** 文件的类型和存取的权限,对应 POSIX stat.st_mode */ - mode: number + mode: number; /** 文件大小,单位:B,对应 POSIX stat.st_size */ - size: number + size: number; /** [boolean Stats.isDirectory()](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isDirectory.html) * * 在插件中使用:需要基础库 `2.19.2` * * 判断当前文件是否一个目录 */ - isDirectory(): boolean + isDirectory(): boolean; /** [boolean Stats.isFile()](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isFile.html) * * 在插件中使用:需要基础库 `2.19.2` * * 判断当前文件是否一个普通文件 */ - isFile(): boolean + isFile(): boolean; } interface StepOption { /** 动画延迟时间,单位 ms */ - delay?: number + delay?: number; /** 动画持续时间,单位 ms */ - duration?: number + duration?: number; /** 动画的效果 * * 可选值: @@ -11525,24 +11378,17 @@ wx.createSelectorQuery() * - 'ease-out': 动画以低速结束; * - 'step-start': 动画第一帧就跳至结束状态直到结束; * - 'step-end': 动画一直保持开始状态,最后一帧跳到结束状态; */ - timingFunction?: - | 'linear' - | 'ease' - | 'ease-in' - | 'ease-in-out' - | 'ease-out' - | 'step-start' - | 'step-end' - transformOrigin?: string + timingFunction?: 'linear' | 'ease' | 'ease-in' | 'ease-in-out' | 'ease-out' | 'step-start' | 'step-end'; + transformOrigin?: string; } /** 贴纸类型 */ interface Sticker { /** 贴纸帧数 */ - len: number + len: number; /** 贴纸资源路径。资源必须为一个资源文件夹路径或一个压缩包路径,文件夹或压缩包内的贴纸资源必须按照 `{title}_{index}.{ext}` 格式命名。其中 `{title}` 为贴纸名称;`{index}` 为帧序号,从0开始;`{ext}` 为拓展名。 */ - path: string + path: string; /** 贴纸名称 */ - title: string + title: string; /** 贴纸触发动作 * * 可选值: @@ -11568,217 +11414,195 @@ wx.createSelectorQuery() * - 110: 数字8; * - 111: 暂不支持(留空); * - 112: 双手抱拳/恭喜发财; */ - active?: - | -1 - | 10 - | 11 - | 12 - | 13 - | 14 - | 15 - | 16 - | 17 - | 100 - | 101 - | 102 - | 103 - | 104 - | 105 - | 106 - | 107 - | 108 - | 109 - | 110 - | 111 - | 112 + active?: -1 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112; /** 贴纸ID */ - id?: string + id?: string; /** 贴纸资源 md5 */ - md5?: string + md5?: string; /** 贴纸位置,格式为 [x1,y1,x2,y2] 。当 `type` 为 `'2D'` 或 `'front'` 时必填。仅 2D 贴纸和前景贴纸有效 */ - pos?: string[] + pos?: string[]; /** 背景贴纸展示位置。仅背景贴纸有效 * * 可选值: * - 0: 背景贴纸; * - 1: 只在人像区域显示的贴纸; */ - segtype?: 0 | 1 + segtype?: 0 | 1; } interface StopAccelerometerOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopAccelerometerCompleteCallback + complete?: StopAccelerometerCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopAccelerometerFailCallback + fail?: StopAccelerometerFailCallback; /** 接口调用成功的回调函数 */ - success?: StopAccelerometerSuccessCallback + success?: StopAccelerometerSuccessCallback; } interface StopAdvertisingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopAdvertisingCompleteCallback + complete?: StopAdvertisingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopAdvertisingFailCallback + fail?: StopAdvertisingFailCallback; /** 接口调用成功的回调函数 */ - success?: StopAdvertisingSuccessCallback + success?: StopAdvertisingSuccessCallback; } interface StopBGMOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopBGMCompleteCallback + complete?: StopBGMCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopBGMFailCallback + fail?: StopBGMFailCallback; /** 接口调用成功的回调函数 */ - success?: StopBGMSuccessCallback + success?: StopBGMSuccessCallback; } interface StopBackgroundAudioOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopBackgroundAudioCompleteCallback + complete?: StopBackgroundAudioCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopBackgroundAudioFailCallback + fail?: StopBackgroundAudioFailCallback; /** 接口调用成功的回调函数 */ - success?: StopBackgroundAudioSuccessCallback + success?: StopBackgroundAudioSuccessCallback; } interface StopBeaconDiscoveryOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopBeaconDiscoveryCompleteCallback + complete?: StopBeaconDiscoveryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopBeaconDiscoveryFailCallback + fail?: StopBeaconDiscoveryFailCallback; /** 接口调用成功的回调函数 */ - success?: StopBeaconDiscoverySuccessCallback + success?: StopBeaconDiscoverySuccessCallback; } interface StopBluetoothDevicesDiscoveryOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopBluetoothDevicesDiscoveryCompleteCallback + complete?: StopBluetoothDevicesDiscoveryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopBluetoothDevicesDiscoveryFailCallback + fail?: StopBluetoothDevicesDiscoveryFailCallback; /** 接口调用成功的回调函数 */ - success?: StopBluetoothDevicesDiscoverySuccessCallback + success?: StopBluetoothDevicesDiscoverySuccessCallback; } interface StopCompassOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopCompassCompleteCallback + complete?: StopCompassCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopCompassFailCallback + fail?: StopCompassFailCallback; /** 接口调用成功的回调函数 */ - success?: StopCompassSuccessCallback + success?: StopCompassSuccessCallback; } interface StopDeviceMotionListeningOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopDeviceMotionListeningCompleteCallback + complete?: StopDeviceMotionListeningCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopDeviceMotionListeningFailCallback + fail?: StopDeviceMotionListeningFailCallback; /** 接口调用成功的回调函数 */ - success?: StopDeviceMotionListeningSuccessCallback + success?: StopDeviceMotionListeningSuccessCallback; } interface StopDiscoveryOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopDiscoveryCompleteCallback + complete?: StopDiscoveryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopDiscoveryFailCallback + fail?: StopDiscoveryFailCallback; /** 接口调用成功的回调函数 */ - success?: StopDiscoverySuccessCallback + success?: StopDiscoverySuccessCallback; } interface StopFaceDetectOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopFaceDetectCompleteCallback + complete?: StopFaceDetectCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopFaceDetectFailCallback + fail?: StopFaceDetectFailCallback; /** 接口调用成功的回调函数 */ - success?: StopFaceDetectSuccessCallback + success?: StopFaceDetectSuccessCallback; } interface StopGyroscopeOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopGyroscopeCompleteCallback + complete?: StopGyroscopeCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopGyroscopeFailCallback + fail?: StopGyroscopeFailCallback; /** 接口调用成功的回调函数 */ - success?: StopGyroscopeSuccessCallback + success?: StopGyroscopeSuccessCallback; } interface StopHCEOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopHCECompleteCallback + complete?: StopHCECompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopHCEFailCallback + fail?: StopHCEFailCallback; /** 接口调用成功的回调函数 */ - success?: StopHCESuccessCallback + success?: StopHCESuccessCallback; } interface StopLocalServiceDiscoveryFailCallbackResult { /** 错误信息 * * 可选值: * - 'task not found': 在当前没有处在搜索服务中的情况下调用 stopLocalServiceDiscovery; */ - errMsg: string + errMsg: string; } interface StopLocalServiceDiscoveryOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopLocalServiceDiscoveryCompleteCallback + complete?: StopLocalServiceDiscoveryCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopLocalServiceDiscoveryFailCallback + fail?: StopLocalServiceDiscoveryFailCallback; /** 接口调用成功的回调函数 */ - success?: StopLocalServiceDiscoverySuccessCallback + success?: StopLocalServiceDiscoverySuccessCallback; } interface StopLocationUpdateOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopLocationUpdateCompleteCallback + complete?: StopLocationUpdateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopLocationUpdateFailCallback + fail?: StopLocationUpdateFailCallback; /** 接口调用成功的回调函数 */ - success?: StopLocationUpdateSuccessCallback + success?: StopLocationUpdateSuccessCallback; } interface StopOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopCompleteCallback + complete?: StopCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopFailCallback + fail?: StopFailCallback; /** 接口调用成功的回调函数 */ - success?: StopSuccessCallback + success?: StopSuccessCallback; } interface StopPreviewOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopPreviewCompleteCallback + complete?: StopPreviewCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopPreviewFailCallback + fail?: StopPreviewFailCallback; /** 接口调用成功的回调函数 */ - success?: StopPreviewSuccessCallback + success?: StopPreviewSuccessCallback; } interface StopPullDownRefreshOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopPullDownRefreshCompleteCallback + complete?: StopPullDownRefreshCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopPullDownRefreshFailCallback + fail?: StopPullDownRefreshFailCallback; /** 接口调用成功的回调函数 */ - success?: StopPullDownRefreshSuccessCallback + success?: StopPullDownRefreshSuccessCallback; } interface StopRecordSuccessCallbackResult { /** 封面图片文件的临时路径 (本地路径) */ - tempThumbPath: string + tempThumbPath: string; /** 视频的文件的临时路径 (本地路径) */ - tempVideoPath: string - errMsg: string + tempVideoPath: string; + errMsg: string; } interface StopVoiceOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopVoiceCompleteCallback + complete?: StopVoiceCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopVoiceFailCallback + fail?: StopVoiceFailCallback; /** 接口调用成功的回调函数 */ - success?: StopVoiceSuccessCallback + success?: StopVoiceSuccessCallback; } interface StopWifiOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopWifiCompleteCallback + complete?: StopWifiCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopWifiFailCallback + fail?: StopWifiFailCallback; /** 接口调用成功的回调函数 */ - success?: StopWifiSuccessCallback + success?: StopWifiSuccessCallback; } interface SubscribeVoIPVideoMembersOption { /** 订阅的成员列表 */ - openIdList: string[] + openIdList: string[]; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SubscribeVoIPVideoMembersCompleteCallback + complete?: SubscribeVoIPVideoMembersCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SubscribeVoIPVideoMembersFailCallback + fail?: SubscribeVoIPVideoMembersFailCallback; /** 接口调用成功的回调函数 */ - success?: SubscribeVoIPVideoMembersSuccessCallback + success?: SubscribeVoIPVideoMembersSuccessCallback; } /** 订阅消息设置 * @@ -11808,121 +11632,121 @@ wx.getSetting({ ``` */ interface SubscriptionsSetting { /** 订阅消息总开关,true为开启,false为关闭 */ - mainSwitch: boolean + mainSwitch: boolean; /** 每一项订阅消息的订阅状态。itemSettings对象的键为**一次性订阅消息的模板id**或**系统订阅消息的类型**,值为'accept'、'reject'、'ban'中的其中一种。'accept'表示用户同意订阅这条消息,'reject'表示用户拒绝订阅这条消息,'ban'表示已被后台封禁。一次性订阅消息使用方法详见 [wx.requestSubscribeMessage](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/subscribe-message/wx.requestSubscribeMessage.html),永久订阅消息(仅小游戏可用)使用方法详见[wx.requestSubscribeSystemMessage](https://developers.weixin.qq.com/minigame/dev/api/open-api/subscribe-message/wx.requestSubscribeSystemMessage.html) * ## 注意事项 * - itemSettings 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 */ - itemSettings?: IAnyObject + itemSettings?: IAnyObject; } interface SwitchCameraOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SwitchCameraCompleteCallback + complete?: SwitchCameraCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SwitchCameraFailCallback + fail?: SwitchCameraFailCallback; /** 接口调用成功的回调函数 */ - success?: SwitchCameraSuccessCallback + success?: SwitchCameraSuccessCallback; } interface SwitchCastingOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SwitchCastingCompleteCallback + complete?: SwitchCastingCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SwitchCastingFailCallback + fail?: SwitchCastingFailCallback; /** 接口调用成功的回调函数 */ - success?: SwitchCastingSuccessCallback + success?: SwitchCastingSuccessCallback; } interface SwitchTabOption { /** 需要跳转的 tabBar 页面的路径 (代码包路径)(需在 app.json 的 [tabBar](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#tabbar) 字段定义的页面),路径后不能带参数。 */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: SwitchTabCompleteCallback + complete?: SwitchTabCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: SwitchTabFailCallback + fail?: SwitchTabFailCallback; /** 接口调用成功的回调函数 */ - success?: SwitchTabSuccessCallback + success?: SwitchTabSuccessCallback; } interface SystemInfo { /** 需要基础库: `1.1.0` * * 客户端基础库版本 */ - SDKVersion: string + SDKVersion: string; /** 需要基础库: `2.6.0` * * 允许微信使用相册的开关(仅 iOS 有效) */ - albumAuthorized: boolean + albumAuthorized: boolean; /** 需要基础库: `1.8.0` * * 设备性能等级(仅 Android)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好)
注意:性能等级当前仅反馈真机机型,暂不支持 IDE 模拟器机型 */ - benchmarkLevel: number + benchmarkLevel: number; /** 需要基础库: `2.6.0` * * 蓝牙的系统开关 */ - bluetoothEnabled: boolean + bluetoothEnabled: boolean; /** 需要基础库: `1.5.0` * * 设备品牌 */ - brand: string + brand: string; /** 需要基础库: `2.6.0` * * 允许微信使用摄像头的开关 */ - cameraAuthorized: boolean + cameraAuthorized: boolean; /** 设备方向(注意:IOS客户端横屏游戏获取deviceOrientation可能不准,建议以屏幕宽高为准) * * 可选值: * - 'portrait': 竖屏; * - 'landscape': 横屏; */ - deviceOrientation: 'portrait' | 'landscape' + deviceOrientation: 'portrait' | 'landscape'; /** 需要基础库: `2.15.0` * * 是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。 */ - enableDebug: boolean + enableDebug: boolean; /** 需要基础库: `1.5.0` * * 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 */ - fontSizeSetting: number + fontSizeSetting: number; /** 需要基础库: `2.12.3` * * 当前小程序运行的宿主环境 */ - host: SystemInfoHost + host: SystemInfoHost; /** 微信设置的语言 */ - language: string + language: string; /** 需要基础库: `2.6.0` * * 允许微信使用定位的开关 */ - locationAuthorized: boolean + locationAuthorized: boolean; /** 需要基础库: `2.6.0` * * 地理位置的系统开关 */ - locationEnabled: boolean + locationEnabled: boolean; /** `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 */ - locationReducedAccuracy: boolean + locationReducedAccuracy: boolean; /** 需要基础库: `2.6.0` * * 允许微信使用麦克风的开关 */ - microphoneAuthorized: boolean + microphoneAuthorized: boolean; /** 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。 */ - model: string + model: string; /** 需要基础库: `2.6.0` * * 允许微信通知带有提醒的开关(仅 iOS 有效) */ - notificationAlertAuthorized: boolean + notificationAlertAuthorized: boolean; /** 需要基础库: `2.6.0` * * 允许微信通知的开关 */ - notificationAuthorized: boolean + notificationAuthorized: boolean; /** 需要基础库: `2.6.0` * * 允许微信通知带有标记的开关(仅 iOS 有效) */ - notificationBadgeAuthorized: boolean + notificationBadgeAuthorized: boolean; /** 需要基础库: `2.6.0` * * 允许微信通知带有声音的开关(仅 iOS 有效) */ - notificationSoundAuthorized: boolean + notificationSoundAuthorized: boolean; /** 需要基础库: `2.19.3` * * 允许微信使用日历的开关 */ - phoneCalendarAuthorized: boolean + phoneCalendarAuthorized: boolean; /** 设备像素比 */ - pixelRatio: number + pixelRatio: number; /** 客户端平台 * * 可选值: @@ -11931,35 +11755,35 @@ wx.getSetting({ * - 'windows': Windows微信; * - 'mac': macOS微信; * - 'devtools': 微信开发者工具; */ - platform: 'ios' | 'android' | 'windows' | 'mac' | 'devtools' + platform: 'ios' | 'android' | 'windows' | 'mac' | 'devtools'; /** 需要基础库: `2.7.0` * * 在竖屏正方向下的安全区域。部分机型没有安全区域概念,也不会返回 safeArea 字段,开发者需自行兼容。 */ - safeArea: SafeArea + safeArea: SafeArea; /** 需要基础库: `1.1.0` * * 屏幕高度,单位px */ - screenHeight: number + screenHeight: number; /** 需要基础库: `1.1.0` * * 屏幕宽度,单位px */ - screenWidth: number + screenWidth: number; /** 需要基础库: `1.9.0` * * 状态栏的高度,单位px */ - statusBarHeight: number + statusBarHeight: number; /** 操作系统及版本 */ - system: string + system: string; /** 微信版本号 */ - version: string + version: string; /** 需要基础库: `2.6.0` * * Wi-Fi 的系统开关 */ - wifiEnabled: boolean + wifiEnabled: boolean; /** 可使用窗口高度,单位px */ - windowHeight: number + windowHeight: number; /** 可使用窗口宽度,单位px */ - windowWidth: number + windowWidth: number; /** 需要基础库: `2.11.0` * * 系统当前主题,取值为`light`或`dark`,全局配置`"darkmode":true`时才能获取,否则为 undefined (不支持小游戏) @@ -11967,76 +11791,76 @@ wx.getSetting({ * 可选值: * - 'dark': 深色主题; * - 'light': 浅色主题; */ - theme?: 'dark' | 'light' + theme?: 'dark' | 'light'; } /** 需要基础库: `2.12.3` * * 当前小程序运行的宿主环境 */ interface SystemInfoHost { /** 宿主 app 对应的 appId */ - appId: string + appId: string; } interface SystemSetting { /** 蓝牙的系统开关 */ - bluetoothEnabled: boolean + bluetoothEnabled: boolean; /** 设备方向(注意:IOS客户端横屏游戏获取deviceOrientation可能不准,建议以屏幕宽高为准) * * 可选值: * - 'portrait': 竖屏; * - 'landscape': 横屏; */ - deviceOrientation: 'portrait' | 'landscape' + deviceOrientation: 'portrait' | 'landscape'; /** 地理位置的系统开关 */ - locationEnabled: boolean + locationEnabled: boolean; /** Wi-Fi 的系统开关 */ - wifiEnabled: boolean + wifiEnabled: boolean; } /** 需要基础库: `3.4.0` * * 异常信息 */ interface TCPExceptionReason { /** 错误原因 */ - errMsg: string + errMsg: string; /** 错误码 */ - errno: string + errno: string; } interface TCPSocketConnectOption { /** 套接字要连接的地址 */ - address: string + address: string; /** 套接字要连接的端口 */ - port: number + port: number; /** 需要基础库: `3.4.0` * * 是否开启 HttpDNS 服务。如开启,需要同时填入 httpDNSServiceId 。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html) */ - enableHttpDNS?: boolean + enableHttpDNS?: boolean; /** 需要基础库: `3.4.0` * * HttpDNS 服务商 Id。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html) */ - httpDNSServiceId?: string + httpDNSServiceId?: string; /** 套接字要连接的超时时间,默认为 2s */ - timeout?: number + timeout?: number; } interface TCPSocketOnMessageListenerResult { /** 接收端地址信息 */ - localInfo: OnMessageListenerResultLocalInfo + localInfo: OnMessageListenerResultLocalInfo; /** 收到的消息 */ - message: ArrayBuffer + message: ArrayBuffer; /** 发送端地址信息 */ - remoteInfo: TCPSocketOnMessageListenerResultRemoteInfo + remoteInfo: TCPSocketOnMessageListenerResultRemoteInfo; } /** 发送端地址信息 */ interface TCPSocketOnMessageListenerResultRemoteInfo { /** 发送消息的 socket 的地址 */ - address: string + address: string; /** 使用的协议族,为 IPv4 或者 IPv6 */ - family: string + family: string; /** 端口号 */ - port: number + port: number; } interface TakePhotoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: TakePhotoCompleteCallback + complete?: TakePhotoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: TakePhotoFailCallback + fail?: TakePhotoFailCallback; /** 成像质量 * * 可选值: @@ -12044,56 +11868,56 @@ wx.getSetting({ * - 'normal': 普通质量; * - 'low': 低质量; * - 'original': 原图; */ - quality?: 'high' | 'normal' | 'low' | 'original' + quality?: 'high' | 'normal' | 'low' | 'original'; /** 需要基础库: `2.22.0` * * 是否开启镜像 */ - selfieMirror?: boolean + selfieMirror?: boolean; /** 接口调用成功的回调函数 */ - success?: TakePhotoSuccessCallback + success?: TakePhotoSuccessCallback; } interface TakePhotoSuccessCallbackResult { /** 照片文件的临时路径 (本地路径),安卓是jpg图片格式,ios是png */ - tempImagePath: string - errMsg: string + tempImagePath: string; + errMsg: string; } interface TakeSnapshotOption { /** 截图文件格式,'rgba' 或 'png',默认值为 'png' */ - format: string + format: string; /** 截图导出类型,'file' 保存到临时文件目录或 'arraybuffer' 返回图片二进制数据,默认值为 'file' */ - type: string + type: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: TakeSnapshotCompleteCallback + complete?: TakeSnapshotCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: TakeSnapshotFailCallback + fail?: TakeSnapshotFailCallback; /** 接口调用成功的回调函数 */ - success?: TakeSnapshotSuccessCallback + success?: TakeSnapshotSuccessCallback; } interface TakeSnapshotSuccessCallbackResult { /** 截图对应的二进制数据,当 type 为 arraybuffer 该字段生效 */ - data: ArrayBuffer + data: ArrayBuffer; /** 截图保存的临时文件路径,当 type 为 file 该字段生效 */ - tempFilePath: string - errMsg: string + tempFilePath: string; + errMsg: string; } /** 标签类型枚举 */ interface TechType { /** 对应IsoDep实例,实例支持ISO-DEP (ISO 14443-4)标准的读写 */ - isoDep: string + isoDep: string; /** 对应MifareClassic实例,实例支持MIFARE Classic标签的读写 */ - mifareClassic: string + mifareClassic: string; /** 对应MifareUltralight实例,实例支持MIFARE Ultralight标签的读写 */ - mifareUltralight: string + mifareUltralight: string; /** 对应Ndef实例,实例支持对NDEF格式的NFC标签上的NDEF数据的读写 */ - ndef: string + ndef: string; /** 对应NfcA实例,实例支持NFC-A (ISO 14443-3A)标准的读写 */ - nfcA: string + nfcA: string; /** 对应NfcB实例,实例支持NFC-B (ISO 14443-3B)标准的读写 */ - nfcB: string + nfcB: string; /** 对应NfcF实例,实例支持NFC-F (JIS 6319-4)标准的读写 */ - nfcF: string + nfcF: string; /** 对应NfcV实例,实例支持NFC-V (ISO 15693)标准的读写 */ - nfcV: string + nfcV: string; } /** 需要基础库: `2.30.0` * @@ -12127,11 +11951,11 @@ session.run({ ``` */ interface Tensor { /** Tensor 值,一段 ArrayBuffer */ - data: ArrayBuffer + data: ArrayBuffer; /** Tensor shape (Tensor 形状,例如 `[1, 3, 224, 224]` 即表示一个4唯Tensor,每个维度的长度分别为1, 3, 224, 224) */ - shape: number[] + shape: number[]; /** ArrayBuffer 值的类型,合法值有 `uint8`, `int8`, `uint32`, `int32`, `float32` */ - type: string + type: string; } /** 需要基础库: `2.30.0` * @@ -12167,389 +11991,389 @@ session.run({ /** [Tensor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/Tensor.html) * * Tensor,每个 Tensor 包含 shape、data、type 字段。 */ - key: Tensor + key: Tensor; } interface TextMetrics { /** 文本的宽度 */ - width: number + width: number; } /** 动画配置 */ interface TimingOption { /** 动画时长 */ - duration?: number + duration?: number; /** 动画曲线,参考 [Easing](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/animation/worklet.Easing.html) 模块。 */ - easing?: (...args: any[]) => any + easing?: (...args: any[]) => any; } interface ToScreenLocationOption { /** 纬度 */ - latitude: number + latitude: number; /** 经度 */ - longitude: number + longitude: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ToScreenLocationCompleteCallback + complete?: ToScreenLocationCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ToScreenLocationFailCallback + fail?: ToScreenLocationFailCallback; /** 接口调用成功的回调函数 */ - success?: ToScreenLocationSuccessCallback + success?: ToScreenLocationSuccessCallback; } interface ToScreenLocationSuccessCallbackResult { /** x 坐标值 */ - x: number + x: number; /** y 坐标值 */ - y: number - errMsg: string + y: number; + errMsg: string; } interface ToggleTorchOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: ToggleTorchCompleteCallback + complete?: ToggleTorchCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: ToggleTorchFailCallback + fail?: ToggleTorchFailCallback; /** 接口调用成功的回调函数 */ - success?: ToggleTorchSuccessCallback + success?: ToggleTorchSuccessCallback; } /** 跟踪能力配置,目前不同的跟踪能力之间是互斥的,默认使用平面跟踪能力。需要注意目前 track 中不同的跟踪配置存在互斥关系(比如 marker 跟踪配置和 OSD 跟踪配置不能同时存在),请按需配置。 */ interface Track { /** 平面跟踪配置 */ - plane: PlaneTrack + plane: PlaneTrack; /** 需要基础库: `3.3.0` * * 身份证检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/idcard.html)。 */ - IDCard?: IDCardTrack + IDCard?: IDCardTrack; /** 需要基础库: `2.27.0` * * OCR检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/ocr.html)。 */ - OCR?: OCRTrack + OCR?: OCRTrack; /** 需要基础库: `2.24.5` * * OSD 跟踪配置 */ - OSD?: boolean + OSD?: boolean; /** 需要基础库: `2.28.0` * * 人体检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/body.html)。 */ - body?: BodyTrack + body?: BodyTrack; /** 需要基础库: `3.0.0` * * 深度识别配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/depth.html)。 */ - depth?: DepthTrack + depth?: DepthTrack; /** 需要基础库: `2.25.0` * * 人脸检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/face.html)。安卓微信8.0.25开始支持,iOS微信8.0.24开始支持。 */ - face?: FaceTrack + face?: FaceTrack; /** 需要基础库: `2.28.0` * * 手势检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/hand.html)。 */ - hand?: HandTrack + hand?: HandTrack; /** 需要基础库: `2.24.5` * * marker 跟踪配置,基础库(3.0.0)开始允许同时支持v2的水平面检测能力 */ - marker?: boolean + marker?: boolean; /** 需要基础库: `3.2.1` * * 鞋部检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/shoe.html)。 */ - shoe?: ShoeTrack + shoe?: ShoeTrack; /** 需要基础库: `2.28.0` * * 提供基础AR功能,输出相机旋转的3个自由度的位姿,利用手机陀螺仪传感器,实现快速稳定的AR定位能力,适用于简单AR场景。 */ - threeDof?: boolean + threeDof?: boolean; } interface TransceiveOption { /** 需要传递的二进制数据 */ - data: ArrayBuffer + data: ArrayBuffer; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: TransceiveCompleteCallback + complete?: TransceiveCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: TransceiveFailCallback + fail?: TransceiveFailCallback; /** 接口调用成功的回调函数 */ - success?: TransceiveSuccessCallback + success?: TransceiveSuccessCallback; } interface TransceiveSuccessCallbackResult { - data: ArrayBuffer - errMsg: string + data: ArrayBuffer; + errMsg: string; } interface TranslateMarkerOption { /** 移动过程中是否自动旋转 marker */ - autoRotate: boolean + autoRotate: boolean; /** 指定 marker 移动到的目标点 */ - destination: DestinationOption + destination: DestinationOption; /** 指定 marker */ - markerId: number + markerId: number; /** marker 的旋转角度 */ - rotate: number + rotate: number; /** 动画结束回调函数 */ - animationEnd?: (...args: any[]) => any + animationEnd?: (...args: any[]) => any; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: TranslateMarkerCompleteCallback + complete?: TranslateMarkerCompleteCallback; /** 动画持续时长,平移与旋转分别计算 */ - duration?: number + duration?: number; /** 接口调用失败的回调函数 */ - fail?: TranslateMarkerFailCallback + fail?: TranslateMarkerFailCallback; /** 需要基础库: `2.13.0` * * 平移和旋转同时进行 */ - moveWithRotate?: boolean + moveWithRotate?: boolean; /** 接口调用成功的回调函数 */ - success?: TranslateMarkerSuccessCallback + success?: TranslateMarkerSuccessCallback; } interface TriggerRefreshOption { /** 动画时长 */ - duration?: number + duration?: number; /** [动画曲线](#) */ - easingFunction?: string + easingFunction?: string; } interface TruncateOption { /** 要截断的文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: TruncateCompleteCallback + complete?: TruncateCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: TruncateFailCallback + fail?: TruncateFailCallback; /** 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') */ - length?: number + length?: number; /** 接口调用成功的回调函数 */ - success?: TruncateSuccessCallback + success?: TruncateSuccessCallback; } interface TruncateSyncOption { /** 要截断的文件路径 (本地路径) */ - filePath: string + filePath: string; /** 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') */ - length?: number + length?: number; } interface UDPSocketConnectOption { /** 要发消息的地址 */ - address: string + address: string; /** 要发送消息的端口号 */ - port: number + port: number; } interface UDPSocketOnMessageListenerResult { /** 接收端地址信息,2.18.0 起支持 */ - localInfo: OnMessageListenerResultLocalInfo + localInfo: OnMessageListenerResultLocalInfo; /** 收到的消息。消息长度需要小于4096。 */ - message: ArrayBuffer + message: ArrayBuffer; /** 发送端地址信息 */ - remoteInfo: UDPSocketOnMessageListenerResultRemoteInfo + remoteInfo: UDPSocketOnMessageListenerResultRemoteInfo; } /** 发送端地址信息 */ interface UDPSocketOnMessageListenerResultRemoteInfo { /** 发送消息的 socket 的地址 */ - address: string + address: string; /** 使用的协议族,为 IPv4 或者 IPv6 */ - family: string + family: string; /** 端口号 */ - port: number + port: number; /** message 的大小,单位:字节 */ - size: number + size: number; } interface UDPSocketSendOption { /** 要发消息的地址。在基础库 <= 2.9.3 版本必须是和本机同网段的 IP 地址,或安全域名列表内的域名地址;之后版本可以是任意 IP 和域名 */ - address: string + address: string; /** 要发送的数据 */ - message: string | ArrayBuffer + message: string | ArrayBuffer; /** 要发送消息的端口号 */ - port: number + port: number; /** 发送数据的长度,仅当 message 为 ArrayBuffer 类型时有效 */ - length?: number + length?: number; /** 发送数据的偏移量,仅当 message 为 ArrayBuffer 类型时有效 */ - offset?: number + offset?: number; /** 向指定地址发消息时,是否要开启广播,基础库 2.24.0 开始支持 */ - setBroadcast?: boolean + setBroadcast?: boolean; } interface UndoOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: UndoCompleteCallback + complete?: UndoCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: UndoFailCallback + fail?: UndoFailCallback; /** 接口调用成功的回调函数 */ - success?: UndoSuccessCallback + success?: UndoSuccessCallback; } interface UnlinkOption { /** 要删除的文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: UnlinkCompleteCallback + complete?: UnlinkCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: UnlinkFailCallback + fail?: UnlinkFailCallback; /** 接口调用成功的回调函数 */ - success?: UnlinkSuccessCallback + success?: UnlinkSuccessCallback; } interface UnzipOption { /** 目标目录路径, 支持本地路径 */ - targetPath: string + targetPath: string; /** 源文件路径,支持本地路径, 只可以是 zip 压缩文件 */ - zipFilePath: string + zipFilePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: UnzipCompleteCallback + complete?: UnzipCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: UnzipFailCallback + fail?: UnzipFailCallback; /** 接口调用成功的回调函数 */ - success?: UnzipSuccessCallback + success?: UnzipSuccessCallback; } /** 参数列表 */ interface UpdatableMessageFrontEndParameter { /** 参数名 */ - name: string + name: string; /** 参数值 */ - value: string + value: string; } /** 需要基础库: `2.4.0` * * 动态消息的模板信息 */ interface UpdatableMessageFrontEndTemplateInfo { /** 参数列表 */ - parameterList: UpdatableMessageFrontEndParameter[] + parameterList: UpdatableMessageFrontEndParameter[]; /** 模板ID */ - templateId: string + templateId: string; } interface Update3DModeOption { /** 是否开启三维识别 */ - open3d: boolean + open3d: boolean; } interface UpdateGroundOverlayOption { /** 图片覆盖的经纬度范围 */ - bounds: MapBounds + bounds: MapBounds; /** 图片图层 id */ - id: string + id: string; /** 图片路径,支持网络图片、临时路径、代码包路径 */ - src: string + src: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: UpdateGroundOverlayCompleteCallback + complete?: UpdateGroundOverlayCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: UpdateGroundOverlayFailCallback + fail?: UpdateGroundOverlayFailCallback; /** 图层透明度 */ - opacity?: number + opacity?: number; /** 接口调用成功的回调函数 */ - success?: UpdateGroundOverlaySuccessCallback + success?: UpdateGroundOverlaySuccessCallback; /** 是否可见 */ - visible?: boolean + visible?: boolean; /** 图层绘制顺序 */ - zIndex?: number + zIndex?: number; } interface UpdateMaskModeOption { /** 设置是否开启试鞋,返回腿部遮挡纹理 */ - useMask: boolean + useMask: boolean; } interface UpdateShareMenuOption { /** 需要基础库: `2.4.0` * * 动态消息的 activityId。通过 [updatableMessage.createActivityId](#) 接口获取 */ - activityId?: string + activityId?: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: UpdateShareMenuCompleteCallback + complete?: UpdateShareMenuCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: UpdateShareMenuFailCallback + fail?: UpdateShareMenuFailCallback; /** 需要基础库: `2.13.0` * * 是否是私密消息。详见 [小程序私密消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/private-message.html) */ - isPrivateMessage?: boolean + isPrivateMessage?: boolean; /** 需要基础库: `2.4.0` * * 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/updatable-message.html) */ - isUpdatableMessage?: boolean + isUpdatableMessage?: boolean; /** 接口调用成功的回调函数 */ - success?: UpdateShareMenuSuccessCallback + success?: UpdateShareMenuSuccessCallback; /** 需要基础库: `2.4.0` * * 动态消息的模板信息 */ - templateInfo?: UpdatableMessageFrontEndTemplateInfo + templateInfo?: UpdatableMessageFrontEndTemplateInfo; /** 需要基础库: `2.11.0` * * 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](#) 接口获取。详见[群待办消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ - toDoActivityId?: string + toDoActivityId?: string; /** 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ - withShareTicket?: boolean + withShareTicket?: boolean; } interface UpdateVoIPChatMuteConfigOption { /** 静音设置 */ - muteConfig: MuteConfig + muteConfig: MuteConfig; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: UpdateVoIPChatMuteConfigCompleteCallback + complete?: UpdateVoIPChatMuteConfigCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: UpdateVoIPChatMuteConfigFailCallback + fail?: UpdateVoIPChatMuteConfigFailCallback; /** 接口调用成功的回调函数 */ - success?: UpdateVoIPChatMuteConfigSuccessCallback + success?: UpdateVoIPChatMuteConfigSuccessCallback; } interface UpdateWeChatAppOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: UpdateWeChatAppCompleteCallback + complete?: UpdateWeChatAppCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: UpdateWeChatAppFailCallback + fail?: UpdateWeChatAppFailCallback; /** 接口调用成功的回调函数 */ - success?: UpdateWeChatAppSuccessCallback + success?: UpdateWeChatAppSuccessCallback; } interface UploadFileOption { /** 要上传文件资源的路径 (本地路径) */ - filePath: string + filePath: string; /** 文件对应的 key,开发者在服务端可以通过这个 key 获取文件的二进制内容 */ - name: string + name: string; /** 开发者服务器地址 */ - url: string + url: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: UploadFileCompleteCallback + complete?: UploadFileCompleteCallback; /** 需要基础库: `2.10.4` * * 是否开启 http2 */ - enableHttp2?: boolean + enableHttp2?: boolean; /** 是否开启 profile,默认开启。开启后可在接口回调的 res.profile 中查看性能调试信息。目前仅 iOS 端支持。 */ - enableProfile?: boolean + enableProfile?: boolean; /** 接口调用失败的回调函数 */ - fail?: UploadFileFailCallback + fail?: UploadFileFailCallback; /** HTTP 请求中其他额外的 form data */ - formData?: IAnyObject + formData?: IAnyObject; /** HTTP 请求 Header,Header 中不能设置 Referer */ - header?: IAnyObject + header?: IAnyObject; /** 接口调用成功的回调函数 */ - success?: UploadFileSuccessCallback + success?: UploadFileSuccessCallback; /** 需要基础库: `2.10.0` * * 超时时间,单位为毫秒 */ - timeout?: number + timeout?: number; /** 需要基础库: `3.4.1` * * 使用高性能模式,暂仅支持 Android,默认关闭。该模式下有更优的网络性能表现。 */ - useHighPerformanceMode?: boolean + useHighPerformanceMode?: boolean; } interface UploadFileSuccessCallbackResult { /** 开发者服务器返回的数据 */ - data: string + data: string; /** 开发者服务器返回的 HTTP 状态码 */ - statusCode: number - errMsg: string + statusCode: number; + errMsg: string; } interface UploadTaskOnProgressUpdateListenerResult { /** 上传进度百分比 */ - progress: number + progress: number; /** 预期需要上传的数据总长度,单位 Bytes */ - totalBytesExpectedToSend: number + totalBytesExpectedToSend: number; /** 已经上传的数据长度,单位 Bytes */ - totalBytesSent: number + totalBytesSent: number; } /** @warning **用户头像昵称获取规则已调整,参考 [用户信息接口调整说明](https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801)、[小程序用户头像昵称获取规则调整公告](https://developers.weixin.qq.com/community/develop/doc/00022c683e8a80b29bed2142b56c01)** * * 用户信息 */ interface UserInfo { /** 用户头像图片的 URL。URL 最后一个数值代表正方形头像大小(有 0、46、64、96、132 数值可选,0 代表 640x640 的正方形头像,46 表示 46x46 的正方形头像,剩余数值以此类推。默认132),用户没有头像时该项为空。若用户更换头像,原有头像 URL 将失效。 */ - avatarUrl: string + avatarUrl: string; /** 用户所在城市。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) */ - city: string + city: string; /** 用户所在国家。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) */ - country: string + country: string; /** 用户性别。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) * * 可选值: * - 0: 未知; * - 1: 男性; * - 2: 女性; */ - gender: 0 | 1 | 2 + gender: 0 | 1 | 2; /** 显示 country,province,city 所用的语言。强制返回 “zh_CN”,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) * * 可选值: * - 'en': 英文; * - 'zh_CN': 简体中文; * - 'zh_TW': 繁体中文; */ - language: 'en' | 'zh_CN' | 'zh_TW' + language: 'en' | 'zh_CN' | 'zh_TW'; /** 用户昵称 */ - nickName: string + nickName: string; /** 用户所在省份。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) */ - province: string + province: string; } /** 需要基础库: `2.28.0` * @@ -12562,24 +12386,24 @@ session.run({ * [实时摄像头body检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/body-detect) */ interface VKBodyAnchor { /** 关键点的置信度 */ - confidence: number[] + confidence: number[]; /** 识别序号 */ - detectId: number + detectId: number; /** 唯一标识 */ - id: number + id: number; /** 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - origin: VKOrigin + origin: VKOrigin; /** 关键点 */ - points: VKOrigin[] + points: VKOrigin[]; /** 总体置信值 */ - score: number + score: number; /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - size: VKSize + size: VKSize; /** 类型 * * 可选值: * - 5: 人体; */ - type: 5 + type: 5; } /** 需要基础库: `2.20.0` * @@ -12588,11 +12412,11 @@ session.run({ /** 需要基础库: `2.22.0` * * 相机内参,只有 v2 版本支持 */ - intrinsics: Float32Array + intrinsics: Float32Array; /** 相机原始的Pose矩阵 */ - transform: Float32Array + transform: Float32Array; /** 视图矩阵 */ - viewMatrix: Float32Array + viewMatrix: Float32Array; /** [Float32Array VKCamera.getProjectionMatrix(number near, number far)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKCamera.getProjectionMatrix.html) * * 需要基础库: `2.20.0` @@ -12604,16 +12428,16 @@ session.run({ /** 近视点 */ near: number, /** 远视点 */ - far: number - ): Float32Array + far: number, + ): Float32Array; } interface VKConfig { /** 跟踪能力配置,目前不同的跟踪能力之间是互斥的,默认使用平面跟踪能力。需要注意目前 track 中不同的跟踪配置存在互斥关系(比如 marker 跟踪配置和 OSD 跟踪配置不能同时存在),请按需配置。 */ - track: Track + track: Track; /** 需要基础库: `2.23.0` * * 绑定的 WebGLRenderingContext 对象 */ - gl?: WebGLRenderingContext + gl?: WebGLRenderingContext; /** 需要基础库: `2.22.0` * * vision kit 版本。 @@ -12621,7 +12445,7 @@ session.run({ * 可选值: * - 'v1': v1适用于用户在平面场景下,例如桌面,地面,泛平面场景,放置虚拟物体,不提供真实世界距离。用户放置物体时,手机相机倾斜向下对着目标平面点击即可,具有广泛的机型支持; * - 'v2': v2提供真实物理距离的 ar 定位功能,提供平面识别功能,用户在平面范围点击放置虚拟物体的功能,具有[有限的机型支持](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/plane.html#%E9%99%84%E5%BD%95)。iOS 设备在基础库 2.22.0 开始支持v2。安卓设备在基础库 2.25.1 开始支持v2,另外,安卓v2不支持竖直平面。**使用v2算法需要初始化,移动手机进行左右平移初始化效果最佳。**; */ - version?: 'v1' | 'v2' + version?: 'v1' | 'v2'; } /** 需要基础库: `2.33.0` * @@ -12632,16 +12456,16 @@ session.run({ * [深度估计能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/depth-detect) */ interface VKDepthAnchor { /** 包含深度信息的数组 */ - depthArray: number[] + depthArray: number[]; /** 唯一标识 */ - id: number + id: number; /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - size: VKSize + size: VKSize; /** 类型 * * 可选值: * - 8: DEPTH; */ - type: 8 + type: 8; } /** 需要基础库: `2.25.0` * @@ -12654,24 +12478,24 @@ session.run({ * [实时摄像头人脸检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/face-detect) */ interface VKFaceAnchor { /** 人脸角度信息 */ - angle: number[] + angle: number[]; /** 关键点的置信度 */ - confidence: number[] + confidence: number[]; /** 识别序号 */ - detectId: number + detectId: number; /** 唯一标识 */ - id: number + id: number; /** 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - origin: VKOrigin + origin: VKOrigin; /** 人脸 106 个关键点的坐标 */ - points: VKPoint[] + points: VKPoint[]; /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - size: VKSize + size: VKSize; /** 类型 * * 可选值: * - 3: 人脸; */ - type: 3 + type: 3; } /** 需要基础库: `2.20.0` * @@ -12680,9 +12504,9 @@ session.run({ /** [VKCamera](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKCamera.html) * * 相机对象 */ - camera: VKCamera + camera: VKCamera; /** 生成时间,单位:纳秒(ns) */ - timestamp: number + timestamp: number; /** [ArrayBuffer VKFrame.getCameraBuffer(number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getCameraBuffer.html) * * 需要基础库: `2.24.0` @@ -12694,8 +12518,8 @@ session.run({ /** 宽度,受系统限制,必须是 16 的整数倍 */ width: number, /** 高度 */ - height: number - ): ArrayBuffer + height: number, + ): ArrayBuffer; /** [ArrayBuffer VKFrame.getCameraJpgBuffer(number width, number height, number quality)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getCameraJpgBuffer.html) * * 需要基础库: `3.0.0` @@ -12709,8 +12533,8 @@ session.run({ /** 高度 */ height: number, /** 获取纹理质量,(0 - 100) */ - quality: number - ): ArrayBuffer + quality: number, + ): ArrayBuffer; /** [Float32Array VKFrame.getDisplayTransform()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getDisplayTransform.html) * * 需要基础库: `2.20.0` @@ -12718,7 +12542,7 @@ session.run({ * 在插件中使用:需要基础库 `2.20.0` * * 获取纹理调整矩阵。默认获取到的纹理是未经裁剪调整的纹理,此矩阵可用于在着色器中根据帧对象尺寸对纹理进行裁剪。 */ - getDisplayTransform(): Float32Array + getDisplayTransform(): Float32Array; /** [Object VKFrame.getCameraTexture(WebGLRenderingContext gl)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getCameraTexture.html) * * 需要基础库: `2.20.0` @@ -12728,8 +12552,8 @@ session.run({ * 获取当前帧纹理,目前只支持 YUV 纹理。 */ getCameraTexture( /** 画布 */ - gl: WebGLRenderingContext - ): YUVTextureRes + gl: WebGLRenderingContext, + ): YUVTextureRes; /** [Object VKFrame.getDepthBuffer()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getDepthBuffer.html) * * 需要基础库: `3.0.0` @@ -12737,7 +12561,7 @@ session.run({ * 在插件中使用:不支持 * * 获取每帧的深度图信息Buffer。安卓微信 8.0.38 开始支持,iOS微信 8.0.39 开始支持。 */ - getDepthBuffer(): DepthBufferRes + getDepthBuffer(): DepthBufferRes; /** [Object VKFrame.getLegSegmentBuffer()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getLegSegmentBuffer.html) * * 需要基础库: `3.2.1` @@ -12745,7 +12569,7 @@ session.run({ * 在插件中使用:不支持 * * 获取每帧的腿部分割信息Buffer,安卓微信 8.0.43,iOS微信 8.0.43 开始支持。 */ - getLegSegmentBuffer(): LegSegmentBufferRes + getLegSegmentBuffer(): LegSegmentBufferRes; } /** 需要基础库: `2.28.0` * @@ -12758,9 +12582,9 @@ session.run({ * [实时摄像头hand检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/hand-detect) */ interface VKHandAnchor { /** 关键点的置信度 */ - confidence: number[] + confidence: number[]; /** 识别序号 */ - detectId: number + detectId: number; /** 手势分类, 返回整数-1到18, -1表示无效手势 * * 可选值: @@ -12784,48 +12608,28 @@ session.run({ * - 17: 双手抱拳; * - 18: 无手势动作; * - -1: 无效手势; */ - gesture: - | 0 - | 1 - | 2 - | 3 - | 4 - | 5 - | 6 - | 7 - | 8 - | 9 - | 10 - | 11 - | 12 - | 13 - | 14 - | 15 - | 16 - | 17 - | 18 - | -1 + gesture: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -1; /** 唯一标识 */ - id: number + id: number; /** 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - origin: VKOrigin + origin: VKOrigin; /** 关键点 */ - points: VKOrigin[] + points: VKOrigin[]; /** 总体置信值 */ - score: number + score: number; /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - size: VKSize + size: VKSize; /** 类型 * * 可选值: * - 7: 手势; */ - type: 7 + type: 7; } interface VKMarker { /** marker id */ - markerId: number + markerId: number; /** 图片路径 */ - path: string + path: string; } /** 需要基础库: `2.24.5` * @@ -12836,18 +12640,18 @@ session.run({ * [2D Marker能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/2dmarker-ar) */ interface VKMarkerAnchor { /** 唯一标识 */ - id: number + id: number; /** marker id */ - markerId: number + markerId: number; /** 图片路径 */ - path: string + path: string; /** 包含位置、旋转、放缩信息的矩阵,以列为主序 */ - transform: Float32Array + transform: Float32Array; /** 类型 * * 可选值: * - 1: marker; */ - type: 1 + type: 1; } /** 需要基础库: `2.27.0` * @@ -12860,14 +12664,14 @@ session.run({ * [实时摄像头OCR检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/ocr-detect) */ interface VKOCRAnchor { /** 唯一标识 */ - id: number + id: number; /** 识别的文字结果 */ - text: string + text: string; /** 类型 * * 可选值: * - 6: OCR; */ - type: 6 + type: 6; } /** 需要基础库: `2.24.5` * @@ -12878,26 +12682,26 @@ session.run({ * [单样本检测(OSD)能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/osd-ar) */ interface VKOSDAnchor { /** 唯一标识 */ - id: number + id: number; /** marker id */ - markerId: number + markerId: number; /** 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - origin: VKOrigin + origin: VKOrigin; /** 图片路径 */ - path: string + path: string; /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ - size: VKSize + size: VKSize; /** 类型 * * 可选值: * - 2: OSD; */ - type: 2 + type: 2; } interface VKOrigin { /** 横坐标 */ - x: number + x: number; /** 纵坐标 */ - y: number + y: number; } /** 需要基础库: `2.22.0` * @@ -12909,34 +12713,34 @@ session.run({ * v2 版本:[水平面AR能力v2使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/plane-ar-v2) */ interface VKPlaneAnchor { /** 方向 */ - alignment: number + alignment: number; /** 唯一标识 */ - id: number + id: number; /** 尺寸 */ - size: VKSize + size: VKSize; /** 包含位置、旋转、放缩信息的矩阵,以列为主序 */ - transform: Float32Array + transform: Float32Array; /** 类型 * * 可选值: * - 0: 平面; */ - type: 0 + type: 0; } /** 人脸 106 个关键点的坐标 */ interface VKPoint { /** 横坐标 */ - x: number + x: number; /** 纵坐标 */ - y: number + y: number; } /** 需要基础库: `2.20.0` * * vision kit 会话对象。 */ interface VKSession { /** 相机尺寸 */ - cameraSize: VKSize + cameraSize: VKSize; /** 会话配置 */ - config: VKConfig + config: VKConfig; /** 会话状态 * * 可选值: @@ -12944,7 +12748,7 @@ session.run({ * - 1: 运行中; * - 2: 暂停中; * - 3: 初始化中; */ - state: 0 | 1 | 2 | 3 + state: 0 | 1 | 2 | 3; /** [Array.<Object> VKSession.getAllMarker()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.getAllMarker.html) * * 需要基础库: `2.24.5` @@ -12952,7 +12756,7 @@ session.run({ * 在插件中使用:需要基础库 `2.24.5` * * 获取所有 marker,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.marker 为 true */ - getAllMarker(): VKMarker[] + getAllMarker(): VKMarker[]; /** [Array.<Object> VKSession.getAllOSDMarker()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.getAllOSDMarker.html) * * 需要基础库: `2.24.5` @@ -12960,7 +12764,7 @@ session.run({ * 在插件中使用:需要基础库 `2.24.5` * * 获取所有 OSD marker,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.OSD 为 true */ - getAllOSDMarker(): VKMarker[] + getAllOSDMarker(): VKMarker[]; /** [Array.<Object> VKSession.hitTest(number x, number y, Object reset)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.hitTest.html) * * 需要基础库: `2.20.0` @@ -12974,8 +12778,8 @@ session.run({ /** 相对视窗的纵坐标,取值范围为 [0, 1],0 为上边缘,1 为下边缘 */ y: number, /** 是否需要重新识别其他平面,v2 版本不再需要此参数 */ - reset: IAnyObject - ): HitTestRes[] + reset: IAnyObject, + ): HitTestRes[]; /** [VKSession.cancelAnimationFrame(number requestID)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.cancelAnimationFrame.html) * * 需要基础库: `2.20.0` @@ -12983,7 +12787,7 @@ session.run({ * 在插件中使用:需要基础库 `2.20.0` * * 取消由 requestAnimationFrame 添加到计划中的动画帧请求。 */ - cancelAnimationFrame(requestID: number): void + cancelAnimationFrame(requestID: number): void; /** [VKSession.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.destroy.html) * * 需要基础库: `2.20.0` @@ -12991,7 +12795,7 @@ session.run({ * 在插件中使用:需要基础库 `2.20.0` * * 销毁会话。 */ - destroy(): void + destroy(): void; /** [VKSession.detectBody(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.detectBody.html) * * 需要基础库: `2.28.0` @@ -12999,7 +12803,7 @@ session.run({ * 在插件中使用:需要基础库 `2.28.0` * * 静态图像人体关键点检测。当 wx.createVKSession 参数传入 {track: {body: {mode: 2} } } 时可用。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/body.html)。 */ - detectBody(option: DetectBodyOption): void + detectBody(option: DetectBodyOption): void; /** [VKSession.detectDepth(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.detectDepth.html) * * 需要基础库: `2.33.0` @@ -13007,7 +12811,7 @@ session.run({ * 在插件中使用:需要基础库 `2.33.0` * * 深度识别。当 wx.createVKSession 参数传入 {track: {depth: {mode: 2} } } 时可用。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/depth.html)。 */ - detectDepth(option: DetectDepthOption): void + detectDepth(option: DetectDepthOption): void; /** [VKSession.detectFace(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.detectFace.html) * * 需要基础库: `2.25.0` @@ -13020,7 +12824,7 @@ session.run({ * * ### 特别说明 * 若小程序人脸识别功能涉及采集、存储用户生物特征(如人脸照片或视频、身份证和手持身份证、身份证照和免冠照等),此类型服务需使用[微信原生人脸识别接口](https://developers.weixin.qq.com/community/develop/doc/000442d352c1202bd498ecb105c00d?highline=%E4%BA%BA%E8%84%B8%E6%A0%B8%E8%BA%AB)。 */ - detectFace(option: DetectFaceOption): void + detectFace(option: DetectFaceOption): void; /** [VKSession.detectHand(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.detectHand.html) * * 需要基础库: `2.28.0` @@ -13028,7 +12832,7 @@ session.run({ * 在插件中使用:需要基础库 `2.28.0` * * 静态图像手势关键点检测。当 wx.createVKSession 参数传入 {track: {hand: {mode: 2} } } 时可用。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/hand.html)。 */ - detectHand(option: DetectHandOption): void + detectHand(option: DetectHandOption): void; /** [VKSession.off(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.off.html) * * 需要基础库: `2.20.0` @@ -13040,8 +12844,8 @@ session.run({ /** 事件名称 */ eventName: string, /** 事件监听函数 */ - fn: (...args: any[]) => any - ): void + fn: (...args: any[]) => any, + ): void; /** [VKSession.on(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.on.html) * * 需要基础库: `2.20.0` @@ -13057,14 +12861,10 @@ session.run({ * - 'addAnchors': 增加 anchor 事件,回调参数为 [VKPlaneAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKPlaneAnchor.html)/[VKMarkerAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKMarkerAnchor.html)/[VKOSDAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKOSDAnchor.html) 列表(只有v2版本支持); * - 'updateAnchors': 更新 anchor 事件,回调参数为 [VKPlaneAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKPlaneAnchor.html)/[VKMarkerAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKMarkerAnchor.html)/[VKOSDAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKOSDAnchor.html) 列表(只有v2版本支持) 或 [VKFaceAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFaceAnchor.html)/[VKOCRAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKOCRAnchor.html)/[VKHandAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKHandAnchor.html)/[VKBodyAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKBodyAnchor.html)列表(v1、v2都支持); * - 'removeAnchors': 删除 anchor 事件,回调参数为 [VKPlaneAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKPlaneAnchor.html)/[VKMarkerAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKMarkerAnchor.html)/[VKOSDAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKOSDAnchor.html) 列表(只有v2版本支持) 或 [VKFaceAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFaceAnchor.html)/[VKOCRAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKOCRAnchor.html)/[VKHandAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKHandAnchor.html)/[VKBodyAnchor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKBodyAnchor.html) 列表(v1、v2都支持); */ - eventName: - | 'resize' - | 'addAnchors' - | 'updateAnchors' - | 'removeAnchors', + eventName: 'resize' | 'addAnchors' | 'updateAnchors' | 'removeAnchors', /** 事件监听函数 */ - fn: (...args: any[]) => any - ): void + fn: (...args: any[]) => any, + ): void; /** [VKSession.removeMarker(number markerId)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.removeMarker.html) * * 需要基础库: `2.24.5` @@ -13074,8 +12874,8 @@ session.run({ * 删除一个 marker,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.marker 为 true */ removeMarker( /** marker id */ - markerId: number - ): void + markerId: number, + ): void; /** [VKSession.removeOSDMarker(number markerId)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.removeOSDMarker.html) * * 需要基础库: `2.24.5` @@ -13085,8 +12885,8 @@ session.run({ * 删除一个 OSD marker,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.OSD 为 true */ removeOSDMarker( /** marker id */ - markerId: number - ): void + markerId: number, + ): void; /** [VKSession.runOCR(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.runOCR.html) * * 需要基础库: `2.27.0` @@ -13094,7 +12894,7 @@ session.run({ * 在插件中使用:需要基础库 `2.27.0` * * 静态图像OCR检测。当 wx.createVKSession 参数传入 {track: {OCR: {mode: 2} } } 时可用。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/ocr.html)。 */ - runOCR(option: RunOCROption): void + runOCR(option: RunOCROption): void; /** [VKSession.setDepthOccRange(number threshold)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.setDepthOccRange.html) * * 需要基础库: `3.0.0` @@ -13104,8 +12904,8 @@ session.run({ * 更新 深度遮挡 Occ范围,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入 {track: {depth: {mode: 2} } } */ setDepthOccRange( /** 阈值 */ - threshold: number - ): void + threshold: number, + ): void; /** [VKSession.start(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.start.html) * * 需要基础库: `2.20.0` @@ -13115,8 +12915,8 @@ session.run({ * 开启会话。 */ start( /** 开启会话回调 */ - callback: VKSessionStartCallback - ): void + callback: VKSessionStartCallback, + ): void; /** [VKSession.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.stop.html) * * 需要基础库: `2.20.0` @@ -13124,7 +12924,7 @@ session.run({ * 在插件中使用:需要基础库 `2.20.0` * * 停止会话。 */ - stop(): void + stop(): void; /** [VKSession.update3DMode(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.update3DMode.html) * * 需要基础库: `2.30.2` @@ -13132,7 +12932,7 @@ session.run({ * 在插件中使用:需要基础库 `2.30.2` * * 更新三维识别相关配置,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时使用 face / hand / body。 */ - update3DMode(option: Update3DModeOption): void + update3DMode(option: Update3DModeOption): void; /** [VKSession.updateMaskMode(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.updateMaskMode.html) * * 需要基础库: `3.2.1` @@ -13140,7 +12940,7 @@ session.run({ * 在插件中使用:需要基础库 `3.2.1` * * 设置裁剪相关配置,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时使用 shoe。 */ - updateMaskMode(option: UpdateMaskModeOption): void + updateMaskMode(option: UpdateMaskModeOption): void; /** [VKSession.updateOSDThreshold(number threshold)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.updateOSDThreshold.html) * * 需要基础库: `2.24.5` @@ -13150,8 +12950,8 @@ session.run({ * 更新 OSD 识别精确度,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.OSD 为 true */ updateOSDThreshold( /** 阈值 */ - threshold: number - ): void + threshold: number, + ): void; /** [[VKFrame](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.html) VKSession.getVKFrame(number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.getVKFrame.html) * * 需要基础库: `2.20.0` @@ -13163,8 +12963,8 @@ session.run({ /** 宽度 */ width: number, /** 高度 */ - height: number - ): VKFrame + height: number, + ): VKFrame; /** [number VKSession.addMarker(string path)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.addMarker.html) * * 需要基础库: `2.24.5` @@ -13237,8 +13037,8 @@ session.run({ * 2.视频时长:视频建议时长在20s~30s,超过30s会被截断,时长过短会导致marker效果欠佳 */ addMarker( /** 图片路径,目前只支持本地用户图片 */ - path: string - ): number + path: string, + ): number; /** [number VKSession.addOSDMarker(string path)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.addOSDMarker.html) * * 需要基础库: `2.24.5` @@ -13277,8 +13077,8 @@ session.run({ * 2. 避免模糊,最好采用高清图片 */ addOSDMarker( /** 图片路径,目前只支持本地用户图片 */ - path: string - ): number + path: string, + ): number; /** [number VKSession.requestAnimationFrame(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.requestAnimationFrame.html) * * 需要基础库: `2.20.0` @@ -13288,41 +13088,41 @@ session.run({ * 在下次进行重绘时执行。 */ requestAnimationFrame( /** 执行的 callback */ - callback: (...args: any[]) => any - ): number + callback: (...args: any[]) => any, + ): number; } interface VKSize { /** 高度 */ - height: number + height: number; /** 宽度 */ - width: number + width: number; } interface VibrateLongOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: VibrateLongCompleteCallback + complete?: VibrateLongCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: VibrateLongFailCallback + fail?: VibrateLongFailCallback; /** 接口调用成功的回调函数 */ - success?: VibrateLongSuccessCallback + success?: VibrateLongSuccessCallback; } interface VibrateShortFailCallbackResult { /** 错误信息 * * 可选值: * - 'style is not support': 当前设备不支持设置震动等级; */ - errMsg: string + errMsg: string; } interface VibrateShortOption { /** 需要基础库: `2.13.0` * * 震动强度类型,有效值为:heavy、medium、light */ - type: string + type: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: VibrateShortCompleteCallback + complete?: VibrateShortCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: VibrateShortFailCallback + fail?: VibrateShortFailCallback; /** 接口调用成功的回调函数 */ - success?: VibrateShortSuccessCallback + success?: VibrateShortSuccessCallback; } interface VideoContextRequestFullScreenOption { /** 需要基础库: `1.7.0` @@ -13333,29 +13133,29 @@ session.run({ * - 0: 正常竖向; * - 90: 屏幕逆时针90度; * - -90: 屏幕顺时针90度; */ - direction?: 0 | 90 | -90 + direction?: 0 | 90 | -90; } interface VideoDecoderStartOption { /** 需要解码的视频源文件。基础库 2.13.0 以下的版本只支持本地路径。 2.13.0 开始支持 http:// 和 https:// 协议的远程路径。 */ - source: string + source: string; /** 需要基础库: `2.15.0` * * 是否不需要音频轨道 */ - abortAudio?: boolean + abortAudio?: boolean; /** 需要基础库: `2.15.0` * * 是否不需要视频轨道 */ - abortVideo?: boolean + abortVideo?: boolean; /** 解码模式。0:按 pts 解码;1:以最快速度解码 */ - mode?: number + mode?: number; } interface VoIP1v1ChatUser { /** 昵称 */ - nickname: string + nickname: string; /** 小程序内 openid */ - openid: string + openid: string; /** 头像 */ - headImage?: string + headImage?: string; } /** 需要基础库: `2.19.0` * @@ -13374,21 +13174,21 @@ setTimeout(audioCtx.resume, 2000) ``` */ interface WebAudioContext { /** 获取当前上下文的时间戳。 */ - currentTime: number + currentTime: number; /** [WebAudioContextNode](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContextNode.html) * * 当前上下文的最终目标节点,一般是音频渲染设备。 */ - destination: WebAudioContextNode + destination: WebAudioContextNode; /** [AudioListener](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioListener.html) * * 空间音频监听器。 */ - listener: AudioListener + listener: AudioListener; /** 可写属性,开发者可以对该属性设置一个监听函数,当WebAudio状态改变的时候,会触发开发者设置的监听函数。 */ - onstatechange: (...args: any[]) => any + onstatechange: (...args: any[]) => any; /** 采样率,通常在8000-96000之间,通常44100hz的采样率最为常见。 */ - sampleRate: number + sampleRate: number; /** 当前WebAudio上下文的状态。可能的值如下:suspended(暂停)、running(正在运行)、closed(已关闭)。需要注意的是,不要在 audioContext close后再访问state属性 */ - state: string + state: string; /** [AnalyserNode WebAudioContext.createAnalyser()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createAnalyser.html) * * 需要基础库: `2.22.0` @@ -13396,13 +13196,13 @@ setTimeout(audioCtx.resume, 2000) * 在插件中使用:不支持 * * 创建一个 AnalyserNode 。可以用来获取音频时间和频率数据,以及实现数据可视化。 */ - createAnalyser(): AnalyserNode + createAnalyser(): AnalyserNode; /** [BiquadFilterNode WebAudioContext.createBiquadFilter()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createBiquadFilter.html) * * 在插件中使用:不支持 * * 创建一个BiquadFilterNode */ - createBiquadFilter(): BiquadFilterNode + createBiquadFilter(): BiquadFilterNode; /** [ChannelMergerNode WebAudioContext.createChannelMerger(number numberOfInputs)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createChannelMerger.html) * * 在插件中使用:不支持 @@ -13410,8 +13210,8 @@ setTimeout(audioCtx.resume, 2000) * 创建一个ChannelMergerNode */ createChannelMerger( /** 输出流中需要保持的输入流的个数 */ - numberOfInputs: number - ): ChannelMergerNode + numberOfInputs: number, + ): ChannelMergerNode; /** [ChannelSplitterNode WebAudioContext.createChannelSplitter(number numberOfOutputs)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createChannelSplitter.html) * * 在插件中使用:不支持 @@ -13419,14 +13219,14 @@ setTimeout(audioCtx.resume, 2000) * 创建一个ChannelSplitterNode */ createChannelSplitter( /** 要分别输出的输入音频流中的通道数 */ - numberOfOutputs: number - ): ChannelSplitterNode + numberOfOutputs: number, + ): ChannelSplitterNode; /** [ConstantSourceNode WebAudioContext.createConstantSource()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createConstantSource.html) * * 在插件中使用:不支持 * * 创建一个ConstantSourceNode */ - createConstantSource(): ConstantSourceNode + createConstantSource(): ConstantSourceNode; /** [DelayNode WebAudioContext.createDelay(number maxDelayTime)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createDelay.html) * * 在插件中使用:不支持 @@ -13434,20 +13234,20 @@ setTimeout(audioCtx.resume, 2000) * 创建一个DelayNode */ createDelay( /** 最大延迟时间 */ - maxDelayTime: number - ): DelayNode + maxDelayTime: number, + ): DelayNode; /** [DynamicsCompressorNode WebAudioContext.createDynamicsCompressor()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createDynamicsCompressor.html) * * 在插件中使用:不支持 * * 创建一个DynamicsCompressorNode */ - createDynamicsCompressor(): DynamicsCompressorNode + createDynamicsCompressor(): DynamicsCompressorNode; /** [GainNode WebAudioContext.createGain()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createGain.html) * * 在插件中使用:不支持 * * 创建一个GainNode */ - createGain(): GainNode + createGain(): GainNode; /** [IIRFilterNode WebAudioContext.createIIRFilter(Array.<number> feedforward, Array.<number> feedback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createIIRFilter.html) * * 在插件中使用:不支持 @@ -13457,20 +13257,20 @@ setTimeout(audioCtx.resume, 2000) /** 一个浮点值数组,指定IIR滤波器传递函数的前馈(分子)系数。 */ feedforward: number[], /** 一个浮点值数组,指定IIR滤波器传递函数的反馈(分母)系数。 */ - feedback: number[] - ): IIRFilterNode + feedback: number[], + ): IIRFilterNode; /** [OscillatorNode WebAudioContext.createOscillator()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createOscillator.html) * * 在插件中使用:不支持 * * 创建一个OscillatorNode */ - createOscillator(): OscillatorNode + createOscillator(): OscillatorNode; /** [PannerNode WebAudioContext.createPanner()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createPanner.html) * * 在插件中使用:不支持 * * 创建一个PannerNode */ - createPanner(): PannerNode + createPanner(): PannerNode; /** [PeriodicWaveNode WebAudioContext.createPeriodicWave(Float32Array real, Float32Array imag, object constraints)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createPeriodicWave.html) * * 在插件中使用:不支持 @@ -13496,8 +13296,8 @@ const waveNode = audioContext.createPeriodicWave(real, imag, {disableNormalizati /** 一系列正弦项(传统上的B项) */ imag: Float32Array, /** 一个字典对象,用于指定是否禁用规范化(默认启用规范化) */ - constraints: Constraints - ): PeriodicWaveNode + constraints: Constraints, + ): PeriodicWaveNode; /** [Promise WebAudioContext.close()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.close.html) * * 在插件中使用:不支持 @@ -13513,19 +13313,19 @@ audioCtx.close().then(() => { console.log(audioCtx.state) // bad case:不应该在close后再访问state }) ``` */ - close(): Promise + close(): Promise; /** [Promise WebAudioContext.resume()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.resume.html) * * 在插件中使用:不支持 * * 同步恢复已经被暂停的WebAudioContext上下文 */ - resume(): Promise + resume(): Promise; /** [Promise WebAudioContext.suspend()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.suspend.html) * * 在插件中使用:不支持 * * 同步暂停WebAudioContext上下文 */ - suspend(): Promise + suspend(): Promise; /** [ScriptProcessorNode WebAudioContext.createScriptProcessor(number bufferSize, number numberOfInputChannels, number numberOfOutputChannels)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createScriptProcessor.html) * * 在插件中使用:不支持 @@ -13537,14 +13337,14 @@ audioCtx.close().then(() => { /** 用于指定输入node的声道的数量 */ numberOfInputChannels: number, /** 用于指定输出node的声道的数量 */ - numberOfOutputChannels: number - ): ScriptProcessorNode + numberOfOutputChannels: number, + ): ScriptProcessorNode; /** [WaveShaperNode WebAudioContext.createWaveShaper()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createWaveShaper.html) * * 在插件中使用:不支持 * * 创建一个WaveShaperNode */ - createWaveShaper(): WaveShaperNode + createWaveShaper(): WaveShaperNode; /** [[AudioBuffer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.html) WebAudioContext.createBuffer(number numOfChannels, number length, number sampleRate)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createBuffer.html) * * 在插件中使用:不支持 @@ -13556,8 +13356,8 @@ audioCtx.close().then(() => { /** 代表 buffer 中的样本帧数的整数 */ length: number, /** 线性音频样本的采样率,即每一秒包含的关键帧的个数 */ - sampleRate: number - ): AudioBuffer + sampleRate: number, + ): AudioBuffer; /** [[AudioBuffer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.html) WebAudioContext.decodeAudioData(ArrayBuffer audioData, function successCallback, function errorCallback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.decodeAudioData.html) * * 在插件中使用:不支持 @@ -13569,14 +13369,14 @@ audioCtx.close().then(() => { /** 在音频数据解码成功时被调用,参数为解码后的AudioBuffer */ successCallback: (...args: any[]) => any, /** 在音频数据解码失败时被调用 */ - errorCallback: (...args: any[]) => any - ): AudioBuffer + errorCallback: (...args: any[]) => any, + ): AudioBuffer; /** [[BufferSourceNode](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.html) WebAudioContext.createBufferSource()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createBufferSource.html) * * 在插件中使用:不支持 * * 创建一个BufferSourceNode实例,通过AudioBuffer对象来播放音频数据。 */ - createBufferSource(): BufferSourceNode + createBufferSource(): BufferSourceNode; } /** 一类音频处理模块,不同的Node具备不同的功能,如GainNode(音量调整)等。一个WebAudioContextNode可以通过上下文来创建。 * 目前已经支持以下Node: @@ -13600,11 +13400,11 @@ audioCtx.close().then(() => { /** 提供预设的 Wi-Fi 信息列表 */ interface WifiData { /** Wi-Fi 的 BSSID */ - BSSID?: string + BSSID?: string; /** Wi-Fi 的 SSID */ - SSID?: string + SSID?: string; /** Wi-Fi 设备密码 */ - password?: string + password?: string; } /** Wifi 信息 * @@ -13615,35 +13415,35 @@ audioCtx.close().then(() => { * - 在某些情况下,可能 Wi-Fi 已经连接成功,但会因为获取不到完整的 WifiInfo 对象报错。具体错误信息为 errCode: 12010, errMsg: can't gain current wifi 或 no wifi is connected 。如果开发者不需要完整的 WifiInfo 对象,则可以通过采取上述策略解决报错问题。 */ interface WifiInfo { /** Wi-Fi 的 BSSID */ - BSSID: string + BSSID: string; /** Wi-Fi 的 SSID */ - SSID: string + SSID: string; /** 需要基础库: `2.12.0` * * Wi-Fi 频段单位 MHz */ - frequency: number + frequency: number; /** Wi-Fi 是否安全 */ - secure: boolean + secure: boolean; /** Wi-Fi 信号强度, 安卓取值 0 ~ 100 ,iOS 取值 0 ~ 1 ,值越大强度越大 */ - signalStrength: number + signalStrength: number; } interface WindowInfo { /** 设备像素比 */ - pixelRatio: number + pixelRatio: number; /** 在竖屏正方向下的安全区域。部分机型没有安全区域概念,也不会返回 safeArea 字段,开发者需自行兼容。 */ - safeArea: SafeArea + safeArea: SafeArea; /** 屏幕高度,单位px */ - screenHeight: number + screenHeight: number; /** 窗口上边缘的y值 */ - screenTop: number + screenTop: number; /** 屏幕宽度,单位px */ - screenWidth: number + screenWidth: number; /** 状态栏的高度,单位px */ - statusBarHeight: number + statusBarHeight: number; /** 可使用窗口高度,单位px */ - windowHeight: number + windowHeight: number; /** 可使用窗口宽度,单位px */ - windowWidth: number + windowWidth: number; } /** Worker 实例,主线程中可通过 [wx.createWorker](https://developers.weixin.qq.com/miniprogram/dev/api/worker/wx.createWorker.html) 接口获取,worker 线程中可通过全局变量 `worker` 获取。 * @@ -13672,7 +13472,7 @@ worker.terminate() ``` */ interface Worker { /** worker内的环境变量 */ - env: WorkerEnv + env: WorkerEnv; /** [ArrayBuffer Worker.getCameraFrameData()](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.getCameraFrameData.html) * * 需要基础库: `2.25.1` @@ -13701,7 +13501,7 @@ cameraFrameListener.start({ const data = worker.getCameraFrameData() console.log(data) ``` */ - getCameraFrameData(): ArrayBuffer + getCameraFrameData(): ArrayBuffer; /** [Worker.onMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.onMessage.html) * * 在插件中使用:不支持 @@ -13709,8 +13509,8 @@ console.log(data) * 监听主线程/Worker 线程向当前线程发送的消息的事件。 */ onMessage( /** 主线程/Worker 线程向当前线程发送的消息的事件的监听函数 */ - listener: WorkerOnMessageCallback - ): void + listener: WorkerOnMessageCallback, + ): void; /** [Worker.onProcessKilled(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.onProcessKilled.html) * * 在插件中使用:不支持 @@ -13718,8 +13518,8 @@ console.log(data) * 监听 worker线程被系统回收事件(开启 useExperimentalWorker 后,当iOS系统资源紧张时,ExperimentalWorker 线程存在被系统回收的可能,开发者可监听此事件并重新创建一个worker)。仅限在主线程 worker 对象上调用。 */ onProcessKilled( /** worker线程被系统回收事件的监听函数 */ - listener: OnProcessKilledCallback - ): void + listener: OnProcessKilledCallback, + ): void; /** [Worker.postMessage(Object message)](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.postMessage.html) * * 在插件中使用:不支持 @@ -13750,14 +13550,14 @@ worker.postMessage({ * 在基础库2.20.2之后,postMessage支持传递任意类型的数据。 */ postMessage( /** 需要发送的消息。 */ - message: IAnyObject - ): void + message: IAnyObject, + ): void; /** [Worker.terminate()](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.terminate.html) * * 在插件中使用:不支持 * * 结束当前 Worker 线程。仅限在主线程 worker 对象上调用。 */ - terminate(): void + terminate(): void; /** [Worker.testOnProcessKilled()](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.testOnProcessKilled.html) * * 需要基础库: `2.27.1` @@ -13789,16 +13589,16 @@ setTimeout(() => { worker.testOnProcessKilled() }, 2000) ``` */ - testOnProcessKilled(): void + testOnProcessKilled(): void; } /** worker内的环境变量 */ interface WorkerEnv { /** 文件系统中的用户目录路径 (本地路径) */ - USER_DATA_PATH: string + USER_DATA_PATH: string; } interface WorkerOnMessageListenerResult { /** 主线程/Worker 线程向当前线程发送的消息 */ - message: IAnyObject + message: IAnyObject; } /** Easing 模块实现了常见的动画缓动函数(动画效果参考 https://easings.net/ ),可从 [wx.worklet](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/wx.worklet.html) 对象中读取。 * @@ -13964,63 +13764,63 @@ Easing.inOut(easing) interface WorkletScrollViewContext {} interface WorkletScrollViewContextScrollToOption { /** 是否启用滚动动画 */ - animated?: boolean + animated?: boolean; /** 滚动动画时长 */ - duration?: number + duration?: number; /** 动画曲线 */ - easingFunction?: string + easingFunction?: string; /** 左边界距离 */ - left?: number + left?: number; /** 顶部距离 */ - top?: number + top?: number; } interface WriteBLECharacteristicValueOption { /** 蓝牙特征的 UUID */ - characteristicId: string + characteristicId: string; /** 蓝牙设备 id */ - deviceId: string + deviceId: string; /** 蓝牙特征对应服务的 UUID */ - serviceId: string + serviceId: string; /** 蓝牙设备特征对应的二进制值 */ - value: ArrayBuffer + value: ArrayBuffer; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: WriteBLECharacteristicValueCompleteCallback + complete?: WriteBLECharacteristicValueCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: WriteBLECharacteristicValueFailCallback + fail?: WriteBLECharacteristicValueFailCallback; /** 接口调用成功的回调函数 */ - success?: WriteBLECharacteristicValueSuccessCallback + success?: WriteBLECharacteristicValueSuccessCallback; /** 蓝牙特征值的写模式设置,有两种模式,iOS 优先 write,安卓优先 writeNoResponse 。(基础库 2.22.0 开始支持) * * 可选值: * - 'write': 强制回复写,不支持时报错; * - 'writeNoResponse': 强制无回复写,不支持时报错; */ - writeType?: 'write' | 'writeNoResponse' + writeType?: 'write' | 'writeNoResponse'; } interface WriteCharacteristicValueObject { /** 蓝牙特征的 UUID */ - characteristicId: string + characteristicId: string; /** 是否需要通知主机 value 已更新 */ - needNotify: boolean + needNotify: boolean; /** 蓝牙特征对应服务的 UUID */ - serviceId: string + serviceId: string; /** characteristic 对应的二进制值 */ - value: ArrayBuffer + value: ArrayBuffer; /** 可选,处理回包时使用 */ - callbackId?: number + callbackId?: number; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: WriteCharacteristicValueCompleteCallback + complete?: WriteCharacteristicValueCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: WriteCharacteristicValueFailCallback + fail?: WriteCharacteristicValueFailCallback; /** 接口调用成功的回调函数 */ - success?: WriteCharacteristicValueSuccessCallback + success?: WriteCharacteristicValueSuccessCallback; } interface WriteFileOption { /** 要写入的文本或二进制数据 */ - data: string | ArrayBuffer + data: string | ArrayBuffer; /** 要写入的文件路径 (本地路径) */ - filePath: string + filePath: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: WriteFileCompleteCallback + complete?: WriteFileCompleteCallback; /** 指定写入文件的字符编码 * * 可选值: @@ -14035,44 +13835,33 @@ Easing.inOut(easing) * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | '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?: WriteFileFailCallback + fail?: WriteFileFailCallback; /** 接口调用成功的回调函数 */ - success?: WriteFileSuccessCallback + success?: WriteFileSuccessCallback; } interface WriteNdefMessageOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: WriteNdefMessageCompleteCallback + complete?: WriteNdefMessageCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: WriteNdefMessageFailCallback + fail?: WriteNdefMessageFailCallback; /** 二进制对象数组, 需要指明 id, type 以及 payload (均为 ArrayBuffer 类型) */ - records?: any[] + records?: any[]; /** 接口调用成功的回调函数 */ - success?: WriteNdefMessageSuccessCallback + success?: WriteNdefMessageSuccessCallback; /** text 数组 */ - texts?: any[] + texts?: any[]; /** uri 数组 */ - uris?: any[] + uris?: any[]; } interface WriteOption { /** 写入的内容,类型为 String 或 ArrayBuffer */ - data: string | ArrayBuffer + data: string | ArrayBuffer; /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: WriteCompleteCallback + complete?: WriteCompleteCallback; /** 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8 * * 可选值: @@ -14087,44 +13876,33 @@ Easing.inOut(easing) * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | '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?: WriteFailCallback + fail?: WriteFailCallback; /** 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 ArrayBuffer 从0开始偏移 offset 个字节后剩余的字节数 */ - length?: number + length?: number; /** 只在 data 类型是 ArrayBuffer 时有效,决定 ArrayBuffer 中要被写入的部位,即 ArrayBuffer 中的索引,默认0 */ - offset?: number + offset?: number; /** 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 */ - position?: number + position?: number; /** 接口调用成功的回调函数 */ - success?: WriteSuccessCallback + success?: WriteSuccessCallback; } /** 文件写入结果。 通过 [FileSystemManager.writeSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeSync.html) 接口返回 */ interface WriteResult { /** 实际被写入到文件中的字节数(注意,被写入的字节数不一定与被写入的字符串字符数相同) */ - bytesWritten: number + bytesWritten: number; } interface WriteSuccessCallbackResult { /** 实际被写入到文件中的字节数(注意,被写入的字节数不一定与被写入的字符串字符数相同) */ - bytesWritten: number - errMsg: string + bytesWritten: number; + errMsg: string; } interface WriteSyncOption { /** 写入的内容,类型为 String 或 ArrayBuffer */ - data: string | ArrayBuffer + data: string | ArrayBuffer; /** 文件描述符。fd 通过 [FileSystemManager.open](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) 或 [FileSystemManager.openSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) 接口获得 */ - fd: string + fd: string; /** 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8 * * 可选值: @@ -14139,65 +13917,54 @@ Easing.inOut(easing) * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | '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'; /** 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 ArrayBuffer 从0开始偏移 offset 个字节后剩余的字节数 */ - length?: number + length?: number; /** 只在 data 类型是 ArrayBuffer 时有效,决定 ArrayBuffer 中要被写入的部位,即 ArrayBuffer 中的索引,默认0 */ - offset?: number + offset?: number; /** 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 */ - position?: number + position?: number; } interface WxStartRecordOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StartRecordCompleteCallback + complete?: StartRecordCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StartRecordFailCallback + fail?: StartRecordFailCallback; /** 接口调用成功的回调函数 */ - success?: WxStartRecordSuccessCallback + success?: WxStartRecordSuccessCallback; } interface WxStopRecordOption { /** 接口调用结束的回调函数(调用成功、失败都会执行) */ - complete?: StopRecordCompleteCallback + complete?: StopRecordCompleteCallback; /** 接口调用失败的回调函数 */ - fail?: StopRecordFailCallback + fail?: StopRecordFailCallback; /** 接口调用成功的回调函数 */ - success?: WxStopRecordSuccessCallback + success?: WxStopRecordSuccessCallback; } /** 运动数据列表 */ interface WxaSportRecord { /** 消耗卡路里 */ - calorie: number + calorie: number; /** 运动距离 */ - distance: number + distance: number; /** 运动时长 */ - time: number + time: number; /** 运动项目id */ - typeId: number + typeId: number; } /** 帧纹理对象 */ interface YUVTextureRes { /** UV 分量纹理 */ - uvTexture: WebGLTexture + uvTexture: WebGLTexture; /** Y 分量纹理 */ - yTexture: WebGLTexture + yTexture: WebGLTexture; } /** 文件路径 */ interface ZipFileItem { /** 文件内容 */ - data: string | ArrayBuffer + data: string | ArrayBuffer; /** 错误信息 */ - errMsg: string + errMsg: string; } interface Animation { /** [Object Animation.export()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.export.html) @@ -14205,7 +13972,7 @@ Easing.inOut(easing) * 在插件中使用:支持 * * 导出动画队列。**export 方法每次调用后会清掉之前的动画操作。** */ - export(): AnimationExportResult + export(): AnimationExportResult; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.backgroundColor(string value)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.backgroundColor.html) * * 在插件中使用:支持 @@ -14213,8 +13980,8 @@ Easing.inOut(easing) * 设置背景色 */ backgroundColor( /** 颜色值 */ - value: string - ): Animation + value: string, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.bottom(number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.bottom.html) * * 在插件中使用:支持 @@ -14222,8 +13989,8 @@ Easing.inOut(easing) * 设置 bottom 值 */ bottom( /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ - value: number | string - ): Animation + value: number | string, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.height(number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.height.html) * * 在插件中使用:支持 @@ -14231,8 +13998,8 @@ Easing.inOut(easing) * 设置高度 */ height( /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ - value: number | string - ): Animation + value: number | string, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.left(number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.left.html) * * 在插件中使用:支持 @@ -14240,20 +14007,20 @@ Easing.inOut(easing) * 设置 left 值 */ left( /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ - value: number | string - ): Animation + value: number | string, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.matrix()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.matrix.html) * * 在插件中使用:支持 * * 同 [transform-function matrix](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix) */ - matrix(): Animation + matrix(): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.matrix3d()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.matrix3d.html) * * 在插件中使用:支持 * * 同 [transform-function matrix3d](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix3d) */ - matrix3d(): Animation + matrix3d(): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.opacity(number value)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.opacity.html) * * 在插件中使用:支持 @@ -14261,8 +14028,8 @@ Easing.inOut(easing) * 设置透明度 */ opacity( /** 透明度,范围 0-1 */ - value: number - ): Animation + value: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.right(number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.right.html) * * 在插件中使用:支持 @@ -14270,8 +14037,8 @@ Easing.inOut(easing) * 设置 right 值 */ right( /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ - value: number | string - ): Animation + value: number | string, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.rotate(number angle)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotate.html) * * 在插件中使用:支持 @@ -14279,8 +14046,8 @@ Easing.inOut(easing) * 从原点顺时针旋转一个角度 */ rotate( /** 旋转的角度。范围 [-180, 180] */ - angle: number - ): Animation + angle: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.rotate3d(number x, number y, number z, number angle)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotate3d.html) * * 在插件中使用:支持 @@ -14294,8 +14061,8 @@ Easing.inOut(easing) /** 旋转轴的 z 坐标 */ z: number, /** 旋转的角度。范围 [-180, 180] */ - angle: number - ): Animation + angle: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.rotateX(number angle)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateX.html) * * 在插件中使用:支持 @@ -14303,8 +14070,8 @@ Easing.inOut(easing) * 从 X 轴顺时针旋转一个角度 */ rotateX( /** 旋转的角度。范围 [-180, 180] */ - angle: number - ): Animation + angle: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.rotateY(number angle)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateY.html) * * 在插件中使用:支持 @@ -14312,8 +14079,8 @@ Easing.inOut(easing) * 从 Y 轴顺时针旋转一个角度 */ rotateY( /** 旋转的角度。范围 [-180, 180] */ - angle: number - ): Animation + angle: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.rotateZ(number angle)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.rotateZ.html) * * 在插件中使用:支持 @@ -14321,8 +14088,8 @@ Easing.inOut(easing) * 从 Z 轴顺时针旋转一个角度 */ rotateZ( /** 旋转的角度。范围 [-180, 180] */ - angle: number - ): Animation + angle: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.scale(number sx, number sy)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scale.html) * * 在插件中使用:支持 @@ -14332,8 +14099,8 @@ Easing.inOut(easing) /** 当仅有 sx 参数时,表示在 X 轴、Y 轴同时缩放sx倍数 */ sx: number, /** 在 Y 轴缩放 sy 倍数 */ - sy?: number - ): Animation + sy?: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.scale3d(number sx, number sy, number sz)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scale3d.html) * * 在插件中使用:支持 @@ -14345,8 +14112,8 @@ Easing.inOut(easing) /** y 轴的缩放倍数 */ sy: number, /** z 轴的缩放倍数 */ - sz: number - ): Animation + sz: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.scaleX(number scale)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleX.html) * * 在插件中使用:支持 @@ -14354,8 +14121,8 @@ Easing.inOut(easing) * 缩放 X 轴 */ scaleX( /** X 轴的缩放倍数 */ - scale: number - ): Animation + scale: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.scaleY(number scale)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleY.html) * * 在插件中使用:支持 @@ -14363,8 +14130,8 @@ Easing.inOut(easing) * 缩放 Y 轴 */ scaleY( /** Y 轴的缩放倍数 */ - scale: number - ): Animation + scale: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.scaleZ(number scale)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.scaleZ.html) * * 在插件中使用:支持 @@ -14372,8 +14139,8 @@ Easing.inOut(easing) * 缩放 Z 轴 */ scaleZ( /** Z 轴的缩放倍数 */ - scale: number - ): Animation + scale: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.skew(number ax, number ay)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skew.html) * * 在插件中使用:支持 @@ -14383,8 +14150,8 @@ Easing.inOut(easing) /** 对 X 轴坐标倾斜的角度,范围 [-180, 180] */ ax: number, /** 对 Y 轴坐标倾斜的角度,范围 [-180, 180] */ - ay: number - ): Animation + ay: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.skewX(number angle)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skewX.html) * * 在插件中使用:支持 @@ -14392,8 +14159,8 @@ Easing.inOut(easing) * 对 X 轴坐标进行倾斜 */ skewX( /** 倾斜的角度,范围 [-180, 180] */ - angle: number - ): Animation + angle: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.skewY(number angle)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.skewY.html) * * 在插件中使用:支持 @@ -14401,14 +14168,14 @@ Easing.inOut(easing) * 对 Y 轴坐标进行倾斜 */ skewY( /** 倾斜的角度,范围 [-180, 180] */ - angle: number - ): Animation + angle: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.step(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.step.html) * * 在插件中使用:支持 * * 表示一组动画完成。可以在一组动画中调用任意多个动画方法,一组动画中的所有动画会同时开始,一组动画完成后才会进行下一组动画。 */ - step(option?: StepOption): Animation + step(option?: StepOption): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.top(number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.top.html) * * 在插件中使用:支持 @@ -14416,8 +14183,8 @@ Easing.inOut(easing) * 设置 top 值 */ top( /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ - value: number | string - ): Animation + value: number | string, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.translate(number tx, number ty)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translate.html) * * 在插件中使用:支持 @@ -14427,8 +14194,8 @@ Easing.inOut(easing) /** 当仅有该参数时表示在 X 轴偏移 tx,单位 px */ tx?: number, /** 在 Y 轴平移的距离,单位为 px */ - ty?: number - ): Animation + ty?: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.translate3d(number tx, number ty, number tz)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translate3d.html) * * 在插件中使用:支持 @@ -14440,8 +14207,8 @@ Easing.inOut(easing) /** 在 Y 轴平移的距离,单位为 px */ ty?: number, /** 在 Z 轴平移的距离,单位为 px */ - tz?: number - ): Animation + tz?: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.translateX(number translation)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateX.html) * * 在插件中使用:支持 @@ -14449,8 +14216,8 @@ Easing.inOut(easing) * 对 X 轴平移 */ translateX( /** 在 X 轴平移的距离,单位为 px */ - translation: number - ): Animation + translation: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.translateY(number translation)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateY.html) * * 在插件中使用:支持 @@ -14458,8 +14225,8 @@ Easing.inOut(easing) * 对 Y 轴平移 */ translateY( /** 在 Y 轴平移的距离,单位为 px */ - translation: number - ): Animation + translation: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.translateZ(number translation)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.translateZ.html) * * 在插件中使用:支持 @@ -14467,8 +14234,8 @@ Easing.inOut(easing) * 对 Z 轴平移 */ translateZ( /** 在 Z 轴平移的距离,单位为 px */ - translation: number - ): Animation + translation: number, + ): Animation; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) Animation.width(number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.width.html) * * 在插件中使用:支持 @@ -14476,8 +14243,8 @@ Easing.inOut(easing) * 设置宽度 */ width( /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ - value: number | string - ): Animation + value: number | string, + ): Animation; } interface AudioContext { /** [AudioContext.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.pause.html) @@ -14486,14 +14253,14 @@ Easing.inOut(easing) * @deprecated 基础库版本 [1.6.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.createInnerAudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createInnerAudioContext.html) 替换 * * 暂停音频。 */ - pause(): void + pause(): void; /** [AudioContext.play()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.play.html) * * 在插件中使用:支持 * @deprecated 基础库版本 [1.6.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.createInnerAudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createInnerAudioContext.html) 替换 * * 播放音频。 */ - play(): void + play(): void; /** [AudioContext.seek(number position)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.seek.html) * * 在插件中使用:支持 @@ -14502,8 +14269,8 @@ Easing.inOut(easing) * 跳转到指定位置。 */ seek( /** 跳转位置,单位 s */ - position: number - ): void + position: number, + ): void; /** [AudioContext.setSrc(string src)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.setSrc.html) * * 在插件中使用:支持 @@ -14512,8 +14279,8 @@ Easing.inOut(easing) * 设置音频地址 */ setSrc( /** 音频地址 */ - src: string - ): void + src: string, + ): void; } interface BLEPeripheralServer { /** [BLEPeripheralServer.addService(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.addService.html) @@ -14523,7 +14290,7 @@ Easing.inOut(easing) * 在插件中使用:不支持 * * 添加服务。 */ - addService(option: AddServiceOption): void + addService(option: AddServiceOption): void; /** [BLEPeripheralServer.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.close.html) * * 需要基础库: `2.10.3` @@ -14531,7 +14298,7 @@ Easing.inOut(easing) * 在插件中使用:不支持 * * 关闭当前服务端。 */ - close(option?: BLEPeripheralServerCloseOption): void + close(option?: BLEPeripheralServerCloseOption): void; /** [BLEPeripheralServer.offCharacteristicReadRequest(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicReadRequest.html) * * 需要基础库: `2.10.3` @@ -14550,8 +14317,8 @@ BLEPeripheralServer.offCharacteristicReadRequest(listener) // 需传入与监听 ``` */ offCharacteristicReadRequest( /** onCharacteristicReadRequest 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffCharacteristicReadRequestCallback - ): void + listener?: OffCharacteristicReadRequestCallback, + ): void; /** [BLEPeripheralServer.offCharacteristicSubscribed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicSubscribed.html) * * 需要基础库: `2.13.0` @@ -14570,8 +14337,8 @@ BLEPeripheralServer.offCharacteristicSubscribed(listener) // 需传入与监听 ``` */ offCharacteristicSubscribed( /** onCharacteristicSubscribed 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffCharacteristicSubscribedCallback - ): void + listener?: OffCharacteristicSubscribedCallback, + ): void; /** [BLEPeripheralServer.offCharacteristicUnsubscribed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicUnsubscribed.html) * * 需要基础库: `2.13.0` @@ -14590,8 +14357,8 @@ BLEPeripheralServer.offCharacteristicUnsubscribed(listener) // 需传入与监 ``` */ offCharacteristicUnsubscribed( /** onCharacteristicUnsubscribed 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffCharacteristicUnsubscribedCallback - ): void + listener?: OffCharacteristicUnsubscribedCallback, + ): void; /** [BLEPeripheralServer.offCharacteristicWriteRequest(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicWriteRequest.html) * * 需要基础库: `2.10.3` @@ -14610,8 +14377,8 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 ``` */ offCharacteristicWriteRequest( /** onCharacteristicWriteRequest 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffCharacteristicWriteRequestCallback - ): void + listener?: OffCharacteristicWriteRequestCallback, + ): void; /** [BLEPeripheralServer.onCharacteristicReadRequest(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicReadRequest.html) * * 需要基础库: `2.10.3` @@ -14621,8 +14388,8 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * 监听已连接的设备请求读当前外围设备的特征值事件。收到该消息后需要立刻调用 [writeCharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 写回数据,否则主机不会收到响应。 */ onCharacteristicReadRequest( /** 已连接的设备请求读当前外围设备的特征值事件的监听函数 */ - listener: OnCharacteristicReadRequestCallback - ): void + listener: OnCharacteristicReadRequestCallback, + ): void; /** [BLEPeripheralServer.onCharacteristicSubscribed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicSubscribed.html) * * 需要基础库: `2.13.0` @@ -14632,8 +14399,8 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * 监听特征订阅事件,仅 iOS 支持。 */ onCharacteristicSubscribed( /** 特征订阅事件的监听函数 */ - listener: OnCharacteristicSubscribedCallback - ): void + listener: OnCharacteristicSubscribedCallback, + ): void; /** [BLEPeripheralServer.onCharacteristicUnsubscribed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicUnsubscribed.html) * * 需要基础库: `2.13.0` @@ -14643,8 +14410,8 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * 监听取消特征订阅事件,仅 iOS 支持。 */ onCharacteristicUnsubscribed( /** 取消特征订阅事件的监听函数 */ - listener: OnCharacteristicUnsubscribedCallback - ): void + listener: OnCharacteristicUnsubscribedCallback, + ): void; /** [BLEPeripheralServer.onCharacteristicWriteRequest(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicWriteRequest.html) * * 需要基础库: `2.10.3` @@ -14654,8 +14421,8 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * 监听已连接的设备请求写当前外围设备的特征值事件。收到该消息后需要立刻调用 [writeCharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 写回数据,否则主机不会收到响应。 */ onCharacteristicWriteRequest( /** 已连接的设备请求写当前外围设备的特征值事件的监听函数 */ - listener: OnCharacteristicWriteRequestCallback - ): void + listener: OnCharacteristicWriteRequestCallback, + ): void; /** [BLEPeripheralServer.removeService(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.removeService.html) * * 需要基础库: `2.10.3` @@ -14663,7 +14430,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * 在插件中使用:不支持 * * 移除服务。 */ - removeService(option: RemoveServiceOption): void + removeService(option: RemoveServiceOption): void; /** [BLEPeripheralServer.startAdvertising(Object Object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.startAdvertising.html) * * 需要基础库: `2.10.3` @@ -14679,7 +14446,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * - iOS 必须直接使用 16 位的 UUID,不能补位到 128 位,否则系统组包时仍会按照 128 位传输。iOS 暂不支持 32 位 UUID。 * - iOS 同时只能发起一个广播,安卓支持同时发起多个广播。 * - 传 beacon 参数时,不能同时传入 deviceName,serviceUuids,manufacturerData 参数。 */ - startAdvertising(Object: StartAdvertisingObject): void + startAdvertising(Object: StartAdvertisingObject): void; /** [BLEPeripheralServer.stopAdvertising(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.stopAdvertising.html) * * 需要基础库: `2.10.3` @@ -14687,7 +14454,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * 在插件中使用:不支持 * * 停止广播。 */ - stopAdvertising(option?: StopAdvertisingOption): void + stopAdvertising(option?: StopAdvertisingOption): void; /** [BLEPeripheralServer.writeCharacteristicValue(Object Object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) * * 需要基础库: `2.10.3` @@ -14695,7 +14462,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * 在插件中使用:不支持 * * 往指定特征写入二进制数据值,并通知已连接的主机,从机的特征值已发生变化,该接口会处理是走回包还是走订阅。 */ - writeCharacteristicValue(Object: WriteCharacteristicValueObject): void + writeCharacteristicValue(Object: WriteCharacteristicValueObject): void; } interface BackgroundAudioError { /** 错误信息 @@ -14706,7 +14473,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * | 10002 | | 网络错误 | * | 10003 | | 文件错误,请检查是否responseheader是否缺少Content-Length | * | 10004 | | 格式错误 | - * | -1 | | 未知错误 | */ errMsg: string + * | -1 | | 未知错误 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -14715,7 +14482,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * | 10002 | | 网络错误 | * | 10003 | | 文件错误,请检查是否responseheader是否缺少Content-Length | * | 10004 | | 格式错误 | - * | -1 | | 未知错误 | */ errCode: number + * | -1 | | 未知错误 | */ errCode: number; } interface BeaconError { /** 错误信息 @@ -14729,7 +14496,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * | 11003 | already start | 已经开始搜索 | * | 11004 | not startBeaconDiscovery | 还未开始搜索 | * | 11005 | system error | 系统错误 | - * | 11006 | invalid data | 参数不正确 | */ errMsg: string + * | 11006 | invalid data | 参数不正确 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -14741,7 +14508,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * | 11003 | already start | 已经开始搜索 | * | 11004 | not startBeaconDiscovery | 还未开始搜索 | * | 11005 | system error | 系统错误 | - * | 11006 | invalid data | 参数不正确 | */ errCode: number + * | 11006 | invalid data | 参数不正确 | */ errCode: number; } interface BluetoothError { /** 错误信息 @@ -14761,7 +14528,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * | 10008 | system error | 其余所有系统上报的异常 | * | 10009 | system not support | Android 系统特有,系统版本低于 4.3 不支持 BLE | * | 10012 | operate time out | 连接超时 | - * | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | */ errMsg: string + * | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -14779,7 +14546,7 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * | 10008 | system error | 其余所有系统上报的异常 | * | 10009 | system not support | Android 系统特有,系统版本低于 4.3 不支持 BLE | * | 10012 | operate time out | 连接超时 | - * | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | */ errCode: number + * | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | */ errCode: number; } interface CameraContext { /** [CameraContext.setZoom(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.setZoom.html) @@ -14789,25 +14556,25 @@ BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监 * 在插件中使用:支持 * * 设置缩放级别 */ - setZoom(option: CameraContextSetZoomOption): void + setZoom(option: CameraContextSetZoomOption): void; /** [CameraContext.startRecord(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.startRecord.html) * * 在插件中使用:支持 * * 开始录像 */ - startRecord(option: CameraContextStartRecordOption): void + startRecord(option: CameraContextStartRecordOption): void; /** [CameraContext.stopRecord(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.stopRecord.html) * * 在插件中使用:支持 * * 结束录像 */ - stopRecord(option: CameraContextStopRecordOption): void + stopRecord(option: CameraContextStopRecordOption): void; /** [CameraContext.takePhoto(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.takePhoto.html) * * 在插件中使用:支持 * * 拍摄照片 */ - takePhoto(option: TakePhotoOption): void + takePhoto(option: TakePhotoOption): void; /** [[CameraFrameListener](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraFrameListener.html) CameraContext.onCameraFrame(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.onCameraFrame.html) * * 需要基础库: `2.7.0` @@ -14831,8 +14598,8 @@ listener.start() ``` */ onCameraFrame( /** 回调函数 */ - callback: OnCameraFrameCallback - ): CameraFrameListener + callback: OnCameraFrameCallback, + ): CameraFrameListener; } interface CameraFrameListener { /** [CameraFrameListener.start(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraFrameListener.start.html) @@ -14840,13 +14607,13 @@ listener.start() * 在插件中使用:不支持 * * 开始监听帧数据 */ - start(option?: CameraFrameListenerStartOption): void + start(option?: CameraFrameListenerStartOption): void; /** [CameraFrameListener.stop(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraFrameListener.stop.html) * * 在插件中使用:不支持 * * 停止监听帧数据 */ - stop(option?: StopOption): void + stop(option?: StopOption): void; } interface CanvasGradient { /** [CanvasGradient.addColorStop(number stop, string color)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasGradient.addColorStop.html) @@ -14883,8 +14650,8 @@ ctx.draw() /** 表示渐变中开始与结束之间的位置,范围 0-1。 */ stop: number, /** 渐变点的颜色。 */ - color: string - ): void + color: string, + ): void; } interface CommonPaymentError { /** 错误信息 @@ -14900,7 +14667,7 @@ ctx.draw() * | 702005 | | out_trade_no重复,请更换新单号重试 | * | 702006 | | 二级商户进件未完成 | * | 702007 | | 用户未授权给品牌 | - * | 702008 | | 正式版小程序只能用生产环境下单 | */ errMsg: string + * | 702008 | | 正式版小程序只能用生产环境下单 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -14914,7 +14681,7 @@ ctx.draw() * | 702005 | | out_trade_no重复,请更换新单号重试 | * | 702006 | | 二级商户进件未完成 | * | 702007 | | 用户未授权给品牌 | - * | 702008 | | 正式版小程序只能用生产环境下单 | */ errCode: number + * | 702008 | | 正式版小程序只能用生产环境下单 | */ errCode: number; } interface Console { /** [console.debug()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.debug.html) @@ -14925,7 +14692,7 @@ ctx.draw() debug( /** 日志内容,可以有任意多个。 */ ...args: any[] - ): void + ): void; /** [console.error()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.error.html) * * 在插件中使用:不支持 @@ -14934,7 +14701,7 @@ ctx.draw() error( /** 日志内容,可以有任意多个。 */ ...args: any[] - ): void + ): void; /** [console.group(string label)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.group.html) * * 在插件中使用:不支持 @@ -14946,8 +14713,8 @@ ctx.draw() * 仅在工具中有效,在 vConsole 中为空函数实现。 */ group( /** 分组标记,可选。 */ - label?: string - ): void + label?: string, + ): void; /** [console.groupEnd()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.groupEnd.html) * * 在插件中使用:不支持 @@ -14957,7 +14724,7 @@ ctx.draw() * **注意** * * 仅在工具中有效,在 vConsole 中为空函数实现。 */ - groupEnd(): void + groupEnd(): void; /** [console.info()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.info.html) * * 在插件中使用:不支持 @@ -14966,7 +14733,7 @@ ctx.draw() info( /** 日志内容,可以有任意多个。 */ ...args: any[] - ): void + ): void; /** [console.log()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.log.html) * * 在插件中使用:不支持 @@ -14975,7 +14742,7 @@ ctx.draw() log( /** 日志内容,可以有任意多个。 */ ...args: any[] - ): void + ): void; /** [console.warn()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.warn.html) * * 在插件中使用:不支持 @@ -14984,7 +14751,7 @@ ctx.draw() warn( /** 日志内容,可以有任意多个。 */ ...args: any[] - ): void + ): void; } interface DownloadTask { /** [DownloadTask.abort()](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.abort.html) @@ -14994,7 +14761,7 @@ ctx.draw() * 在插件中使用:支持 * * 中断下载任务 */ - abort(): void + abort(): void; /** [DownloadTask.offHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.offHeadersReceived.html) * * 需要基础库: `2.1.0` @@ -15013,8 +14780,8 @@ DownloadTask.offHeadersReceived(listener) // 需传入与监听时同一个的 ``` */ offHeadersReceived( /** onHeadersReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: DownloadTaskOffHeadersReceivedCallback - ): void + listener?: DownloadTaskOffHeadersReceivedCallback, + ): void; /** [DownloadTask.offProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.offProgressUpdate.html) * * 需要基础库: `2.1.0` @@ -15033,8 +14800,8 @@ DownloadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函 ``` */ offProgressUpdate( /** onProgressUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: DownloadTaskOffProgressUpdateCallback - ): void + listener?: DownloadTaskOffProgressUpdateCallback, + ): void; /** [DownloadTask.onHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.onHeadersReceived.html) * * 需要基础库: `2.1.0` @@ -15044,8 +14811,8 @@ DownloadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函 * 监听 HTTP Response Header 事件。会比请求完成事件更早 */ onHeadersReceived( /** HTTP Response Header 事件的监听函数 */ - listener: DownloadTaskOnHeadersReceivedCallback - ): void + listener: DownloadTaskOnHeadersReceivedCallback, + ): void; /** [DownloadTask.onProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.onProgressUpdate.html) * * 需要基础库: `1.4.0` @@ -15055,8 +14822,8 @@ DownloadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函 * 监听下载进度变化事件 */ onProgressUpdate( /** 下载进度变化事件的监听函数 */ - listener: DownloadTaskOnProgressUpdateCallback - ): void + listener: DownloadTaskOnProgressUpdateCallback, + ): void; } interface DraggableSheetContext { /** [DraggableSheetContext.scrollTo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/skyline/DraggableSheetContext.scrollTo.html) @@ -15086,7 +14853,7 @@ Page({ }, }) ``` */ - scrollTo(option: DraggableSheetContextScrollToOption): void + scrollTo(option: DraggableSheetContextScrollToOption): void; } interface EditorContext { /** [EditorContext.blur(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.blur.html) @@ -15096,7 +14863,7 @@ Page({ * 在插件中使用:支持 * * 编辑器失焦,同时收起键盘。 */ - blur(option?: BlurOption): void + blur(option?: BlurOption): void; /** [EditorContext.clear(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.clear.html) * * 需要基础库: `2.7.0` @@ -15104,7 +14871,7 @@ Page({ * 在插件中使用:支持 * * 清空编辑器内容 */ - clear(option?: ClearOption): void + clear(option?: ClearOption): void; /** [EditorContext.format(string name, string value)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.format.html) * * 需要基础库: `2.7.0` @@ -15147,8 +14914,8 @@ Page({ /** 属性 */ name: string, /** 值 */ - value?: string - ): void + value?: string, + ): void; /** [EditorContext.getContents(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.getContents.html) * * 需要基础库: `2.7.0` @@ -15156,7 +14923,7 @@ Page({ * 在插件中使用:支持 * * 获取编辑器内容 */ - getContents(option?: GetContentsOption): void + getContents(option?: GetContentsOption): void; /** [EditorContext.getSelectionText(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.getSelectionText.html) * * 需要基础库: `2.10.2` @@ -15164,7 +14931,7 @@ Page({ * 在插件中使用:支持 * * 获取编辑器已选区域内的纯文本内容。当编辑器失焦或未选中一段区间时,返回内容为空。 */ - getSelectionText(option?: GetSelectionTextOption): void + getSelectionText(option?: GetSelectionTextOption): void; /** [EditorContext.insertDivider(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertDivider.html) * * 需要基础库: `2.7.0` @@ -15172,7 +14939,7 @@ Page({ * 在插件中使用:支持 * * 插入分割线 */ - insertDivider(option?: InsertDividerOption): void + insertDivider(option?: InsertDividerOption): void; /** [EditorContext.insertImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertImage.html) * * 需要基础库: `2.7.0` @@ -15195,7 +14962,7 @@ this.editorCtx.insertImage({ extClass: className }) ``` */ - insertImage(option: InsertImageOption): void + insertImage(option: InsertImageOption): void; /** [EditorContext.insertText(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertText.html) * * 需要基础库: `2.7.0` @@ -15203,7 +14970,7 @@ this.editorCtx.insertImage({ * 在插件中使用:支持 * * 覆盖当前选区,设置一段文本 */ - insertText(option: InsertTextOption): void + insertText(option: InsertTextOption): void; /** [EditorContext.redo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.redo.html) * * 需要基础库: `2.7.0` @@ -15211,7 +14978,7 @@ this.editorCtx.insertImage({ * 在插件中使用:支持 * * 恢复 */ - redo(option?: RedoOption): void + redo(option?: RedoOption): void; /** [EditorContext.removeFormat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.removeFormat.html) * * 需要基础库: `2.7.0` @@ -15219,7 +14986,7 @@ this.editorCtx.insertImage({ * 在插件中使用:支持 * * 清除当前选区的样式 */ - removeFormat(option?: RemoveFormatOption): void + removeFormat(option?: RemoveFormatOption): void; /** [EditorContext.scrollIntoView()](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.scrollIntoView.html) * * 需要基础库: `2.8.3` @@ -15227,7 +14994,7 @@ this.editorCtx.insertImage({ * 在插件中使用:支持 * * 使得编辑器光标处滚动到窗口可视区域内。 */ - scrollIntoView(): void + scrollIntoView(): void; /** [EditorContext.setContents(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.setContents.html) * * 需要基础库: `2.7.0` @@ -15235,7 +15002,7 @@ this.editorCtx.insertImage({ * 在插件中使用:支持 * * 初始化编辑器内容,html和delta同时存在时仅delta生效 */ - setContents(option: SetContentsOption): void + setContents(option: SetContentsOption): void; /** [EditorContext.undo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.undo.html) * * 需要基础库: `2.7.0` @@ -15243,7 +15010,7 @@ this.editorCtx.insertImage({ * 在插件中使用:支持 * * 撤销 */ - undo(option?: UndoOption): void + undo(option?: UndoOption): void; } interface EntryList { /** [Array.<[PerformanceEntry](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html)> EntryList.getEntries()](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/EntryList.getEntries.html) @@ -15253,7 +15020,7 @@ this.editorCtx.insertImage({ * 在插件中使用:不支持 * * 该方法返回当前列表中的所有性能数据 */ - getEntries(): PerformanceEntry[] + getEntries(): PerformanceEntry[]; /** [Array.<[PerformanceEntry](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html)> EntryList.getEntriesByName(string name, string entryType)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/EntryList.getEntriesByName.html) * * 需要基础库: `2.11.0` @@ -15261,10 +15028,7 @@ this.editorCtx.insertImage({ * 在插件中使用:不支持 * * 获取当前列表中所有名称为 [name] 且类型为 [entryType] 的性能数据 */ - getEntriesByName( - name: string, - entryType?: string - ): PerformanceEntry[] + getEntriesByName(name: string, entryType?: string): PerformanceEntry[]; /** [Array.<[PerformanceEntry](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html)> EntryList.getEntriesByType(string entryType)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/EntryList.getEntriesByType.html) * * 需要基础库: `2.11.0` @@ -15272,7 +15036,7 @@ this.editorCtx.insertImage({ * 在插件中使用:不支持 * * 获取当前列表中所有类型为 [entryType] 的性能数据 */ - getEntriesByType(entryType: string): PerformanceEntry[] + getEntriesByType(entryType: string): PerformanceEntry[]; } interface EventChannel { /** [EventChannel.emit(string eventName, any args)](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.emit.html) @@ -15287,7 +15051,7 @@ this.editorCtx.insertImage({ eventName: string, /** 事件参数 */ ...args: any - ): void + ): void; /** [EventChannel.off(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.off.html) * * 需要基础库: `2.7.3` @@ -15299,8 +15063,8 @@ this.editorCtx.insertImage({ /** 事件名称 */ eventName: string, /** 事件监听函数 */ - fn: EventCallback - ): void + fn: EventCallback, + ): void; /** [EventChannel.on(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.on.html) * * 需要基础库: `2.7.3` @@ -15312,8 +15076,8 @@ this.editorCtx.insertImage({ /** 事件名称 */ eventName: string, /** 事件监听函数 */ - fn: EventCallback - ): void + fn: EventCallback, + ): void; /** [EventChannel.once(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.once.html) * * 需要基础库: `2.7.3` @@ -15325,8 +15089,8 @@ this.editorCtx.insertImage({ /** 事件名称 */ eventName: string, /** 事件监听函数 */ - fn: EventCallback - ): void + fn: EventCallback, + ): void; } interface FileError { /** 错误信息 @@ -15368,7 +15132,7 @@ this.editorCtx.insertImage({ * | 1302003 | invalid flag | 无效的flag | * | 1302004 | permission denied when open using flag | 无法使用flag标志打开文件 | * | 1302005 | array buffer does not exist | 未传入arrayBuffer | - * | 1302100 | array buffer is readonly | arrayBuffer只读 | */ errMsg: string + * | 1302100 | array buffer is readonly | arrayBuffer只读 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -15408,7 +15172,7 @@ this.editorCtx.insertImage({ * | 1302003 | invalid flag | 无效的flag | * | 1302004 | permission denied when open using flag | 无法使用flag标志打开文件 | * | 1302005 | array buffer does not exist | 未传入arrayBuffer | - * | 1302100 | array buffer is readonly | arrayBuffer只读 | */ errCode: number + * | 1302100 | array buffer is readonly | arrayBuffer只读 | */ errCode: number; } interface FileSystemManager { /** [Array.<string> FileSystemManager.readdirSync(string dirPath)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdirSync.html) @@ -15443,8 +15207,8 @@ try { ``` */ readdirSync( /** 要读取的目录路径 (本地路径) */ - dirPath: string - ): string[] + dirPath: string, + ): string[]; /** [ArrayBuffer FileSystemManager.readCompressedFileSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readCompressedFileSync.html) * * 需要基础库: `2.21.1` @@ -15481,9 +15245,7 @@ try { console.log(err) } ``` */ - readCompressedFileSync( - option: ReadCompressedFileSyncOption - ): ArrayBuffer + readCompressedFileSync(option: ReadCompressedFileSyncOption): ArrayBuffer; /** [FileSystemManager.access(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.access.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -15514,7 +15276,7 @@ try { console.error(e) } ``` */ - access(option: AccessOption): void + access(option: AccessOption): void; /** [FileSystemManager.accessSync(string path)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.accessSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -15547,8 +15309,8 @@ try { ``` */ accessSync( /** 要判断是否存在的文件/目录路径 (本地路径) */ - path: string - ): void + path: string, + ): void; /** [FileSystemManager.appendFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFile.html) * * 需要基础库: `2.1.0` @@ -15581,7 +15343,7 @@ try { console.error(e) } ``` */ - appendFile(option: AppendFileOption): void + appendFile(option: AppendFileOption): void; /** [FileSystemManager.appendFileSync(string filePath, string|ArrayBuffer data, string encoding)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFileSync.html) * * 需要基础库: `2.1.0` @@ -15633,19 +15395,8 @@ try { * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | 'ascii' - | 'base64' - | 'binary' - | 'hex' - | 'ucs2' - | 'ucs-2' - | 'utf16le' - | 'utf-16le' - | 'utf-8' - | 'utf8' - | 'latin1' - ): void + encoding?: 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'ucs-2' | 'utf16le' | 'utf-16le' | 'utf-8' | 'utf8' | 'latin1', + ): void; /** [FileSystemManager.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.close.html) * * 需要基础库: `2.16.1` @@ -15670,7 +15421,7 @@ fs.open({ } }) ``` */ - close(option: FileSystemManagerCloseOption): void + close(option: FileSystemManagerCloseOption): void; /** [FileSystemManager.copyFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFile.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -15702,7 +15453,7 @@ try { console.error(e) } ``` */ - copyFile(option: CopyFileOption): void + copyFile(option: CopyFileOption): void; /** [FileSystemManager.copyFileSync(string srcPath, string destPath)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFileSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -15738,8 +15489,8 @@ try { /** 源文件路径,支持本地路径 */ srcPath: string, /** 目标文件路径,支持本地路径 */ - destPath: string - ): void + destPath: string, + ): void; /** [FileSystemManager.fstat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.fstat.html) * * 需要基础库: `2.16.1` @@ -15767,7 +15518,7 @@ fs.open({ } }) ``` */ - fstat(option: FstatOption): void + fstat(option: FstatOption): void; /** [FileSystemManager.ftruncate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.ftruncate.html) * * 需要基础库: `2.16.1` @@ -15796,19 +15547,19 @@ fs.open({ } }) ``` */ - ftruncate(option: FtruncateOption): void + ftruncate(option: FtruncateOption): void; /** [FileSystemManager.getFileInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getFileInfo.html) * * 在插件中使用:不支持 * * 获取该小程序下的 本地临时文件 或 本地缓存文件 信息 */ - getFileInfo(option: GetFileInfoOption): void + getFileInfo(option: GetFileInfoOption): void; /** [FileSystemManager.getSavedFileList(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getSavedFileList.html) * * 在插件中使用:不支持 * * 获取该小程序下已保存的本地缓存文件列表 */ - getSavedFileList(option?: GetSavedFileListOption): void + getSavedFileList(option?: GetSavedFileListOption): void; /** [FileSystemManager.mkdir(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdir.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -15837,7 +15588,7 @@ try { console.error(e) } ``` */ - mkdir(option: MkdirOption): void + mkdir(option: MkdirOption): void; /** [FileSystemManager.mkdirSync(string dirPath, boolean recursive)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdirSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -15872,8 +15623,8 @@ try { /** 需要基础库: `2.3.0` * * 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 */ - recursive?: boolean - ): void + recursive?: boolean, + ): void; /** [FileSystemManager.open(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) * * 需要基础库: `2.16.1` @@ -15894,7 +15645,7 @@ fs.open({ } }) ``` */ - open(option: OpenOption): void + open(option: OpenOption): void; /** [FileSystemManager.read(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.read.html) * * 需要基础库: `2.16.1` @@ -15927,7 +15678,7 @@ fs.open({ ``` * ## 注意事项 * - 小游戏 iOS 高性能模式(iOSHighPerformance)暂不支持 FileSystemManager.read 接口,请使用 FileSystemManager.readFile 接口代替 */ - read(option: ReadOption): void + read(option: ReadOption): void; /** [FileSystemManager.readCompressedFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readCompressedFile.html) * * 需要基础库: `2.21.1` @@ -15960,7 +15711,7 @@ const data = fs.readCompressedFileSync({ }) console.log(data) ``` */ - readCompressedFile(option: ReadCompressedFileOption): void + readCompressedFile(option: ReadCompressedFileOption): void; /** [FileSystemManager.readFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFile.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -15991,7 +15742,7 @@ try { console.error(e) } ``` */ - readFile(option: ReadFileOption): void + readFile(option: ReadFileOption): void; /** [FileSystemManager.readZipEntry(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readZipEntry.html) * * 需要基础库: `2.17.3` @@ -16055,7 +15806,7 @@ fs.readZipEntry({ }, }) ``` */ - readZipEntry(option: ReadZipEntryOption): void + readZipEntry(option: ReadZipEntryOption): void; /** [FileSystemManager.readdir(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdir.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16086,13 +15837,13 @@ try { console.error(e) } ``` */ - readdir(option: ReaddirOption): void + readdir(option: ReaddirOption): void; /** [FileSystemManager.removeSavedFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.removeSavedFile.html) * * 在插件中使用:不支持 * * 删除该小程序下已保存的本地缓存文件 */ - removeSavedFile(option: RemoveSavedFileOption): void + removeSavedFile(option: RemoveSavedFileOption): void; /** [FileSystemManager.rename(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rename.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16125,7 +15876,7 @@ try { console.error(e) } ``` */ - rename(option: RenameOption): void + rename(option: RenameOption): void; /** [FileSystemManager.renameSync(string oldPath, string newPath)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.renameSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16162,8 +15913,8 @@ try { /** 源文件路径,支持本地路径 */ oldPath: string, /** 新文件路径,支持本地路径 */ - newPath: string - ): void + newPath: string, + ): void; /** [FileSystemManager.rmdir(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdir.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16193,7 +15944,7 @@ try { console.error(e) } ``` */ - rmdir(option: RmdirOption): void + rmdir(option: RmdirOption): void; /** [FileSystemManager.rmdirSync(string dirPath, boolean recursive)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdirSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16229,20 +15980,20 @@ try { /** 需要基础库: `2.3.0` * * 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 */ - recursive?: boolean - ): void + recursive?: boolean, + ): void; /** [FileSystemManager.saveFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFile.html) * * 在插件中使用:不支持 * * 保存临时文件到本地。此接口会移动临时文件,因此调用成功后,tempFilePath 将不可用。 */ - saveFile(option: SaveFileOption): void + saveFile(option: SaveFileOption): void; /** [FileSystemManager.stat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.stat.html) * * 在插件中使用:需要基础库 `2.19.2` * * 获取文件 Stats 对象 */ - stat(option: StatOption): void + stat(option: StatOption): void; /** [FileSystemManager.truncate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncate.html) * * 需要基础库: `2.16.1` @@ -16263,7 +16014,7 @@ fs.truncate({ } }) ``` */ - truncate(option: TruncateOption): void + truncate(option: TruncateOption): void; /** [FileSystemManager.unlink(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlink.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16292,7 +16043,7 @@ try { console.error(e) } ``` */ - unlink(option: UnlinkOption): void + unlink(option: UnlinkOption): void; /** [FileSystemManager.unlinkSync(string filePath)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlinkSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16323,8 +16074,8 @@ try { ``` */ unlinkSync( /** 要删除的文件路径 (本地路径) */ - filePath: string - ): void + filePath: string, + ): void; /** [FileSystemManager.unzip(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unzip.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16346,7 +16097,7 @@ fs.unzip({ } }) ``` */ - unzip(option: UnzipOption): void + unzip(option: UnzipOption): void; /** [FileSystemManager.write(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.write.html) * * 需要基础库: `2.16.1` @@ -16375,7 +16126,7 @@ fs.open({ } }) ``` */ - write(option: WriteOption): void + write(option: WriteOption): void; /** [FileSystemManager.writeFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16410,7 +16161,7 @@ try { console.error(e) } ``` */ - writeFile(option: WriteFileOption): void + writeFile(option: WriteFileOption): void; /** [FileSystemManager.writeFileSync(string filePath, string|ArrayBuffer data, string encoding)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFileSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16464,19 +16215,8 @@ try { * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | 'ascii' - | 'base64' - | 'binary' - | 'hex' - | 'ucs2' - | 'ucs-2' - | 'utf16le' - | 'utf-16le' - | 'utf-8' - | 'utf8' - | 'latin1' - ): void + encoding?: 'ascii' | 'base64' | 'binary' | 'hex' | 'ucs2' | 'ucs-2' | 'utf16le' | 'utf-16le' | 'utf-8' | 'utf8' | 'latin1', + ): void; /** [[ReadResult](https://developers.weixin.qq.com/miniprogram/dev/api/file/ReadResult.html) FileSystemManager.readSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readSync.html) * * 需要基础库: `2.16.1` @@ -16503,7 +16243,7 @@ console.log(res) ``` * ## 注意事项 * - 小游戏 iOS 高性能模式(iOSHighPerformance)暂不支持 FileSystemManager.readSync 接口,请使用 FileSystemManager.readFileSync 接口代替 */ - readSync(option: ReadSyncOption): ReadResult + readSync(option: ReadSyncOption): ReadResult; /** [[Stats](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.html) FileSystemManager.fstatSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.fstatSync.html) * * 需要基础库: `2.16.1` @@ -16523,7 +16263,7 @@ const fd = fs.openSync({ const stats = fs.fstatSync({fd: fd}) console.log(stats) ``` */ - fstatSync(option: FstatSyncOption): Stats + fstatSync(option: FstatSyncOption): Stats; /** [[Stats](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.html)|Array.<[FileStats](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileStats.html)> FileSystemManager.statSync(string path, boolean recursive)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.statSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16535,8 +16275,8 @@ console.log(stats) /** 需要基础库: `2.3.0` * * 是否递归获取目录下的每个文件的 Stats 信息 */ - recursive?: boolean - ): Stats | FileStats[] + recursive?: boolean, + ): Stats | FileStats[]; /** [[WriteResult](https://developers.weixin.qq.com/miniprogram/dev/api/file/WriteResult.html) FileSystemManager.writeSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeSync.html) * * 需要基础库: `2.16.1` @@ -16559,7 +16299,7 @@ const res = fs.writeSync({ }) console.log(res.bytesWritten) ``` */ - writeSync(option: WriteSyncOption): WriteResult + writeSync(option: WriteSyncOption): WriteResult; /** [string FileSystemManager.openSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) * * 需要基础库: `2.16.1` @@ -16578,7 +16318,7 @@ const fd = fs.openSync({ }) console.log(fd) ``` */ - openSync(option: OpenSyncOption): string + openSync(option: OpenSyncOption): string; /** [string FileSystemManager.saveFileSync(string tempFilePath, string filePath)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFileSync.html) * * 在插件中使用:不支持 @@ -16588,8 +16328,8 @@ console.log(fd) /** 临时存储文件路径 (本地路径) */ tempFilePath: string, /** 要存储的文件路径 (本地路径) */ - filePath?: string - ): string + filePath?: string, + ): string; /** [string|ArrayBuffer FileSystemManager.readFileSync(string filePath, string encoding, number position, number length)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFileSync.html) * * 在插件中使用:需要基础库 `2.19.2` @@ -16637,18 +16377,7 @@ try { * - 'utf-8': ; * - 'utf8': ; * - 'latin1': ; */ - encoding?: - | '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', /** 需要基础库: `2.10.0` * * 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */ @@ -16656,8 +16385,8 @@ try { /** 需要基础库: `2.10.0` * * 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */ - length?: number - ): string | ArrayBuffer + length?: number, + ): string | ArrayBuffer; /** [undefined FileSystemManager.closeSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.closeSync.html) * * 需要基础库: `2.16.1` @@ -16678,7 +16407,7 @@ const fd = fs.openSync({ // 关闭文件 fs.closeSync({fd: fd}) ``` */ - closeSync(option: CloseSyncOption): undefined + closeSync(option: CloseSyncOption): undefined; /** [undefined FileSystemManager.ftruncateSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.ftruncateSync.html) * * 需要基础库: `2.16.1` @@ -16700,7 +16429,7 @@ fs.ftruncateSync({ length: 10 // 从第10个字节开始截断文件 }) ``` */ - ftruncateSync(option: FtruncateSyncOption): undefined + ftruncateSync(option: FtruncateSyncOption): undefined; /** [undefined FileSystemManager.truncateSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncateSync.html) * * 需要基础库: `2.16.1` @@ -16718,7 +16447,7 @@ fs.truncateSync({ length: 10, // 从第10个字节开始截断 }) ``` */ - truncateSync(option: TruncateSyncOption): undefined + truncateSync(option: TruncateSyncOption): undefined; } interface GetGroupEnterInfoError { /** 错误信息 @@ -16726,13 +16455,13 @@ fs.truncateSync({ * | 错误码 | 错误信息 | 说明 | * | - | - | - | * | 40097 | | 场景错误 | - * | 65206 | | 用户已不在该群内 | */ errMsg: string + * | 65206 | | 用户已不在该群内 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | * | - | - | - | * | 40097 | | 场景错误 | - * | 65206 | | 用户已不在该群内 | */ errCode: number + * | 65206 | | 用户已不在该群内 | */ errCode: number; } interface InferenceSession { /** [InferenceSession.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.destroy.html) @@ -16749,7 +16478,7 @@ fs.truncateSync({ // 销毁会话 session.destroy() ``` */ - destroy(): void + destroy(): void; /** [InferenceSession.offError(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.offError.html) * * 需要基础库: `2.30.0` @@ -16759,8 +16488,8 @@ session.destroy() * 取消监听模型加载失败事件 */ offError( /** 模型加载失败回调函数。传入指定回调函数则只取消指定回调,不传则取消所有回调 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; /** [InferenceSession.offLoad(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.offLoad.html) * * 需要基础库: `2.30.0` @@ -16770,8 +16499,8 @@ session.destroy() * 取消监听模型加载完成事件 */ offLoad( /** 模型加载完成回调函数。传入指定回调函数则只取消指定回调,不传则取消所有回调 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; /** [InferenceSession.onError(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.onError.html) * * 需要基础库: `2.30.0` @@ -16799,8 +16528,8 @@ session.onError(err => { ``` */ onError( /** 模型加载失败回调函数 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; /** [InferenceSession.onLoad(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.onLoad.html) * * 需要基础库: `2.30.0` @@ -16845,8 +16574,8 @@ session.onLoad(() => { ``` */ onLoad( /** 模型加载完成回调函数 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; /** [Promise<[Tensors](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/Tensors.html)> InferenceSession.run([Tensors](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/Tensors.html) tensors)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.run.html) * * 需要基础库: `2.30.0` @@ -16893,8 +16622,8 @@ session.onLoad(() => { /** [Tensors](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/Tensors.html) * * key-value 形式的对象,对象的 key 会作为 input name,对象的 value 则是 Tensor。 Tensor 结构如下。 */ - tensors: Tensors - ): Promise + tensors: Tensors, + ): Promise; } interface IntersectionObserver { /** [IntersectionObserver.disconnect()](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.disconnect.html) @@ -16902,7 +16631,7 @@ session.onLoad(() => { * 在插件中使用:支持 * * 停止监听。回调函数将不再触发 */ - disconnect(): void + disconnect(): void; /** [IntersectionObserver.observe(string targetSelector, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.observe.html) * * 在插件中使用:支持 @@ -16912,8 +16641,8 @@ session.onLoad(() => { /** 选择器 */ targetSelector: string, /** 监听相交状态变化的回调函数 */ - callback: IntersectionObserverObserveCallback - ): void + callback: IntersectionObserverObserveCallback, + ): void; /** [[IntersectionObserver](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.html) IntersectionObserver.relativeTo(string selector, Object margins)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.relativeTo.html) * * 在插件中使用:支持 @@ -16923,8 +16652,8 @@ session.onLoad(() => { /** 选择器 */ selector: string, /** 用来扩展(或收缩)参照节点布局区域的边界 */ - margins?: Margins - ): IntersectionObserver + margins?: Margins, + ): IntersectionObserver; /** [[IntersectionObserver](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.html) IntersectionObserver.relativeToViewport(Object margins)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.relativeToViewport.html) * * 在插件中使用:支持 @@ -16950,8 +16679,8 @@ Page({ ``` */ relativeToViewport( /** 用来扩展(或收缩)参照节点布局区域的边界 */ - margins?: Margins - ): IntersectionObserver + margins?: Margins, + ): IntersectionObserver; } interface InterstitialAd { /** [InterstitialAd.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.destroy.html) @@ -16961,7 +16690,7 @@ Page({ * 在插件中使用:不支持 * * 销毁插屏广告实例。 */ - destroy(): void + destroy(): void; /** [InterstitialAd.offClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.offClose.html) * * 在插件中使用:不支持 @@ -16978,8 +16707,8 @@ InterstitialAd.offClose(listener) // 需传入与监听时同一个的函数对 ``` */ offClose( /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: UDPSocketOffCloseCallback - ): void + listener?: UDPSocketOffCloseCallback, + ): void; /** [InterstitialAd.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.offError.html) * * 在插件中使用:不支持 @@ -16996,8 +16725,8 @@ InterstitialAd.offError(listener) // 需传入与监听时同一个的函数对 ``` */ offError( /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: InterstitialAdOffErrorCallback - ): void + listener?: InterstitialAdOffErrorCallback, + ): void; /** [InterstitialAd.offLoad(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.offLoad.html) * * 在插件中使用:不支持 @@ -17014,8 +16743,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 ``` */ offLoad( /** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffLoadCallback - ): void + listener?: OffLoadCallback, + ): void; /** [InterstitialAd.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.onClose.html) * * 在插件中使用:不支持 @@ -17023,8 +16752,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 监听插屏广告关闭事件。 */ onClose( /** 插屏广告关闭事件的监听函数 */ - listener: UDPSocketOnCloseCallback - ): void + listener: UDPSocketOnCloseCallback, + ): void; /** [InterstitialAd.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.onError.html) * * 在插件中使用:不支持 @@ -17049,8 +16778,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | 1008 | 广告单元已关闭 | 该广告位的广告能力已经被关闭 | 请前往mp.weixin.qq.com重新打开对应广告位的展现。| */ onError( /** 插屏错误事件的监听函数 */ - listener: InterstitialAdOnErrorCallback - ): void + listener: InterstitialAdOnErrorCallback, + ): void; /** [InterstitialAd.onLoad(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.onLoad.html) * * 在插件中使用:不支持 @@ -17058,8 +16787,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 监听插屏广告加载事件。 */ onLoad( /** 插屏广告加载事件的监听函数 */ - listener: OnLoadCallback - ): void + listener: OnLoadCallback, + ): void; /** [Promise InterstitialAd.load()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.load.html) * * 需要基础库: `2.8.0` @@ -17067,7 +16796,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 加载插屏广告。 */ - load(): Promise + load(): Promise; /** [Promise InterstitialAd.show()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.show.html) * * 在插件中使用:不支持 @@ -17085,7 +16814,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | 2003 | 触发频率限制 | 当前正在播放激励视频广告或者插屏广告,不允许再次展示插屏广告 | * | 2004 | 广告渲染失败 | 该项错误不是开发者的异常情况,或因小程序页面切换导致广告渲染失败 | * | 2005 | 广告调用异常 | 插屏广告实例不允许跨页面调用 | */ - show(): Promise + show(): Promise; } interface IsoDep { /** [IsoDep.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.close.html) @@ -17095,7 +16824,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 断开连接 */ - close(option?: NdefCloseOption): void + close(option?: NdefCloseOption): void; /** [IsoDep.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.connect.html) * * 需要基础库: `2.11.2` @@ -17103,7 +16832,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 连接 NFC 标签 */ - connect(option?: NdefConnectOption): void + connect(option?: NdefConnectOption): void; /** [IsoDep.getHistoricalBytes(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.getHistoricalBytes.html) * * 需要基础库: `2.11.2` @@ -17111,7 +16840,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取复位信息 */ - getHistoricalBytes(option?: GetHistoricalBytesOption): void + getHistoricalBytes(option?: GetHistoricalBytesOption): void; /** [IsoDep.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.getMaxTransceiveLength.html) * * 需要基础库: `2.11.2` @@ -17119,7 +16848,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取最大传输长度 */ - getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; /** [IsoDep.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.isConnected.html) * * 需要基础库: `2.11.2` @@ -17129,7 +16858,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * @warning **该接口已废弃,连接状态开发者自行维护即可** * * 检查是否已连接 */ - isConnected(option?: IsConnectedOption): void + isConnected(option?: IsConnectedOption): void; /** [IsoDep.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.setTimeout.html) * * 需要基础库: `2.11.2` @@ -17137,7 +16866,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置超时时间 */ - setTimeout(option: SetTimeoutOption): void + setTimeout(option: SetTimeoutOption): void; /** [IsoDep.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.transceive.html) * * 需要基础库: `2.11.2` @@ -17145,7 +16874,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 发送数据 */ - transceive(option: TransceiveOption): void + transceive(option: TransceiveOption): void; } interface Join1v1ChatError { /** 错误信息 @@ -17164,7 +16893,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | -1 | | 当前已在房间内 | * | -2 | | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | * | -3 | | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | - * | -1000 | | 系统错误 | */ errMsg: string + * | -1000 | | 系统错误 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -17181,7 +16910,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | -1 | | 当前已在房间内 | * | -2 | | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | * | -3 | | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | - * | -1000 | | 系统错误 | */ errCode: number + * | -1000 | | 系统错误 | */ errCode: number; } interface JoinVoIPChatError { /** 错误信息 @@ -17191,7 +16920,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | -1 | 当前已在房间内 | | * | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | * | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | - * | -1000 | 系统错误 | | */ errMsg: string + * | -1000 | 系统错误 | | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -17199,7 +16928,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | -1 | 当前已在房间内 | | * | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | * | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | - * | -1000 | 系统错误 | | */ errCode: number + * | -1000 | 系统错误 | | */ errCode: number; } interface LivePlayerContext { /** [LivePlayerContext.exitCasting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitCasting.html) @@ -17209,25 +16938,25 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 退出投屏。仅支持在 tap 事件回调内调用。 */ - exitCasting(option?: ExitCastingOption): void + exitCasting(option?: ExitCastingOption): void; /** [LivePlayerContext.exitFullScreen(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitFullScreen.html) * * 在插件中使用:支持 * * 退出全屏 */ - exitFullScreen(option?: ExitFullScreenOption): void + exitFullScreen(option?: ExitFullScreenOption): void; /** [LivePlayerContext.exitPictureInPicture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitPictureInPicture.html) * * 在插件中使用:支持 * * 退出小窗,该方法可在任意页面调用 */ - exitPictureInPicture(option?: ExitPictureInPictureOption): void + exitPictureInPicture(option?: ExitPictureInPictureOption): void; /** [LivePlayerContext.mute(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.mute.html) * * 在插件中使用:支持 * * 静音 */ - mute(option?: MuteOption): void + mute(option?: MuteOption): void; /** [LivePlayerContext.pause(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.pause.html) * * 需要基础库: `1.9.90` @@ -17235,13 +16964,13 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 暂停 */ - pause(option?: PauseOption): void + pause(option?: PauseOption): void; /** [LivePlayerContext.play(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.play.html) * * 在插件中使用:支持 * * 播放 */ - play(option?: PlayOption): void + play(option?: PlayOption): void; /** [LivePlayerContext.reconnectCasting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.reconnectCasting.html) * * 需要基础库: `2.32.0` @@ -17249,15 +16978,13 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 重连投屏设备。仅支持在 tap 事件回调内调用。 */ - reconnectCasting(option?: ReconnectCastingOption): void + reconnectCasting(option?: ReconnectCastingOption): void; /** [LivePlayerContext.requestFullScreen(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.requestFullScreen.html) * * 在插件中使用:支持 * * 进入全屏 */ - requestFullScreen( - option: LivePlayerContextRequestFullScreenOption - ): void + requestFullScreen(option: LivePlayerContextRequestFullScreenOption): void; /** [LivePlayerContext.requestPictureInPicture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.requestPictureInPicture.html) * * 需要基础库: `2.15.0` @@ -17265,7 +16992,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 进入小窗 */ - requestPictureInPicture(option?: RequestPictureInPictureOption): void + requestPictureInPicture(option?: RequestPictureInPictureOption): void; /** [LivePlayerContext.resume(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.resume.html) * * 需要基础库: `1.9.90` @@ -17273,7 +17000,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 恢复 */ - resume(option?: ResumeOption): void + resume(option?: ResumeOption): void; /** [LivePlayerContext.snapshot(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.snapshot.html) * * 需要基础库: `2.7.1` @@ -17281,7 +17008,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 截图 */ - snapshot(option: LivePlayerContextSnapshotOption): void + snapshot(option: LivePlayerContextSnapshotOption): void; /** [LivePlayerContext.startCasting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.startCasting.html) * * 需要基础库: `2.32.0` @@ -17289,13 +17016,13 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 开始投屏, 拉起半屏搜索设备。仅支持在 tap 事件回调内调用。 */ - startCasting(option?: StartCastingOption): void + startCasting(option?: StartCastingOption): void; /** [LivePlayerContext.stop(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.stop.html) * * 在插件中使用:支持 * * 停止 */ - stop(option?: StopOption): void + stop(option?: StopOption): void; /** [LivePlayerContext.switchCasting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.switchCasting.html) * * 需要基础库: `2.32.0` @@ -17303,7 +17030,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 切换投屏设备。仅支持在 tap 事件回调内调用。 */ - switchCasting(option?: SwitchCastingOption): void + switchCasting(option?: SwitchCastingOption): void; } interface LivePusherContext { /** [LivePusherContext.applyBlusherStickMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyBlusherStickMakeup.html) @@ -17313,7 +17040,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 添加腮红美妆特效 */ - applyBlusherStickMakeup(option: ApplyBlusherStickMakeupOption): void + applyBlusherStickMakeup(option: ApplyBlusherStickMakeupOption): void; /** [LivePusherContext.applyEyeBrowMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyEyeBrowMakeup.html) * * 需要基础库: `2.14.0` @@ -17321,7 +17048,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 添加眉毛美妆特效 */ - applyEyeBrowMakeup(option: ApplyEyeBrowMakeupOption): void + applyEyeBrowMakeup(option: ApplyEyeBrowMakeupOption): void; /** [LivePusherContext.applyEyeShadowMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyEyeShadowMakeup.html) * * 需要基础库: `2.14.0` @@ -17329,7 +17056,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 添加眼影美妆特效 */ - applyEyeShadowMakeup(option: ApplyEyeShadowMakeupOption): void + applyEyeShadowMakeup(option: ApplyEyeShadowMakeupOption): void; /** [LivePusherContext.applyFaceContourMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyFaceContourMakeup.html) * * 需要基础库: `2.14.0` @@ -17337,7 +17064,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 添加修容美妆特效 */ - applyFaceContourMakeup(option: ApplyFaceContourMakeupOption): void + applyFaceContourMakeup(option: ApplyFaceContourMakeupOption): void; /** [LivePusherContext.applyFilter(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyFilter.html) * * 需要基础库: `2.14.0` @@ -17345,7 +17072,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 添加滤镜效果 */ - applyFilter(option: ApplyFilterOption): void + applyFilter(option: ApplyFilterOption): void; /** [LivePusherContext.applyLipStickMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyLipStickMakeup.html) * * 需要基础库: `2.14.0` @@ -17353,7 +17080,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 添加口红美妆特效 */ - applyLipStickMakeup(option: ApplyLipStickMakeupOption): void + applyLipStickMakeup(option: ApplyLipStickMakeupOption): void; /** [LivePusherContext.applySticker(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applySticker.html) * * 需要基础库: `2.14.0` @@ -17361,7 +17088,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 添加贴纸特效 */ - applySticker(option: ApplyStickerOption): void + applySticker(option: ApplyStickerOption): void; /** [LivePusherContext.clearFilters(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.clearFilters.html) * * 需要基础库: `2.14.0` @@ -17369,7 +17096,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 清除所有滤镜效果 */ - clearFilters(option?: ClearFiltersOption): void + clearFilters(option?: ClearFiltersOption): void; /** [LivePusherContext.clearMakeups(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.clearMakeups.html) * * 需要基础库: `2.14.0` @@ -17377,7 +17104,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 清除所有美妆特效 */ - clearMakeups(option?: ClearMakeupsOption): void + clearMakeups(option?: ClearMakeupsOption): void; /** [LivePusherContext.clearStickers(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.clearStickers.html) * * 需要基础库: `2.14.0` @@ -17385,7 +17112,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:不支持 * * 清除所有贴纸特效 */ - clearStickers(option?: ClearStickersOption): void + clearStickers(option?: ClearStickersOption): void; /** [LivePusherContext.createOffscreenCanvas(object options)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.createOffscreenCanvas.html) * * 需要基础库: `2.29.0` @@ -17395,8 +17122,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 创建一个能够承接 LivePusher 采集纹理的离屏 Canvas,客户端 8.0.31 版本开始支持。 */ createOffscreenCanvas( /** 同[wx.createOffscreenCanvas](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) */ - options: IAnyObject - ): void + options: IAnyObject, + ): void; /** [LivePusherContext.exitPictureInPicture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.exitPictureInPicture.html) * * 需要基础库: `2.25.0` @@ -17404,7 +17131,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 退出小窗,该方法可在任意页面调用 */ - exitPictureInPicture(option?: ExitPictureInPictureOption): void + exitPictureInPicture(option?: ExitPictureInPictureOption): void; /** [LivePusherContext.getMaxZoom(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.getMaxZoom.html) * * 需要基础库: `2.31.0` @@ -17412,7 +17139,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取最大缩放级别 */ - getMaxZoom(option?: GetMaxZoomOption): void + getMaxZoom(option?: GetMaxZoomOption): void; /** [LivePusherContext.onCustomRendererEvent(string event, function|function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.onCustomRendererEvent.html) * * 需要基础库: `2.29.0` @@ -17428,14 +17155,14 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * - 'update': 推流尺寸变更时触发; */ event: 'frame' | 'update', /** 自定义渲染事件处理回调函数 */ - callback: CustomRendererFrameEventCallback - ): void + callback: CustomRendererFrameEventCallback, + ): void; /** [LivePusherContext.pause(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.pause.html) * * 在插件中使用:支持 * * 暂停推流 */ - pause(option?: PauseOption): void + pause(option?: PauseOption): void; /** [LivePusherContext.pauseBGM(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.pauseBGM.html) * * 需要基础库: `2.4.0` @@ -17443,7 +17170,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 暂停背景音 */ - pauseBGM(option?: PauseBGMOption): void + pauseBGM(option?: PauseBGMOption): void; /** [LivePusherContext.playBGM(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.playBGM.html) * * 需要基础库: `2.4.0` @@ -17451,13 +17178,13 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 播放背景音 */ - playBGM(option: PlayBGMOption): void + playBGM(option: PlayBGMOption): void; /** [LivePusherContext.resume(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.resume.html) * * 在插件中使用:支持 * * 恢复推流 */ - resume(option?: ResumeOption): void + resume(option?: ResumeOption): void; /** [LivePusherContext.resumeBGM(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.resumeBGM.html) * * 需要基础库: `2.4.0` @@ -17465,7 +17192,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 恢复背景音 */ - resumeBGM(option?: ResumeBGMOption): void + resumeBGM(option?: ResumeBGMOption): void; /** [LivePusherContext.sendMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.sendMessage.html) * * 需要基础库: `2.10.0` @@ -17473,7 +17200,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 发送SEI消息 */ - sendMessage(option: SendMessageOption): void + sendMessage(option: SendMessageOption): void; /** [LivePusherContext.setBGMVolume(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.setBGMVolume.html) * * 需要基础库: `2.4.0` @@ -17481,7 +17208,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置背景音音量 */ - setBGMVolume(option: SetBGMVolumeOption): void + setBGMVolume(option: SetBGMVolumeOption): void; /** [LivePusherContext.setMICVolume(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.setMICVolume.html) * * 需要基础库: `2.10.0` @@ -17489,7 +17216,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置麦克风音量 */ - setMICVolume(option: SetMICVolumeOption): void + setMICVolume(option: SetMICVolumeOption): void; /** [LivePusherContext.setZoom(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.setZoom.html) * * 需要基础库: `2.31.0` @@ -17497,7 +17224,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置缩放级别 */ - setZoom(option: LivePusherContextSetZoomOption): void + setZoom(option: LivePusherContextSetZoomOption): void; /** [LivePusherContext.snapshot(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.snapshot.html) * * 需要基础库: `1.9.90` @@ -17505,13 +17232,13 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 快照 */ - snapshot(option: LivePusherContextSnapshotOption): void + snapshot(option: LivePusherContextSnapshotOption): void; /** [LivePusherContext.start(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.start.html) * * 在插件中使用:支持 * * 开始推流,同时开启摄像头预览 */ - start(option?: LivePusherContextStartOption): void + start(option?: LivePusherContextStartOption): void; /** [LivePusherContext.startPreview(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.startPreview.html) * * 需要基础库: `2.7.0` @@ -17519,13 +17246,13 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 开启摄像头预览 */ - startPreview(option?: StartPreviewOption): void + startPreview(option?: StartPreviewOption): void; /** [LivePusherContext.stop(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.stop.html) * * 在插件中使用:支持 * * 停止推流,同时停止摄像头预览 */ - stop(option?: StopOption): void + stop(option?: StopOption): void; /** [LivePusherContext.stopBGM(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.stopBGM.html) * * 需要基础库: `2.4.0` @@ -17533,7 +17260,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 停止背景音 */ - stopBGM(option?: StopBGMOption): void + stopBGM(option?: StopBGMOption): void; /** [LivePusherContext.stopPreview(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.stopPreview.html) * * 需要基础库: `2.7.0` @@ -17541,13 +17268,13 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 关闭摄像头预览 */ - stopPreview(option?: StopPreviewOption): void + stopPreview(option?: StopPreviewOption): void; /** [LivePusherContext.switchCamera(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.switchCamera.html) * * 在插件中使用:支持 * * 切换前后摄像头 */ - switchCamera(option?: SwitchCameraOption): void + switchCamera(option?: SwitchCameraOption): void; /** [LivePusherContext.toggleTorch(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.toggleTorch.html) * * 需要基础库: `2.1.0` @@ -17555,7 +17282,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 切换手电筒 */ - toggleTorch(option?: ToggleTorchOption): void + toggleTorch(option?: ToggleTorchOption): void; } interface LogManager { /** [LogManager.debug()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.debug.html) @@ -17566,7 +17293,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 debug( /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过100Kb */ ...args: any[] - ): void + ): void; /** [LogManager.info()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.info.html) * * 在插件中使用:不支持 @@ -17575,7 +17302,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 info( /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过100Kb */ ...args: any[] - ): void + ): void; /** [LogManager.log()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.log.html) * * 在插件中使用:不支持 @@ -17584,7 +17311,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 log( /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过100Kb */ ...args: any[] - ): void + ): void; /** [LogManager.warn()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.warn.html) * * 在插件中使用:不支持 @@ -17593,7 +17320,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 warn( /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过100Kb */ ...args: any[] - ): void + ): void; } interface MapContext { /** [MapContext.addArc(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addArc.html) @@ -17603,7 +17330,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 添加弧线,途经点与夹角必须设置一个。途经点必须在起终点有效坐标范围内,否则不能生成正确的弧线,同时设置夹角角度时,以夹角角度为准。夹角定义为起点到终点,与起点外切线逆时针旋转的角度。工具侧暂未支持。 */ - addArc(option: AddArcOption): void + addArc(option: AddArcOption): void; /** [MapContext.addCustomLayer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addCustomLayer.html) * * 需要基础库: `2.12.0` @@ -17611,7 +17338,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 添加个性化图层。图层创建[参考文档](https://lbs.qq.com/dev/console/customLayer/create) */ - addCustomLayer(option: AddCustomLayerOption): void + addCustomLayer(option: AddCustomLayerOption): void; /** [MapContext.addGroundOverlay(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addGroundOverlay.html) * * 需要基础库: `2.14.0` @@ -17619,7 +17346,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 创建自定义图片图层,图片会随着地图缩放而缩放。 */ - addGroundOverlay(option: AddGroundOverlayOption): void + addGroundOverlay(option: AddGroundOverlayOption): void; /** [MapContext.addMarkers(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addMarkers.html) * * 需要基础库: `2.13.0` @@ -17627,7 +17354,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 添加 marker。 */ - addMarkers(option: AddMarkersOption): void + addMarkers(option: AddMarkersOption): void; /** [MapContext.addVisualLayer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addVisualLayer.html) * * 需要基础库: `2.20.1` @@ -17635,7 +17362,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 添加可视化图层。需要刷新时,interval 可设置的最小值为 15 s。 */ - addVisualLayer(option: AddVisualLayerOption): void + addVisualLayer(option: AddVisualLayerOption): void; /** [MapContext.eraseLines(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.eraseLines.html) * * 需要基础库: `2.5.0` @@ -17643,7 +17370,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 擦除或置灰已添加到地图中的线段。 */ - eraseLines(option: EraseLinesOption): void + eraseLines(option: EraseLinesOption): void; /** [MapContext.executeVisualLayerCommand(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.executeVisualLayerCommand.html) * * 需要基础库: `2.26.0` @@ -17651,7 +17378,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 执行可视化图层指令,结合 `MapContext.on('visualLayerEvent')` 监听事件使用。 */ - executeVisualLayerCommand(option: ExecuteVisualLayerCommandOption): void + executeVisualLayerCommand(option: ExecuteVisualLayerCommandOption): void; /** [MapContext.fromScreenLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.fromScreenLocation.html) * * 需要基础库: `2.14.0` @@ -17659,13 +17386,13 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取屏幕上的点对应的经纬度,坐标原点为地图左上角。 */ - fromScreenLocation(option: FromScreenLocationOption): void + fromScreenLocation(option: FromScreenLocationOption): void; /** [MapContext.getCenterLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getCenterLocation.html) * * 在插件中使用:支持 * * 获取当前地图中心的经纬度。返回的是 gcj02 坐标系,可以用于 [wx.openLocation()](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.openLocation.html) */ - getCenterLocation(option: GetCenterLocationOption): void + getCenterLocation(option: GetCenterLocationOption): void; /** [MapContext.getRegion(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getRegion.html) * * 需要基础库: `1.4.0` @@ -17673,7 +17400,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取当前地图的视野范围 */ - getRegion(option?: GetRegionOption): void + getRegion(option?: GetRegionOption): void; /** [MapContext.getRotate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getRotate.html) * * 需要基础库: `2.8.0` @@ -17681,7 +17408,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取当前地图的旋转角 */ - getRotate(option?: GetRotateOption): void + getRotate(option?: GetRotateOption): void; /** [MapContext.getScale(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getScale.html) * * 需要基础库: `1.4.0` @@ -17689,7 +17416,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取当前地图的缩放级别 */ - getScale(option?: GetScaleOption): void + getScale(option?: GetScaleOption): void; /** [MapContext.getSkew(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getSkew.html) * * 需要基础库: `2.8.0` @@ -17697,7 +17424,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取当前地图的倾斜角 */ - getSkew(option?: GetSkewOption): void + getSkew(option?: GetSkewOption): void; /** [MapContext.includePoints(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.includePoints.html) * * 需要基础库: `1.2.0` @@ -17705,7 +17432,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 缩放视野展示所有经纬度 */ - includePoints(option: IncludePointsOption): void + includePoints(option: IncludePointsOption): void; /** [MapContext.initMarkerCluster(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.initMarkerCluster.html) * * 需要基础库: `2.13.0` @@ -17713,7 +17440,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 初始化点聚合的配置,未调用时采用默认配置。 */ - initMarkerCluster(option: InitMarkerClusterOption): void + initMarkerCluster(option: InitMarkerClusterOption): void; /** [MapContext.moveAlong(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.moveAlong.html) * * 需要基础库: `2.13.0` @@ -17721,7 +17448,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 沿指定路径移动 `marker`,用于轨迹回放等场景。动画完成时触发回调事件,若动画进行中,对同一 `marker` 再次调用 `moveAlong` 方法,前一次的动画将被打断。 */ - moveAlong(option: MoveAlongOption): void + moveAlong(option: MoveAlongOption): void; /** [MapContext.moveToLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.moveToLocation.html) * * 需要基础库: `1.2.0` @@ -17729,7 +17456,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 将地图中心移置当前定位点,此时需设置地图组件 show-location 为true。[2.8.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持将地图中心移动到指定位置。 */ - moveToLocation(option?: MoveToLocationOption): void + moveToLocation(option?: MoveToLocationOption): void; /** [MapContext.on(string event, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.on.html) * * 需要基础库: `2.13.0` @@ -17805,14 +17532,10 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * - 'markerClusterClick': ; * - 'visualLayerEvent': ; * - 'markerCollisionStatusChange': ; */ - event: - | 'markerClusterCreate' - | 'markerClusterClick' - | 'visualLayerEvent' - | 'markerCollisionStatusChange', + event: 'markerClusterCreate' | 'markerClusterClick' | 'visualLayerEvent' | 'markerCollisionStatusChange', /** 事件的回调函数 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; /** [MapContext.openMapApp(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.openMapApp.html) * * 需要基础库: `2.14.0` @@ -17820,7 +17543,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 拉起地图APP选择导航。 */ - openMapApp(option: OpenMapAppOption): void + openMapApp(option: OpenMapAppOption): void; /** [MapContext.removeArc(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeArc.html) * * 需要基础库: `2.22.0` @@ -17828,7 +17551,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 删除弧线。工具侧暂未支持。 */ - removeArc(option: RemoveArcOption): void + removeArc(option: RemoveArcOption): void; /** [MapContext.removeCustomLayer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeCustomLayer.html) * * 需要基础库: `2.12.0` @@ -17836,7 +17559,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 移除个性化图层。 */ - removeCustomLayer(option: RemoveCustomLayerOption): void + removeCustomLayer(option: RemoveCustomLayerOption): void; /** [MapContext.removeGroundOverlay(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeGroundOverlay.html) * * 需要基础库: `2.14.0` @@ -17844,7 +17567,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 移除自定义图片图层。 */ - removeGroundOverlay(option: RemoveGroundOverlayOption): void + removeGroundOverlay(option: RemoveGroundOverlayOption): void; /** [MapContext.removeMarkers(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeMarkers.html) * * 需要基础库: `2.13.0` @@ -17852,7 +17575,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 移除 marker。 */ - removeMarkers(option: RemoveMarkersOption): void + removeMarkers(option: RemoveMarkersOption): void; /** [MapContext.removeVisualLayer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeVisualLayer.html) * * 需要基础库: `2.20.1` @@ -17860,7 +17583,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 移除可视化图层。 */ - removeVisualLayer(option: RemoveVisualLayerOption): void + removeVisualLayer(option: RemoveVisualLayerOption): void; /** [MapContext.setBoundary(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.setBoundary.html) * * 需要基础库: `2.22.0` @@ -17868,7 +17591,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 限制地图的显示范围。此接口同时会限制地图的最小缩放整数级别。 */ - setBoundary(option: SetBoundaryOption): void + setBoundary(option: SetBoundaryOption): void; /** [MapContext.setCenterOffset(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.setCenterOffset.html) * * 需要基础库: `2.10.0` @@ -17876,7 +17599,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置地图中心点偏移,向后向下为增长,屏幕比例范围(0.25~0.75),默认偏移为[0.5, 0.5] */ - setCenterOffset(option: SetCenterOffsetOption): void + setCenterOffset(option: SetCenterOffsetOption): void; /** [MapContext.setLocMarkerIcon(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.setLocMarkerIcon.html) * * 需要基础库: `2.16.0` @@ -17884,7 +17607,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置定位点图标,支持网络路径、本地路径、代码包路径 */ - setLocMarkerIcon(option: SetLocMarkerIconOption): void + setLocMarkerIcon(option: SetLocMarkerIconOption): void; /** [MapContext.toScreenLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.toScreenLocation.html) * * 需要基础库: `2.14.0` @@ -17892,7 +17615,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取经纬度对应的屏幕坐标,坐标原点为地图左上角。 */ - toScreenLocation(option: ToScreenLocationOption): void + toScreenLocation(option: ToScreenLocationOption): void; /** [MapContext.translateMarker(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.translateMarker.html) * * 需要基础库: `1.2.0` @@ -17900,7 +17623,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 平移marker,带动画。 */ - translateMarker(option: TranslateMarkerOption): void + translateMarker(option: TranslateMarkerOption): void; /** [MapContext.updateGroundOverlay(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.updateGroundOverlay.html) * * 需要基础库: `2.14.0` @@ -17908,7 +17631,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 更新自定义图片图层。 */ - updateGroundOverlay(option: UpdateGroundOverlayOption): void + updateGroundOverlay(option: UpdateGroundOverlayOption): void; } interface MediaContainer { /** [MediaContainer.addTrack([MediaTrack](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaTrack.html) track)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.addTrack.html) @@ -17922,8 +17645,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 /** [MediaTrack](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaTrack.html) * * 要添加的音频或视频轨道 */ - track: MediaTrack - ): void + track: MediaTrack, + ): void; /** [MediaContainer.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.destroy.html) * * 需要基础库: `2.9.0` @@ -17931,7 +17654,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 将容器销毁,释放资源 */ - destroy(): void + destroy(): void; /** [MediaContainer.export()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.export.html) * * 需要基础库: `2.9.0` @@ -17939,7 +17662,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 将容器内的轨道合并并导出视频文件 */ - export(): void + export(): void; /** [MediaContainer.extractDataSource(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.extractDataSource.html) * * 需要基础库: `2.9.0` @@ -17947,7 +17670,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 将传入的视频源分离轨道。不会自动将轨道添加到待合成的容器里。 */ - extractDataSource(option: ExtractDataSourceOption): void + extractDataSource(option: ExtractDataSourceOption): void; /** [MediaContainer.removeTrack([MediaTrack](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaTrack.html) track)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.removeTrack.html) * * 需要基础库: `2.9.0` @@ -17959,8 +17682,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 /** [MediaTrack](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaTrack.html) * * 要移除的音频或视频轨道 */ - track: MediaTrack - ): void + track: MediaTrack, + ): void; } interface MediaQueryObserver { /** [MediaQueryObserver.disconnect()](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/MediaQueryObserver.disconnect.html) @@ -17968,7 +17691,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 停止监听。回调函数将不再触发 */ - disconnect(): void + disconnect(): void; /** [MediaQueryObserver.observe(Object descriptor, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/MediaQueryObserver.observe.html) * * 在插件中使用:支持 @@ -17978,8 +17701,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 /** media query 描述符 */ descriptor: ObserveDescriptor, /** 监听 media query 状态变化的回调函数 */ - callback: MediaQueryObserverObserveCallback - ): void + callback: MediaQueryObserverObserveCallback, + ): void; } interface MediaRecorder { /** [MediaRecorder.off(string eventName, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.off.html) @@ -17993,8 +17716,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 /** 事件名 */ eventName: string, /** 事件触发时执行的回调函数 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; /** [MediaRecorder.on(string eventName, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.on.html) * * 需要基础库: `2.11.0` @@ -18013,8 +17736,8 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * - 'timeupdate': 录制时间更新事件。; */ eventName: 'start' | 'stop' | 'pause' | 'resume' | 'timeupdate', /** 事件触发时执行的回调函数 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; /** [Promise MediaRecorder.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.destroy.html) * * 需要基础库: `2.11.0` @@ -18022,7 +17745,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 销毁录制器 */ - destroy(): Promise + destroy(): Promise; /** [Promise MediaRecorder.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.pause.html) * * 需要基础库: `2.11.0` @@ -18030,7 +17753,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 暂停录制 */ - pause(): Promise + pause(): Promise; /** [Promise MediaRecorder.requestFrame(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.requestFrame.html) * * 需要基础库: `2.11.0` @@ -18038,7 +17761,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 请求下一帧录制,在 callback 里完成一帧渲染后开始录制当前帧 */ - requestFrame(callback: (...args: any[]) => any): Promise + requestFrame(callback: (...args: any[]) => any): Promise; /** [Promise MediaRecorder.resume()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.resume.html) * * 需要基础库: `2.11.0` @@ -18046,7 +17769,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 恢复录制 */ - resume(): Promise + resume(): Promise; /** [Promise MediaRecorder.start()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.start.html) * * 需要基础库: `2.11.0` @@ -18054,7 +17777,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 开始录制 */ - start(): Promise + start(): Promise; /** [Promise MediaRecorder.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.stop.html) * * 需要基础库: `2.11.0` @@ -18062,7 +17785,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 结束录制 */ - stop(): Promise + stop(): Promise; } interface MifareClassic { /** [MifareClassic.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.close.html) @@ -18072,7 +17795,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 断开连接 */ - close(option?: NdefCloseOption): void + close(option?: NdefCloseOption): void; /** [MifareClassic.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.connect.html) * * 需要基础库: `2.11.2` @@ -18080,7 +17803,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 连接 NFC 标签 */ - connect(option?: NdefConnectOption): void + connect(option?: NdefConnectOption): void; /** [MifareClassic.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.getMaxTransceiveLength.html) * * 需要基础库: `2.11.2` @@ -18088,7 +17811,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取最大传输长度 */ - getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; /** [MifareClassic.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.isConnected.html) * * 需要基础库: `2.11.2` @@ -18098,7 +17821,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * @warning **该接口已废弃,连接状态开发者自行维护即可** * * 检查是否已连接 */ - isConnected(option?: IsConnectedOption): void + isConnected(option?: IsConnectedOption): void; /** [MifareClassic.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.setTimeout.html) * * 需要基础库: `2.11.2` @@ -18106,7 +17829,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置超时时间 */ - setTimeout(option: SetTimeoutOption): void + setTimeout(option: SetTimeoutOption): void; /** [MifareClassic.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.transceive.html) * * 需要基础库: `2.11.2` @@ -18114,7 +17837,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 发送数据 */ - transceive(option: TransceiveOption): void + transceive(option: TransceiveOption): void; } interface MifareUltralight { /** [MifareUltralight.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.close.html) @@ -18124,7 +17847,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 断开连接 */ - close(option?: NdefCloseOption): void + close(option?: NdefCloseOption): void; /** [MifareUltralight.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.connect.html) * * 需要基础库: `2.11.2` @@ -18132,7 +17855,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 连接 NFC 标签 */ - connect(option?: NdefConnectOption): void + connect(option?: NdefConnectOption): void; /** [MifareUltralight.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.getMaxTransceiveLength.html) * * 需要基础库: `2.11.2` @@ -18140,7 +17863,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取最大传输长度 */ - getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; /** [MifareUltralight.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.isConnected.html) * * 需要基础库: `2.11.2` @@ -18150,7 +17873,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * @warning **该接口已废弃,连接状态开发者自行维护即可** * * 检查是否已连接 */ - isConnected(option?: IsConnectedOption): void + isConnected(option?: IsConnectedOption): void; /** [MifareUltralight.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.setTimeout.html) * * 需要基础库: `2.11.2` @@ -18158,7 +17881,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置超时时间 */ - setTimeout(option: SetTimeoutOption): void + setTimeout(option: SetTimeoutOption): void; /** [MifareUltralight.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.transceive.html) * * 需要基础库: `2.11.2` @@ -18166,7 +17889,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 发送数据 */ - transceive(option: TransceiveOption): void + transceive(option: TransceiveOption): void; } interface NFCError { /** 错误信息 @@ -18180,7 +17903,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | 13003 | | AID列表参数格式错误 | * | 13004 | | 未设置微信为默认NFC支付应用 | * | 13005 | | 返回的指令不合法 | - * | 13006 | | 注册AID失败 | */ errMsg: string + * | 13006 | | 注册AID失败 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -18192,7 +17915,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | 13003 | | AID列表参数格式错误 | * | 13004 | | 未设置微信为默认NFC支付应用 | * | 13005 | | 返回的指令不合法 | - * | 13006 | | 注册AID失败 | */ errCode: number + * | 13006 | | 注册AID失败 | */ errCode: number; } interface Ndef { /** [Ndef.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.close.html) @@ -18202,7 +17925,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 断开连接 */ - close(option?: NdefCloseOption): void + close(option?: NdefCloseOption): void; /** [Ndef.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.connect.html) * * 需要基础库: `2.11.2` @@ -18210,7 +17933,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 连接 NFC 标签 */ - connect(option?: NdefConnectOption): void + connect(option?: NdefConnectOption): void; /** [Ndef.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.isConnected.html) * * 需要基础库: `2.11.2` @@ -18220,7 +17943,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * @warning **该接口已废弃,连接状态开发者自行维护即可** * * 检查是否已连接 */ - isConnected(option?: IsConnectedOption): void + isConnected(option?: IsConnectedOption): void; /** [Ndef.offNdefMessage(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.offNdefMessage.html) * * 需要基础库: `2.11.2` @@ -18228,7 +17951,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 取消监听 Ndef 消息 */ - offNdefMessage(callback: (...args: any[]) => any): void + offNdefMessage(callback: (...args: any[]) => any): void; /** [Ndef.onNdefMessage(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.onNdefMessage.html) * * 需要基础库: `2.11.2` @@ -18236,7 +17959,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 监听 Ndef 消息 */ - onNdefMessage(callback: (...args: any[]) => any): void + onNdefMessage(callback: (...args: any[]) => any): void; /** [Ndef.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.setTimeout.html) * * 需要基础库: `2.11.2` @@ -18244,7 +17967,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置超时时间 */ - setTimeout(option: SetTimeoutOption): void + setTimeout(option: SetTimeoutOption): void; /** [Ndef.writeNdefMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.writeNdefMessage.html) * * 需要基础库: `2.11.2` @@ -18252,7 +17975,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 重写 Ndef 标签内容 */ - writeNdefMessage(option: WriteNdefMessageOption): void + writeNdefMessage(option: WriteNdefMessageOption): void; } interface NfcA { /** [NfcA.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.close.html) @@ -18262,7 +17985,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 断开连接 */ - close(option?: NdefCloseOption): void + close(option?: NdefCloseOption): void; /** [NfcA.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.connect.html) * * 需要基础库: `2.11.2` @@ -18270,7 +17993,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 连接 NFC 标签 */ - connect(option?: NdefConnectOption): void + connect(option?: NdefConnectOption): void; /** [NfcA.getAtqa(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getAtqa.html) * * 需要基础库: `2.11.2` @@ -18278,7 +18001,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取ATQA信息 */ - getAtqa(option?: GetAtqaOption): void + getAtqa(option?: GetAtqaOption): void; /** [NfcA.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getMaxTransceiveLength.html) * * 需要基础库: `2.11.2` @@ -18286,7 +18009,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取最大传输长度 */ - getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; /** [NfcA.getSak(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getSak.html) * * 需要基础库: `2.11.2` @@ -18294,7 +18017,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取SAK信息 */ - getSak(option?: GetSakOption): void + getSak(option?: GetSakOption): void; /** [NfcA.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.isConnected.html) * * 需要基础库: `2.11.2` @@ -18304,7 +18027,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * @warning **该接口已废弃,连接状态开发者自行维护即可** * * 检查是否已连接 */ - isConnected(option?: IsConnectedOption): void + isConnected(option?: IsConnectedOption): void; /** [NfcA.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.setTimeout.html) * * 需要基础库: `2.11.2` @@ -18312,7 +18035,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置超时时间 */ - setTimeout(option: SetTimeoutOption): void + setTimeout(option: SetTimeoutOption): void; /** [NfcA.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.transceive.html) * * 需要基础库: `2.11.2` @@ -18320,7 +18043,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 发送数据 */ - transceive(option: TransceiveOption): void + transceive(option: TransceiveOption): void; } interface NfcB { /** [NfcB.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.close.html) @@ -18330,7 +18053,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 断开连接 */ - close(option?: NdefCloseOption): void + close(option?: NdefCloseOption): void; /** [NfcB.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.connect.html) * * 需要基础库: `2.11.2` @@ -18338,7 +18061,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 连接 NFC 标签 */ - connect(option?: NdefConnectOption): void + connect(option?: NdefConnectOption): void; /** [NfcB.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.getMaxTransceiveLength.html) * * 需要基础库: `2.11.2` @@ -18346,7 +18069,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取最大传输长度 */ - getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; /** [NfcB.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.isConnected.html) * * 需要基础库: `2.11.2` @@ -18356,7 +18079,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * @warning **该接口已废弃,连接状态开发者自行维护即可** * * 检查是否已连接 */ - isConnected(option?: IsConnectedOption): void + isConnected(option?: IsConnectedOption): void; /** [NfcB.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.setTimeout.html) * * 需要基础库: `2.11.2` @@ -18364,7 +18087,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置超时时间 */ - setTimeout(option: SetTimeoutOption): void + setTimeout(option: SetTimeoutOption): void; /** [NfcB.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.transceive.html) * * 需要基础库: `2.11.2` @@ -18372,7 +18095,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 发送数据 */ - transceive(option: TransceiveOption): void + transceive(option: TransceiveOption): void; } interface NfcF { /** [NfcF.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.close.html) @@ -18382,7 +18105,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 断开连接 */ - close(option?: NdefCloseOption): void + close(option?: NdefCloseOption): void; /** [NfcF.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.connect.html) * * 需要基础库: `2.11.2` @@ -18390,7 +18113,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 连接 NFC 标签 */ - connect(option?: NdefConnectOption): void + connect(option?: NdefConnectOption): void; /** [NfcF.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.getMaxTransceiveLength.html) * * 需要基础库: `2.11.2` @@ -18398,7 +18121,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取最大传输长度 */ - getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; /** [NfcF.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.isConnected.html) * * 需要基础库: `2.11.2` @@ -18408,7 +18131,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * @warning **该接口已废弃,连接状态开发者自行维护即可** * * 检查是否已连接 */ - isConnected(option?: IsConnectedOption): void + isConnected(option?: IsConnectedOption): void; /** [NfcF.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.setTimeout.html) * * 需要基础库: `2.11.2` @@ -18416,7 +18139,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置超时时间 */ - setTimeout(option: SetTimeoutOption): void + setTimeout(option: SetTimeoutOption): void; /** [NfcF.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.transceive.html) * * 需要基础库: `2.11.2` @@ -18424,7 +18147,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 发送数据 */ - transceive(option: TransceiveOption): void + transceive(option: TransceiveOption): void; } interface NfcV { /** [NfcV.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.close.html) @@ -18434,7 +18157,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 断开连接 */ - close(option?: NdefCloseOption): void + close(option?: NdefCloseOption): void; /** [NfcV.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.connect.html) * * 需要基础库: `2.11.2` @@ -18442,7 +18165,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 连接 NFC 标签 */ - connect(option?: NdefConnectOption): void + connect(option?: NdefConnectOption): void; /** [NfcV.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.getMaxTransceiveLength.html) * * 需要基础库: `2.11.2` @@ -18450,7 +18173,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 获取最大传输长度 */ - getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; /** [NfcV.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.isConnected.html) * * 需要基础库: `2.11.2` @@ -18460,7 +18183,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * @warning **该接口已废弃,连接状态开发者自行维护即可** * * 检查是否已连接 */ - isConnected(option?: IsConnectedOption): void + isConnected(option?: IsConnectedOption): void; /** [NfcV.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.setTimeout.html) * * 需要基础库: `2.11.2` @@ -18468,7 +18191,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 设置超时时间 */ - setTimeout(option: SetTimeoutOption): void + setTimeout(option: SetTimeoutOption): void; /** [NfcV.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.transceive.html) * * 需要基础库: `2.11.2` @@ -18476,7 +18199,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 在插件中使用:支持 * * 发送数据 */ - transceive(option: TransceiveOption): void + transceive(option: TransceiveOption): void; } interface Nfcrwerror { /** 错误信息 @@ -18498,7 +18221,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | 13015 | unavailable tech | 从标签上获取对应技术失败 | * | 13024 | function not support | 当前标签技术不支持该功能 | * | 13017 | system internal error | 相关读写操作失败 | - * | 13016 | connect fail | 连接失败 | */ errMsg: string + * | 13016 | connect fail | 连接失败 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -18518,7 +18241,7 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | 13015 | unavailable tech | 从标签上获取对应技术失败 | * | 13024 | function not support | 当前标签技术不支持该功能 | * | 13017 | system internal error | 相关读写操作失败 | - * | 13016 | connect fail | 连接失败 | */ errCode: number + * | 13016 | connect fail | 连接失败 | */ errCode: number; } interface NodesRef { /** [[SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) NodesRef.boundingClientRect(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.boundingClientRect.html) @@ -18561,8 +18284,8 @@ Page({ ``` */ boundingClientRect( /** 回调函数,在执行 `SelectorQuery.exec` 方法后,节点信息会在 `callback` 中返回。 */ - callback?: BoundingClientRectCallback - ): SelectorQuery + callback?: BoundingClientRectCallback, + ): SelectorQuery; /** [[SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) NodesRef.context(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.context.html) * * 需要基础库: `2.4.2` @@ -18584,8 +18307,8 @@ Page({ ``` */ context( /** 回调函数,在执行 `SelectorQuery.exec` 方法后,返回节点信息。 */ - callback?: ContextCallback - ): SelectorQuery + callback?: ContextCallback, + ): SelectorQuery; /** [[SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) NodesRef.fields(Object fields, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.fields.html) * * 在插件中使用:支持 @@ -18628,8 +18351,8 @@ Page({ fields( fields: Fields, /** 回调函数 */ - callback?: FieldsCallback - ): SelectorQuery + callback?: FieldsCallback, + ): SelectorQuery; /** [[SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) NodesRef.node(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.node.html) * * 需要基础库: `2.7.0` @@ -18651,8 +18374,8 @@ Page({ ``` */ node( /** 回调函数,在执行 `SelectorQuery.exec` 方法后,返回节点信息。 */ - callback?: NodeCallback - ): SelectorQuery + callback?: NodeCallback, + ): SelectorQuery; /** [[SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) NodesRef.ref(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.ref.html) * * 需要基础库: `3.3.0` @@ -18674,8 +18397,8 @@ Page({ ``` */ ref( /** 回调函数,在执行 `SelectorQuery.exec` 方法后,返回节点 Ref 对象。 */ - callback?: RefCallback - ): SelectorQuery + callback?: RefCallback, + ): SelectorQuery; /** [[SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) NodesRef.scrollOffset(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.scrollOffset.html) * * 在插件中使用:支持 @@ -18698,8 +18421,8 @@ Page({ ``` */ scrollOffset( /** 回调函数,在执行 `SelectorQuery.exec` 方法后,节点信息会在 `callback` 中返回。 */ - callback?: ScrollOffsetCallback - ): SelectorQuery + callback?: ScrollOffsetCallback, + ): SelectorQuery; } interface Path2D { /** [Path2D.addPath([Path2D](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) path)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.addPath.html) @@ -18713,8 +18436,8 @@ Page({ /** [Path2D](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) * * 添加的 Path2D 路径。 */ - path: Path2D - ): void + path: Path2D, + ): void; /** [Path2D.arc(number x, number y, number radius, number startAngle, number endAngle, boolean counterclockwise)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.arc.html) * * 需要基础库: `2.11.0` @@ -18734,8 +18457,8 @@ Page({ /** 圆弧结束角度。 */ endAngle: number, /** 是否逆时针绘制。如果传 true, 则会从 endAngle 开始绘制到 startAngle。 */ - counterclockwise?: boolean - ): void + counterclockwise?: boolean, + ): void; /** [Path2D.arcTo(number x1, number y1, number x2, number y2, number radius)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.arcTo.html) * * 需要基础库: `2.11.0` @@ -18753,8 +18476,8 @@ Page({ /** 第二个控制点纵坐标。 */ y2: number, /** 圆形半径,必须为非负数。 */ - radius: number - ): void + radius: number, + ): void; /** [Path2D.bezierCurveTo(number cp1x, number cp1y, number cp2x, number cp2y, number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.bezierCurveTo.html) * * 需要基础库: `2.11.0` @@ -18774,8 +18497,8 @@ Page({ /** 结束点横坐标。 */ x: number, /** 结束点纵坐标。 */ - y: number - ): void + y: number, + ): void; /** [Path2D.closePath()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.closePath.html) * * 需要基础库: `2.11.0` @@ -18783,7 +18506,7 @@ Page({ * 在插件中使用:不支持 * * 闭合路径到起点。 */ - closePath(): void + closePath(): void; /** [Path2D.ellipse(number x, number y, number radiusX, number radiusY, number rotation, number startAngle, number endAngle, boolean counterclockwise)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.ellipse.html) * * 需要基础库: `2.11.0` @@ -18807,8 +18530,8 @@ Page({ /** 圆弧结束角度。 */ endAngle: number, /** 是否逆时针绘制。如果传 true, 则会从 endAngle 开始绘制到 startAngle。 */ - counterclockwise?: boolean - ): void + counterclockwise?: boolean, + ): void; /** [Path2D.lineTo(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.lineTo.html) * * 需要基础库: `2.11.0` @@ -18820,8 +18543,8 @@ Page({ /** 结束点横坐标。 */ x: number, /** 结束点纵坐标。 */ - y: number - ): void + y: number, + ): void; /** [Path2D.moveTo(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.moveTo.html) * * 需要基础库: `2.11.0` @@ -18833,8 +18556,8 @@ Page({ /** 横坐标。 */ x: number, /** 纵坐标。 */ - y: number - ): void + y: number, + ): void; /** [Path2D.quadraticCurveTo(number cpx, number cpy, number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.quadraticCurveTo.html) * * 需要基础库: `2.11.0` @@ -18850,8 +18573,8 @@ Page({ /** 结束点横坐标。 */ x: number, /** 结束点纵坐标。 */ - y: number - ): void + y: number, + ): void; /** [Path2D.rect(number x, number y, number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.rect.html) * * 需要基础库: `2.11.0` @@ -18867,8 +18590,8 @@ Page({ /** 方形宽度,正数向右,负数向左。 */ width: number, /** 方形高度,正数向下,负数向上。 */ - height: number - ): void + height: number, + ): void; } interface Performance { /** [Array.<[PerformanceEntry](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html)> Performance.getEntries()](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.getEntries.html) @@ -18878,7 +18601,7 @@ Page({ * 在插件中使用:不支持 * * 该方法返回当前缓冲区中的所有性能数据 */ - getEntries(): PerformanceEntry[] + getEntries(): PerformanceEntry[]; /** [Array.<[PerformanceEntry](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html)> Performance.getEntriesByName(string name, string entryType)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.getEntriesByName.html) * * 需要基础库: `2.11.0` @@ -18890,8 +18613,8 @@ Page({ /** 名称 */ name: string, /** 类型 */ - entryType?: string - ): PerformanceEntry[] + entryType?: string, + ): PerformanceEntry[]; /** [Array.<[PerformanceEntry](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html)> Performance.getEntriesByType(string entryType)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.getEntriesByType.html) * * 需要基础库: `2.11.0` @@ -18901,8 +18624,8 @@ Page({ * 获取当前缓冲区中所有类型为 [entryType] 的性能数据 */ getEntriesByType( /** 类型 */ - entryType: string - ): PerformanceEntry[] + entryType: string, + ): PerformanceEntry[]; /** [Performance.setBufferSize(number size)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.setBufferSize.html) * * 需要基础库: `2.11.0` @@ -18910,7 +18633,7 @@ Page({ * 在插件中使用:不支持 * * 设置缓冲区大小,默认缓冲 30 条性能数据 */ - setBufferSize(size: number): void + setBufferSize(size: number): void; /** [[PerformanceObserver](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceObserver.html) Performance.createObserver(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.createObserver.html) * * 需要基础库: `2.11.0` @@ -18920,8 +18643,8 @@ Page({ * 创建全局性能事件监听器 */ createObserver( /** 回调函数 */ - callback: (...args: any[]) => any - ): PerformanceObserver + callback: (...args: any[]) => any, + ): PerformanceObserver; } interface PreDownloadSubpackageTask { /** [PreDownloadSubpackageTask.onProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/subpackage/PreDownloadSubpackageTask.onProgressUpdate.html) @@ -18933,8 +18656,8 @@ Page({ * 监听分包加载进度变化事件 */ onProgressUpdate( /** 分包加载进度变化事件的监听函数 */ - listener: PreDownloadSubpackageTaskOnProgressUpdateCallback - ): void + listener: PreDownloadSubpackageTaskOnProgressUpdateCallback, + ): void; } interface RealtimeLogManager { /** [Object RealtimeLogManager.getCurrentState()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.getCurrentState.html) @@ -18946,7 +18669,7 @@ Page({ * 实时日志会将一定时间间隔内缓存的日志聚合上报,如果该时间内缓存的内容超出限制,则会被丢弃。此方法可以获取当前缓存剩余空间。 * * > 注意:基础库内部在对日志进行上报时会补充一些结构化数据,如果遇到上报溢出的情况也会补充警告日志,所以此方法获取到的当前占用信息会比预期的大一些。 */ - getCurrentState(): CurrentState + getCurrentState(): CurrentState; /** [RealtimeLogManager.addFilterMsg(string msg)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.addFilterMsg.html) * * 需要基础库: `2.8.1` @@ -18956,8 +18679,8 @@ Page({ * 添加过滤关键字,暂不支持在插件使用 */ addFilterMsg( /** 是setFilterMsg的添加接口。用于设置多个过滤关键字。 */ - msg: string - ): void + msg: string, + ): void; /** [RealtimeLogManager.error()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.error.html) * * 需要基础库: `2.7.1` @@ -18968,7 +18691,7 @@ Page({ error( /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过5Kb */ ...args: any[] - ): void + ): void; /** [RealtimeLogManager.in(Page pageInstance)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.in.html) * * 需要基础库: `2.9.1` @@ -18978,8 +18701,8 @@ Page({ * 设置实时日志page参数所在的页面,暂不支持在插件使用 */ in( /** page实例 */ - pageInstance: Page.TrivialInstance - ): void + pageInstance: Page.TrivialInstance, + ): void; /** [RealtimeLogManager.info()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.info.html) * * 需要基础库: `2.7.1` @@ -18990,7 +18713,7 @@ Page({ info( /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过5Kb */ ...args: any[] - ): void + ): void; /** [RealtimeLogManager.setFilterMsg(string msg)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.setFilterMsg.html) * * 需要基础库: `2.7.3` @@ -19000,8 +18723,8 @@ Page({ * 设置过滤关键字,暂不支持在插件使用 */ setFilterMsg( /** 过滤关键字,最多不超过1Kb,可以在小程序管理后台根据设置的内容搜索得到对应的日志。 */ - msg: string - ): void + msg: string, + ): void; /** [RealtimeLogManager.warn()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.warn.html) * * 需要基础库: `2.7.1` @@ -19012,7 +18735,7 @@ Page({ warn( /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过5Kb */ ...args: any[] - ): void + ): void; /** [[RealtimeTagLogManager](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeTagLogManager.html) RealtimeLogManager.tag(string tagName)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.tag.html) * * 需要基础库: `2.16.0` @@ -19022,8 +18745,8 @@ Page({ * 获取给定标签的日志管理器实例,目前只支持在插件使用 */ tag( /** 标签名 */ - tagName: string - ): RealtimeTagLogManager + tagName: string, + ): RealtimeTagLogManager; } interface RealtimeTagLogManager { /** [RealtimeTagLogManager.addFilterMsg(string msg)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeTagLogManager.addFilterMsg.html) @@ -19035,8 +18758,8 @@ Page({ * 添加过滤关键字 */ addFilterMsg( /** 是setFilterMsg的添加接口。用于设置多个过滤关键字。 */ - msg: string - ): void + msg: string, + ): void; /** [RealtimeTagLogManager.error(string key, Object|Array.<any>|number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeTagLogManager.error.html) * * 需要基础库: `2.16.0` @@ -19048,8 +18771,8 @@ Page({ /** 日志的 key */ key: string, /** 日志的值,每次调用的参数的总大小不超过5Kb */ - value: IAnyObject | any[] | number | string - ): void + value: IAnyObject | any[] | number | string, + ): void; /** [RealtimeTagLogManager.info(string key, Object|Array.<any>|number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeTagLogManager.info.html) * * 需要基础库: `2.16.0` @@ -19061,8 +18784,8 @@ Page({ /** 日志的 key */ key: string, /** 日志的值,每次调用的参数的总大小不超过5Kb */ - value: IAnyObject | any[] | number | string - ): void + value: IAnyObject | any[] | number | string, + ): void; /** [RealtimeTagLogManager.setFilterMsg(string msg)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeTagLogManager.setFilterMsg.html) * * 需要基础库: `2.16.0` @@ -19072,8 +18795,8 @@ Page({ * 设置过滤关键字 */ setFilterMsg( /** 过滤关键字,最多不超过1Kb,可以在小程序管理后台根据设置的内容搜索得到对应的日志。 */ - msg: string - ): void + msg: string, + ): void; /** [RealtimeTagLogManager.warn(string key, Object|Array.<any>|number|string value)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeTagLogManager.warn.html) * * 需要基础库: `2.16.0` @@ -19085,8 +18808,8 @@ Page({ /** 日志的 key */ key: string, /** 日志的值,每次调用的参数的总大小不超过5Kb */ - value: IAnyObject | any[] | number | string - ): void + value: IAnyObject | any[] | number | string, + ): void; } interface RecorderManager { /** [RecorderManager.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onError.html) @@ -19096,8 +18819,8 @@ Page({ * 监听录音错误事件 */ onError( /** 录音错误事件的监听函数 */ - listener: UDPSocketOnErrorCallback - ): void + listener: UDPSocketOnErrorCallback, + ): void; /** [RecorderManager.onFrameRecorded(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onFrameRecorded.html) * * 在插件中使用:支持 @@ -19105,8 +18828,8 @@ Page({ * 监听已录制完指定帧大小的文件事件。如果设置了 frameSize,则会回调此事件。 */ onFrameRecorded( /** 已录制完指定帧大小的文件事件的监听函数 */ - listener: OnFrameRecordedCallback - ): void + listener: OnFrameRecordedCallback, + ): void; /** [RecorderManager.onInterruptionBegin(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onInterruptionBegin.html) * * 需要基础库: `2.3.0` @@ -19116,8 +18839,8 @@ Page({ * 监听录音因为受到系统占用而被中断开始事件。以下场景会触发此事件:微信语音聊天、微信视频聊天。此事件触发后,录音会被暂停。pause 事件在此事件后触发 */ onInterruptionBegin( /** 录音因为受到系统占用而被中断开始事件的监听函数 */ - listener: OnInterruptionBeginCallback - ): void + listener: OnInterruptionBeginCallback, + ): void; /** [RecorderManager.onInterruptionEnd(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onInterruptionEnd.html) * * 需要基础库: `2.3.0` @@ -19127,8 +18850,8 @@ Page({ * 监听录音中断结束事件。在收到 interruptionBegin 事件之后,小程序内所有录音会暂停,收到此事件之后才可再次录音成功。 */ onInterruptionEnd( /** 录音中断结束事件的监听函数 */ - listener: OnInterruptionEndCallback - ): void + listener: OnInterruptionEndCallback, + ): void; /** [RecorderManager.onPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onPause.html) * * 在插件中使用:支持 @@ -19136,8 +18859,8 @@ Page({ * 监听录音暂停事件 */ onPause( /** 录音暂停事件的监听函数 */ - listener: OnPauseCallback - ): void + listener: OnPauseCallback, + ): void; /** [RecorderManager.onResume(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onResume.html) * * 在插件中使用:支持 @@ -19145,8 +18868,8 @@ Page({ * 监听录音继续事件 */ onResume( /** 录音继续事件的监听函数 */ - listener: OnResumeCallback - ): void + listener: OnResumeCallback, + ): void; /** [RecorderManager.onStart(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onStart.html) * * 在插件中使用:支持 @@ -19154,8 +18877,8 @@ Page({ * 监听录音开始事件 */ onStart( /** 录音开始事件的监听函数 */ - listener: OnStartCallback - ): void + listener: OnStartCallback, + ): void; /** [RecorderManager.onStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onStop.html) * * 在插件中使用:支持 @@ -19163,20 +18886,20 @@ Page({ * 监听录音结束事件 */ onStop( /** 录音结束事件的监听函数 */ - listener: RecorderManagerOnStopCallback - ): void + listener: RecorderManagerOnStopCallback, + ): void; /** [RecorderManager.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.pause.html) * * 在插件中使用:支持 * * 暂停录音 */ - pause(): void + pause(): void; /** [RecorderManager.resume()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.resume.html) * * 在插件中使用:支持 * * 继续录音 */ - resume(): void + resume(): void; /** [RecorderManager.start(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.start.html) * * 在插件中使用:支持 @@ -19198,13 +18921,13 @@ Page({ * | 32000 | 48000 ~ 192000 | * | 44100 | 64000 ~ 320000 | * | 48000 | 64000 ~ 320000 | */ - start(option: RecorderManagerStartOption): void + start(option: RecorderManagerStartOption): void; /** [RecorderManager.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.stop.html) * * 在插件中使用:支持 * * 停止录音 */ - stop(): void + stop(): void; } interface RequestTask { /** [RequestTask.abort()](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.abort.html) @@ -19214,7 +18937,7 @@ Page({ * 在插件中使用:支持 * * 中断请求任务 */ - abort(): void + abort(): void; /** [RequestTask.offChunkReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.offChunkReceived.html) * * 需要基础库: `2.20.1` @@ -19233,8 +18956,8 @@ RequestTask.offChunkReceived(listener) // 需传入与监听时同一个的函 ``` */ offChunkReceived( /** onChunkReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffChunkReceivedCallback - ): void + listener?: OffChunkReceivedCallback, + ): void; /** [RequestTask.offHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.offHeadersReceived.html) * * 需要基础库: `2.1.0` @@ -19253,8 +18976,8 @@ RequestTask.offHeadersReceived(listener) // 需传入与监听时同一个的函 ``` */ offHeadersReceived( /** onHeadersReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: RequestTaskOffHeadersReceivedCallback - ): void + listener?: RequestTaskOffHeadersReceivedCallback, + ): void; /** [RequestTask.onChunkReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.onChunkReceived.html) * * 需要基础库: `2.20.1` @@ -19264,8 +18987,8 @@ RequestTask.offHeadersReceived(listener) // 需传入与监听时同一个的函 * 监听 Transfer-Encoding Chunk Received 事件。当接收到新的chunk时触发。 */ onChunkReceived( /** Transfer-Encoding Chunk Received 事件的监听函数 */ - listener: OnChunkReceivedCallback - ): void + listener: OnChunkReceivedCallback, + ): void; /** [RequestTask.onHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.onHeadersReceived.html) * * 需要基础库: `2.1.0` @@ -19275,8 +18998,8 @@ RequestTask.offHeadersReceived(listener) // 需传入与监听时同一个的函 * 监听 HTTP Response Header 事件。会比请求完成事件更早 */ onHeadersReceived( /** HTTP Response Header 事件的监听函数 */ - listener: RequestTaskOnHeadersReceivedCallback - ): void + listener: RequestTaskOnHeadersReceivedCallback, + ): void; } interface RewardedVideoAd { /** [Promise RewardedVideoAd.load()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.load.html) @@ -19284,13 +19007,13 @@ RequestTask.offHeadersReceived(listener) // 需传入与监听时同一个的函 * 在插件中使用:不支持 * * 加载激励视频广告。 */ - load(): Promise + load(): Promise; /** [Promise RewardedVideoAd.show()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.show.html) * * 在插件中使用:不支持 * * 显示激励视频广告。激励视频广告将从屏幕下方推入。 */ - show(): Promise + show(): Promise; /** [RewardedVideoAd.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.destroy.html) * * 需要基础库: `2.8.0` @@ -19298,7 +19021,7 @@ RequestTask.offHeadersReceived(listener) // 需传入与监听时同一个的函 * 在插件中使用:不支持 * * 销毁激励视频广告实例。 */ - destroy(): void + destroy(): void; /** [RewardedVideoAd.offClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.offClose.html) * * 在插件中使用:不支持 @@ -19315,8 +19038,8 @@ RewardedVideoAd.offClose(listener) // 需传入与监听时同一个的函数对 ``` */ offClose( /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: RewardedVideoAdOffCloseCallback - ): void + listener?: RewardedVideoAdOffCloseCallback, + ): void; /** [RewardedVideoAd.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.offError.html) * * 在插件中使用:不支持 @@ -19333,8 +19056,8 @@ RewardedVideoAd.offError(listener) // 需传入与监听时同一个的函数对 ``` */ offError( /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: RewardedVideoAdOffErrorCallback - ): void + listener?: RewardedVideoAdOffErrorCallback, + ): void; /** [RewardedVideoAd.offLoad(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.offLoad.html) * * 在插件中使用:不支持 @@ -19351,8 +19074,8 @@ RewardedVideoAd.offLoad(listener) // 需传入与监听时同一个的函数对 ``` */ offLoad( /** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffLoadCallback - ): void + listener?: OffLoadCallback, + ): void; /** [RewardedVideoAd.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.onClose.html) * * 在插件中使用:不支持 @@ -19360,8 +19083,8 @@ RewardedVideoAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 监听用户点击 `关闭广告` 按钮的事件。 */ onClose( /** 用户点击 `关闭广告` 按钮的事件的监听函数 */ - listener: RewardedVideoAdOnCloseCallback - ): void + listener: RewardedVideoAdOnCloseCallback, + ): void; /** [RewardedVideoAd.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.onError.html) * * 在插件中使用:不支持 @@ -19386,8 +19109,8 @@ RewardedVideoAd.offLoad(listener) // 需传入与监听时同一个的函数对 * | 1008 | 广告单元已关闭 | 该广告位的广告能力已经被关闭 | 请前往mp.weixin.qq.com重新打开对应广告位的展现。| */ onError( /** 激励视频错误事件的监听函数 */ - listener: RewardedVideoAdOnErrorCallback - ): void + listener: RewardedVideoAdOnErrorCallback, + ): void; /** [RewardedVideoAd.onLoad(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.onLoad.html) * * 在插件中使用:不支持 @@ -19395,8 +19118,8 @@ RewardedVideoAd.offLoad(listener) // 需传入与监听时同一个的函数对 * 监听激励视频广告加载事件。 */ onLoad( /** 激励视频广告加载事件的监听函数 */ - listener: OnLoadCallback - ): void + listener: OnLoadCallback, + ): void; } interface Router { /** [router.addRouteBuilder(string routeType, function routeBuilder)](https://developers.weixin.qq.com/miniprogram/dev/api/route/router/base/router.addRouteBuilder.html) @@ -19437,8 +19160,8 @@ wx.navigateTo({ /** 路由类型 */ routeType: string, /** [路由动画定义函数](#) */ - routeBuilder: CustomRouteBuilder - ): void + routeBuilder: CustomRouteBuilder, + ): void; /** [router.getRouteContext(Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/route/router/base/router.getRouteContext.html) * * 在插件中使用:不支持 @@ -19446,8 +19169,8 @@ wx.navigateTo({ * 获取页面对应的自定义路由上下文对象 */ getRouteContext( /** 页面/自定义组件实例 */ - component: Component.TrivialInstance | Page.TrivialInstance - ): void + component: Component.TrivialInstance | Page.TrivialInstance, + ): void; /** [router.removeRouteBuilder(string routeType)](https://developers.weixin.qq.com/miniprogram/dev/api/route/router/base/router.removeRouteBuilder.html) * * 在插件中使用:不支持 @@ -19455,8 +19178,8 @@ wx.navigateTo({ * 移除自定义路由配置 */ removeRouteBuilder( /** 路由类型 */ - routeType: string - ): void + routeType: string, + ): void; } interface SelectorQuery { /** [[NodesRef](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.html) SelectorQuery.exec(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.exec.html) @@ -19466,8 +19189,8 @@ wx.navigateTo({ * 执行所有的请求。请求结果按请求次序构成数组,在callback的第一个参数中返回。 */ exec( /** 回调函数 */ - callback?: (...args: any[]) => any - ): NodesRef + callback?: (...args: any[]) => any, + ): NodesRef; /** [[NodesRef](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.html) SelectorQuery.select(string selector)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.select.html) * * 在插件中使用:支持 @@ -19486,8 +19209,8 @@ wx.navigateTo({ * - 多选择器的并集:#a-node, .some-other-nodes */ select( /** 选择器 */ - selector: string - ): NodesRef + selector: string, + ): NodesRef; /** [[NodesRef](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.html) SelectorQuery.selectAll(string selector)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.selectAll.html) * * 在插件中使用:支持 @@ -19506,14 +19229,14 @@ wx.navigateTo({ * - 多选择器的并集:#a-node, .some-other-nodes */ selectAll( /** 选择器 */ - selector: string - ): NodesRef + selector: string, + ): NodesRef; /** [[NodesRef](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.html) SelectorQuery.selectViewport()](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.selectViewport.html) * * 在插件中使用:支持 * * 选择显示区域。可用于获取显示区域的尺寸、滚动位置等信息。 */ - selectViewport(): NodesRef + selectViewport(): NodesRef; /** [[SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) SelectorQuery.in(Component component)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.in.html) * * 需要基础库: `1.6.0` @@ -19536,8 +19259,8 @@ Component({ ``` */ in( /** 自定义组件实例 */ - component: Component.TrivialInstance | Page.TrivialInstance - ): SelectorQuery + component: Component.TrivialInstance | Page.TrivialInstance, + ): SelectorQuery; } interface SocketTask { /** [SocketTask.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.close.html) @@ -19545,7 +19268,7 @@ Component({ * 在插件中使用:支持 * * 关闭 WebSocket 连接 */ - close(option: SocketTaskCloseOption): void + close(option: SocketTaskCloseOption): void; /** [SocketTask.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onClose.html) * * 在插件中使用:支持 @@ -19553,8 +19276,8 @@ Component({ * 监听 WebSocket 连接关闭事件 */ onClose( /** WebSocket 连接关闭事件的监听函数 */ - listener: SocketTaskOnCloseCallback - ): void + listener: SocketTaskOnCloseCallback, + ): void; /** [SocketTask.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onError.html) * * 在插件中使用:支持 @@ -19562,8 +19285,8 @@ Component({ * 监听 WebSocket 错误事件 */ onError( /** WebSocket 错误事件的监听函数 */ - listener: UDPSocketOnErrorCallback - ): void + listener: UDPSocketOnErrorCallback, + ): void; /** [SocketTask.onMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onMessage.html) * * 在插件中使用:支持 @@ -19571,8 +19294,8 @@ Component({ * 监听 WebSocket 接收到服务器的消息事件 */ onMessage( /** WebSocket 接收到服务器的消息事件的监听函数 */ - listener: SocketTaskOnMessageCallback - ): void + listener: SocketTaskOnMessageCallback, + ): void; /** [SocketTask.onOpen(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onOpen.html) * * 在插件中使用:支持 @@ -19580,14 +19303,14 @@ Component({ * 监听 WebSocket 连接打开事件 */ onOpen( /** WebSocket 连接打开事件的监听函数 */ - listener: OnOpenCallback - ): void + listener: OnOpenCallback, + ): void; /** [SocketTask.send(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.send.html) * * 在插件中使用:支持 * * 通过 WebSocket 连接发送数据 */ - send(option: SocketTaskSendOption): void + send(option: SocketTaskSendOption): void; } interface TCPSocket { /** [TCPSocket.bindWifi(Object options)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.bindWifi.html) @@ -19597,19 +19320,19 @@ Component({ * 在插件中使用:不支持 * * 将 TCP Socket 绑定到当前 wifi 网络,成功后会触发 onBindWifi 事件(仅安卓支持) */ - bindWifi(options: BindWifiOption): void + bindWifi(options: BindWifiOption): void; /** [TCPSocket.close()](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.close.html) * * 在插件中使用:不支持 * * 关闭连接 */ - close(): void + close(): void; /** [TCPSocket.connect(Object options)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.connect.html) * * 在插件中使用:不支持 * * 在给定的套接字上启动连接 */ - connect(options: TCPSocketConnectOption): void + connect(options: TCPSocketConnectOption): void; /** [TCPSocket.offBindWifi(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offBindWifi.html) * * 需要基础库: `2.25.0` @@ -19628,8 +19351,8 @@ TCPSocket.offBindWifi(listener) // 需传入与监听时同一个的函数对象 ``` */ offBindWifi( /** onBindWifi 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffBindWifiCallback - ): void + listener?: OffBindWifiCallback, + ): void; /** [TCPSocket.offClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offClose.html) * * 在插件中使用:不支持 @@ -19646,8 +19369,8 @@ TCPSocket.offClose(listener) // 需传入与监听时同一个的函数对象 ``` */ offClose( /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: UDPSocketOffCloseCallback - ): void + listener?: UDPSocketOffCloseCallback, + ): void; /** [TCPSocket.offConnect(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offConnect.html) * * 在插件中使用:不支持 @@ -19664,8 +19387,8 @@ TCPSocket.offConnect(listener) // 需传入与监听时同一个的函数对象 ``` */ offConnect( /** onConnect 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffConnectCallback - ): void + listener?: OffConnectCallback, + ): void; /** [TCPSocket.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offError.html) * * 在插件中使用:不支持 @@ -19682,8 +19405,8 @@ TCPSocket.offError(listener) // 需传入与监听时同一个的函数对象 ``` */ offError( /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: UDPSocketOffErrorCallback - ): void + listener?: UDPSocketOffErrorCallback, + ): void; /** [TCPSocket.offMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offMessage.html) * * 在插件中使用:不支持 @@ -19700,8 +19423,8 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 ``` */ offMessage( /** onMessage 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: TCPSocketOffMessageCallback - ): void + listener?: TCPSocketOffMessageCallback, + ): void; /** [TCPSocket.onBindWifi(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onBindWifi.html) * * 需要基础库: `2.25.0` @@ -19711,8 +19434,8 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听当一个 socket 绑定当前 wifi 网络成功时触发该事件 */ onBindWifi( /** 当一个 socket 绑定当前 wifi 网络成功时触发该事件的监听函数 */ - listener: OnBindWifiCallback - ): void + listener: OnBindWifiCallback, + ): void; /** [TCPSocket.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onClose.html) * * 在插件中使用:不支持 @@ -19720,8 +19443,8 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听一旦 socket 完全关闭就发出该事件 */ onClose( /** 一旦 socket 完全关闭就发出该事件的监听函数 */ - listener: UDPSocketOnCloseCallback - ): void + listener: UDPSocketOnCloseCallback, + ): void; /** [TCPSocket.onConnect(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onConnect.html) * * 在插件中使用:不支持 @@ -19729,8 +19452,8 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听当一个 socket 连接成功建立的时候触发该事件 */ onConnect( /** 当一个 socket 连接成功建立的时候触发该事件的监听函数 */ - listener: OnConnectCallback - ): void + listener: OnConnectCallback, + ): void; /** [TCPSocket.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onError.html) * * 在插件中使用:不支持 @@ -19738,8 +19461,8 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听当错误发生时触发 */ onError( /** 的监听函数 */ - listener: UDPSocketOnErrorCallback - ): void + listener: UDPSocketOnErrorCallback, + ): void; /** [TCPSocket.onMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onMessage.html) * * 在插件中使用:不支持 @@ -19747,8 +19470,8 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听当接收到数据的时触发该事件 */ onMessage( /** 当接收到数据的时触发该事件的监听函数 */ - listener: TCPSocketOnMessageCallback - ): void + listener: TCPSocketOnMessageCallback, + ): void; /** [TCPSocket.write(string|ArrayBuffer data)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.write.html) * * 在插件中使用:不支持 @@ -19756,8 +19479,8 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 在 socket 上发送数据 */ write( /** 要发送的数据 */ - data: string | ArrayBuffer - ): void + data: string | ArrayBuffer, + ): void; } interface UDPSocket { /** [UDPSocket.close()](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.close.html) @@ -19765,7 +19488,7 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 在插件中使用:需要基础库 `2.11.1` * * 关闭 UDP Socket 实例,相当于销毁。 在关闭之后,UDP Socket 实例不能再发送消息,每次调用 `UDPSocket.send` 将会触发错误事件,并且 message 事件回调函数也不会再也执行。在 `UDPSocket` 实例被创建后将被 Native 强引用,保证其不被 GC。在 `UDPSocket.close` 后将解除对其的强引用,让 UDPSocket 实例遵从 GC。 */ - close(): void + close(): void; /** [UDPSocket.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.connect.html) * * 需要基础库: `2.15.0` @@ -19773,7 +19496,7 @@ TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 在插件中使用:需要基础库 `2.11.1` * * 预先连接到指定的 IP 和 port,需要配合 write 方法一起使用 */ - connect(option: UDPSocketConnectOption): void + connect(option: UDPSocketConnectOption): void; /** [UDPSocket.offClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.offClose.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19790,8 +19513,8 @@ UDPSocket.offClose(listener) // 需传入与监听时同一个的函数对象 ``` */ offClose( /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: UDPSocketOffCloseCallback - ): void + listener?: UDPSocketOffCloseCallback, + ): void; /** [UDPSocket.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.offError.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19808,8 +19531,8 @@ UDPSocket.offError(listener) // 需传入与监听时同一个的函数对象 ``` */ offError( /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: UDPSocketOffErrorCallback - ): void + listener?: UDPSocketOffErrorCallback, + ): void; /** [UDPSocket.offListening(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.offListening.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19826,8 +19549,8 @@ UDPSocket.offListening(listener) // 需传入与监听时同一个的函数对 ``` */ offListening( /** onListening 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: OffListeningCallback - ): void + listener?: OffListeningCallback, + ): void; /** [UDPSocket.offMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.offMessage.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19844,8 +19567,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 ``` */ offMessage( /** onMessage 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: UDPSocketOffMessageCallback - ): void + listener?: UDPSocketOffMessageCallback, + ): void; /** [UDPSocket.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.onClose.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19853,8 +19576,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听关闭事件 */ onClose( /** 关闭事件的监听函数 */ - listener: UDPSocketOnCloseCallback - ): void + listener: UDPSocketOnCloseCallback, + ): void; /** [UDPSocket.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.onError.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19862,8 +19585,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听错误事件 */ onError( /** 错误事件的监听函数 */ - listener: UDPSocketOnErrorCallback - ): void + listener: UDPSocketOnErrorCallback, + ): void; /** [UDPSocket.onListening(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.onListening.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19871,8 +19594,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听开始监听数据包消息的事件 */ onListening( /** 开始监听数据包消息的事件的监听函数 */ - listener: OnListeningCallback - ): void + listener: OnListeningCallback, + ): void; /** [UDPSocket.onMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.onMessage.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19880,14 +19603,14 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 监听收到消息的事件 */ onMessage( /** 收到消息的事件的监听函数 */ - listener: UDPSocketOnMessageCallback - ): void + listener: UDPSocketOnMessageCallback, + ): void; /** [UDPSocket.send(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.send.html) * * 在插件中使用:需要基础库 `2.11.1` * * 向指定的 IP 和 port 发送消息。基础库 2.9.0 起支持广播 (指定地址为 255.255.255.255)。 */ - send(option: UDPSocketSendOption): void + send(option: UDPSocketSendOption): void; /** [UDPSocket.setTTL(number ttl)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.setTTL.html) * * 需要基础库: `2.18.0` @@ -19897,8 +19620,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 设置 IP_TTL 套接字选项,用于设置一个 IP 数据包传输时允许的最大跳步数 */ setTTL( /** ttl 参数可以是 0 到 255 之间 */ - ttl: number - ): void + ttl: number, + ): void; /** [UDPSocket.write(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.write.html) * * 需要基础库: `2.15.0` @@ -19906,7 +19629,7 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 在插件中使用:需要基础库 `2.11.1` * * 用法与 send 方法相同,如果没有预先调用 connect 则与 send 无差异(注意即使调用了 connect 也需要在本接口填入地址和端口参数) */ - write(option: UDPSocketSendOption): void + write(option: UDPSocketSendOption): void; /** [number UDPSocket.bind(number port)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.bind.html) * * 在插件中使用:需要基础库 `2.11.1` @@ -19916,8 +19639,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 /** 需要基础库: `2.9.0` * * 指定要绑定的端口号,不传则返回系统随机分配的可用端口 */ - port?: number - ): number + port?: number, + ): number; } interface UpdateManager { /** [UpdateManager.applyUpdate()](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.applyUpdate.html) @@ -19929,7 +19652,7 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * **示例代码** * * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ - applyUpdate(): void + applyUpdate(): void; /** [UpdateManager.onCheckForUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onCheckForUpdate.html) * * 在插件中使用:不支持 @@ -19941,8 +19664,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ onCheckForUpdate( /** 向微信后台请求检查更新结果事件的监听函数 */ - listener: OnCheckForUpdateCallback - ): void + listener: OnCheckForUpdateCallback, + ): void; /** [UpdateManager.onUpdateFailed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateFailed.html) * * 在插件中使用:不支持 @@ -19954,8 +19677,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ onUpdateFailed( /** 小程序更新失败事件的监听函数 */ - listener: OnUpdateFailedCallback - ): void + listener: OnUpdateFailedCallback, + ): void; /** [UpdateManager.onUpdateReady(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateReady.html) * * 在插件中使用:不支持 @@ -19967,8 +19690,8 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ onUpdateReady( /** 小程序有版本更新事件的监听函数 */ - listener: OnUpdateReadyCallback - ): void + listener: OnUpdateReadyCallback, + ): void; } interface UploadTask { /** [UploadTask.abort()](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.abort.html) @@ -19978,7 +19701,7 @@ UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 * 在插件中使用:支持 * * 中断上传任务 */ - abort(): void + abort(): void; /** [UploadTask.offHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.offHeadersReceived.html) * * 需要基础库: `2.1.0` @@ -19997,8 +19720,8 @@ UploadTask.offHeadersReceived(listener) // 需传入与监听时同一个的函 ``` */ offHeadersReceived( /** onHeadersReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: DownloadTaskOffHeadersReceivedCallback - ): void + listener?: DownloadTaskOffHeadersReceivedCallback, + ): void; /** [UploadTask.offProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.offProgressUpdate.html) * * 需要基础库: `2.1.0` @@ -20017,8 +19740,8 @@ UploadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函 ``` */ offProgressUpdate( /** onProgressUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ - listener?: UploadTaskOffProgressUpdateCallback - ): void + listener?: UploadTaskOffProgressUpdateCallback, + ): void; /** [UploadTask.onHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.onHeadersReceived.html) * * 需要基础库: `2.1.0` @@ -20028,8 +19751,8 @@ UploadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函 * 监听 HTTP Response Header 事件。会比请求完成事件更早 */ onHeadersReceived( /** HTTP Response Header 事件的监听函数 */ - listener: DownloadTaskOnHeadersReceivedCallback - ): void + listener: DownloadTaskOnHeadersReceivedCallback, + ): void; /** [UploadTask.onProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.onProgressUpdate.html) * * 需要基础库: `1.4.0` @@ -20039,8 +19762,8 @@ UploadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函 * 监听上传进度变化事件 */ onProgressUpdate( /** 上传进度变化事件的监听函数 */ - listener: UploadTaskOnProgressUpdateCallback - ): void + listener: UploadTaskOnProgressUpdateCallback, + ): void; } interface UserCryptoManager { /** [UserCryptoManager.getLatestUserKey(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/crypto/UserCryptoManager.getLatestUserKey.html) @@ -20062,7 +19785,7 @@ userCryptoManager.getLatestUserKey({ } }) ``` */ - getLatestUserKey(option?: GetLatestUserKeyOption): void + getLatestUserKey(option?: GetLatestUserKeyOption): void; /** [UserCryptoManager.getRandomValues(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/crypto/UserCryptoManager.getRandomValues.html) * * 需要基础库: `2.17.3` @@ -20082,7 +19805,7 @@ userCryptoManager.getRandomValues({ } }) ``` */ - getRandomValues(option: GetRandomValuesOption): void + getRandomValues(option: GetRandomValuesOption): void; } interface VideoContext { /** [VideoContext.exitBackgroundPlayback()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.exitBackgroundPlayback.html) @@ -20092,7 +19815,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 退出后台音频播放模式。 */ - exitBackgroundPlayback(): void + exitBackgroundPlayback(): void; /** [VideoContext.exitCasting()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.exitCasting.html) * * 需要基础库: `2.32.0` @@ -20100,7 +19823,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 退出投屏。仅支持在 tap 事件回调内调用。 */ - exitCasting(): void + exitCasting(): void; /** [VideoContext.exitFullScreen()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.exitFullScreen.html) * * 需要基础库: `1.4.0` @@ -20108,13 +19831,13 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 退出全屏 */ - exitFullScreen(): void + exitFullScreen(): void; /** [VideoContext.exitPictureInPicture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.exitPictureInPicture.html) * * 在插件中使用:支持 * * 退出小窗,该方法可在任意页面调用 */ - exitPictureInPicture(option?: ExitPictureInPictureOption): void + exitPictureInPicture(option?: ExitPictureInPictureOption): void; /** [VideoContext.hideStatusBar()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.hideStatusBar.html) * * 需要基础库: `2.1.0` @@ -20122,19 +19845,19 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 隐藏状态栏,仅在iOS全屏下有效 */ - hideStatusBar(): void + hideStatusBar(): void; /** [VideoContext.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.pause.html) * * 在插件中使用:支持 * * 暂停视频 */ - pause(): void + pause(): void; /** [VideoContext.play()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.play.html) * * 在插件中使用:支持 * * 播放视频 */ - play(): void + play(): void; /** [VideoContext.playbackRate(number rate)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.playbackRate.html) * * 需要基础库: `1.4.0` @@ -20144,8 +19867,8 @@ userCryptoManager.getRandomValues({ * 设置倍速播放 */ playbackRate( /** 倍率,支持 0.5/0.8/1.0/1.25/1.5,2.6.3 起支持 2.0 倍速 */ - rate: number - ): void + rate: number, + ): void; /** [VideoContext.reconnectCasting()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.reconnectCasting.html) * * 需要基础库: `2.32.0` @@ -20153,7 +19876,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 重连投屏设备。仅支持在 tap 事件回调内调用。 */ - reconnectCasting(): void + reconnectCasting(): void; /** [VideoContext.requestBackgroundPlayback()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.requestBackgroundPlayback.html) * * 需要基础库: `2.14.3` @@ -20161,7 +19884,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 进入后台音频播放模式。 */ - requestBackgroundPlayback(): void + requestBackgroundPlayback(): void; /** [VideoContext.requestFullScreen(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.requestFullScreen.html) * * 需要基础库: `1.4.0` @@ -20169,7 +19892,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 进入全屏。若有自定义内容需在全屏时展示,需将内容节点放置到 video 节点内。 */ - requestFullScreen(option: VideoContextRequestFullScreenOption): void + requestFullScreen(option: VideoContextRequestFullScreenOption): void; /** [VideoContext.seek(number position)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.seek.html) * * 在插件中使用:支持 @@ -20177,8 +19900,8 @@ userCryptoManager.getRandomValues({ * 跳转到指定位置 */ seek( /** 跳转到的位置,单位 s */ - position: number - ): void + position: number, + ): void; /** [VideoContext.sendDanmu(Object data)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.sendDanmu.html) * * 在插件中使用:支持 @@ -20186,8 +19909,8 @@ userCryptoManager.getRandomValues({ * 发送弹幕 */ sendDanmu( /** 弹幕内容 */ - data: Danmu - ): void + data: Danmu, + ): void; /** [VideoContext.showStatusBar()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.showStatusBar.html) * * 需要基础库: `2.1.0` @@ -20195,7 +19918,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 显示状态栏,仅在iOS全屏下有效 */ - showStatusBar(): void + showStatusBar(): void; /** [VideoContext.startCasting()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.startCasting.html) * * 需要基础库: `2.32.0` @@ -20203,7 +19926,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 开始投屏, 拉起半屏搜索设备。仅支持在 tap 事件回调内调用。 */ - startCasting(): void + startCasting(): void; /** [VideoContext.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.stop.html) * * 需要基础库: `1.7.0` @@ -20211,7 +19934,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 停止视频 */ - stop(): void + stop(): void; /** [VideoContext.switchCasting()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.switchCasting.html) * * 需要基础库: `2.32.0` @@ -20219,7 +19942,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 切换投屏设备。仅支持在 tap 事件回调内调用。 */ - switchCasting(): void + switchCasting(): void; } interface VideoDecoder { /** [Object VideoDecoder.getFrameData()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.getFrameData.html) @@ -20229,7 +19952,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 获取下一帧的解码数据 */ - getFrameData(): FrameDataOptions + getFrameData(): FrameDataOptions; /** [Promise VideoDecoder.remove()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.remove.html) * * 需要基础库: `2.11.0` @@ -20237,7 +19960,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 移除解码器 */ - remove(): Promise + remove(): Promise; /** [Promise VideoDecoder.seek(number position)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.seek.html) * * 需要基础库: `2.11.0` @@ -20247,8 +19970,8 @@ userCryptoManager.getRandomValues({ * 跳到某个时间点解码 */ seek( /** 跳转的解码位置,单位 ms */ - position: number - ): Promise + position: number, + ): Promise; /** [Promise VideoDecoder.start(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.start.html) * * 需要基础库: `2.11.0` @@ -20256,7 +19979,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 开始解码 */ - start(option: VideoDecoderStartOption): Promise + start(option: VideoDecoderStartOption): Promise; /** [Promise VideoDecoder.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.stop.html) * * 需要基础库: `2.11.0` @@ -20264,7 +19987,7 @@ userCryptoManager.getRandomValues({ * 在插件中使用:支持 * * 停止解码 */ - stop(): Promise + stop(): Promise; /** [VideoDecoder.off(string eventName, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.off.html) * * 需要基础库: `2.11.0` @@ -20276,8 +19999,8 @@ userCryptoManager.getRandomValues({ /** 事件名 */ eventName: string, /** 事件触发时执行的回调函数 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; /** [VideoDecoder.on(string eventName, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.on.html) * * 需要基础库: `2.11.0` @@ -20296,8 +20019,8 @@ userCryptoManager.getRandomValues({ * - 'ended': 解码结束事件。; */ eventName: 'start' | 'stop' | 'seek' | 'bufferchange' | 'ended', /** 事件触发时执行的回调函数 */ - callback: (...args: any[]) => any - ): void + callback: (...args: any[]) => any, + ): void; } interface VirtualPaymentError { /** 错误信息 @@ -20328,7 +20051,7 @@ userCryptoManager.getRandomValues({ * | -15018 | | 代币或者道具productId审核不通过 | * | -15019 | | 调微信报商户受限,商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | * | -15020 | | 操作过快,请稍候再试 | - * | -15021 | | 小程序被限频交易 | */ errMsg: string + * | -15021 | | 小程序被限频交易 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -20357,7 +20080,7 @@ userCryptoManager.getRandomValues({ * | -15018 | | 代币或者道具productId审核不通过 | * | -15019 | | 调微信报商户受限,商家可以登录微信商户平台/微信支付商家助手小程序查看原因和解决方案 | * | -15020 | | 操作过快,请稍候再试 | - * | -15021 | | 小程序被限频交易 | */ errCode: number + * | -15021 | | 小程序被限频交易 | */ errCode: number; } interface WifiError { /** 错误信息 @@ -20378,7 +20101,7 @@ userCryptoManager.getRandomValues({ * | 12010 | system internal error | 系统其他错误,需要在 errmsg 打印具体的错误原因 | * | 12011 | weapp in background | 应用在后台无法配置 Wi-Fi | * | 12013 | wifi config may be expired | 系统保存的 Wi-Fi 配置过期,建议忘记 Wi-Fi 后重试,仅 Android 支持 | - * | 12014 | invalid WEP / WPA password | iOS 特有,无效的 WEP / WPA 密码 | */ errMsg: string + * | 12014 | invalid WEP / WPA password | iOS 特有,无效的 WEP / WPA 密码 | */ errMsg: string; /** 错误码 * * | 错误码 | 错误信息 | 说明 | @@ -20397,7 +20120,7 @@ userCryptoManager.getRandomValues({ * | 12010 | system internal error | 系统其他错误,需要在 errmsg 打印具体的错误原因 | * | 12011 | weapp in background | 应用在后台无法配置 Wi-Fi | * | 12013 | wifi config may be expired | 系统保存的 Wi-Fi 配置过期,建议忘记 Wi-Fi 后重试,仅 Android 支持 | - * | 12014 | invalid WEP / WPA password | iOS 特有,无效的 WEP / WPA 密码 | */ errCode: number + * | 12014 | invalid WEP / WPA password | iOS 特有,无效的 WEP / WPA 密码 | */ errCode: number; } interface Worklet { /** Easing 模块实现了常见的动画缓动函数(动画效果参考 https://easings.net/ ),可从 [wx.worklet](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/wx.worklet.html) 对象中读取。 @@ -20557,7 +20280,7 @@ Easing.out(easing) * ```js Easing.inOut(easing) ``` */ - Easing: WorkletEasing + Easing: WorkletEasing; /** [AnimationObject worklet.decay(Object options, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/animation/worklet.decay.html) * * 在插件中使用:不支持 @@ -20608,8 +20331,8 @@ Page({ /** 动画配置 */ options: DecayOption, /** 动画完成回调。动画被取消时,返回 fasle,正常完成时返回 true。 */ - callback: (...args: any[]) => any - ): AnimationObject + callback: (...args: any[]) => any, + ): AnimationObject; /** [AnimationObject worklet.delay(number delayMS, AnimationObject delayedAnimation)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/combine-animation/worklet.delay.html) * * 在插件中使用:不支持 @@ -20619,8 +20342,8 @@ Page({ /** 动画开始前等待的时间,单位:毫秒。 */ delayMS: number, /** 动画对象。 */ - delayedAnimation: AnimationObject - ): AnimationObject + delayedAnimation: AnimationObject, + ): AnimationObject; /** [AnimationObject worklet.repeat(AnimationObject animation, number numberOfReps, boolean reverse, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/combine-animation/worklet.repeat.html) * * 在插件中使用:不支持 @@ -20634,8 +20357,8 @@ Page({ /** 反向运行动画,每周期结束动画由尾到头运行。该字段仅对 timing 和 spring 返回的动画对象生效。 */ reverse?: boolean, /** 动画完成回调。动画被取消时,返回 fasle,正常完成时返回 true。 */ - callback?: (...args: any[]) => any - ): AnimationObject + callback?: (...args: any[]) => any, + ): AnimationObject; /** [AnimationObject worklet.sequence(AnimationObject animationN)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/combine-animation/worklet.sequence.html) * * 在插件中使用:不支持 @@ -20643,8 +20366,8 @@ Page({ * 组合动画序列,依次执行传入的动画。 */ sequence( /** 动画对象 */ - animationN: AnimationObject - ): AnimationObject + animationN: AnimationObject, + ): AnimationObject; /** [AnimationObject worklet.spring(number|string toValue, Object options, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/animation/worklet.spring.html) * * 在插件中使用:不支持 @@ -20656,8 +20379,8 @@ Page({ /** 动画配置 */ options: SpringOption, /** 动画完成回调。动画被取消时,返回 fasle,正常完成时返回 true。 */ - callback: (...args: any[]) => any - ): AnimationObject + callback: (...args: any[]) => any, + ): AnimationObject; /** [AnimationObject worklet.timing(number toValue, Object options, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/animation/worklet.timing.html) * * 在插件中使用:不支持 @@ -20669,8 +20392,8 @@ Page({ /** 动画配置 */ options: TimingOption, /** 动画完成回调。动画被取消时,返回 fasle,正常完成时返回 true。 */ - callback: (...args: any[]) => any - ): AnimationObject + callback: (...args: any[]) => any, + ): AnimationObject; /** [DerivedValue worklet.derived(WorkletFunction updaterWorklet)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/base/worklet.derived.html) * * 在插件中使用:不支持 @@ -20678,8 +20401,8 @@ Page({ * 衍生值 `DerivedValue`,可基于已有的 `SharedValue` 生成其它共享变量。 */ derived( /** worklet 函数类型,该函数被立即执行,返回值作为 DerivedValue 的初始值。当函数内捕获的 SharedValue 类型值发生变化时,updaterWorklet 被驱动执行,返回值用于更新 DerivedValue。可类比 computed 计算属性进行理解。 */ - updaterWorklet: WorkletFunction - ): DerivedValue + updaterWorklet: WorkletFunction, + ): DerivedValue; /** [SharedValue worklet.shared(any initialValue)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/base/worklet.shared.html) * * 在插件中使用:不支持 @@ -20687,8 +20410,8 @@ Page({ * 创建共享变量 `SharedValue`,用于跨线程共享数据和驱动动画。 */ shared( /** 初始值,可通过 `.value` 属性进行读取和修改。类型可以是 `number | string | bool | null | undefined | Object | Array | Function`。 */ - initialValue: any - ): SharedValue + initialValue: any, + ): SharedValue; /** [function worklet.runOnJS(function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/tool-function/worklet.runOnJS.html) * * 在插件中使用:不支持 @@ -20697,8 +20420,8 @@ Page({ * 有这样的要求是因为,调用其它 `worklet` 函数时是同步调用,但在 `UI` 线程执行 `JS` 线程的函数只能是异步,开发者容易混淆,试图同步获取 `JS` 线程的返回值。 */ runOnJS( /** 未声明为 worklet 类型的普通函数。 */ - fn: (...args: any[]) => any - ): (...args: any[]) => any + fn: (...args: any[]) => any, + ): (...args: any[]) => any; /** [function worklet.runOnUI(function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/tool-function/worklet.runOnUI.html) * * 在插件中使用:不支持 @@ -20706,8 +20429,8 @@ Page({ * 在 UI 线程执行 worklet 函数。 */ runOnUI( /** worklet 类型函数。 */ - fn: (...args: any[]) => any - ): (...args: any[]) => any + fn: (...args: any[]) => any, + ): (...args: any[]) => any; /** [worklet.cancelAnimation(SharedValue SharedValue)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/base/worklet.cancelAnimation.html) * * 在插件中使用:不支持 @@ -20715,8 +20438,8 @@ Page({ * 取消由 `SharedValue` 驱动的动画。 */ cancelAnimation( /** 共享变量。 */ - SharedValue: SharedValue - ): void + SharedValue: SharedValue, + ): void; /** [worklet.scrollViewContext.scrollTo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/base/worklet.scrollViewContext.scrollTo.html) * * 需要基础库: `3.3.0` @@ -20728,11 +20451,11 @@ Page({ * **示例代码** * * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/R0cfBJml7SNB) */ - scrollTo(option: WorkletScrollViewContextScrollToOption): void + scrollTo(option: WorkletScrollViewContextScrollToOption): void; /** 需要基础库: `3.3.0` * * `ScrollView` 实例,可在 `worklet` 函数内操作 `scroll-view` 组件。 */ - scrollViewContext: WorkletScrollViewContext + scrollViewContext: WorkletScrollViewContext; } interface Wx { /** [Array.<any> wx.batchGetStorageSync(Array.<string> keyList)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.batchGetStorageSync.html) @@ -20761,8 +20484,8 @@ try { * 对于多个key的读取, 批量读取在性能上优于多次getStorageSync读取 */ batchGetStorageSync( /** 本地缓存中指定的 key 数组 */ - keyList: string[] - ): any[] + keyList: string[], + ): any[]; /** [ArrayBuffer wx.base64ToArrayBuffer(string base64)](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.base64ToArrayBuffer.html) * * 需要基础库: `1.1.0` @@ -20773,8 +20496,8 @@ try { * 将 Base64 字符串转成 ArrayBuffer 对象 */ base64ToArrayBuffer( /** 要转化成 ArrayBuffer 对象的 Base64 字符串 */ - base64: string - ): ArrayBuffer + base64: string, + ): ArrayBuffer; /** [Object wx.getAccountInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html) * * 需要基础库: `2.2.2` @@ -20791,7 +20514,7 @@ console.log(accountInfo.miniProgram.appId) // 小程序 appId console.log(accountInfo.plugin.appId) // 插件 appId console.log(accountInfo.plugin.version) // 插件版本号, 'a.b.c' 这样的形式 ``` */ - getAccountInfoSync(): AccountInfo + getAccountInfoSync(): AccountInfo; /** [Object wx.getAppAuthorizeSetting()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppAuthorizeSetting.html) * * 需要基础库: `2.20.1` @@ -20823,7 +20546,7 @@ console.log(appAuthorizeSetting.phoneCalendarAuthorized) * `'authorized'` 表示已经获得授权,无需再次请求授权; * `'denied'` 表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户[打开系统设置](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),在设置页中打开权限) * `'non determined'` 表示尚未请求授权,会在微信下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) */ - getAppAuthorizeSetting(): AppAuthorizeSetting + getAppAuthorizeSetting(): AppAuthorizeSetting; /** [Object wx.getAppBaseInfo()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppBaseInfo.html) * * 需要基础库: `2.20.1` @@ -20844,13 +20567,13 @@ console.log(appBaseInfo.language) console.log(appBaseInfo.version) console.log(appBaseInfo.theme) ``` */ - getAppBaseInfo(): AppBaseInfo + getAppBaseInfo(): AppBaseInfo; /** [Object wx.getBatteryInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfoSync.html) * * 在插件中使用:需要基础库 `2.15.0` * * [wx.getBatteryInfo](https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfo.html) 的同步版本 */ - getBatteryInfoSync(): GetBatteryInfoSyncResult + getBatteryInfoSync(): GetBatteryInfoSyncResult; /** [Object wx.getDeviceInfo()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceInfo.html) * * 需要基础库: `2.20.1` @@ -20871,7 +20594,7 @@ console.log(deviceInfo.model) console.log(deviceInfo.platform) console.log(deviceInfo.system) ``` */ - getDeviceInfo(): DeviceInfo + getDeviceInfo(): DeviceInfo; /** [Object wx.getEnterOptionsSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getEnterOptionsSync.html) * * 需要基础库: `2.9.4` @@ -20907,7 +20630,7 @@ console.log(deviceInfo.system) * **注意** * * 部分版本在无 `referrerInfo` 的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。 */ - getEnterOptionsSync(): LaunchOptionsApp + getEnterOptionsSync(): LaunchOptionsApp; /** [Object wx.getExptInfoSync(Array.<string> keys)](https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.getExptInfoSync.html) * * 需要基础库: `2.17.0` @@ -20923,8 +20646,8 @@ console.log(deviceInfo.system) * 而 wx.getExptInfoSync(['color']) 则只会返回 `{color:'#fff'}` */ getExptInfoSync( /** 实验参数数组,不填则获取所有实验参数 */ - keys?: string[] - ): IAnyObject + keys?: string[], + ): IAnyObject; /** [Object wx.getExtConfigSync()](https://developers.weixin.qq.com/miniprogram/dev/api/ext/wx.getExtConfigSync.html) * * 需要基础库: `1.1.0` @@ -20943,7 +20666,7 @@ console.log(deviceInfo.system) let extConfig = wx.getExtConfigSync? wx.getExtConfigSync(): {} console.log(extConfig) ``` */ - getExtConfigSync(): IAnyObject + getExtConfigSync(): IAnyObject; /** [Object wx.getLaunchOptionsSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) * * 需要基础库: `2.1.2` @@ -20980,7 +20703,7 @@ console.log(extConfig) * **注意** * * 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。 */ - getLaunchOptionsSync(): LaunchOptionsApp + getLaunchOptionsSync(): LaunchOptionsApp; /** [Object wx.getMenuButtonBoundingClientRect()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/menu/wx.getMenuButtonBoundingClientRect.html) * * 需要基础库: `2.1.0` @@ -21001,7 +20724,7 @@ console.log(res.right) console.log(res.bottom) console.log(res.left) ``` */ - getMenuButtonBoundingClientRect(): ClientRect + getMenuButtonBoundingClientRect(): ClientRect; /** [Object wx.getSkylineInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSkylineInfoSync.html) * * 需要基础库: `2.26.2` @@ -21009,7 +20732,7 @@ console.log(res.left) * 在插件中使用:需要基础库 `2.26.2` * * 获取当前运行环境对于 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的支持情况 */ - getSkylineInfoSync(): SkylineInfo + getSkylineInfoSync(): SkylineInfo; /** [Object wx.getStorageInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageInfoSync.html) * * 在插件中使用:不支持 @@ -21038,7 +20761,7 @@ try { // Do something when catch error } ``` */ - getStorageInfoSync(): GetStorageInfoSyncOption + getStorageInfoSync(): GetStorageInfoSyncOption; /** [Object wx.getSystemInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoSync.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21084,7 +20807,7 @@ try { * ## 注意事项 * - 当 wx.getSystemInfoSync() 接口发生错误时可能会返回空对象 * - wx.getSystemInfo 接口由于会获取系统权限,可能触发授权弹窗,请使用 [wx.getSystemSetting](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemSetting.html)、[wx.getAppAuthorizeSetting](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppAuthorizeSetting.html)、[wx.getDeviceInfo](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceInfo.html)、[wx.getWindowInfo](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getWindowInfo.html)、[wx.getAppBaseInfo](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppBaseInfo.html) 替代 */ - getSystemInfoSync(): SystemInfo + getSystemInfoSync(): SystemInfo; /** [Object wx.getSystemSetting()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemSetting.html) * * 需要基础库: `2.20.1` @@ -21103,7 +20826,7 @@ console.log(systemSetting.deviceOrientation) console.log(systemSetting.locationEnabled) console.log(systemSetting.wifiEnabled) ``` */ - getSystemSetting(): SystemSetting + getSystemSetting(): SystemSetting; /** [Object wx.getWindowInfo()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getWindowInfo.html) * * 需要基础库: `2.20.1` @@ -21126,7 +20849,7 @@ console.log(windowInfo.statusBarHeight) console.log(windowInfo.safeArea) console.log(windowInfo.screenTop) ``` */ - getWindowInfo(): WindowInfo + getWindowInfo(): WindowInfo; /** [Promise wx.getRendererUserAgent(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getRendererUserAgent.html) * * 需要基础库: `2.26.3` @@ -21145,15 +20868,13 @@ wx.getRendererUserAgent({ success(res) { console.log(res.userAgent) } }) ``` */ - getRendererUserAgent( - option?: GetRendererUserAgentOption - ): Promise + getRendererUserAgent(option?: GetRendererUserAgentOption): Promise; /** [[Animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html) wx.createAnimation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/wx.createAnimation.html) * * 在插件中使用:需要基础库 `1.9.6` * * 创建一个动画实例 [animation](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.html)。调用实例的方法来描述动画。最后通过动画实例的 export 方法导出动画数据传递给组件的 animation 属性。 */ - createAnimation(option: StepOption): Animation + createAnimation(option: StepOption): Animation; /** [[AudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.html) wx.createAudioContext(string id, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createAudioContext.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21164,8 +20885,8 @@ wx.getRendererUserAgent({ /** [audio](https://developers.weixin.qq.com/miniprogram/dev/component/audio.html) 组件的 id */ id: string, /** 在自定义组件下,当前组件实例的this,以操作组件内 [audio](https://developers.weixin.qq.com/miniprogram/dev/component/audio.html) 组件 */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): AudioContext + component?: Component.TrivialInstance | Page.TrivialInstance, + ): AudioContext; /** [[BackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.html) wx.getBackgroundAudioManager()](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) * * 需要基础库: `1.2.0` @@ -21176,7 +20897,7 @@ wx.getRendererUserAgent({ * 小程序切入后台,如果音频处于播放状态,可以继续播放。但是后台状态不能通过调用API操纵音频的播放状态。 * * 从微信客户端6.7.2版本开始,若需要在小程序切后台后继续播放音频,需要在 [app.json](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html) 中配置 `requiredBackgroundModes` 属性。开发版和体验版上可以直接生效,正式版还需通过审核。 */ - getBackgroundAudioManager(): BackgroundAudioManager + getBackgroundAudioManager(): BackgroundAudioManager; /** [[CacheManager](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.html) wx.createCacheManager(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/wx.createCacheManager.html) * * 需要基础库: `2.24.0` @@ -21207,7 +20928,7 @@ cacheManager.on('request', evt => { }) }) ``` */ - createCacheManager(option: CreateCacheManagerOption): CacheManager + createCacheManager(option: CreateCacheManagerOption): CacheManager; /** [[CameraContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.html) wx.createCameraContext()](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/wx.createCameraContext.html) * * 需要基础库: `1.6.0` @@ -21215,7 +20936,7 @@ cacheManager.on('request', evt => { * 在插件中使用:需要基础库 `1.9.6` * * 创建 [camera](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html) 上下文 [CameraContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.html) 对象。 */ - createCameraContext(): CameraContext + createCameraContext(): CameraContext; /** [[CanvasContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) wx.createCanvasContext(string canvasId, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createCanvasContext.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21226,8 +20947,8 @@ cacheManager.on('request', evt => { /** 要获取上下文的 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件 canvas-id 属性 */ canvasId: string, /** 在自定义组件下,当前组件实例的this,表示在这个自定义组件下查找拥有 canvas-id 的 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) ,如果省略则不在任何自定义组件内查找 */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): CanvasContext + component?: Component.TrivialInstance | Page.TrivialInstance, + ): CanvasContext; /** [[DownloadTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.html) wx.downloadFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/wx.downloadFile.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21251,7 +20972,7 @@ wx.downloadFile({ } }) ``` */ - downloadFile(option: DownloadFileOption): DownloadTask + downloadFile(option: DownloadFileOption): DownloadTask; /** [[FileSystemManager](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.html) wx.getFileSystemManager()](https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html) * * 需要基础库: `1.9.9` @@ -21259,7 +20980,7 @@ wx.downloadFile({ * 在插件中使用:需要基础库 `2.19.2` * * 获取全局唯一的文件管理器 */ - getFileSystemManager(): FileSystemManager + getFileSystemManager(): FileSystemManager; /** [[InferenceSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.html) wx.createInferenceSession(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/wx.createInferenceSession.html) * * 需要基础库: `2.30.0` @@ -21313,9 +21034,7 @@ session.onLoad(() => { // 销毁会话 session.destroy() ``` */ - createInferenceSession( - option: CreateInferenceSessionOption - ): InferenceSession + createInferenceSession(option: CreateInferenceSessionOption): InferenceSession; /** [[InnerAudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.html) wx.createInnerAudioContext(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createInnerAudioContext.html) * * 需要基础库: `1.6.0` @@ -21340,9 +21059,7 @@ innerAudioContext.stop() // 停止 innerAudioContext.destroy() // 释放音频资源 ``` */ - createInnerAudioContext( - option?: CreateInnerAudioContextOption - ): InnerAudioContext + createInnerAudioContext(option?: CreateInnerAudioContextOption): InnerAudioContext; /** [[IntersectionObserver](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.html) wx.createIntersectionObserver(Object component, Object options)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createIntersectionObserver.html) * * 需要基础库: `1.9.3` @@ -21373,8 +21090,8 @@ innerAudioContext.destroy() // 释放音频资源 /** 自定义组件实例 */ component: IAnyObject, /** 选项 */ - options?: CreateIntersectionObserverOption - ): IntersectionObserver + options?: CreateIntersectionObserverOption, + ): IntersectionObserver; /** [[InterstitialAd](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.html) wx.createInterstitialAd(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/wx.createInterstitialAd.html) * * 需要基础库: `2.6.0` @@ -21382,7 +21099,7 @@ innerAudioContext.destroy() // 释放音频资源 * 在插件中使用:需要基础库 `2.8.1` * * 创建插屏广告组件。请通过 [wx.getSystemInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoSync.html) 返回对象的 SDKVersion 判断基础库版本号后再使用该 API。每次调用该方法创建插屏广告都会返回一个全新的实例(小程序端的插屏广告实例不允许跨页面使用)。 */ - createInterstitialAd(option: CreateInterstitialAdOption): InterstitialAd + createInterstitialAd(option: CreateInterstitialAdOption): InterstitialAd; /** [[LivePlayerContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.html) wx.createLivePlayerContext(string id, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/wx.createLivePlayerContext.html) * * 需要基础库: `1.7.0` @@ -21394,8 +21111,8 @@ innerAudioContext.destroy() // 释放音频资源 /** [live-player](https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html) 组件的 id */ id: string, /** 在自定义组件下,当前组件实例的this,以操作组件内 [live-player](https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html) 组件 */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): LivePlayerContext + component?: Component.TrivialInstance | Page.TrivialInstance, + ): LivePlayerContext; /** [[LivePusherContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.html) wx.createLivePusherContext()](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/wx.createLivePusherContext.html) * * 需要基础库: `1.7.0` @@ -21403,7 +21120,7 @@ innerAudioContext.destroy() // 释放音频资源 * 在插件中使用:需要基础库 `1.9.6` * * 创建 [live-pusher](https://developers.weixin.qq.com/miniprogram/dev/component/live-pusher.html) 上下文 [LivePusherContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.html) 对象。 */ - createLivePusherContext(): LivePusherContext + createLivePusherContext(): LivePusherContext; /** [[LogManager](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.html) wx.getLogManager(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getLogManager.html) * * 需要基础库: `2.1.0` @@ -21421,7 +21138,7 @@ logger.info({str: 'hello world'}, 'info log', 100, [1, 2, 3]) logger.debug({str: 'hello world'}, 'debug log', 100, [1, 2, 3]) logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3]) ``` */ - getLogManager(option: GetLogManagerOption): LogManager + getLogManager(option: GetLogManagerOption): LogManager; /** [[MapContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.html) wx.createMapContext(string mapId, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/wx.createMapContext.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21431,8 +21148,8 @@ logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3]) /** [map](https://developers.weixin.qq.com/miniprogram/dev/component/map.html) 组件的 id */ mapId: string, /** 在自定义组件下,当前组件实例的this,以操作组件内 [map](https://developers.weixin.qq.com/miniprogram/dev/component/map.html) 组件 */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): MapContext + component?: Component.TrivialInstance | Page.TrivialInstance, + ): MapContext; /** [[MediaAudioPlayer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.html) wx.createMediaAudioPlayer()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createMediaAudioPlayer.html) * * 需要基础库: `2.13.0` @@ -21472,7 +21189,7 @@ logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3]) * **完整demo(小游戏)** * * - https://developers.weixin.qq.com/s/SF2duHmb7MjI */ - createMediaAudioPlayer(): MediaAudioPlayer + createMediaAudioPlayer(): MediaAudioPlayer; /** [[MediaContainer](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.html) wx.createMediaContainer()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/wx.createMediaContainer.html) * * 需要基础库: `2.9.0` @@ -21480,7 +21197,7 @@ logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3]) * 在插件中使用:需要基础库 `2.10.0` * * 创建音视频处理容器,最终可将容器中的轨道合成一个视频 */ - createMediaContainer(): MediaContainer + createMediaContainer(): MediaContainer; /** [[MediaRecorder](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.html) wx.createMediaRecorder(Object canvas, Object options)](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/wx.createMediaRecorder.html) * * 需要基础库: `2.11.0` @@ -21518,8 +21235,8 @@ const {tempFilePath} = await new Promise(resolve => { createMediaRecorder( /** WebGL 对象,通过 [SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) 获取到的 node 对象或通过 [wx.createOffscreenCanvas](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) 创建的离屏 WebGL Canvas 对象 */ canvas: IAnyObject, - options: CreateMediaRecorderOption - ): MediaRecorder + options: CreateMediaRecorderOption, + ): MediaRecorder; /** [[NFCAdapter](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.html) wx.getNFCAdapter()](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/wx.getNFCAdapter.html) * * 需要基础库: `2.11.2` @@ -21531,7 +21248,7 @@ const {tempFilePath} = await new Promise(resolve => { * **示例代码** * * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/1WsbDwmb75ig) */ - getNFCAdapter(): NFCAdapter + getNFCAdapter(): NFCAdapter; /** [[OffscreenCanvas](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/OffscreenCanvas.html) wx.createOffscreenCanvas(object object, number width, number height, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) * * 需要基础库: `2.16.1` @@ -21564,8 +21281,8 @@ const {tempFilePath} = await new Promise(resolve => { /** 画布高度 */ height: number, /** 在自定义组件下,当前组件实例的 this */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): OffscreenCanvas + component?: Component.TrivialInstance | Page.TrivialInstance, + ): OffscreenCanvas; /** [[OffscreenCanvas](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/OffscreenCanvas.html) wx.createOffscreenCanvas(object object, number width, number height, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) * * 需要基础库: `2.16.1` @@ -21592,9 +21309,7 @@ const {tempFilePath} = await new Promise(resolve => { * * 从基础库 2.16.1 开始改为 `wx.createOffscreenCanvas(options: object): OffscreenCanvas`,向下兼容旧版入参。 * 但需注意旧版入参只能创建 webgl 类型,如需创建 2d 类型则必须使用新版。 */ - createOffscreenCanvas( - option: CreateOffscreenCanvasOption - ): OffscreenCanvas + createOffscreenCanvas(option: CreateOffscreenCanvasOption): OffscreenCanvas; /** [[Performance](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.html) wx.getPerformance()](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.getPerformance.html) * * 需要基础库: `2.11.0` @@ -21633,7 +21348,7 @@ observer.observe({ entryTypes: ['render', 'script', 'navigation'] }) * * - 目前,当开启代码 [按需注入](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/lazyload.html) 时,`evaluateScript` 将仅包含公有部分代码(2.21.2 开始会区分公共部分/页面和组件的部分),页面和组件的代码注入的时间会包含在 `firstRender` 中(因为页面和组件的代码注入过程成为了首次渲染过程的一部分)。因此开启按需注入后,脚本耗时降低,渲染时间提高属于正常现象,优化效果可以关注整体启动耗时(`appLaunch`)来评估。 * - firstPaint 和 firstContentfulPaint 指标在开启 vConsole 的情况下,由于绘制 vConsole 面板,会导致数据提前。 */ - getPerformance(): Performance + getPerformance(): Performance; /** [[PreDownloadSubpackageTask](https://developers.weixin.qq.com/miniprogram/dev/api/base/subpackage/PreDownloadSubpackageTask.html) wx.preDownloadSubpackage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/subpackage/wx.preDownloadSubpackage.html) * * 需要基础库: `2.27.3` @@ -21672,9 +21387,7 @@ task.onProgressUpdate(res => { console.log(res.totalBytesExpectedToWrite) }) ``` */ - preDownloadSubpackage( - option: PreDownloadSubpackageOption - ): PreDownloadSubpackageTask + preDownloadSubpackage(option: PreDownloadSubpackageOption): PreDownloadSubpackageTask; /** [[RealtimeLogManager](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.html) wx.getRealtimeLogManager()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.getRealtimeLogManager.html) * * 需要基础库: `2.7.1` @@ -21699,7 +21412,7 @@ logger.info('key1', 'value1') logger.error('key2', {str: 'value2'}) logger.warn('key3', 'value3') ``` */ - getRealtimeLogManager(): RealtimeLogManager + getRealtimeLogManager(): RealtimeLogManager; /** [[RecorderManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.html) wx.getRecorderManager()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.getRecorderManager.html) * * 需要基础库: `1.6.0` @@ -21707,7 +21420,7 @@ logger.warn('key3', 'value3') * 在插件中使用:需要基础库 `1.9.94` * * 获取**全局唯一**的录音管理器 RecorderManager */ - getRecorderManager(): RecorderManager + getRecorderManager(): RecorderManager; /** [[RequestTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.html) wx.request(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/wx.request.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21747,14 +21460,7 @@ wx.request({ } }) ``` */ - request< - T extends string | IAnyObject | ArrayBuffer = - | string - | IAnyObject - | ArrayBuffer - >( - option: RequestOption - ): RequestTask + request(option: RequestOption): RequestTask; /** [[RewardedVideoAd](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.html) wx.createRewardedVideoAd(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/wx.createRewardedVideoAd.html) * * 需要基础库: `2.0.4` @@ -21762,9 +21468,7 @@ wx.request({ * 在插件中使用:需要基础库 `2.8.1` * * 创建激励视频广告组件。请通过 [wx.getSystemInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoSync.html) 返回对象的 SDKVersion 判断基础库版本号后再使用该 API(小游戏端要求 >= 2.0.4, 小程序端要求 >= 2.6.0)。调用该方法创建的激励视频广告是一个单例(小游戏端是全局单例,小程序端是页面内单例,在小程序端的单例对象不允许跨页面使用)。 */ - createRewardedVideoAd( - option: CreateRewardedVideoAdOption - ): RewardedVideoAd + createRewardedVideoAd(option: CreateRewardedVideoAdOption): RewardedVideoAd; /** [[SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) wx.createSelectorQuery()](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createSelectorQuery.html) * * 需要基础库: `1.4.0` @@ -21784,7 +21488,7 @@ query.exec(function(res){ res[1].scrollTop // 显示区域的竖直滚动位置 }) ``` */ - createSelectorQuery(): SelectorQuery + createSelectorQuery(): SelectorQuery; /** [[SocketTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html) wx.connectSocket(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.connectSocket.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21808,7 +21512,7 @@ wx.connectSocket({ } }) ``` */ - connectSocket(option: ConnectSocketOption): SocketTask + connectSocket(option: ConnectSocketOption): SocketTask; /** [[TCPSocket](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.html) wx.createTCPSocket()](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/wx.createTCPSocket.html) * * 需要基础库: `2.18.0` @@ -21823,7 +21527,7 @@ wx.connectSocket({ * - 允许与配置过的服务器域名通信,详见[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html) * - 禁止与以下端口号连接:`1024 以下` `1099` `1433` `1521` `1719` `1720` `1723` `2049` `2375` `3128` `3306` `3389` `3659` `4045` `5060` `5061` `5432` `5984` `6379` `6000` `6566` `7001` `7002` `8000-8100` `8443` `8888` `9200` `9300` `10051` `10080` `11211` `27017` `27018` `27019` * - 每 5 分钟内最多创建 20 个 TCPSocket */ - createTCPSocket(): TCPSocket + createTCPSocket(): TCPSocket; /** [[UDPSocket](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.html) wx.createUDPSocket()](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/wx.createUDPSocket.html) * * 需要基础库: `2.7.0` @@ -21831,7 +21535,7 @@ wx.connectSocket({ * 在插件中使用:需要基础库 `2.11.1` * * 创建一个 UDP Socket 实例。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 */ - createUDPSocket(): UDPSocket + createUDPSocket(): UDPSocket; /** [[UpdateManager](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html) wx.getUpdateManager()](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/wx.getUpdateManager.html) * * 需要基础库: `1.9.90` @@ -21843,7 +21547,7 @@ wx.connectSocket({ * **示例代码** * * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ - getUpdateManager(): UpdateManager + getUpdateManager(): UpdateManager; /** [[UploadTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.html) wx.uploadFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/wx.uploadFile.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21871,7 +21575,7 @@ wx.chooseImage({ } }) ``` */ - uploadFile(option: UploadFileOption): UploadTask + uploadFile(option: UploadFileOption): UploadTask; /** [[UserCryptoManager](https://developers.weixin.qq.com/miniprogram/dev/api/base/crypto/UserCryptoManager.html) wx.getUserCryptoManager()](https://developers.weixin.qq.com/miniprogram/dev/api/base/crypto/wx.getUserCryptoManager.html) * * 需要基础库: `2.17.3` @@ -21879,7 +21583,7 @@ wx.chooseImage({ * 在插件中使用:不支持 * * 获取用户加密模块 */ - getUserCryptoManager(): UserCryptoManager + getUserCryptoManager(): UserCryptoManager; /** [[VKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.html) wx.createVKSession(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) * * 需要基础库: `2.20.0` @@ -21923,7 +21627,7 @@ const doRender = frame => { // ... } ``` */ - createVKSession(option: VKConfig): VKSession + createVKSession(option: VKConfig): VKSession; /** [[VideoContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.html) wx.createVideoContext(string id, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.createVideoContext.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -21933,8 +21637,8 @@ const doRender = frame => { /** [video](https://developers.weixin.qq.com/miniprogram/dev/component/video.html) 组件的 id */ id: string, /** 在自定义组件下,当前组件实例的this,以操作组件内 [video](https://developers.weixin.qq.com/miniprogram/dev/component/video.html) 组件 */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): VideoContext + component?: Component.TrivialInstance | Page.TrivialInstance, + ): VideoContext; /** [[VideoDecoder](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.html) wx.createVideoDecoder()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/wx.createVideoDecoder.html) * * 需要基础库: `2.11.0` @@ -21942,7 +21646,7 @@ const doRender = frame => { * 在插件中使用:需要基础库 `2.11.0` * * 创建视频解码器,可逐帧获取解码后的数据 */ - createVideoDecoder(): VideoDecoder + createVideoDecoder(): VideoDecoder; /** [[WebAudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.html) wx.createWebAudioContext()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createWebAudioContext.html) * * 需要基础库: `2.19.0` @@ -21950,7 +21654,7 @@ const doRender = frame => { * 在插件中使用:不支持 * * 创建 WebAudio 上下文。 */ - createWebAudioContext(): WebAudioContext + createWebAudioContext(): WebAudioContext; /** [[Worker](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.html) wx.createWorker(string scriptPath, object options)](https://developers.weixin.qq.com/miniprogram/dev/api/worker/wx.createWorker.html) * * 需要基础库: `1.9.90` @@ -21983,8 +21687,8 @@ createNewWorker() /** worker 入口文件的**绝对路径** */ scriptPath: string, /** 可选参数 */ - options?: CreateWorkerOption - ): Worker + options?: CreateWorkerOption, + ): Worker; /** [any wx.getStorageSync(string key)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageSync.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -22009,8 +21713,8 @@ try { ``` */ getStorageSync( /** 本地缓存中指定的 key */ - key: string - ): T + key: string, + ): T; /** [boolean wx.canIUse(string schema)](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.canIUse.html) * * 需要基础库: `1.1.1` @@ -22053,8 +21757,8 @@ wx.canIUse('button.open-type.contact') ``` */ canIUse( /** 使用 `${API}.${method}.${param}.${option}` 或者 `${component}.${attribute}.${option}` 方式来调用 */ - schema: string - ): boolean + schema: string, + ): boolean; /** [boolean wx.checkIsPictureInPictureActive()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/window/wx.checkIsPictureInPictureActive.html) * * 需要基础库: `2.29.2` @@ -22062,7 +21766,7 @@ wx.canIUse('button.open-type.contact') * 在插件中使用:不支持 * * 返回当前是否存在小窗播放(小窗在 video/live-player/live-pusher 下可用) */ - checkIsPictureInPictureActive(): boolean + checkIsPictureInPictureActive(): boolean; /** [boolean wx.isVKSupport(string version)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.isVKSupport.html) * * 需要基础库: `2.22.0` @@ -22080,8 +21784,8 @@ const isSupportV2 = wx.isVKSupport('v2') /** 参数 version 可选值: * - 'v1': 旧版本; * - 'v2': v2 版本,目前只有 iOS 基础库 2.22.0 以上支持; */ - version: 'v1' | 'v2' - ): boolean + version: 'v1' | 'v2', + ): boolean; /** [string wx.arrayBufferToBase64(ArrayBuffer arrayBuffer)](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.arrayBufferToBase64.html) * * 需要基础库: `1.1.0` @@ -22092,8 +21796,8 @@ const isSupportV2 = wx.isVKSupport('v2') * 将 ArrayBuffer 对象转成 Base64 字符串 */ arrayBufferToBase64( /** 要转换成 Base64 字符串的 ArrayBuffer 对象 */ - arrayBuffer: ArrayBuffer - ): string + arrayBuffer: ArrayBuffer, + ): string; /** [string wx.createBufferURL(ArrayBuffer|TypedArray buffer)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.createBufferURL.html) * * 需要基础库: `2.14.0` @@ -22103,18 +21807,8 @@ const isSupportV2 = wx.isVKSupport('v2') * 根据传入的 buffer 创建一个唯一的 URL 存在内存中 */ createBufferURL( /** 需要存入内存的二进制数据 */ - buffer: - | ArrayBuffer - | Int8Array - | Uint8Array - | Uint8ClampedArray - | Int16Array - | Uint16Array - | Int32Array - | Uint32Array - | Float32Array - | Float64Array - ): string + buffer: ArrayBuffer | Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array, + ): string; /** [string wx.getApiCategory()](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getApiCategory.html) * * 需要基础库: `2.33.0` @@ -22135,7 +21829,7 @@ const isSupportV2 = wx.isVKSupport('v2') * |<button open-type="feedback"> | | | `X` | | * |<button open-type="open-setting">| | | `X` | | * |openEmbeddedMiniProgram | | `X` | `X` | `X` | */ - getApiCategory(): string + getApiCategory(): string; /** [wx.addCard(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/card/wx.addCard.html) * * 需要基础库: `1.1.0` @@ -22166,9 +21860,7 @@ wx.addCard({ } }) ``` */ - addCard( - option: T - ): PromisifySuccessResult + addCard(option: T): PromisifySuccessResult; /** [wx.addFileToFavorites(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/favorites/wx.addFileToFavorites.html) * * 需要基础库: `2.16.1` @@ -22176,11 +21868,7 @@ wx.addCard({ * 在插件中使用:不支持 * * 收藏文件 */ - addFileToFavorites< - T extends AddFileToFavoritesOption = AddFileToFavoritesOption - >( - option: T - ): PromisifySuccessResult + addFileToFavorites(option: T): PromisifySuccessResult; /** [wx.addPhoneCalendar(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/calendar/wx.addPhoneCalendar.html) * * 需要基础库: `2.15.0` @@ -22188,11 +21876,7 @@ wx.addCard({ * 在插件中使用:不支持 * * 向系统日历添加事件 */ - addPhoneCalendar< - T extends AddPhoneCalendarOption = AddPhoneCalendarOption - >( - option: T - ): PromisifySuccessResult + addPhoneCalendar(option: T): PromisifySuccessResult; /** [wx.addPhoneContact(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/contact/wx.addPhoneContact.html) * * 需要基础库: `1.2.0` @@ -22200,11 +21884,7 @@ wx.addCard({ * 在插件中使用:需要基础库 `1.9.6` * * 添加手机通讯录联系人。用户可以选择将该表单以「新增联系人」或「添加到已有联系人」的方式,写入手机系统通讯录。 */ - addPhoneContact< - T extends AddPhoneContactOption = AddPhoneContactOption - >( - option: T - ): PromisifySuccessResult + addPhoneContact(option: T): PromisifySuccessResult; /** [wx.addPhoneRepeatCalendar(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/calendar/wx.addPhoneRepeatCalendar.html) * * 需要基础库: `2.15.0` @@ -22212,11 +21892,7 @@ wx.addCard({ * 在插件中使用:不支持 * * 向系统日历添加重复事件 */ - addPhoneRepeatCalendar< - T extends AddPhoneRepeatCalendarOption = AddPhoneRepeatCalendarOption - >( - option: T - ): PromisifySuccessResult + addPhoneRepeatCalendar(option: T): PromisifySuccessResult; /** [wx.addVideoToFavorites(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/favorites/wx.addVideoToFavorites.html) * * 需要基础库: `2.16.1` @@ -22224,11 +21900,7 @@ wx.addCard({ * 在插件中使用:不支持 * * 收藏视频 */ - addVideoToFavorites< - T extends AddVideoToFavoritesOption = AddVideoToFavoritesOption - >( - option: T - ): PromisifySuccessResult + addVideoToFavorites(option: T): PromisifySuccessResult; /** [wx.authPrivateMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.authPrivateMessage.html) * * 需要基础库: `2.13.0` @@ -22257,7 +21929,7 @@ wx.authPrivateMessage({ } }) ``` */ - authPrivateMessage(option?: AuthPrivateMessageOption): void + authPrivateMessage(option?: AuthPrivateMessageOption): void; /** [wx.authorize(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorize.html) * * 需要基础库: `1.2.0` @@ -22285,9 +21957,7 @@ wx.getSetting({ } }) ``` */ - authorize( - option: T - ): PromisifySuccessResult + authorize(option: T): PromisifySuccessResult; /** [wx.authorizeForMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorizeForMiniProgram.html) * * 需要基础库: `2.14.4` @@ -22307,7 +21977,7 @@ wx.authorizeForMiniProgram({ } }) ``` */ - authorizeForMiniProgram(option: AuthorizeForMiniProgramOption): void + authorizeForMiniProgram(option: AuthorizeForMiniProgramOption): void; /** [wx.batchGetStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.batchGetStorage.html) * * 需要基础库: `2.25.0` @@ -22326,11 +21996,7 @@ wx.batchGetStorage({ } }) ``` */ - batchGetStorage< - T extends BatchGetStorageOption = BatchGetStorageOption - >( - option: T - ): PromisifySuccessResult + batchGetStorage(option: T): PromisifySuccessResult; /** [wx.batchSetStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.batchSetStorage.html) * * 需要基础库: `2.25.0` @@ -22357,11 +22023,7 @@ wx.batchSetStorage({ }], }) ``` */ - batchSetStorage< - T extends BatchSetStorageOption = BatchSetStorageOption - >( - option: T - ): PromisifySuccessResult + batchSetStorage(option: T): PromisifySuccessResult; /** [wx.batchSetStorageSync(Array.<Object> kvList)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.batchSetStorageSync.html) * * 需要基础库: `2.25.0` @@ -22377,7 +22039,7 @@ try { wx.batchSetStorageSync([{key: 'key', value: 'value'}]) } catch (e) { } ``` */ - batchSetStorageSync(kvList: KvList[]): void + batchSetStorageSync(kvList: KvList[]): void; /** [wx.canvasGetImageData(Object object, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasGetImageData.html) * * 需要基础库: `1.9.0` @@ -22405,13 +22067,11 @@ wx.canvasGetImageData({ } }) ``` */ - canvasGetImageData< - T extends CanvasGetImageDataOption = CanvasGetImageDataOption - >( + canvasGetImageData( option: T, /** 在自定义组件下,当前组件实例的this,以操作组件内 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件 */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): PromisifySuccessResult + component?: Component.TrivialInstance | Page.TrivialInstance, + ): PromisifySuccessResult; /** [wx.canvasPutImageData(Object object, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasPutImageData.html) * * 需要基础库: `1.9.0` @@ -22419,25 +22079,21 @@ wx.canvasGetImageData({ * 在插件中使用:需要基础库 `1.9.6` * * 将像素数据绘制到画布。在自定义组件下,第二个参数传入自定义组件实例 this,以操作组件内 组件 */ - canvasPutImageData< - T extends CanvasPutImageDataOption = CanvasPutImageDataOption - >( + canvasPutImageData( option: T, /** 在自定义组件下,当前组件实例的this,以操作组件内 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件 */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): PromisifySuccessResult + component?: Component.TrivialInstance | Page.TrivialInstance, + ): PromisifySuccessResult; /** [wx.canvasToTempFilePath(Object object, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasToTempFilePath.html) * * 在插件中使用:需要基础库 `1.9.6` * * 把当前画布指定区域的内容导出生成指定大小的图片。在 `draw()` 回调里调用该方法才能保证图片导出成功。 */ - canvasToTempFilePath< - T extends CanvasToTempFilePathOption = CanvasToTempFilePathOption - >( + canvasToTempFilePath( option: T, /** 在自定义组件下,当前组件实例的this,以操作组件内 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件 */ - component?: Component.TrivialInstance | Page.TrivialInstance - ): PromisifySuccessResult + component?: Component.TrivialInstance | Page.TrivialInstance, + ): PromisifySuccessResult; /** [wx.checkIsAddedToMyMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/my-miniprogram/wx.checkIsAddedToMyMiniProgram.html) * * 需要基础库: `2.29.1` @@ -22445,9 +22101,7 @@ wx.canvasGetImageData({ * 在插件中使用:不支持 * * 检查小程序是否被添加至 「我的小程序」 */ - checkIsAddedToMyMiniProgram( - option: CheckIsAddedToMyMiniProgramOption - ): void + checkIsAddedToMyMiniProgram(option: CheckIsAddedToMyMiniProgramOption): void; /** [wx.checkIsOpenAccessibility(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/accessibility/wx.checkIsOpenAccessibility.html) * * 需要基础库: `2.13.0` @@ -22455,11 +22109,7 @@ wx.canvasGetImageData({ * 在插件中使用:不支持 * * 检测是否开启视觉无障碍功能。 */ - checkIsOpenAccessibility< - T extends CheckIsOpenAccessibilityOption = CheckIsOpenAccessibilityOption - >( - option?: T - ): PromisifySuccessResult + checkIsOpenAccessibility(option?: T): PromisifySuccessResult; /** [wx.checkIsSoterEnrolledInDevice(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/soter/wx.checkIsSoterEnrolledInDevice.html) * * 需要基础库: `1.6.0` @@ -22478,11 +22128,7 @@ wx.checkIsSoterEnrolledInDevice({ } }) ``` */ - checkIsSoterEnrolledInDevice< - T extends CheckIsSoterEnrolledInDeviceOption = CheckIsSoterEnrolledInDeviceOption - >( - option: T - ): PromisifySuccessResult + checkIsSoterEnrolledInDevice(option: T): PromisifySuccessResult; /** [wx.checkIsSupportSoterAuthentication(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/soter/wx.checkIsSupportSoterAuthentication.html) * * 需要基础库: `1.5.0` @@ -22502,11 +22148,9 @@ wx.checkIsSupportSoterAuthentication({ } }) ``` */ - checkIsSupportSoterAuthentication< - T extends CheckIsSupportSoterAuthenticationOption = CheckIsSupportSoterAuthenticationOption - >( - option?: T - ): PromisifySuccessResult + checkIsSupportSoterAuthentication( + option?: T, + ): PromisifySuccessResult; /** [wx.checkSession(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.checkSession.html) * * 在插件中使用:不支持 @@ -22534,9 +22178,7 @@ wx.checkSession({ } }) ``` */ - checkSession( - option?: T - ): PromisifySuccessResult + checkSession(option?: T): PromisifySuccessResult; /** [wx.chooseAddress(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/address/wx.chooseAddress.html) * * 需要基础库: `1.1.0` @@ -22567,9 +22209,7 @@ wx.chooseAddress({ } }) ``` */ - chooseAddress( - option?: T - ): PromisifySuccessResult + chooseAddress(option?: T): PromisifySuccessResult; /** [wx.chooseContact(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/contact/wx.chooseContact.html) * * 需要基础库: `2.8.0` @@ -22577,7 +22217,7 @@ wx.chooseAddress({ * 在插件中使用:不支持 * * 拉起手机通讯录,选择联系人。 */ - chooseContact(option?: ChooseContactOption): void + chooseContact(option?: ChooseContactOption): void; /** [wx.chooseImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -22598,9 +22238,7 @@ wx.chooseImage({ } }) ``` */ - chooseImage( - option?: T - ): PromisifySuccessResult + chooseImage(option?: T): PromisifySuccessResult; /** [wx.chooseInvoice(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoice.html) * * 需要基础库: `2.3.0` @@ -22613,9 +22251,7 @@ wx.chooseImage({ * * 请参考[微信电子发票文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=21517918939oae3U)中,「查询报销发票信息」部分。 * 其中 `access_token` 的获取请参考[auth.getAccessToken](#)文档 */ - chooseInvoice( - option?: T - ): PromisifySuccessResult + chooseInvoice(option?: T): PromisifySuccessResult; /** [wx.chooseInvoiceTitle(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoiceTitle.html) * * 需要基础库: `1.5.0` @@ -22633,11 +22269,7 @@ wx.chooseInvoiceTitle({ success(res) {} }) ``` */ - chooseInvoiceTitle< - T extends ChooseInvoiceTitleOption = ChooseInvoiceTitleOption - >( - option?: T - ): PromisifySuccessResult + chooseInvoiceTitle(option?: T): PromisifySuccessResult; /** [wx.chooseLicensePlate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/license-plate/wx.chooseLicensePlate.html) * * 需要基础库: `2.19.0` @@ -22645,11 +22277,7 @@ wx.chooseInvoiceTitle({ * 在插件中使用:不支持 * * 选择车牌号 */ - chooseLicensePlate< - T extends ChooseLicensePlateOption = ChooseLicensePlateOption - >( - option?: T - ): PromisifySuccessResult + chooseLicensePlate(option?: T): PromisifySuccessResult; /** [wx.chooseLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.chooseLocation.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -22666,9 +22294,7 @@ wx.chooseInvoiceTitle({ * **示例** * * ![](https://res.wx.qq.com/op_res/WDFC8aB4FI8rJ9oEmbYfbH_Fl3EIv91471YVxezVfLRESkUuCgfODZcbOoyteKU4j-OLZa2EFKY9BDPd3g-tfg#width:260px) */ - chooseLocation( - option: T - ): PromisifySuccessResult + chooseLocation(option: T): PromisifySuccessResult; /** [wx.chooseMedia(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html) * * 需要基础库: `2.10.0` @@ -22692,9 +22318,7 @@ wx.chooseMedia({ } }) ``` */ - chooseMedia( - option: T - ): PromisifySuccessResult + chooseMedia(option: T): PromisifySuccessResult; /** [wx.chooseMessageFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseMessageFile.html) * * 需要基础库: `2.5.0` @@ -22715,11 +22339,7 @@ wx.chooseMessageFile({ } }) ``` */ - chooseMessageFile< - T extends ChooseMessageFileOption = ChooseMessageFileOption - >( - option: T - ): PromisifySuccessResult + chooseMessageFile(option: T): PromisifySuccessResult; /** [wx.choosePoi(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.choosePoi.html) * * 在插件中使用:不支持 @@ -22736,9 +22356,7 @@ wx.chooseMessageFile({ * **示例** * * ![](https://res.wx.qq.com/op_res/lzDsNyBNifLczyLX0ms7ZpPQysgAgdhrQTGzzTQPiXkAB2HJIf1Slvl4rnN9I1q0AT3xqoGTg98jMsNexDLbbA#width:260px) */ - choosePoi( - option: T - ): PromisifySuccessResult + choosePoi(option: T): PromisifySuccessResult; /** [wx.chooseVideo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -22758,9 +22376,7 @@ wx.chooseVideo({ } }) ``` */ - chooseVideo( - option: T - ): PromisifySuccessResult + chooseVideo(option: T): PromisifySuccessResult; /** [wx.clearStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorage.html) * * 在插件中使用:不支持 @@ -22780,9 +22396,7 @@ try { // Do something when catch error } ``` */ - clearStorage( - option?: T - ): PromisifySuccessResult + clearStorage(option?: T): PromisifySuccessResult; /** [wx.clearStorageSync()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorageSync.html) * * 在插件中使用:不支持 @@ -22802,7 +22416,7 @@ try { // Do something when catch error } ``` */ - clearStorageSync(): void + clearStorageSync(): void; /** [wx.closeBLEConnection(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.closeBLEConnection.html) * * 需要基础库: `1.1.0` @@ -22822,11 +22436,7 @@ wx.closeBLEConnection({ } }) ``` */ - closeBLEConnection< - T extends CloseBLEConnectionOption = CloseBLEConnectionOption - >( - option: T - ): PromisifySuccessResult + closeBLEConnection(option: T): PromisifySuccessResult; /** [wx.closeBluetoothAdapter(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.closeBluetoothAdapter.html) * * 需要基础库: `1.1.0` @@ -22845,11 +22455,7 @@ wx.closeBluetoothAdapter({ } }) ``` */ - closeBluetoothAdapter< - T extends CloseBluetoothAdapterOption = CloseBluetoothAdapterOption - >( - option?: T - ): PromisifySuccessResult + closeBluetoothAdapter(option?: T): PromisifySuccessResult; /** [wx.closeSocket(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.closeSocket.html) * * 在插件中使用:不支持 @@ -22876,9 +22482,7 @@ wx.onSocketClose(function(res) { console.log('WebSocket 已关闭!') }) ``` */ - closeSocket( - option?: T - ): PromisifySuccessResult + closeSocket(option?: T): PromisifySuccessResult; /** [wx.compressImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.compressImage.html) * * 需要基础库: `2.4.0` @@ -22895,9 +22499,7 @@ wx.compressImage({ quality: 80 // 压缩质量 }) ``` */ - compressImage( - option: T - ): PromisifySuccessResult + compressImage(option: T): PromisifySuccessResult; /** [wx.compressVideo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.compressVideo.html) * * 需要基础库: `2.11.0` @@ -22905,9 +22507,7 @@ wx.compressImage({ * 在插件中使用:需要基础库 `2.11.1` * * 压缩视频接口。开发者可指定压缩质量 `quality` 进行压缩。当需要更精细的控制时,可指定 `bitrate`、`fps`、和 `resolution`,当 `quality` 传入时,这三个参数将被忽略。原视频的相关信息可通过 [getVideoInfo](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.getVideoInfo.html) 获取。 */ - compressVideo( - option: T - ): PromisifySuccessResult + compressVideo(option: T): PromisifySuccessResult; /** [wx.connectWifi(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.connectWifi.html) * * 需要基础库: `1.6.0` @@ -22934,9 +22534,7 @@ wx.connectWifi({ * - iOS 系统底层没有给开发者提供因 wifi 密码错误而连接失败的事件,但用户可以收到密码错误的系统弹窗。建议开发者通过 onWifiConnected 事件来判断 wifi 是否连接成功;即设置定时器,若超时后仍没有 onWifiConnected 事件,则认定此次 wifi 连接无效。 * - Android / iOS 在系统已经连上目标 wifi 的情况下,小程序再次连接目标 wifi,此时无论输入的密码是否正确,系统都会默认此次连接成功,且没有 onWifiConnected 事件。 * - onWifiConnected 事件可能会返回空对象,此时代表 wifi 断开连接,开发者可忽略这种情况。 */ - connectWifi( - option: T - ): PromisifySuccessResult + connectWifi(option: T): PromisifySuccessResult; /** [wx.createBLEConnection(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) * * 需要基础库: `1.1.0` @@ -22964,11 +22562,7 @@ wx.createBLEConnection({ } }) ``` */ - createBLEConnection< - T extends CreateBLEConnectionOption = CreateBLEConnectionOption - >( - option: T - ): PromisifySuccessResult + createBLEConnection(option: T): PromisifySuccessResult; /** [wx.createBLEPeripheralServer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/wx.createBLEPeripheralServer.html) * * 需要基础库: `2.10.3` @@ -22976,11 +22570,7 @@ wx.createBLEConnection({ * 在插件中使用:需要基础库 `2.22.1` * * 建立本地作为蓝牙低功耗外围设备的服务端,可创建多个。 */ - createBLEPeripheralServer< - T extends CreateBLEPeripheralServerOption = CreateBLEPeripheralServerOption - >( - option?: T - ): PromisifySuccessResult + createBLEPeripheralServer(option?: T): PromisifySuccessResult; /** [wx.cropImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.cropImage.html) * * 需要基础库: `2.26.0` @@ -22997,7 +22587,7 @@ wx.cropImage({ cropScale: '16:9', // 裁剪比例 }) ``` */ - cropImage(option: CropImageOption): void + cropImage(option: CropImageOption): void; /** [wx.disableAlertBeforeUnload(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.disableAlertBeforeUnload.html) * * 需要基础库: `2.12.0` @@ -23005,7 +22595,7 @@ wx.cropImage({ * 在插件中使用:不支持 * * 关闭小程序页面返回询问对话框。 */ - disableAlertBeforeUnload(option?: DisableAlertBeforeUnloadOption): void + disableAlertBeforeUnload(option?: DisableAlertBeforeUnloadOption): void; /** [wx.editImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.editImage.html) * * 需要基础库: `2.22.0` @@ -23021,7 +22611,7 @@ wx.editImage({ src: '', // 图片路径 }) ``` */ - editImage(option: EditImageOption): void + editImage(option: EditImageOption): void; /** [wx.enableAlertBeforeUnload(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.enableAlertBeforeUnload.html) * * 需要基础库: `2.12.0` @@ -23043,7 +22633,7 @@ wx.editImage({ * **示例代码** * * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/MTPm9Cmh7VfT) */ - enableAlertBeforeUnload(option: EnableAlertBeforeUnloadOption): void + enableAlertBeforeUnload(option: EnableAlertBeforeUnloadOption): void; /** [wx.exitMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.exitMiniProgram.html) * * 需要基础库: `2.17.3` @@ -23051,11 +22641,7 @@ wx.editImage({ * 在插件中使用:需要基础库 `2.30.1` * * 退出当前小程序。必须有点击行为才能调用成功。 */ - exitMiniProgram< - T extends ExitMiniProgramOption = ExitMiniProgramOption - >( - option?: T - ): PromisifySuccessResult + exitMiniProgram(option?: T): PromisifySuccessResult; /** [wx.exitVoIPChat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.exitVoIPChat.html) * * 需要基础库: `2.7.0` @@ -23063,9 +22649,7 @@ wx.editImage({ * 在插件中使用:需要基础库 `2.9.0` * * 退出(销毁)实时语音通话 */ - exitVoIPChat( - option?: T - ): PromisifySuccessResult + exitVoIPChat(option?: T): PromisifySuccessResult; /** [wx.faceDetect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/face/wx.faceDetect.html) * * 需要基础库: `2.18.0` @@ -23080,7 +22664,7 @@ wx.editImage({ * * ### 特别说明 * 若小程序人脸识别功能涉及采集、存储用户生物特征(如人脸照片或视频、身份证和手持身份证、身份证照和免冠照等),此类型服务需使用[微信原生人脸识别接口](https://developers.weixin.qq.com/community/develop/doc/000442d352c1202bd498ecb105c00d?highline=%E4%BA%BA%E8%84%B8%E6%A0%B8%E8%BA%AB)。 */ - faceDetect(option: FaceDetectOption): void + faceDetect(option: FaceDetectOption): void; /** [wx.getAvailableAudioSources(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.getAvailableAudioSources.html) * * 需要基础库: `2.1.0` @@ -23088,11 +22672,7 @@ wx.editImage({ * 在插件中使用:需要基础库 `2.15.0` * * 获取当前支持的音频输入源 */ - getAvailableAudioSources< - T extends GetAvailableAudioSourcesOption = GetAvailableAudioSourcesOption - >( - option?: T - ): PromisifySuccessResult + getAvailableAudioSources(option?: T): PromisifySuccessResult; /** [wx.getBLEDeviceCharacteristics(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEDeviceCharacteristics.html) * * 需要基础库: `1.1.0` @@ -23115,11 +22695,7 @@ wx.getBLEDeviceCharacteristics({ } }) ``` */ - getBLEDeviceCharacteristics< - T extends GetBLEDeviceCharacteristicsOption = GetBLEDeviceCharacteristicsOption - >( - option: T - ): PromisifySuccessResult + getBLEDeviceCharacteristics(option: T): PromisifySuccessResult; /** [wx.getBLEDeviceRSSI(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEDeviceRSSI.html) * * 需要基础库: `2.11.0` @@ -23127,11 +22703,7 @@ wx.getBLEDeviceCharacteristics({ * 在插件中使用:需要基础库 `2.11.0` * * 获取蓝牙低功耗设备的信号强度 (Received Signal Strength Indication, RSSI)。 */ - getBLEDeviceRSSI< - T extends GetBLEDeviceRSSIOption = GetBLEDeviceRSSIOption - >( - option: T - ): PromisifySuccessResult + getBLEDeviceRSSI(option: T): PromisifySuccessResult; /** [wx.getBLEDeviceServices(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEDeviceServices.html) * * 需要基础库: `1.1.0` @@ -23152,11 +22724,7 @@ wx.getBLEDeviceServices({ } }) ``` */ - getBLEDeviceServices< - T extends GetBLEDeviceServicesOption = GetBLEDeviceServicesOption - >( - option: T - ): PromisifySuccessResult + getBLEDeviceServices(option: T): PromisifySuccessResult; /** [wx.getBLEMTU(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEMTU.html) * * 需要基础库: `2.20.1` @@ -23182,9 +22750,7 @@ wx.getBLEMTU({ } }) ``` */ - getBLEMTU( - option: T - ): PromisifySuccessResult + getBLEMTU(option: T): PromisifySuccessResult; /** [wx.getBackgroundAudioPlayerState(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioPlayerState.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -23205,11 +22771,7 @@ wx.getBackgroundAudioPlayerState({ } }) ``` */ - getBackgroundAudioPlayerState< - T extends GetBackgroundAudioPlayerStateOption = GetBackgroundAudioPlayerStateOption - >( - option?: T - ): PromisifySuccessResult + getBackgroundAudioPlayerState(option?: T): PromisifySuccessResult; /** [wx.getBackgroundFetchData(object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/background-fetch/wx.getBackgroundFetchData.html) * * 需要基础库: `2.8.0` @@ -23218,11 +22780,7 @@ wx.getBackgroundAudioPlayerState({ * * 拉取 backgroundFetch 客户端缓存数据。 * 当调用接口时,若当次请求未结束,会先返回本地的旧数据(之前打开小程序时请求的),如果本地没有旧数据,安卓上会返回fail,不会等待请求完成,iOS上会返回success但fetchedData为空,也不会等待请求完成。建议和 [wx.onBackgroundFetchData](https://developers.weixin.qq.com/miniprogram/dev/api/storage/background-fetch/wx.onBackgroundFetchData.html) 配合使用。 */ - getBackgroundFetchData< - T extends GetBackgroundFetchDataOption = GetBackgroundFetchDataOption - >( - option: T - ): PromisifySuccessResult + getBackgroundFetchData(option: T): PromisifySuccessResult; /** [wx.getBackgroundFetchToken(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/background-fetch/wx.getBackgroundFetchToken.html) * * 需要基础库: `2.8.0` @@ -23230,19 +22788,13 @@ wx.getBackgroundAudioPlayerState({ * 在插件中使用:不支持 * * 获取设置过的自定义登录态。若无,则返回 fail。 */ - getBackgroundFetchToken< - T extends GetBackgroundFetchTokenOption = GetBackgroundFetchTokenOption - >( - option?: T - ): PromisifySuccessResult + getBackgroundFetchToken(option?: T): PromisifySuccessResult; /** [wx.getBatteryInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfo.html) * * 在插件中使用:需要基础库 `2.15.0` * * 获取设备电池信息。同步 API [wx.getBatteryInfoSync](https://developers.weixin.qq.com/miniprogram/dev/api/device/battery/wx.getBatteryInfoSync.html) 在 iOS 上不可用。 */ - getBatteryInfo( - option?: T - ): PromisifySuccessResult + getBatteryInfo(option?: T): PromisifySuccessResult; /** [wx.getBeacons(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.getBeacons.html) * * 需要基础库: `1.2.0` @@ -23250,9 +22802,7 @@ wx.getBackgroundAudioPlayerState({ * 在插件中使用:需要基础库 `1.9.6` * * 获取所有已搜索到的 Beacon 设备 */ - getBeacons( - option?: T - ): PromisifySuccessResult + getBeacons(option?: T): PromisifySuccessResult; /** [wx.getBluetoothAdapterState(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getBluetoothAdapterState.html) * * 需要基础库: `1.1.0` @@ -23271,11 +22821,7 @@ wx.getBluetoothAdapterState({ } }) ``` */ - getBluetoothAdapterState< - T extends GetBluetoothAdapterStateOption = GetBluetoothAdapterStateOption - >( - option?: T - ): PromisifySuccessResult + getBluetoothAdapterState(option?: T): PromisifySuccessResult; /** [wx.getBluetoothDevices(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getBluetoothDevices.html) * * 需要基础库: `1.1.0` @@ -23312,11 +22858,7 @@ wx.getBluetoothDevices({ * **注意** * * - 该接口获取到的设备列表为**蓝牙模块生效期间所有搜索到的蓝牙设备**,若在蓝牙模块使用流程结束后未及时调用 [wx.closeBluetoothAdapter](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.closeBluetoothAdapter.html) 释放资源,会存在调用该接口会返回之前的蓝牙使用流程中搜索到的蓝牙设备,可能设备已经不在用户身边,无法连接。 */ - getBluetoothDevices< - T extends GetBluetoothDevicesOption = GetBluetoothDevicesOption - >( - option?: T - ): PromisifySuccessResult + getBluetoothDevices(option?: T): PromisifySuccessResult; /** [wx.getChannelsLiveInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsLiveInfo.html) * * 需要基础库: `2.15.0` @@ -23324,7 +22866,7 @@ wx.getBluetoothDevices({ * 在插件中使用:不支持 * * 获取视频号直播信息 */ - getChannelsLiveInfo(option: GetChannelsLiveInfoOption): void + getChannelsLiveInfo(option: GetChannelsLiveInfoOption): void; /** [wx.getChannelsLiveNoticeInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsLiveNoticeInfo.html) * * 需要基础库: `2.19.0` @@ -23332,7 +22874,7 @@ wx.getBluetoothDevices({ * 在插件中使用:不支持 * * 获取视频号直播预告信息 */ - getChannelsLiveNoticeInfo(option: GetChannelsLiveNoticeInfoOption): void + getChannelsLiveNoticeInfo(option: GetChannelsLiveNoticeInfoOption): void; /** [wx.getChannelsShareKey(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsShareKey.html) * * 需要基础库: `2.22.1` @@ -23340,7 +22882,7 @@ wx.getBluetoothDevices({ * 在插件中使用:不支持 * * 获取视频号直播卡片/视频卡片的分享来源,仅当卡片携带了分享信息、同时用户已授权该小程序获取视频号分享信息且启动场景值为 1177、1184、1195、1208 时可用。 */ - getChannelsShareKey(option?: GetChannelsShareKeyOption): void + getChannelsShareKey(option?: GetChannelsShareKeyOption): void; /** [wx.getClipboardData(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html) * * 需要基础库: `1.1.0` @@ -23358,11 +22900,7 @@ wx.getClipboardData({ } }) ``` */ - getClipboardData< - T extends GetClipboardDataOption = GetClipboardDataOption - >( - option?: T - ): PromisifySuccessResult + getClipboardData(option?: T): PromisifySuccessResult; /** [wx.getCommonConfig(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.getCommonConfig.html) * * 需要基础库: `2.33.0` @@ -23386,7 +22924,7 @@ wx.getClipboardData({ console.log(res) }}) ``` */ - getCommonConfig(option: GetCommonConfigOption): void + getCommonConfig(option: GetCommonConfigOption): void; /** [wx.getConnectedBluetoothDevices(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getConnectedBluetoothDevices.html) * * 需要基础库: `1.1.0` @@ -23406,11 +22944,7 @@ wx.getConnectedBluetoothDevices({ } }) ``` */ - getConnectedBluetoothDevices< - T extends GetConnectedBluetoothDevicesOption = GetConnectedBluetoothDevicesOption - >( - option: T - ): PromisifySuccessResult + getConnectedBluetoothDevices(option: T): PromisifySuccessResult; /** [wx.getConnectedWifi(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getConnectedWifi.html) * * 需要基础库: `1.6.0` @@ -23418,11 +22952,7 @@ wx.getConnectedBluetoothDevices({ * 在插件中使用:需要基础库 `2.9.1` * * 获取已连接中的 Wi-Fi 信息。 */ - getConnectedWifi< - T extends GetConnectedWifiOption = GetConnectedWifiOption - >( - option: T - ): PromisifySuccessResult + getConnectedWifi(option: T): PromisifySuccessResult; /** [wx.getDeviceBenchmarkInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceBenchmarkInfo.html) * * 需要基础库: `3.4.5` @@ -23441,7 +22971,7 @@ wx.getDeviceBenchmarkInfo({ } }) ``` */ - getDeviceBenchmarkInfo(option?: GetDeviceBenchmarkInfoOption): void + getDeviceBenchmarkInfo(option?: GetDeviceBenchmarkInfoOption): void; /** [wx.getDeviceVoIPList(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/device-voip/wx.getDeviceVoIPList.html) * * 需要基础库: `2.30.3` @@ -23462,7 +22992,7 @@ wx.getDeviceVoIPList({ } }) ``` */ - getDeviceVoIPList(option?: GetDeviceVoIPListOption): void + getDeviceVoIPList(option?: GetDeviceVoIPListOption): void; /** [wx.getExtConfig(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ext/wx.getExtConfig.html) * * 需要基础库: `1.1.0` @@ -23486,9 +23016,7 @@ if (wx.getExtConfig) { }) } ``` */ - getExtConfig( - option?: T - ): PromisifySuccessResult + getExtConfig(option?: T): PromisifySuccessResult; /** [wx.getFuzzyLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getFuzzyLocation.html) * * 需要基础库: `2.25.0` @@ -23512,7 +23040,7 @@ if (wx.getExtConfig) { } }) ``` */ - getFuzzyLocation(option: GetFuzzyLocationOption): void + getFuzzyLocation(option: GetFuzzyLocationOption): void; /** [wx.getGroupEnterInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/group/wx.getGroupEnterInfo.html) * * 需要基础库: `2.10.4` @@ -23555,7 +23083,7 @@ wx.getGroupEnterInfo({ * * - 如需要展示群名称,小程序可以使用[开放数据组件](https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html) * - 小游戏可以通过 `wx.getGroupInfo` 接口获取群名称 */ - getGroupEnterInfo(option: GetGroupEnterInfoOption): void + getGroupEnterInfo(option: GetGroupEnterInfoOption): void; /** [wx.getHCEState(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc-hce/wx.getHCEState.html) * * 需要基础库: `1.7.0` @@ -23573,9 +23101,7 @@ wx.getHCEState({ } }) ``` */ - getHCEState( - option?: T - ): PromisifySuccessResult + getHCEState(option?: T): PromisifySuccessResult; /** [wx.getImageInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.getImageInfo.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -23607,9 +23133,7 @@ wx.chooseImage({ } }) ``` */ - getImageInfo( - option: T - ): PromisifySuccessResult + getImageInfo(option: T): PromisifySuccessResult; /** [wx.getInferenceEnvInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/wx.getInferenceEnvInfo.html) * * 需要基础库: `2.30.1` @@ -23629,7 +23153,7 @@ wx.getInferenceEnvInfo({ }, }) ``` */ - getInferenceEnvInfo(option?: GetInferenceEnvInfoOption): void + getInferenceEnvInfo(option?: GetInferenceEnvInfoOption): void; /** [wx.getLocalIPAddress(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.getLocalIPAddress.html) * * 需要基础库: `2.20.1` @@ -23647,7 +23171,7 @@ wx.getLocalIPAddress({ } }) ``` */ - getLocalIPAddress(option: GetLocalIPAddressOption): void + getLocalIPAddress(option: GetLocalIPAddressOption): void; /** [wx.getLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -23715,9 +23239,7 @@ wx.getLocalIPAddress({ * - `2.17.0 起 `wx.getLocation` 增加调用频率限制,[相关公告](https://developers.weixin.qq.com/community/develop/doc/000aee91a98d206bc6dbe722b51801) * - 工具中定位模拟使用IP定位,可能会有一定误差。且工具目前仅支持 gcj02 坐标。 * - 使用第三方服务进行逆地址解析时,请确认第三方服务默认的坐标系,正确进行坐标转换。 */ - getLocation( - option: T - ): PromisifySuccessResult + getLocation(option: T): PromisifySuccessResult; /** [wx.getNetworkType(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.getNetworkType.html) * * 在插件中使用:需要基础库 `1.9.6` @@ -23734,9 +23256,7 @@ wx.getNetworkType({ } }) ``` */ - getNetworkType( - option?: T - ): PromisifySuccessResult + getNetworkType(option?: T): PromisifySuccessResult; /** [wx.getPrivacySetting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/privacy/wx.getPrivacySetting.html) * * 需要基础库: `2.32.3` @@ -23808,7 +23328,7 @@ Page({ * * demo4: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `