From f8f31dc4d9054677273394ce4e97f97cdc59a53c Mon Sep 17 00:00:00 2001 From: zhanghaijun <1055190269@qq.com> Date: Thu, 19 Jun 2025 17:33:18 +0800 Subject: [PATCH] init --- .eslintrc.js | 31 + .gitignore | 2 + .husky/commit-msg | 4 + .husky/pre-commit | 5 + .npmrc | 1 + README.md | 78 + commitlint.config.js | 3 + lint-staged.config.js | 6 + miniprogram/api/auth.ts | 7 + miniprogram/api/base.ts | 130 + miniprogram/app.json | 135 + miniprogram/app.less | 16 + miniprogram/app.ts | 62 + .../components/uploadPic/uploadPic.json | 6 + .../components/uploadPic/uploadPic.less | 64 + miniprogram/components/uploadPic/uploadPic.ts | 164 + .../components/uploadPic/uploadPic.wxml | 22 + miniprogram/config.ts | 13 + miniprogram/custom-tab-bar/index.js | 38 + miniprogram/custom-tab-bar/index.json | 3 + miniprogram/custom-tab-bar/index.less | 62 + miniprogram/custom-tab-bar/index.wxml | 12 + miniprogram/images/bg_btn3.png | Bin 0 -> 4870 bytes miniprogram/images/bg_page_blue.png | Bin 0 -> 4849 bytes miniprogram/images/bg_record.png | Bin 0 -> 8895 bytes miniprogram/images/bg_tabbar.png | Bin 0 -> 2627 bytes miniprogram/images/btn_add.png | Bin 0 -> 1212 bytes miniprogram/images/btn_del.png | Bin 0 -> 1387 bytes miniprogram/images/btn_exit.png | Bin 0 -> 736 bytes miniprogram/images/btn_l.png | Bin 0 -> 1789 bytes miniprogram/images/btn_maintain.png | Bin 0 -> 4579 bytes miniprogram/images/btn_maintain_r.png | Bin 0 -> 4339 bytes miniprogram/images/btn_project_l.png | Bin 0 -> 4691 bytes miniprogram/images/btn_project_r.png | Bin 0 -> 4344 bytes miniprogram/images/btn_r.png | Bin 0 -> 1675 bytes miniprogram/images/btn_reset.png | Bin 0 -> 756 bytes miniprogram/images/btn_upkeep_c.png | Bin 0 -> 5893 bytes miniprogram/images/btn_upkeep_l.png | Bin 0 -> 12959 bytes miniprogram/images/btn_upkeep_r.png | Bin 0 -> 4779 bytes miniprogram/images/cancel-icon.png | Bin 0 -> 1643 bytes miniprogram/images/car.png | Bin 0 -> 1239 bytes miniprogram/images/car_select.png | Bin 0 -> 2691 bytes miniprogram/images/default_pic.png | Bin 0 -> 11752 bytes miniprogram/images/icon_add.png | Bin 0 -> 900 bytes miniprogram/images/icon_address.png | Bin 0 -> 1479 bytes miniprogram/images/icon_address_w.png | Bin 0 -> 791 bytes miniprogram/images/icon_cal.png | Bin 0 -> 535 bytes miniprogram/images/icon_contact.png | Bin 0 -> 598 bytes .../images/icon_costEstimationRecord.png | Bin 0 -> 5761 bytes miniprogram/images/icon_customerFollow.png | Bin 0 -> 6957 bytes miniprogram/images/icon_datetime.png | Bin 0 -> 1471 bytes miniprogram/images/icon_delete.png | Bin 0 -> 351 bytes miniprogram/images/icon_down.png | Bin 0 -> 1263 bytes miniprogram/images/icon_filter.png | Bin 0 -> 1237 bytes miniprogram/images/icon_filter2.png | Bin 0 -> 297 bytes miniprogram/images/icon_list.png | Bin 0 -> 179 bytes miniprogram/images/icon_location.png | Bin 0 -> 858 bytes miniprogram/images/icon_logo.png | Bin 0 -> 888 bytes miniprogram/images/icon_maintain.png | Bin 0 -> 1038 bytes miniprogram/images/icon_maintain1.png | Bin 0 -> 3186 bytes miniprogram/images/icon_map.png | Bin 0 -> 916 bytes miniprogram/images/icon_navigation.png | Bin 0 -> 1251 bytes miniprogram/images/icon_phone.png | Bin 0 -> 639 bytes miniprogram/images/icon_plateNumber1.png | Bin 0 -> 1314 bytes .../images/icon_plateNumber_active.png | Bin 0 -> 1319 bytes miniprogram/images/icon_platenumber.png | Bin 0 -> 806 bytes miniprogram/images/icon_project.png | Bin 0 -> 1210 bytes miniprogram/images/icon_pw.png | Bin 0 -> 799 bytes miniprogram/images/icon_reload.png | Bin 0 -> 1079 bytes miniprogram/images/icon_search.png | Bin 0 -> 1322 bytes miniprogram/images/icon_select-disabled.png | Bin 0 -> 3790 bytes miniprogram/images/icon_select.png | Bin 0 -> 3954 bytes miniprogram/images/icon_success.png | Bin 0 -> 6351 bytes miniprogram/images/icon_tabbar2.png | Bin 0 -> 3788 bytes miniprogram/images/icon_tabbar_h.png | Bin 0 -> 1091 bytes miniprogram/images/icon_tabbar_hs.png | Bin 0 -> 1092 bytes miniprogram/images/icon_tabbar_n.png | Bin 0 -> 1035 bytes miniprogram/images/icon_tabbar_ns.png | Bin 0 -> 1280 bytes miniprogram/images/icon_un.png | Bin 0 -> 822 bytes miniprogram/images/icon_up.png | Bin 0 -> 1233 bytes miniprogram/images/icon_upload.png | Bin 0 -> 861 bytes miniprogram/images/icon_vehicleDispatch.png | Bin 0 -> 2933 bytes miniprogram/images/icon_workbench.png | Bin 0 -> 1027 bytes miniprogram/images/icon_workbench1.png | Bin 0 -> 2395 bytes miniprogram/images/icon_workbench2.png | Bin 0 -> 2612 bytes miniprogram/images/icon_workbench3.png | Bin 0 -> 2221 bytes miniprogram/images/icon_workbench4.png | Bin 0 -> 2002 bytes miniprogram/images/icon_workbench5.png | Bin 0 -> 3015 bytes miniprogram/images/icon_workbench6.png | Bin 0 -> 2689 bytes miniprogram/images/icon_workbench7.png | Bin 0 -> 2765 bytes miniprogram/images/info-bottom.png | Bin 0 -> 337 bytes miniprogram/images/info-top.png | Bin 0 -> 530 bytes miniprogram/images/logo_company.png | Bin 0 -> 10093 bytes miniprogram/images/nodata_signin.png | Bin 0 -> 8069 bytes miniprogram/images/num_add.png | Bin 0 -> 1245 bytes miniprogram/images/num_subtract.png | Bin 0 -> 1169 bytes miniprogram/images/subscription.png | Bin 0 -> 9198 bytes miniprogram/images/success.png | Bin 0 -> 5572 bytes miniprogram/images/top-bg.png | Bin 0 -> 2599 bytes miniprogram/images/wechat.png | Bin 0 -> 2644 bytes .../pages/customerFollow/customerFollow.json | 12 + .../pages/customerFollow/customerFollow.less | 386 + .../pages/customerFollow/customerFollow.ts | 1169 + .../pages/customerFollow/customerFollow.wxml | 600 + .../customerFollowDetail.json | 4 + .../customerFollowDetail.less | 207 + .../customerFollowDetail.ts | 131 + .../customerFollowDetail.wxml | 141 + .../RefuelingChargingDetail.json | 4 + .../RefuelingChargingDetail.less | 199 + .../RefuelingChargingDetail.ts | 105 + .../RefuelingChargingDetail.wxml | 85 + .../RefuelingChargingRecord.json | 10 + .../RefuelingChargingRecord.less | 296 + .../RefuelingChargingRecord.ts | 395 + .../RefuelingChargingRecord.wxml | 124 + .../RefuelingChargingReporting.json | 9 + .../RefuelingChargingReporting.less | 361 + .../RefuelingChargingReporting.ts | 599 + .../RefuelingChargingReporting.wxml | 234 + .../UpkeepBillCheck/UpkeepBillCheck.json | 8 + .../UpkeepBillCheck/UpkeepBillCheck.less | 413 + .../UpkeepBillCheck/UpkeepBillCheck.ts | 237 + .../UpkeepBillCheck/UpkeepBillCheck.wxml | 250 + .../UpkeepBillProcedure.json | 8 + .../UpkeepBillProcedure.less | 462 + .../UpkeepBillProcedure.ts | 259 + .../UpkeepBillProcedure.wxml | 297 + .../UpkeepBillRecord/UpkeepBillRecord.json | 11 + .../UpkeepBillRecord/UpkeepBillRecord.less | 379 + .../UpkeepBillRecord/UpkeepBillRecord.ts | 525 + .../UpkeepBillRecord/UpkeepBillRecord.wxml | 166 + .../UpkeepBillResult/UpkeepBillResult.json | 8 + .../UpkeepBillResult/UpkeepBillResult.less | 459 + .../UpkeepBillResult/UpkeepBillResult.ts | 203 + .../UpkeepBillResult/UpkeepBillResult.wxml | 302 + .../UpkeepBillSend/UpkeepBillSend.json | 12 + .../UpkeepBillSend/UpkeepBillSend.less | 463 + .../UpkeepBillSend/UpkeepBillSend.ts | 431 + .../UpkeepBillSend/UpkeepBillSend.wxml | 279 + .../UpkeepBill/operation/cancel/cancel.json | 4 + .../UpkeepBill/operation/cancel/cancel.less | 203 + .../UpkeepBill/operation/cancel/cancel.ts | 133 + .../UpkeepBill/operation/cancel/cancel.wxml | 31 + .../UpkeepBill/operation/check/check.json | 7 + .../UpkeepBill/operation/check/check.less | 152 + .../pages/UpkeepBill/operation/check/check.ts | 170 + .../UpkeepBill/operation/check/check.wxml | 21 + .../operation/complete/complete.json | 7 + .../operation/complete/complete.less | 152 + .../UpkeepBill/operation/complete/complete.ts | 158 + .../operation/complete/complete.wxml | 22 + .../operation/dataEntryOne/dataEntryOne.json | 10 + .../operation/dataEntryOne/dataEntryOne.less | 431 + .../operation/dataEntryOne/dataEntryOne.ts | 545 + .../operation/dataEntryOne/dataEntryOne.wxml | 184 + .../operation/dataEntryTwo/dataEntryTwo.json | 9 + .../operation/dataEntryTwo/dataEntryTwo.less | 389 + .../operation/dataEntryTwo/dataEntryTwo.ts | 492 + .../operation/dataEntryTwo/dataEntryTwo.wxml | 190 + .../UpkeepBill/operation/message/message.json | 4 + .../UpkeepBill/operation/message/message.less | 123 + .../UpkeepBill/operation/message/message.ts | 234 + .../UpkeepBill/operation/message/message.wxml | 144 + .../UpkeepBill/operation/offer/offer.json | 9 + .../UpkeepBill/operation/offer/offer.less | 381 + .../pages/UpkeepBill/operation/offer/offer.ts | 519 + .../UpkeepBill/operation/offer/offer.wxml | 181 + .../UpkeepBill/operation/upkeep/upkeep.json | 6 + .../UpkeepBill/operation/upkeep/upkeep.less | 186 + .../UpkeepBill/operation/upkeep/upkeep.ts | 271 + .../UpkeepBill/operation/upkeep/upkeep.wxml | 38 + .../UpkeepPlanApply/UpkeepPlanApply.json | 10 + .../UpkeepPlanApply/UpkeepPlanApply.less | 380 + .../UpkeepPlanApply/UpkeepPlanApply.ts | 548 + .../UpkeepPlanApply/UpkeepPlanApply.wxml | 129 + .../UpkeepPlanInfo/UpkeepPlanInfo.json | 8 + .../UpkeepPlanInfo/UpkeepPlanInfo.less | 414 + .../UpkeepPlanInfo/UpkeepPlanInfo.ts | 183 + .../UpkeepPlanInfo/UpkeepPlanInfo.wxml | 152 + .../UpkeepPlanRecord/UpkeepPlanRecord.json | 11 + .../UpkeepPlanRecord/UpkeepPlanRecord.less | 384 + .../UpkeepPlanRecord/UpkeepPlanRecord.ts | 484 + .../UpkeepPlanRecord/UpkeepPlanRecord.wxml | 132 + .../pages/UpkeepPlan/cancel/cancel.json | 4 + .../pages/UpkeepPlan/cancel/cancel.less | 208 + miniprogram/pages/UpkeepPlan/cancel/cancel.ts | 129 + .../pages/UpkeepPlan/cancel/cancel.wxml | 33 + miniprogram/pages/UpkeepPlan/check/check.json | 7 + miniprogram/pages/UpkeepPlan/check/check.less | 152 + miniprogram/pages/UpkeepPlan/check/check.ts | 150 + miniprogram/pages/UpkeepPlan/check/check.wxml | 20 + .../pages/UpkeepPlan/message/message.json | 4 + .../pages/UpkeepPlan/message/message.less | 123 + .../pages/UpkeepPlan/message/message.ts | 122 + .../pages/UpkeepPlan/message/message.wxml | 64 + .../accidentReporting/accidentReporting.json | 12 + .../accidentReporting/accidentReporting.less | 229 + .../accidentReporting/accidentReporting.ts | 1348 + .../accidentReporting/accidentReporting.wxml | 818 + .../pages/addressBook/addressBook.json | 9 + .../pages/addressBook/addressBook.less | 84 + miniprogram/pages/addressBook/addressBook.ts | 124 + .../pages/addressBook/addressBook.wxml | 37 + .../pages/backlog/accident/accident.json | 7 + .../pages/backlog/accident/accident.less | 210 + .../pages/backlog/accident/accident.ts | 148 + .../pages/backlog/accident/accident.wxml | 254 + .../accidentFeedback/accidentFeedback.json | 8 + .../accidentFeedback/accidentFeedback.less | 142 + .../accidentFeedback/accidentFeedback.ts | 211 + .../accidentFeedback/accidentFeedback.wxml | 86 + .../annualInspection/annualInspection.json | 4 + .../annualInspection/annualInspection.less | 207 + .../annualInspection/annualInspection.ts | 130 + .../annualInspection/annualInspection.wxml | 144 + .../annualInspectionFeedback.json | 11 + .../annualInspectionFeedback.less | 367 + .../annualInspectionFeedback.ts | 589 + .../annualInspectionFeedback.wxml | 321 + .../backlogFeedback/backlogFeedback.json | 4 + .../backlogFeedback/backlogFeedback.less | 108 + .../backlogFeedback/backlogFeedback.ts | 60 + .../backlogFeedback/backlogFeedback.wxml | 23 + .../backlog/backlogList/backlogList.json | 10 + .../backlog/backlogList/backlogList.less | 151 + .../pages/backlog/backlogList/backlogList.ts | 302 + .../backlog/backlogList/backlogList.wxml | 75 + .../pages/backlog/insurance/insurance.json | 7 + .../pages/backlog/insurance/insurance.less | 184 + .../pages/backlog/insurance/insurance.ts | 124 + .../pages/backlog/insurance/insurance.wxml | 137 + .../insuranceFeedback/insuranceFeedback.json | 7 + .../insuranceFeedback/insuranceFeedback.less | 150 + .../insuranceFeedback/insuranceFeedback.ts | 386 + .../insuranceFeedback/insuranceFeedback.wxml | 197 + .../pages/backlog/violation/violation.json | 7 + .../pages/backlog/violation/violation.less | 198 + .../pages/backlog/violation/violation.ts | 105 + .../pages/backlog/violation/violation.wxml | 65 + .../violationFeedback/violationFeedback.json | 9 + .../violationFeedback/violationFeedback.less | 139 + .../violationFeedback/violationFeedback.ts | 255 + .../violationFeedback/violationFeedback.wxml | 67 + .../costEstimationAdd/costEstimationAdd.json | 9 + .../costEstimationAdd/costEstimationAdd.less | 453 + .../costEstimationAdd/costEstimationAdd.ts | 482 + .../costEstimationAdd/costEstimationAdd.wxml | 221 + .../costEstimationDetail.json | 6 + .../costEstimationDetail.less | 251 + .../costEstimationDetail.ts | 213 + .../costEstimationDetail.wxml | 407 + .../costEstimationDetail.wxs | 22 + .../costEstimationRecord.json | 12 + .../costEstimationRecord.less | 321 + .../costEstimationRecord.ts | 297 + .../costEstimationRecord.wxml | 95 + miniprogram/pages/driverIndex/index.json | 4 + miniprogram/pages/driverIndex/index.less | 418 + miniprogram/pages/driverIndex/index.ts | 403 + miniprogram/pages/driverIndex/index.wxml | 104 + .../page/signInFeedback/signInFeedback.json | 4 + .../page/signInFeedback/signInFeedback.less | 106 + .../page/signInFeedback/signInFeedback.ts | 81 + .../page/signInFeedback/signInFeedback.wxml | 51 + .../component/calendar/calendar.js | 344 + .../component/calendar/calendar.json | 4 + .../component/calendar/calendar.wxml | 55 + .../component/calendar/calendar.wxss | 125 + .../page/signInReocrd/signInReocrd.json | 7 + .../page/signInReocrd/signInReocrd.less | 169 + .../page/signInReocrd/signInReocrd.ts | 195 + .../page/signInReocrd/signInReocrd.wxml | 44 + .../eventReportAdd/eventReportAdd.json | 9 + .../eventReportAdd/eventReportAdd.less | 311 + .../eventReportAdd/eventReportAdd.ts | 618 + .../eventReportAdd/eventReportAdd.wxml | 182 + .../eventReportDetail/eventReportDetail.json | 7 + .../eventReportDetail/eventReportDetail.less | 223 + .../eventReportDetail/eventReportDetail.ts | 176 + .../eventReportDetail/eventReportDetail.wxml | 102 + .../eventReportFeedback.json | 9 + .../eventReportFeedback.less | 301 + .../eventReportFeedback.ts | 396 + .../eventReportFeedback.wxml | 85 + .../eventReportRecord/eventReportRecord.json | 11 + .../eventReportRecord/eventReportRecord.less | 135 + .../eventReportRecord/eventReportRecord.ts | 267 + .../eventReportRecord/eventReportRecord.wxml | 52 + .../handoverVehicleRecord.json | 13 + .../handoverVehicleRecord.less | 238 + .../handoverVehicleRecord.ts | 404 + .../handoverVehicleRecord.wxml | 189 + .../procurementDelivery.json | 7 + .../procurementDelivery.less | 136 + .../procurementDelivery.ts | 174 + .../procurementDelivery.wxml | 246 + .../procurementDeliveryEdit.json | 11 + .../procurementDeliveryEdit.less | 316 + .../procurementDeliveryEdit.ts | 1106 + .../procurementDeliveryEdit.wxml | 505 + .../rentalDelivery/rentalDelivery.json | 7 + .../rentalDelivery/rentalDelivery.less | 297 + .../rentalDelivery/rentalDelivery.ts | 222 + .../rentalDelivery/rentalDelivery.wxml | 463 + .../rentalDeliveryEdit.json | 11 + .../rentalDeliveryEdit.less | 491 + .../rentalDeliveryEdit/rentalDeliveryEdit.ts | 1162 + .../rentalDeliveryEdit.wxml | 959 + miniprogram/pages/index/index.less | 5 + miniprogram/pages/index/index.ts | 79 + miniprogram/pages/index/index.wxml | 2 + .../insurancePolicyReport.json | 11 + .../insurancePolicyReport.less | 359 + .../insurancePolicyReport.ts | 691 + .../insurancePolicyReport.wxml | 525 + miniprogram/pages/login/login.json | 6 + miniprogram/pages/login/login.less | 119 + miniprogram/pages/login/login.ts | 274 + miniprogram/pages/login/login.wxml | 54 + miniprogram/pages/logs/logs.json | 4 + miniprogram/pages/logs/logs.ts | 19 + miniprogram/pages/logs/logs.wxml | 6 + miniprogram/pages/logs/logs.wxss | 8 + .../maintenanceIndex/maintenanceIndex.json | 5 + .../maintenanceIndex/maintenanceIndex.less | 270 + .../maintenanceIndex/maintenanceIndex.ts | 205 + .../maintenanceIndex/maintenanceIndex.wxml | 195 + .../manufacturerIndex/manufacturerIndex.json | 10 + .../manufacturerIndex/manufacturerIndex.less | 263 + .../manufacturerIndex/manufacturerIndex.ts | 240 + .../manufacturerIndex/manufacturerIndex.wxml | 82 + miniprogram/pages/module/module.wxs | 19 + .../pages/projectIndex/projectIndex.json | 4 + .../pages/projectIndex/projectIndex.less | 397 + .../pages/projectIndex/projectIndex.ts | 238 + .../pages/projectIndex/projectIndex.wxml | 137 + .../reportStatement/reportStatement.json | 9 + .../reportStatement/reportStatement.less | 451 + .../reportStatement/reportStatement.ts | 335 + .../reportStatement/reportStatement.wxml | 193 + .../maintainCheck/maintainCheck.json | 8 + .../maintainCheck/maintainCheck.less | 413 + .../maintainCheck/maintainCheck.ts | 232 + .../maintainCheck/maintainCheck.wxml | 242 + .../maintainProcedure/maintainProcedure.json | 8 + .../maintainProcedure/maintainProcedure.less | 462 + .../maintainProcedure/maintainProcedure.ts | 254 + .../maintainProcedure/maintainProcedure.wxml | 274 + .../maintainRecord/maintainRecord.json | 11 + .../maintainRecord/maintainRecord.less | 441 + .../maintainRecord/maintainRecord.ts | 528 + .../maintainRecord/maintainRecord.wxml | 130 + .../maintainResult/maintainResult.json | 8 + .../maintainResult/maintainResult.less | 459 + .../maintainResult/maintainResult.ts | 197 + .../maintainResult/maintainResult.wxml | 284 + .../maintainSend/maintainSend.json | 14 + .../maintainSend/maintainSend.less | 490 + .../maintainSend/maintainSend.ts | 433 + .../maintainSend/maintainSend.wxml | 278 + .../operation/cancel/cancel.json | 4 + .../operation/cancel/cancel.less | 203 + .../operation/cancel/cancel.ts | 133 + .../operation/cancel/cancel.wxml | 31 + .../operation/check/check.json | 7 + .../operation/check/check.less | 152 + .../operation/check/check.ts | 174 + .../operation/check/check.wxml | 21 + .../operation/complete/complete.json | 7 + .../operation/complete/complete.less | 152 + .../operation/complete/complete.ts | 158 + .../operation/complete/complete.wxml | 22 + .../operation/dataEntryOne/dataEntryOne.json | 12 + .../operation/dataEntryOne/dataEntryOne.less | 452 + .../operation/dataEntryOne/dataEntryOne.ts | 590 + .../operation/dataEntryOne/dataEntryOne.wxml | 155 + .../operation/dataEntryTwo/dataEntryTwo.json | 9 + .../operation/dataEntryTwo/dataEntryTwo.less | 389 + .../operation/dataEntryTwo/dataEntryTwo.ts | 464 + .../operation/dataEntryTwo/dataEntryTwo.wxml | 178 + .../maintainApply/maintainApply.json | 10 + .../maintainApply/maintainApply.less | 343 + .../operation/maintainApply/maintainApply.ts | 444 + .../maintainApply/maintainApply.wxml | 115 + .../operation/message/message.json | 4 + .../operation/message/message.less | 123 + .../operation/message/message.ts | 264 + .../operation/message/message.wxml | 160 + .../operation/offer/offer.json | 9 + .../operation/offer/offer.less | 381 + .../operation/offer/offer.ts | 465 + .../operation/offer/offer.wxml | 161 + .../operation/repair/repair.json | 6 + .../operation/repair/repair.less | 186 + .../operation/repair/repair.ts | 264 + .../operation/repair/repair.wxml | 38 + .../vehicleSearch/vehicleSearch.json | 7 + .../vehicleSearch/vehicleSearch.less | 71 + .../component/vehicleSearch/vehicleSearch.ts | 111 + .../vehicleSearch/vehicleSearch.wxml | 30 + .../failureAlert/failureAlert.json | 13 + .../failureAlert/failureAlert.less | 339 + .../failureAlert/failureAlert.ts | 640 + .../failureAlert/failureAlert.wxml | 354 + .../vehicleMonitoring/global/global.json | 9 + .../vehicleMonitoring/global/global.less | 240 + .../pages/vehicleMonitoring/global/global.ts | 389 + .../vehicleMonitoring/global/global.wxml | 74 + .../vehicleMonitoring/realtime/realtime.json | 6 + .../vehicleMonitoring/realtime/realtime.less | 231 + .../vehicleMonitoring/realtime/realtime.ts | 845 + .../vehicleMonitoring/realtime/realtime.wxml | 74 + .../violationReporting.json | 10 + .../violationReporting.less | 148 + .../violationReporting/violationReporting.ts | 385 + .../violationReporting.wxml | 178 + miniprogram/sitemap.json | 7 + miniprogram/utils/base64.js | 109 + miniprogram/utils/qqmap-wx-jssdk.min.js | 1015 + miniprogram/utils/util.ts | 19 + package.json | 26 + pnpm-lock.yaml | 1661 + prettier.config.js | 1 + project.config.json | 42 + project.private.config.json | 8 + tsconfig.json | 35 + typings/index.d.ts | 8 + typings/types/index.d.ts | 1 + typings/types/wx/index.d.ts | 162 + typings/types/wx/lib.wx.api.d.ts | 31966 ++++++++++++++++ typings/types/wx/lib.wx.app.d.ts | 400 + typings/types/wx/lib.wx.behavior.d.ts | 68 + typings/types/wx/lib.wx.cloud.d.ts | 975 + typings/types/wx/lib.wx.component.d.ts | 670 + typings/types/wx/lib.wx.event.d.ts | 1436 + typings/types/wx/lib.wx.page.d.ts | 272 + 437 files changed, 103080 insertions(+) create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .husky/commit-msg create mode 100644 .husky/pre-commit create mode 100644 .npmrc create mode 100644 README.md create mode 100644 commitlint.config.js create mode 100644 lint-staged.config.js create mode 100644 miniprogram/api/auth.ts create mode 100644 miniprogram/api/base.ts create mode 100644 miniprogram/app.json create mode 100644 miniprogram/app.less create mode 100644 miniprogram/app.ts create mode 100644 miniprogram/components/uploadPic/uploadPic.json create mode 100644 miniprogram/components/uploadPic/uploadPic.less create mode 100644 miniprogram/components/uploadPic/uploadPic.ts create mode 100644 miniprogram/components/uploadPic/uploadPic.wxml create mode 100644 miniprogram/config.ts create mode 100644 miniprogram/custom-tab-bar/index.js create mode 100644 miniprogram/custom-tab-bar/index.json create mode 100644 miniprogram/custom-tab-bar/index.less create mode 100644 miniprogram/custom-tab-bar/index.wxml create mode 100644 miniprogram/images/bg_btn3.png create mode 100644 miniprogram/images/bg_page_blue.png create mode 100644 miniprogram/images/bg_record.png create mode 100644 miniprogram/images/bg_tabbar.png create mode 100644 miniprogram/images/btn_add.png create mode 100644 miniprogram/images/btn_del.png create mode 100644 miniprogram/images/btn_exit.png create mode 100644 miniprogram/images/btn_l.png create mode 100644 miniprogram/images/btn_maintain.png create mode 100644 miniprogram/images/btn_maintain_r.png create mode 100644 miniprogram/images/btn_project_l.png create mode 100644 miniprogram/images/btn_project_r.png create mode 100644 miniprogram/images/btn_r.png create mode 100644 miniprogram/images/btn_reset.png create mode 100644 miniprogram/images/btn_upkeep_c.png create mode 100644 miniprogram/images/btn_upkeep_l.png create mode 100644 miniprogram/images/btn_upkeep_r.png create mode 100644 miniprogram/images/cancel-icon.png create mode 100644 miniprogram/images/car.png create mode 100644 miniprogram/images/car_select.png create mode 100644 miniprogram/images/default_pic.png create mode 100644 miniprogram/images/icon_add.png create mode 100644 miniprogram/images/icon_address.png create mode 100644 miniprogram/images/icon_address_w.png create mode 100644 miniprogram/images/icon_cal.png create mode 100644 miniprogram/images/icon_contact.png create mode 100644 miniprogram/images/icon_costEstimationRecord.png create mode 100644 miniprogram/images/icon_customerFollow.png create mode 100644 miniprogram/images/icon_datetime.png create mode 100644 miniprogram/images/icon_delete.png create mode 100644 miniprogram/images/icon_down.png create mode 100644 miniprogram/images/icon_filter.png create mode 100644 miniprogram/images/icon_filter2.png create mode 100644 miniprogram/images/icon_list.png create mode 100644 miniprogram/images/icon_location.png create mode 100644 miniprogram/images/icon_logo.png create mode 100644 miniprogram/images/icon_maintain.png create mode 100644 miniprogram/images/icon_maintain1.png create mode 100644 miniprogram/images/icon_map.png create mode 100644 miniprogram/images/icon_navigation.png create mode 100644 miniprogram/images/icon_phone.png create mode 100644 miniprogram/images/icon_plateNumber1.png create mode 100644 miniprogram/images/icon_plateNumber_active.png create mode 100644 miniprogram/images/icon_platenumber.png create mode 100644 miniprogram/images/icon_project.png create mode 100644 miniprogram/images/icon_pw.png create mode 100644 miniprogram/images/icon_reload.png create mode 100644 miniprogram/images/icon_search.png create mode 100644 miniprogram/images/icon_select-disabled.png create mode 100644 miniprogram/images/icon_select.png create mode 100644 miniprogram/images/icon_success.png create mode 100644 miniprogram/images/icon_tabbar2.png create mode 100644 miniprogram/images/icon_tabbar_h.png create mode 100644 miniprogram/images/icon_tabbar_hs.png create mode 100644 miniprogram/images/icon_tabbar_n.png create mode 100644 miniprogram/images/icon_tabbar_ns.png create mode 100644 miniprogram/images/icon_un.png create mode 100644 miniprogram/images/icon_up.png create mode 100644 miniprogram/images/icon_upload.png create mode 100644 miniprogram/images/icon_vehicleDispatch.png create mode 100644 miniprogram/images/icon_workbench.png create mode 100644 miniprogram/images/icon_workbench1.png create mode 100644 miniprogram/images/icon_workbench2.png create mode 100644 miniprogram/images/icon_workbench3.png create mode 100644 miniprogram/images/icon_workbench4.png create mode 100644 miniprogram/images/icon_workbench5.png create mode 100644 miniprogram/images/icon_workbench6.png create mode 100644 miniprogram/images/icon_workbench7.png create mode 100644 miniprogram/images/info-bottom.png create mode 100644 miniprogram/images/info-top.png create mode 100644 miniprogram/images/logo_company.png create mode 100644 miniprogram/images/nodata_signin.png create mode 100644 miniprogram/images/num_add.png create mode 100644 miniprogram/images/num_subtract.png create mode 100644 miniprogram/images/subscription.png create mode 100644 miniprogram/images/success.png create mode 100644 miniprogram/images/top-bg.png create mode 100644 miniprogram/images/wechat.png create mode 100644 miniprogram/packageA/pages/customerFollow/customerFollow.json create mode 100644 miniprogram/packageA/pages/customerFollow/customerFollow.less create mode 100644 miniprogram/packageA/pages/customerFollow/customerFollow.ts create mode 100644 miniprogram/packageA/pages/customerFollow/customerFollow.wxml create mode 100644 miniprogram/packageA/pages/customerFollowDetail/customerFollowDetail.json create mode 100644 miniprogram/packageA/pages/customerFollowDetail/customerFollowDetail.less create mode 100644 miniprogram/packageA/pages/customerFollowDetail/customerFollowDetail.ts create mode 100644 miniprogram/packageA/pages/customerFollowDetail/customerFollowDetail.wxml create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingDetail/RefuelingChargingDetail.json create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingDetail/RefuelingChargingDetail.less create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingDetail/RefuelingChargingDetail.ts create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingDetail/RefuelingChargingDetail.wxml create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingRecord/RefuelingChargingRecord.json create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingRecord/RefuelingChargingRecord.less create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingRecord/RefuelingChargingRecord.ts create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingRecord/RefuelingChargingRecord.wxml create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting.json create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting.less create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting.ts create mode 100644 miniprogram/packageA/pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting.wxml create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillCheck/UpkeepBillCheck.json create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillCheck/UpkeepBillCheck.less create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillCheck/UpkeepBillCheck.ts create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillCheck/UpkeepBillCheck.wxml create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure.json create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure.less create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure.ts create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure.wxml create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillRecord/UpkeepBillRecord.json create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillRecord/UpkeepBillRecord.less create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillRecord/UpkeepBillRecord.ts create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillRecord/UpkeepBillRecord.wxml create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillResult/UpkeepBillResult.json create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillResult/UpkeepBillResult.less create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillResult/UpkeepBillResult.ts create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillResult/UpkeepBillResult.wxml create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillSend/UpkeepBillSend.json create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillSend/UpkeepBillSend.less create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillSend/UpkeepBillSend.ts create mode 100644 miniprogram/pages/UpkeepBill/UpkeepBillSend/UpkeepBillSend.wxml create mode 100644 miniprogram/pages/UpkeepBill/operation/cancel/cancel.json create mode 100644 miniprogram/pages/UpkeepBill/operation/cancel/cancel.less create mode 100644 miniprogram/pages/UpkeepBill/operation/cancel/cancel.ts create mode 100644 miniprogram/pages/UpkeepBill/operation/cancel/cancel.wxml create mode 100644 miniprogram/pages/UpkeepBill/operation/check/check.json create mode 100644 miniprogram/pages/UpkeepBill/operation/check/check.less create mode 100644 miniprogram/pages/UpkeepBill/operation/check/check.ts create mode 100644 miniprogram/pages/UpkeepBill/operation/check/check.wxml create mode 100644 miniprogram/pages/UpkeepBill/operation/complete/complete.json create mode 100644 miniprogram/pages/UpkeepBill/operation/complete/complete.less create mode 100644 miniprogram/pages/UpkeepBill/operation/complete/complete.ts create mode 100644 miniprogram/pages/UpkeepBill/operation/complete/complete.wxml create mode 100644 miniprogram/pages/UpkeepBill/operation/dataEntryOne/dataEntryOne.json create mode 100644 miniprogram/pages/UpkeepBill/operation/dataEntryOne/dataEntryOne.less create mode 100644 miniprogram/pages/UpkeepBill/operation/dataEntryOne/dataEntryOne.ts create mode 100644 miniprogram/pages/UpkeepBill/operation/dataEntryOne/dataEntryOne.wxml create mode 100644 miniprogram/pages/UpkeepBill/operation/dataEntryTwo/dataEntryTwo.json create mode 100644 miniprogram/pages/UpkeepBill/operation/dataEntryTwo/dataEntryTwo.less create mode 100644 miniprogram/pages/UpkeepBill/operation/dataEntryTwo/dataEntryTwo.ts create mode 100644 miniprogram/pages/UpkeepBill/operation/dataEntryTwo/dataEntryTwo.wxml create mode 100644 miniprogram/pages/UpkeepBill/operation/message/message.json create mode 100644 miniprogram/pages/UpkeepBill/operation/message/message.less create mode 100644 miniprogram/pages/UpkeepBill/operation/message/message.ts create mode 100644 miniprogram/pages/UpkeepBill/operation/message/message.wxml create mode 100644 miniprogram/pages/UpkeepBill/operation/offer/offer.json create mode 100644 miniprogram/pages/UpkeepBill/operation/offer/offer.less create mode 100644 miniprogram/pages/UpkeepBill/operation/offer/offer.ts create mode 100644 miniprogram/pages/UpkeepBill/operation/offer/offer.wxml create mode 100644 miniprogram/pages/UpkeepBill/operation/upkeep/upkeep.json create mode 100644 miniprogram/pages/UpkeepBill/operation/upkeep/upkeep.less create mode 100644 miniprogram/pages/UpkeepBill/operation/upkeep/upkeep.ts create mode 100644 miniprogram/pages/UpkeepBill/operation/upkeep/upkeep.wxml create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanApply/UpkeepPlanApply.json create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanApply/UpkeepPlanApply.less create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanApply/UpkeepPlanApply.ts create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanApply/UpkeepPlanApply.wxml create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanInfo/UpkeepPlanInfo.json create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanInfo/UpkeepPlanInfo.less create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanInfo/UpkeepPlanInfo.ts create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanInfo/UpkeepPlanInfo.wxml create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanRecord/UpkeepPlanRecord.json create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanRecord/UpkeepPlanRecord.less create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanRecord/UpkeepPlanRecord.ts create mode 100644 miniprogram/pages/UpkeepPlan/UpkeepPlanRecord/UpkeepPlanRecord.wxml create mode 100644 miniprogram/pages/UpkeepPlan/cancel/cancel.json create mode 100644 miniprogram/pages/UpkeepPlan/cancel/cancel.less create mode 100644 miniprogram/pages/UpkeepPlan/cancel/cancel.ts create mode 100644 miniprogram/pages/UpkeepPlan/cancel/cancel.wxml create mode 100644 miniprogram/pages/UpkeepPlan/check/check.json create mode 100644 miniprogram/pages/UpkeepPlan/check/check.less create mode 100644 miniprogram/pages/UpkeepPlan/check/check.ts create mode 100644 miniprogram/pages/UpkeepPlan/check/check.wxml create mode 100644 miniprogram/pages/UpkeepPlan/message/message.json create mode 100644 miniprogram/pages/UpkeepPlan/message/message.less create mode 100644 miniprogram/pages/UpkeepPlan/message/message.ts create mode 100644 miniprogram/pages/UpkeepPlan/message/message.wxml create mode 100644 miniprogram/pages/accidentReporting/accidentReporting.json create mode 100644 miniprogram/pages/accidentReporting/accidentReporting.less create mode 100644 miniprogram/pages/accidentReporting/accidentReporting.ts create mode 100644 miniprogram/pages/accidentReporting/accidentReporting.wxml create mode 100644 miniprogram/pages/addressBook/addressBook.json create mode 100644 miniprogram/pages/addressBook/addressBook.less create mode 100644 miniprogram/pages/addressBook/addressBook.ts create mode 100644 miniprogram/pages/addressBook/addressBook.wxml create mode 100644 miniprogram/pages/backlog/accident/accident.json create mode 100644 miniprogram/pages/backlog/accident/accident.less create mode 100644 miniprogram/pages/backlog/accident/accident.ts create mode 100644 miniprogram/pages/backlog/accident/accident.wxml create mode 100644 miniprogram/pages/backlog/accidentFeedback/accidentFeedback.json create mode 100644 miniprogram/pages/backlog/accidentFeedback/accidentFeedback.less create mode 100644 miniprogram/pages/backlog/accidentFeedback/accidentFeedback.ts create mode 100644 miniprogram/pages/backlog/accidentFeedback/accidentFeedback.wxml create mode 100644 miniprogram/pages/backlog/annualInspection/annualInspection.json create mode 100644 miniprogram/pages/backlog/annualInspection/annualInspection.less create mode 100644 miniprogram/pages/backlog/annualInspection/annualInspection.ts create mode 100644 miniprogram/pages/backlog/annualInspection/annualInspection.wxml create mode 100644 miniprogram/pages/backlog/annualInspectionFeedback/annualInspectionFeedback.json create mode 100644 miniprogram/pages/backlog/annualInspectionFeedback/annualInspectionFeedback.less create mode 100644 miniprogram/pages/backlog/annualInspectionFeedback/annualInspectionFeedback.ts create mode 100644 miniprogram/pages/backlog/annualInspectionFeedback/annualInspectionFeedback.wxml create mode 100644 miniprogram/pages/backlog/backlogFeedback/backlogFeedback.json create mode 100644 miniprogram/pages/backlog/backlogFeedback/backlogFeedback.less create mode 100644 miniprogram/pages/backlog/backlogFeedback/backlogFeedback.ts create mode 100644 miniprogram/pages/backlog/backlogFeedback/backlogFeedback.wxml create mode 100644 miniprogram/pages/backlog/backlogList/backlogList.json create mode 100644 miniprogram/pages/backlog/backlogList/backlogList.less create mode 100644 miniprogram/pages/backlog/backlogList/backlogList.ts create mode 100644 miniprogram/pages/backlog/backlogList/backlogList.wxml create mode 100644 miniprogram/pages/backlog/insurance/insurance.json create mode 100644 miniprogram/pages/backlog/insurance/insurance.less create mode 100644 miniprogram/pages/backlog/insurance/insurance.ts create mode 100644 miniprogram/pages/backlog/insurance/insurance.wxml create mode 100644 miniprogram/pages/backlog/insuranceFeedback/insuranceFeedback.json create mode 100644 miniprogram/pages/backlog/insuranceFeedback/insuranceFeedback.less create mode 100644 miniprogram/pages/backlog/insuranceFeedback/insuranceFeedback.ts create mode 100644 miniprogram/pages/backlog/insuranceFeedback/insuranceFeedback.wxml create mode 100644 miniprogram/pages/backlog/violation/violation.json create mode 100644 miniprogram/pages/backlog/violation/violation.less create mode 100644 miniprogram/pages/backlog/violation/violation.ts create mode 100644 miniprogram/pages/backlog/violation/violation.wxml create mode 100644 miniprogram/pages/backlog/violationFeedback/violationFeedback.json create mode 100644 miniprogram/pages/backlog/violationFeedback/violationFeedback.less create mode 100644 miniprogram/pages/backlog/violationFeedback/violationFeedback.ts create mode 100644 miniprogram/pages/backlog/violationFeedback/violationFeedback.wxml create mode 100644 miniprogram/pages/costEstimation/costEstimationAdd/costEstimationAdd.json create mode 100644 miniprogram/pages/costEstimation/costEstimationAdd/costEstimationAdd.less create mode 100644 miniprogram/pages/costEstimation/costEstimationAdd/costEstimationAdd.ts create mode 100644 miniprogram/pages/costEstimation/costEstimationAdd/costEstimationAdd.wxml create mode 100644 miniprogram/pages/costEstimation/costEstimationDetail/costEstimationDetail.json create mode 100644 miniprogram/pages/costEstimation/costEstimationDetail/costEstimationDetail.less create mode 100644 miniprogram/pages/costEstimation/costEstimationDetail/costEstimationDetail.ts create mode 100644 miniprogram/pages/costEstimation/costEstimationDetail/costEstimationDetail.wxml create mode 100644 miniprogram/pages/costEstimation/costEstimationDetail/costEstimationDetail.wxs create mode 100644 miniprogram/pages/costEstimation/costEstimationRecord/costEstimationRecord.json create mode 100644 miniprogram/pages/costEstimation/costEstimationRecord/costEstimationRecord.less create mode 100644 miniprogram/pages/costEstimation/costEstimationRecord/costEstimationRecord.ts create mode 100644 miniprogram/pages/costEstimation/costEstimationRecord/costEstimationRecord.wxml create mode 100644 miniprogram/pages/driverIndex/index.json create mode 100644 miniprogram/pages/driverIndex/index.less create mode 100644 miniprogram/pages/driverIndex/index.ts create mode 100644 miniprogram/pages/driverIndex/index.wxml create mode 100644 miniprogram/pages/driverIndex/page/signInFeedback/signInFeedback.json create mode 100644 miniprogram/pages/driverIndex/page/signInFeedback/signInFeedback.less create mode 100644 miniprogram/pages/driverIndex/page/signInFeedback/signInFeedback.ts create mode 100644 miniprogram/pages/driverIndex/page/signInFeedback/signInFeedback.wxml create mode 100644 miniprogram/pages/driverIndex/page/signInReocrd/component/calendar/calendar.js create mode 100644 miniprogram/pages/driverIndex/page/signInReocrd/component/calendar/calendar.json create mode 100644 miniprogram/pages/driverIndex/page/signInReocrd/component/calendar/calendar.wxml create mode 100644 miniprogram/pages/driverIndex/page/signInReocrd/component/calendar/calendar.wxss create mode 100644 miniprogram/pages/driverIndex/page/signInReocrd/signInReocrd.json create mode 100644 miniprogram/pages/driverIndex/page/signInReocrd/signInReocrd.less create mode 100644 miniprogram/pages/driverIndex/page/signInReocrd/signInReocrd.ts create mode 100644 miniprogram/pages/driverIndex/page/signInReocrd/signInReocrd.wxml create mode 100644 miniprogram/pages/eventReport/eventReportAdd/eventReportAdd.json create mode 100644 miniprogram/pages/eventReport/eventReportAdd/eventReportAdd.less create mode 100644 miniprogram/pages/eventReport/eventReportAdd/eventReportAdd.ts create mode 100644 miniprogram/pages/eventReport/eventReportAdd/eventReportAdd.wxml create mode 100644 miniprogram/pages/eventReport/eventReportDetail/eventReportDetail.json create mode 100644 miniprogram/pages/eventReport/eventReportDetail/eventReportDetail.less create mode 100644 miniprogram/pages/eventReport/eventReportDetail/eventReportDetail.ts create mode 100644 miniprogram/pages/eventReport/eventReportDetail/eventReportDetail.wxml create mode 100644 miniprogram/pages/eventReport/eventReportFeedback/eventReportFeedback.json create mode 100644 miniprogram/pages/eventReport/eventReportFeedback/eventReportFeedback.less create mode 100644 miniprogram/pages/eventReport/eventReportFeedback/eventReportFeedback.ts create mode 100644 miniprogram/pages/eventReport/eventReportFeedback/eventReportFeedback.wxml create mode 100644 miniprogram/pages/eventReport/eventReportRecord/eventReportRecord.json create mode 100644 miniprogram/pages/eventReport/eventReportRecord/eventReportRecord.less create mode 100644 miniprogram/pages/eventReport/eventReportRecord/eventReportRecord.ts create mode 100644 miniprogram/pages/eventReport/eventReportRecord/eventReportRecord.wxml create mode 100644 miniprogram/pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord.json create mode 100644 miniprogram/pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord.less create mode 100644 miniprogram/pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord.ts create mode 100644 miniprogram/pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord.wxml create mode 100644 miniprogram/pages/handoverVehicle/procurementDelivery/procurementDelivery.json create mode 100644 miniprogram/pages/handoverVehicle/procurementDelivery/procurementDelivery.less create mode 100644 miniprogram/pages/handoverVehicle/procurementDelivery/procurementDelivery.ts create mode 100644 miniprogram/pages/handoverVehicle/procurementDelivery/procurementDelivery.wxml create mode 100644 miniprogram/pages/handoverVehicle/procurementDeliveryEdit/procurementDeliveryEdit.json create mode 100644 miniprogram/pages/handoverVehicle/procurementDeliveryEdit/procurementDeliveryEdit.less create mode 100644 miniprogram/pages/handoverVehicle/procurementDeliveryEdit/procurementDeliveryEdit.ts create mode 100644 miniprogram/pages/handoverVehicle/procurementDeliveryEdit/procurementDeliveryEdit.wxml create mode 100644 miniprogram/pages/handoverVehicle/rentalDelivery/rentalDelivery.json create mode 100644 miniprogram/pages/handoverVehicle/rentalDelivery/rentalDelivery.less create mode 100644 miniprogram/pages/handoverVehicle/rentalDelivery/rentalDelivery.ts create mode 100644 miniprogram/pages/handoverVehicle/rentalDelivery/rentalDelivery.wxml create mode 100644 miniprogram/pages/handoverVehicle/rentalDeliveryEdit/rentalDeliveryEdit.json create mode 100644 miniprogram/pages/handoverVehicle/rentalDeliveryEdit/rentalDeliveryEdit.less create mode 100644 miniprogram/pages/handoverVehicle/rentalDeliveryEdit/rentalDeliveryEdit.ts create mode 100644 miniprogram/pages/handoverVehicle/rentalDeliveryEdit/rentalDeliveryEdit.wxml create mode 100644 miniprogram/pages/index/index.less create mode 100644 miniprogram/pages/index/index.ts create mode 100644 miniprogram/pages/index/index.wxml create mode 100644 miniprogram/pages/insurancePolicyReport/insurancePolicyReport.json create mode 100644 miniprogram/pages/insurancePolicyReport/insurancePolicyReport.less create mode 100644 miniprogram/pages/insurancePolicyReport/insurancePolicyReport.ts create mode 100644 miniprogram/pages/insurancePolicyReport/insurancePolicyReport.wxml create mode 100644 miniprogram/pages/login/login.json create mode 100644 miniprogram/pages/login/login.less create mode 100644 miniprogram/pages/login/login.ts create mode 100644 miniprogram/pages/login/login.wxml create mode 100644 miniprogram/pages/logs/logs.json create mode 100644 miniprogram/pages/logs/logs.ts create mode 100644 miniprogram/pages/logs/logs.wxml create mode 100644 miniprogram/pages/logs/logs.wxss create mode 100644 miniprogram/pages/maintenanceIndex/maintenanceIndex.json create mode 100644 miniprogram/pages/maintenanceIndex/maintenanceIndex.less create mode 100644 miniprogram/pages/maintenanceIndex/maintenanceIndex.ts create mode 100644 miniprogram/pages/maintenanceIndex/maintenanceIndex.wxml create mode 100644 miniprogram/pages/manufacturerIndex/manufacturerIndex.json create mode 100644 miniprogram/pages/manufacturerIndex/manufacturerIndex.less create mode 100644 miniprogram/pages/manufacturerIndex/manufacturerIndex.ts create mode 100644 miniprogram/pages/manufacturerIndex/manufacturerIndex.wxml create mode 100644 miniprogram/pages/module/module.wxs create mode 100644 miniprogram/pages/projectIndex/projectIndex.json create mode 100644 miniprogram/pages/projectIndex/projectIndex.less create mode 100644 miniprogram/pages/projectIndex/projectIndex.ts create mode 100644 miniprogram/pages/projectIndex/projectIndex.wxml create mode 100644 miniprogram/pages/statement/reportStatement/reportStatement.json create mode 100644 miniprogram/pages/statement/reportStatement/reportStatement.less create mode 100644 miniprogram/pages/statement/reportStatement/reportStatement.ts create mode 100644 miniprogram/pages/statement/reportStatement/reportStatement.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/maintainCheck/maintainCheck.json create mode 100644 miniprogram/pages/vehicleMaintenance/maintainCheck/maintainCheck.less create mode 100644 miniprogram/pages/vehicleMaintenance/maintainCheck/maintainCheck.ts create mode 100644 miniprogram/pages/vehicleMaintenance/maintainCheck/maintainCheck.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/maintainProcedure/maintainProcedure.json create mode 100644 miniprogram/pages/vehicleMaintenance/maintainProcedure/maintainProcedure.less create mode 100644 miniprogram/pages/vehicleMaintenance/maintainProcedure/maintainProcedure.ts create mode 100644 miniprogram/pages/vehicleMaintenance/maintainProcedure/maintainProcedure.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/maintainRecord/maintainRecord.json create mode 100644 miniprogram/pages/vehicleMaintenance/maintainRecord/maintainRecord.less create mode 100644 miniprogram/pages/vehicleMaintenance/maintainRecord/maintainRecord.ts create mode 100644 miniprogram/pages/vehicleMaintenance/maintainRecord/maintainRecord.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/maintainResult/maintainResult.json create mode 100644 miniprogram/pages/vehicleMaintenance/maintainResult/maintainResult.less create mode 100644 miniprogram/pages/vehicleMaintenance/maintainResult/maintainResult.ts create mode 100644 miniprogram/pages/vehicleMaintenance/maintainResult/maintainResult.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/maintainSend/maintainSend.json create mode 100644 miniprogram/pages/vehicleMaintenance/maintainSend/maintainSend.less create mode 100644 miniprogram/pages/vehicleMaintenance/maintainSend/maintainSend.ts create mode 100644 miniprogram/pages/vehicleMaintenance/maintainSend/maintainSend.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/cancel/cancel.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/cancel/cancel.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/cancel/cancel.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/cancel/cancel.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/check/check.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/check/check.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/check/check.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/check/check.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/complete/complete.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/complete/complete.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/complete/complete.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/complete/complete.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/dataEntryOne/dataEntryOne.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/dataEntryOne/dataEntryOne.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/dataEntryOne/dataEntryOne.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/dataEntryOne/dataEntryOne.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/dataEntryTwo/dataEntryTwo.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/dataEntryTwo/dataEntryTwo.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/dataEntryTwo/dataEntryTwo.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/dataEntryTwo/dataEntryTwo.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/maintainApply/maintainApply.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/maintainApply/maintainApply.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/maintainApply/maintainApply.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/maintainApply/maintainApply.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/message/message.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/message/message.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/message/message.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/message/message.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/offer/offer.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/offer/offer.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/offer/offer.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/offer/offer.wxml create mode 100644 miniprogram/pages/vehicleMaintenance/operation/repair/repair.json create mode 100644 miniprogram/pages/vehicleMaintenance/operation/repair/repair.less create mode 100644 miniprogram/pages/vehicleMaintenance/operation/repair/repair.ts create mode 100644 miniprogram/pages/vehicleMaintenance/operation/repair/repair.wxml create mode 100644 miniprogram/pages/vehicleMonitoring/component/vehicleSearch/vehicleSearch.json create mode 100644 miniprogram/pages/vehicleMonitoring/component/vehicleSearch/vehicleSearch.less create mode 100644 miniprogram/pages/vehicleMonitoring/component/vehicleSearch/vehicleSearch.ts create mode 100644 miniprogram/pages/vehicleMonitoring/component/vehicleSearch/vehicleSearch.wxml create mode 100644 miniprogram/pages/vehicleMonitoring/failureAlert/failureAlert.json create mode 100644 miniprogram/pages/vehicleMonitoring/failureAlert/failureAlert.less create mode 100644 miniprogram/pages/vehicleMonitoring/failureAlert/failureAlert.ts create mode 100644 miniprogram/pages/vehicleMonitoring/failureAlert/failureAlert.wxml create mode 100644 miniprogram/pages/vehicleMonitoring/global/global.json create mode 100644 miniprogram/pages/vehicleMonitoring/global/global.less create mode 100644 miniprogram/pages/vehicleMonitoring/global/global.ts create mode 100644 miniprogram/pages/vehicleMonitoring/global/global.wxml create mode 100644 miniprogram/pages/vehicleMonitoring/realtime/realtime.json create mode 100644 miniprogram/pages/vehicleMonitoring/realtime/realtime.less create mode 100644 miniprogram/pages/vehicleMonitoring/realtime/realtime.ts create mode 100644 miniprogram/pages/vehicleMonitoring/realtime/realtime.wxml create mode 100644 miniprogram/pages/violationReporting/violationReporting.json create mode 100644 miniprogram/pages/violationReporting/violationReporting.less create mode 100644 miniprogram/pages/violationReporting/violationReporting.ts create mode 100644 miniprogram/pages/violationReporting/violationReporting.wxml create mode 100644 miniprogram/sitemap.json create mode 100644 miniprogram/utils/base64.js create mode 100644 miniprogram/utils/qqmap-wx-jssdk.min.js create mode 100644 miniprogram/utils/util.ts create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 prettier.config.js create mode 100644 project.config.json create mode 100644 project.private.config.json create mode 100644 tsconfig.json create mode 100644 typings/index.d.ts create mode 100644 typings/types/index.d.ts create mode 100644 typings/types/wx/index.d.ts create mode 100644 typings/types/wx/lib.wx.api.d.ts create mode 100644 typings/types/wx/lib.wx.app.d.ts create mode 100644 typings/types/wx/lib.wx.behavior.d.ts create mode 100644 typings/types/wx/lib.wx.cloud.d.ts create mode 100644 typings/types/wx/lib.wx.component.d.ts create mode 100644 typings/types/wx/lib.wx.event.d.ts create mode 100644 typings/types/wx/lib.wx.page.d.ts diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..0eea193 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,31 @@ +/* + * Eslint config file + * Documentation: https://eslint.org/docs/user-guide/configuring/ + * Install the Eslint extension before using this feature. + */ +module.exports = { + env: { + es6: true, + browser: true, + node: true + }, + ecmaFeatures: { + modules: true + }, + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module' + }, + globals: { + wx: true, + App: true, + Page: true, + getCurrentPages: true, + getApp: true, + Component: true, + requirePlugin: true, + requireMiniProgram: true + }, + extends: 'eslint:recommended', + rules: {} +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0564bfc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +miniprogram_npm \ No newline at end of file diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..b567676 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx --no -- commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..2a0399b --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +# 触发 lint-staged 钩子 +npx lint-staged diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..5c32e26 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry = http://10.91.137.86:8002/repository/npm-group diff --git a/README.md b/README.md new file mode 100644 index 0000000..0a92373 --- /dev/null +++ b/README.md @@ -0,0 +1,78 @@ +## gci小程序原生开发框架 + +该框架用于原生小程序开发,集成了 ts + less + @vant/weapp。 + +### quick start + +1. pnpm i +2. 在微信开发者工具中构建npm: + > 工具 -> 构建npm + > 该步骤会产生 /miniprogram/miniprogram_npm +3. 开始开发。推荐使用vscode作为代码编辑器。 + +### npm库引用 + +#### npm install 的方式 + +1. pnpm i xxx +2. 在微信开发这工具中构建npm +3. 代码中引用库 + > 当引用组件时,要先在页面的json文件或者 app.json 中引入: + +``` +// app.json +{ + "usingComponents": { + "vant-btn": "@vant/weapp/button/index" + } +} +``` + +#### dist 引入的方式 + +1. 复制目标库的 dist 到 /miniprogram/lib +2. 引用的时候需要具体到 /miniprogram/lib/dist,如: + +``` +// app.json +{ + "usingComponents": { + "vant-btn": "/lib/@vant/weapp/button/index" + } +} +``` + +### http 请求 + +小程序与web不同在于小程序需要指定域,所以需要在 `/miniprogram/config.ts` 中指定访问的域。 +针对小程序的 `wx.request` 做了简单封装,使用风格沿用 gci-boot: + +```js +// 详情请见 /miniprogram/api/base.ts +getAction(url, data); +deleteAction(url, data); +postAction(url, data); +putAction(url, data); +upload(url, { filePath }); +``` + +建议在 /api 路径下建立各个模块的接口文件。例如: + +```ts +// /api/auth.ts +/** + * 获取加密字符串 + * @returns + */ +export const getEncryptedString = () => getAction('/sys/getEncryptedString'); + +// /pages/index.ts +const foo = async () => { + try { + const res = await getEncryptedString(); + // do sth + } catch (err) { + // do sth to handle err + } +}; +``` diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..c34aa79 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'] +}; diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 0000000..8931b85 --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1,6 @@ +module.exports = { + '*.{js,ts,jsx,tsx,md,vue}': [ + // 'eslint --fix', + 'prettier --write' + ] +}; diff --git a/miniprogram/api/auth.ts b/miniprogram/api/auth.ts new file mode 100644 index 0000000..138cf83 --- /dev/null +++ b/miniprogram/api/auth.ts @@ -0,0 +1,7 @@ +import { getAction } from './base'; + +/** + * 获取加密字符串 + * @returns + */ +export const getEncryptedString = () => getAction('/sys/getEncryptedString'); diff --git a/miniprogram/api/base.ts b/miniprogram/api/base.ts new file mode 100644 index 0000000..463da1b --- /dev/null +++ b/miniprogram/api/base.ts @@ -0,0 +1,130 @@ +import config from '../config'; + +// 定义token +let token = ''; +// 在登录之后设置token +export function setToken(t: string) { + token = t; + // 可以选择将token保存到缓存中 + // wx.setStorageSync('token', token) +} +export function clearToken() { + token = ''; + // wx.setStorageSync('token', '') +} + +interface Header { + 'X-Access-Token': string; +} +export function request(method: any = 'GET', url: string, data?: any) { + return new Promise((resolve, reject) => { + const header: Header = { 'X-Access-Token': '' }; + if (token) { + header['X-Access-Token'] = token; + } else { + header['X-Access-Token'] = wx.getStorageSync('token'); + } + wx.request({ + method, + url: config.baseUrl + url, + data, + header, + success: (res: any) => { + console.log(res); + if (res.data.code === 200 || res.data.code === 0) { + resolve(res.data); + } else if (res.data.message.includes('token失效')) { + //重新登录 + wx.removeStorageSync('userInfo'); + wx.removeStorageSync('token'); + wx.removeStorageSync('organName'); + wx.reLaunch({ + url: '/pages/login/login' + }); + } else { + resolve(res.data); + wx.showToast({ + title: res.data.message, + icon: 'none' + }); + } + }, + fail: err => { + wx.showToast({ + title: '访问失败,请检查当前的网络', + icon: 'none' + }); + console.error('请求错误', err); + reject(err); + } + }); + }); +} + +export const getAction = (url: string, params?: Object) => + request('GET', generateUrl(url, params)); + +export const deleteAction = (url: string, params?: Object) => + request('DELETE', generateUrl(url, params)); + +export const postAction = (url: string, data?: Object) => + request('POST', url, data); + +export const putAction = (url: string, data?: Object) => + request('PUT', url, data); + +interface UploadOption { + name: string; + filePath: string; + params?: Object; +} +export function upload(url: string, option: UploadOption) { + const { name = 'file', filePath, params } = option; + if (!filePath) throw new Error('filepath-not-found'); + if (!wx.getStorageSync('token')) throw new Error('请先登录!'); + + return new Promise((resolve, reject) => { + const header: any = { + 'Content-Type': 'multipart/form-data', + 'X-Access-Token': '' + }; + if (token) { + header['X-Access-Token'] = token; + } else { + header['X-Access-Token'] = wx.getStorageSync('token'); + } + wx.uploadFile({ + url: config.baseUrl + url, + filePath, + name, + formData: params, + header, + success: resolve, + fail: err => { + wx.showToast({ + title: '上传失败', + icon: 'none' + }); + console.error('请求错误', err.errMsg); + reject(err); + } + }); + }); +} + +const generateUrl = (url: string, params?: any) => { + if (!params) return url; + + const keys = Object.keys(params); + if (keys.length < 1) return url; + + return ( + url + + keys.reduce((res, it, idx) => { + if (typeof params[it] !== 'undefined') { + return `${res}${idx > 0 ? '&' : ''}${it}=${params[it]}`; + } + return res; + }, '?') + ); +}; diff --git a/miniprogram/app.json b/miniprogram/app.json new file mode 100644 index 0000000..0a3f2ee --- /dev/null +++ b/miniprogram/app.json @@ -0,0 +1,135 @@ +{ + "pages": [ + "pages/index/index", + "pages/manufacturerIndex/manufacturerIndex", + "pages/projectIndex/projectIndex", + "pages/maintenanceIndex/maintenanceIndex", + "pages/accidentReporting/accidentReporting", + "pages/violationReporting/violationReporting", + "pages/logs/logs", + "pages/login/login", + "pages/addressBook/addressBook", + + "pages/driverIndex/index", + "pages/driverIndex/page/signInReocrd/signInReocrd", + "pages/driverIndex/page/signInFeedback/signInFeedback", + + "pages/vehicleMonitoring/global/global", + "pages/vehicleMonitoring/realtime/realtime", + "pages/vehicleMonitoring/failureAlert/failureAlert", + "pages/vehicleMonitoring/component/vehicleSearch/vehicleSearch", + "pages/vehicleMaintenance/maintainRecord/maintainRecord", + "pages/vehicleMaintenance/maintainSend/maintainSend", + "pages/vehicleMaintenance/maintainCheck/maintainCheck", + "pages/vehicleMaintenance/maintainProcedure/maintainProcedure", + "pages/vehicleMaintenance/maintainResult/maintainResult", + "pages/vehicleMaintenance/operation/maintainApply/maintainApply", + "pages/vehicleMaintenance/operation/message/message", + "pages/vehicleMaintenance/operation/offer/offer", + "pages/vehicleMaintenance/operation/check/check", + "pages/vehicleMaintenance/operation/repair/repair", + "pages/vehicleMaintenance/operation/complete/complete", + "pages/vehicleMaintenance/operation/cancel/cancel", + "pages/vehicleMaintenance/operation/dataEntryOne/dataEntryOne", + "pages/vehicleMaintenance/operation/dataEntryTwo/dataEntryTwo", + + "pages/UpkeepPlan/UpkeepPlanApply/UpkeepPlanApply", + "pages/UpkeepPlan/message/message", + "pages/UpkeepPlan/check/check", + "pages/UpkeepPlan/cancel/cancel", + "pages/UpkeepPlan/UpkeepPlanRecord/UpkeepPlanRecord", + "pages/UpkeepPlan/UpkeepPlanInfo/UpkeepPlanInfo", + + "pages/UpkeepBill/UpkeepBillRecord/UpkeepBillRecord", + "pages/UpkeepBill/UpkeepBillSend/UpkeepBillSend", + "pages/UpkeepBill/UpkeepBillCheck/UpkeepBillCheck", + "pages/UpkeepBill/UpkeepBillProcedure/UpkeepBillProcedure", + "pages/UpkeepBill/UpkeepBillResult/UpkeepBillResult", + "pages/UpkeepBill/operation/message/message", + "pages/UpkeepBill/operation/cancel/cancel", + "pages/UpkeepBill/operation/offer/offer", + "pages/UpkeepBill/operation/check/check", + "pages/UpkeepBill/operation/upkeep/upkeep", + "pages/UpkeepBill/operation/complete/complete", + "pages/UpkeepBill/operation/dataEntryOne/dataEntryOne", + "pages/UpkeepBill/operation/dataEntryTwo/dataEntryTwo", + + "pages/backlog/backlogList/backlogList", + "pages/backlog/backlogFeedback/backlogFeedback", + "pages/backlog/insurance/insurance", + "pages/backlog/insuranceFeedback/insuranceFeedback", + "pages/backlog/violation/violation", + "pages/backlog/violationFeedback/violationFeedback", + "pages/backlog/accident/accident", + "pages/backlog/accidentFeedback/accidentFeedback", + "pages/backlog/annualInspection/annualInspection", + "pages/backlog/annualInspectionFeedback/annualInspectionFeedback", + + "pages/handoverVehicle/handoverVehicleRecord/handoverVehicleRecord", + "pages/handoverVehicle/procurementDelivery/procurementDelivery", + "pages/handoverVehicle/procurementDeliveryEdit/procurementDeliveryEdit", + "pages/handoverVehicle/rentalDelivery/rentalDelivery", + "pages/handoverVehicle/rentalDeliveryEdit/rentalDeliveryEdit", + + "pages/eventReport/eventReportRecord/eventReportRecord", + "pages/eventReport/eventReportDetail/eventReportDetail", + "pages/eventReport/eventReportAdd/eventReportAdd", + "pages/eventReport/eventReportFeedback/eventReportFeedback", + + "pages/insurancePolicyReport/insurancePolicyReport", + + "pages/statement/reportStatement/reportStatement", + "pages/costEstimation/costEstimationRecord/costEstimationRecord", + "pages/costEstimation/costEstimationDetail/costEstimationDetail", + "pages/costEstimation/costEstimationAdd/costEstimationAdd" + ], + "subPackages": [ + { + "root": "packageA", + "pages": [ + "pages/customerFollow/customerFollow", + "pages/customerFollowDetail/customerFollowDetail", + + "pages/refuelingCharging/RefuelingChargingRecord/RefuelingChargingRecord", + "pages/refuelingCharging/RefuelingChargingDetail/RefuelingChargingDetail", + "pages/refuelingCharging/RefuelingChargingReporting/RefuelingChargingReporting" + ] + } + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#3679FC", + "navigationBarTitleText": "Weixin", + "navigationBarTextStyle": "white" + }, + "tabBar": { + "custom": true, + "color": "#000000", + "selectedColor": "#000000", + "backgroundColor": "#000000", + "list": [ + { + "pagePath": "pages/maintenanceIndex/maintenanceIndex", + "text": "工作台" + }, + { + "pagePath": "pages/backlog/backlogList/backlogList", + "text": "代办" + }, + { + "pagePath": "pages/addressBook/addressBook", + "text": "通讯录" + } + ] + }, + "requiredPrivateInfos": [ + "chooseLocation", + "getLocation" + ], + "permission": { + "scope.userLocation": { + "desc": "获取当前位置" + } + }, + "sitemapLocation": "sitemap.json" +} \ No newline at end of file diff --git a/miniprogram/app.less b/miniprogram/app.less new file mode 100644 index 0000000..6f65c78 --- /dev/null +++ b/miniprogram/app.less @@ -0,0 +1,16 @@ +/**app.wxss**/ +// .container { +// height: 100%; +// display: flex; +// flex-direction: column; +// align-items: center; +// justify-content: space-between; +// padding: 200rpx 0; +// box-sizing: border-box; +// } +page { + max-height: 100vh; + padding-bottom: constant(safe-area-inset-bottom); //constant在iOS<11.2的版本中生效 + padding-bottom: env(safe-area-inset-bottom); //env在iOS>=11.2的版本中生效 + box-sizing: border-box; +} \ No newline at end of file diff --git a/miniprogram/app.ts b/miniprogram/app.ts new file mode 100644 index 0000000..6d4ccc7 --- /dev/null +++ b/miniprogram/app.ts @@ -0,0 +1,62 @@ +// app.ts +App({ + globalData: {}, + onLaunch() { + // 小程序每次打开都会调用一次 + // 展示本地存储能力 + const logs = wx.getStorageSync('logs') || []; + logs.unshift(Date.now()); + wx.setStorageSync('logs', logs); + + wx.getSetting({ + success(res: any) { + console.log(res.authSetting); + if (!res.authSetting['scope.userLocation']) { + wx.showToast({ + title: '请在小程序设置界面中设置位置消息权限。', + icon: 'none' + }); + } + } + }); + // 登录 + wx.login({ + success: res => { + console.log(res.code); + // 发送 res.code 到后台换取 openId, sessionKey, unionId + wx.setStorageSync('code', res.code); + } + }); + // 判断是否登录 + const token = wx.getStorageSync('token'); + if (!token) { + wx.reLaunch({ + url: '/pages/login/login' + }); + } else { + // 获取token,用户信息 判断账号角色然后跳转到对应的首页 + let userInfo = wx.getStorageSync('userInfo'); + if (userInfo.type == '1') { + wx.reLaunch({ + url: '/pages/driverIndex/index' + }); + } else if (userInfo.type == '2') { + wx.reLaunch({ + url: '/pages/manufacturerIndex/manufacturerIndex' + }); + } else if (userInfo.type == '3') { + wx.reLaunch({ + url: '/pages/projectIndex/projectIndex' + }); + } else if (userInfo.type == '4') { + wx.reLaunch({ + url: '/pages/maintenanceIndex/maintenanceIndex' + }); + } else { + wx.reLaunch({ + url: '/pages/login/login' + }); + } + } + } +}); diff --git a/miniprogram/components/uploadPic/uploadPic.json b/miniprogram/components/uploadPic/uploadPic.json new file mode 100644 index 0000000..0922e68 --- /dev/null +++ b/miniprogram/components/uploadPic/uploadPic.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "van-uploader": "@vant/weapp/uploader/index" + } +} \ No newline at end of file diff --git a/miniprogram/components/uploadPic/uploadPic.less b/miniprogram/components/uploadPic/uploadPic.less new file mode 100644 index 0000000..1ef661d --- /dev/null +++ b/miniprogram/components/uploadPic/uploadPic.less @@ -0,0 +1,64 @@ +/* components/uploadPic/uploadPic.wxss */ +.upload-container { + .upload { + // width: 100%; + // margin-top: 8px; + display: flex; + flex-wrap: wrap; + + .upload-btn { + width: 64px; + height: 64px; + margin-right: 8px; + margin-bottom: 8px; + background: #ECF1FF; + border-radius: 4px; + border: 1px dashed #4381FC; + box-sizing: border-box; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + image { + width: 20px; + height: 20px; + margin: 16rpx 0 8rpx; + } + + .val { + color: #4381FC; + font-size: 14px; + } + } + + .photo-list { + width: 64px; + height: 64px; + margin-right: 8px; + margin-bottom: 8px; + border-radius: 4px; + position: relative; + + image { + width: 100%; + height: 100%; + display: block; + } + + .del { + width: 20px; + height: 20px; + position: absolute; + top: -10px; + right: -10px; + + image { + width: 100%; + height: 100%; + display: block; + } + } + } + } +} \ No newline at end of file diff --git a/miniprogram/components/uploadPic/uploadPic.ts b/miniprogram/components/uploadPic/uploadPic.ts new file mode 100644 index 0000000..7ac1c6a --- /dev/null +++ b/miniprogram/components/uploadPic/uploadPic.ts @@ -0,0 +1,164 @@ +// components/uploadPic/uploadPic.ts +import { postAction, upload } from '../../api/base'; + +Component({ + /** + * 组件的属性列表 + */ + properties: { + uploadUrl: { + type: String, + value: 'api/vehicles/accidentInfo/upload' + }, + maxLength: { + type: Number, + value: 1 + }, + picList: { + type: Array, + value: [] + } + }, + observers: { + picList: function (val: any, oVal: any) { + // console.log(val,oVal) + // if(val) { + // this.setDate({ + // photoList: val + // }) + // this.data.changePhotoList() + // } + } + }, + attached() { + // console.log(this.properties.picList) + // this.setData({ + // photoList: this.properties.picList.value + // }) + }, + /** + * 组件的初始数据 + */ + data: { + photoList: [] + }, + + /** + * 组件的方法列表 + */ + ready: function () { + console.log('上传ready', this.properties.picList); + }, + methods: { + // initPhotoList(list: any) { + // console.log(list) + // this.setData({ + // photoList: list + // }) + // }, + choosePhoto() { + console.log(this); + let _this = this; + if (this.data.photoList.length < this.properties.maxLength) { + let maxCount; + if (this.properties.maxLength - this.data.photoList.length >= 6) + maxCount = 6; + else maxCount = this.properties.maxLength - this.data.photoList.length; + wx.chooseMedia({ + count: maxCount, // 最多同时选 6张 + mediaType: ['image'], + success(res) { + console.log(res); + let { tempFiles } = res; + tempFiles.forEach((item, index) => { + _this.uploadImg(item.tempFilePath); // 循环执行上传放法,实现多张图片,同时上传 + }); + }, + fail(err) { + console.log(err); + } + }); + } else { + wx.showToast({ + title: `最多上传${this.properties.maxLength}张图片`, + icon: 'none' + }); + } + }, + + // 选择本地图片 + uploadImg(imgSrcList: any) { + console.log(imgSrcList); + var that = this; + let { photoList } = this.data; + wx.showLoading({ + title: '加载中', + mask: true + }); + let parms = { + name: 'file', + filePath: imgSrcList + }; + upload(this.properties.uploadUrl, parms) + .then((res: any) => { + let result = JSON.parse(res.data); + if (result.code == 200) { + // console.log(result); + photoList.push(result.result); + this.setData({ + photoList: photoList + }); + this.returnPic(); + wx.hideLoading(); + } else { + console.log('失败'); + wx.hideLoading(); + wx.showToast({ + title: result.message, + icon: 'none' + }); + } + }) + .catch(err => { + wx.hideLoading(); + wx.showToast({ + title: err.message, + icon: 'none' + }); + }); + }, + delImg(e: any) { + let that = this; + let { index } = e.currentTarget.dataset; + let { photoList } = this.data; + wx.showModal({ + title: '提示', + content: '是否删除当前照片', + success(res) { + if (res.confirm) { + photoList.splice(index, 1); + that.setData({ + photoList + }); + that.returnPic(); + } + } + }); + }, + returnPic() { + this.triggerEvent('returnPic', { photoList: this.data.photoList }); + }, + previewImg(e: any) { + let { index } = e.currentTarget.dataset; + let { photoList } = this.data; + let list = [] as any; + photoList.forEach((item: any) => { + list.push(item.fileUrl); + }); + wx.previewImage({ + current: list[index | 0], // 当前显示图片的http链接 默认urls[0] + urls: list // 需要预览的图片http链接列表 + }); + } + } +}); diff --git a/miniprogram/components/uploadPic/uploadPic.wxml b/miniprogram/components/uploadPic/uploadPic.wxml new file mode 100644 index 0000000..65cc56c --- /dev/null +++ b/miniprogram/components/uploadPic/uploadPic.wxml @@ -0,0 +1,22 @@ + + + + + + 上传图片 + + + + + + + + + + + \ No newline at end of file diff --git a/miniprogram/config.ts b/miniprogram/config.ts new file mode 100644 index 0000000..a0c4ee0 --- /dev/null +++ b/miniprogram/config.ts @@ -0,0 +1,13 @@ +export default { + // baseUrl: 'http:10.91.122.6:8051/smartTransportMobile' + // baseUrl: 'http://10.91.123.10:8068/cdenv-api/' // 书汉 + // baseUrl: 'http://10.180.20.111:8068/cdenv-api/' // 文龙 + // baseUrl: 'http://10.180.12.174:8068/cdenv-api/' // 作恒 + // baseUrl: 'http://10.180.22.227:8068/cdenv-api/' //玉赞 + // baseUrl: 'https://gaosudanao.gci-china.com/' //高速公路测试环境 + // baseUrl: 'http://10.91.123.10:8091/cdenv/' + baseUrl: 'http://10.91.123.10:8068/cdenv-api/' + // baseUrl: 'http://10.91.137.95:8080/kfb' + // baseUrl: 'http://10.180.11.162:8068/cdenv-api/' + // baseUrl: 'https://zuche.cdenvironment.com:25000/cdenv-api/' // 产线 +}; diff --git a/miniprogram/custom-tab-bar/index.js b/miniprogram/custom-tab-bar/index.js new file mode 100644 index 0000000..d191470 --- /dev/null +++ b/miniprogram/custom-tab-bar/index.js @@ -0,0 +1,38 @@ +Component({ + data: { + selected: 0, + color: '#7A7E83', + selectedColor: '#3B7CFC', + list: [ + { + pagePath: '/pages/maintenanceIndex/maintenanceIndex', + iconPath: '/images/icon_tabbar_h.png', + selectedIconPath: '/images/icon_tabbar_hs.png', + text: '工作台' + }, + { + pagePath: '/pages/backlog/backlogList/backlogList', + iconPath: '/images/icon_tabbar2.png', + selectedIconPath: '/images/icon_tabbar2.png', + text: '待办' + }, + { + pagePath: '/pages/addressBook/addressBook', + iconPath: '/images/icon_tabbar_n.png', + selectedIconPath: '/images/icon_tabbar_ns.png', + text: '通讯录' + } + ] + }, + attached() {}, + methods: { + switchTab(e) { + const data = e.currentTarget.dataset; + const url = data.path; + wx.switchTab({ url }); + this.setData({ + selected: data.index + }); + } + } +}); diff --git a/miniprogram/custom-tab-bar/index.json b/miniprogram/custom-tab-bar/index.json new file mode 100644 index 0000000..32640e0 --- /dev/null +++ b/miniprogram/custom-tab-bar/index.json @@ -0,0 +1,3 @@ +{ + "component": true +} \ No newline at end of file diff --git a/miniprogram/custom-tab-bar/index.less b/miniprogram/custom-tab-bar/index.less new file mode 100644 index 0000000..313814e --- /dev/null +++ b/miniprogram/custom-tab-bar/index.less @@ -0,0 +1,62 @@ +.tab-bar { + position: fixed; + bottom: 0; + left: 0; + right: 0; + height: 120px; + background: transparent; + // padding-bottom: env(safe-area-inset-bottom); + .tab-bar-bg { + width: 100vw; + height: 120px; + position: absolute; + left: 0; + top: 0; + image { + width: 100%; + height: 100%; + display: block; + } + } + .tab-bar-list { + width: 100%; + // height: 80px; + padding-bottom: env(safe-area-inset-bottom); + box-sizing: border-box; + display: flex; + position: absolute; + top: 86rpx; + // bottom: 0; + .tab-bar-item { + padding-top: 8px; + flex: 1; + text-align: center; + display: flex; + justify-content: flex-end; + align-items: center; + flex-direction: column; + image { + width: 20px; + height: 20px; + } + view { + margin-top: 10px; + color: #737373; + font-size: 12px; + font-weight: bold; + } + } + .tab-bar-item:nth-child(2) { + image { + width: 56px; + height: 56px; + position: absolute; + top: -24px; + } + view { + margin-top: 20px; + } + } + } + +} diff --git a/miniprogram/custom-tab-bar/index.wxml b/miniprogram/custom-tab-bar/index.wxml new file mode 100644 index 0000000..1a0dd32 --- /dev/null +++ b/miniprogram/custom-tab-bar/index.wxml @@ -0,0 +1,12 @@ + + + + + + + + + {{item.text}} + + + diff --git a/miniprogram/images/bg_btn3.png b/miniprogram/images/bg_btn3.png new file mode 100644 index 0000000000000000000000000000000000000000..dda0f1f57906d3671e05f0bfd72236bbbb670c4c GIT binary patch literal 4870 zcmV+h6Z!0kP)E*0#d; z=W^G#%KGbX)wRX<=+OJ^TE(c!{On4?p1JknV9Kn>`0361?8y4+%l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0DWIiN9Q}mT^{KJX}tL zUhn+bN%D9#zpiJf{<9ss*Krew!Z18g_&2)^mXMGY(b_J?DYl_PLI}+r(9=-t{nt6? z3}$SzW5-!`s_%&fh%edd)vO#!vMr39lJgZ=NRR-pqAa<{(o~Y=VoLlMi<6 z)BU$3+5R!6q9*BRn?oT%<^V6aDw2}y3?*5xS&BrE@Qoz-`dM<46-PPkYb;gn&v%@V z@a-_$&M-;Raj88pjnW(B@i^YGV}F{YsHRcMn`%`219b#=m5bFSX;pW|p*YKkAmImb zk@VptOXE}5wK?n4sjH27T4bfP*2jS!o^P($u}^m=Cz52|m1BXItNon2ylv^PoNFUV zN|oc)-p6O90bVzWQvSE{qbmzjTf;BvPPdn2Po)(3nA&TyzoN<26L#!Rc4>0detvY8 z{%rGGC5QSfNPus%2c?f23wv}TNcd^m^IiP*g*LWG1PKA?`>#TB9e=^wA{#2QHV=Z_ z?e=8H6VBT`3hM0D)z!GrdjHi4@r;NlKE5R3r&@ z>~rrDWLMu6xm7G)+kfPT9s6v1a=}G5{dJOWu@ccL1qe(|$?GEfRip;LP$UGG5H6B6 z^jZBE9zY6)!gHWqJSzB_+%CW)Z8=U&HcrG??fNBme*a07*qoM6N<$f^kxaSpWb4 literal 0 HcmV?d00001 diff --git a/miniprogram/images/bg_page_blue.png b/miniprogram/images/bg_page_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..bbabfc8cae0c778fec8521da13cf89a96cce1e24 GIT binary patch literal 4849 zcmai23pmq%`&KHFQwrsoXSZ4TcOLzBd2QDPIU*djq}9wR=IBDQ=i zwk?#{Je62yOO9qqj^#TvHWr72#B;e^3i=q-M&<=P$Oxgf2=@+*=FW%8nbK)4fhZ_Cn&(m7C=mPWT$zgJS%`NN zK#d{>c58dC1|g3ow9m?j=k4hynH!FvjZG2{(`ih!50r%k6ZBHv|6h9l#eBhnO$$IQ zEfVBz&2RvYWNxTBWYM{rl@WTe>be;N*k_`ABnSo!q;nHc-2e)KCi$baY{a4s#Wls< z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(z||qpzd~D;&y}eg4Gc8r@w0eauGR%Y}X#To(K6SL_0W zP+~nN5)po$p8Ls0} zPOQz)u;H1(cZgt9+KA>^p|`3tN#bs)Mxxcn8Jrg_zo|h+4EYW**Xxj@nLSF!C5k2V z%~wBnAf3UyV8I#nVD%-7R&}0WgvV(I*TViOXzS=|38!_n|AQdokqQ*6ZVH6X-v#)u z%->!J`{;+56u7<9L`+b!(<(cb4>hVaF0?g^S)-CNS1mXnABQn{YAdQ!?=D?JCF|>J zITxE@AG`6fGuc6Yw=}We{Ca(l4~k;6lb7itR^nsl{?=&ai$W7}Vwz#`!HC5FJk@i3 z+eWHjUjNj17LjNLBOC7gd19qTTlk4}k#6*5q>7@ZBlag$l4ys1LlKNa-tk4%_Ju9c z#d^va#S1-Mbf+4xJcBSv!(&b_j>M?rKPWl<*xOiy$psST^kh_qL1*4jT9OTH5FTUG zquF6ryx6#CZb;P$VCQ7#?X$D@cl?6jRmXraD`Hg6b<-T0{XRJJg+H8 ztuK;y=%%9?*!3`F;FF#o^PO7z(z)YbTn+M0EPu^0^`wm-5HJR;78a}2Gr93Uwr literal 0 HcmV?d00001 diff --git a/miniprogram/images/bg_tabbar.png b/miniprogram/images/bg_tabbar.png new file mode 100644 index 0000000000000000000000000000000000000000..44b87ee7f43c57b3d6da11337fa0a3b123834d2b GIT binary patch literal 2627 zcmd5;dpy(oA6{`NHA~i6l3RrnIh~GMX(LHm#gG^d6*|Ik>Ci5Q^~$206Ur?u!zo87 z%k7|<4wB1chg@Rz)hPkraUC~i(byk`~N%u0K&t=*VosJi;Hb+Y}VG+dV6~n z3dP38#?sOfl}gRY$yr=noS&Z;i^VfDGbt%4D=RB(9AO^k>2?XEz7w*0yZ+v9q5Jl0kd93|8}lRNbKS0p zwgzg^abPGv`vK0!j23gXk26Igq=G=(osef7y>O#KHp`p)!`>85H3MW}p*zxfc9*JN ztU_j6@o3KYxn}RS$a~|2>4j5?E7U?ysUX)cCQ z*b$B1PPFQzGVS~)FDfov7pk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)-j5=B45J-^B1fryQd|SSG-300vs1LVzGrL(fa__ z184*gkR&V+Q6Dq+Dwfp~I(+z+S1?~oTuYR9?u_O$nMDO5UbIYe>?@d1l;MD74XEMp tALF+YzhF}aIMKvj<0iDkUd5-v?_bN}A4g+YD0lz>002ovPDHLkV1mPSmO=mk literal 0 HcmV?d00001 diff --git a/miniprogram/images/btn_exit.png b/miniprogram/images/btn_exit.png new file mode 100644 index 0000000000000000000000000000000000000000..ea38ce87f861c30ce135ea79f4b60c86c6102bec GIT binary patch literal 736 zcmV<60w4W}P)Px%nn^@KR9HvVm`kWmQ5462f5l9$M1&MMI6yO70z3x#fIq-l-~#X(_!$wvBz=$YOV6O0-2k=*xE+#)tBBX( zJC;E+n*+QDCIROp?XM$1RgEOzHefVkYa~6YDqe?w5^xY03Zkd>X z?2A2hc|f7Ij!62EXFIMAnpxKY&CIvaRp1%0QPM~rWTP20Ge3A|0@QP0K+?xfkWB-6 zg*XrFEehEvphKCNLwfPw6Ci!L*Jow2alo>WJpn8O*)zZl$fv-D!6w41hy0i9&0iv>2wvqQ^3L4=mq?COS%{h81~PCnwHqN z%Qaw80KWq4l=Qn2V1X>;nuNW4A6S_N*Hb_yh9b$JObWH`W8FOwD#L_;1;kjR_kwwB}{8+qP-6*wD1Uu-@nFKj)m^IoESt*Kt~;RtXuI2Gc{g_@q&>L6%cyO7U0m>e-X5!fIWzyI*{ zv^77oCTxiDuF5=PW}Vr;{ER4WK`g(5FEGAqvyCf@W<$Ar>H9hxKaM5GEr*R-aLjIg zZcX*spx}g*2%=(x=ME=+b0lTY^dBvQlk**K(*kX8zx{arU1L`M^vNA3dk%@8W)=Rl zPaQszQO9P6GjuD)9lz{CFapmdn7Xfo_xwD!=-5I#zcI(yANA*1S*oz?UQ@72TMlSGB#i?~%u~_Ms;y>cF8WtLp0X}Qq`|G>T1IId6I<(_o9s&eOnRPxwrT)vG z0!$1LtiiGQz(}pC?}T~R$u(p7Fgw%SICHY`0~!~Sy+FK`t&{o_14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$D<)wL)$e;Fu+Mx3;b8`U`!=5%NQfZgY7B<`hcKD1W!M zZrgSGxIP~ZHkwyJchlVPH$hp`YfY0Qp5E;=FA5lhzj_(M2R}axUN1nedau}IE~?Cx zb6&B-0xyl4zXgXR2MWA1*4^bwEj9|k^S3yGWL$9ea=Xn3fnC2Skn~q=m)UQQ7Zhgw zqCWm&l3c*-kncFx{u;YLN*q(PKLz`<38Wx#SOju~z^u0pAccv;j`(Y4{M|zOk<5@~ z((gULfEfNvfx0_VlsW9MNAdT}JDoDeGCYFmz3=;pzZ3aEY$F3GyUrg5;cuA0@uf=b z6GgGZLMEvBgFv>X{%cjAO(ey{37%xm6ONhX_ziYmGH1ZOrXC?(wvFN(vTu=sME%4h5J@DSn4jYr(`Hbh@ z(IW%@5S$&e$V|#pGC273KVIYnt{lW5@@R_xGkOi3!$pGdH98rS_YY{wbj9OXZm<9V N002ovPDHLkV1lDOk?;Tj literal 0 HcmV?d00001 diff --git a/miniprogram/images/btn_maintain_r.png b/miniprogram/images/btn_maintain_r.png new file mode 100644 index 0000000000000000000000000000000000000000..11d8ccbfd0cdc556ea7969212c7087f942bf24ac GIT binary patch literal 4339 zcmV0004QP)t-s0001U z)V6@zzFW?yJ-n7#%&2qRxIMg=W!A5N;J|<2zh&32J-e23+_*fumvh~@JieD^*04am zm^-?aK)skr!=6LHnnl5zLBE+})vjLBt4qb7VbiQUyOw6xus*z(Sk9+M!kk>ts#VOT zP{^WM&!{`Pl~c;3O~#;7$)iulp;yhOW!0`=)2v(1se0VJcG$Uj+q-Ymv~$isHecrxu*0*%oxp~>TZPT-L*0^rev}(|?OvRvV&$4vZ zw}IfmaMiVN)3tlty}tM5y!YgO-M)X`zkJ)gbJn-O_~wM*!FSfV();dv+q-Pgvey0Z z$@%Jg*}KO0=)(BtzV_tJ`s};(;?(@_!1m>V-oM-a^JC7f#P{dN`RUmG^3VJ2!uRHR z*t%ZJs)FIb#QEsA@!!k&>yYBepy<)1>eOb?ub1S^h~2_g$);-5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Zzp=TnXkYOI36|V{nc|+Ur9V-%SZp11NO-^N7jKDSUseEGWsEV7MDHbUuV4%?*!Y_OGr>N>T&o}pgAtFw+Y0Q zUFsus-82m^7hI9RWd)H~{CrVqNNCh# hpFOkQg!_P<{Rg#8$hx8~-(mm&002ovPDHLkV1g5p?EnA( literal 0 HcmV?d00001 diff --git a/miniprogram/images/btn_project_l.png b/miniprogram/images/btn_project_l.png new file mode 100644 index 0000000000000000000000000000000000000000..3c022a6f1e38d78412bf714ee6158871c5b412ac GIT binary patch literal 4691 zcmV-Z60GfsP)0004QP)t-s0001I z&aYO=rdZ0SJ-nAayq9X$vS!z?aoDzG)vrCgmpr?cKfISayOwCzvOK<*bJ)0M*05gD zt5C?IW!A4fyOw0tu0g(;KfRb^)U7+Zl}EyzL%*6nyq96qtWCzCMZud~(5ghhnrGLr zQpuxJ%A{J)s9)2pNy45>#h*sOoK(xDY0$D*&8J+?saMRVWX`W^(z8p%pGm}?R?Mbq z(XwaHv02WiV#}>(&aiFMv}DY#T*s+q&aY$4u3N^bV9Tsb#h`A~wOz@oUB{_k$*W(= ztHSr@TE?ip_T|9#=5N)uan`oV{OrT{=*Rf!a@M!X`Rcm$<6+ROZ`QTA^x@3??K`=a z(fjVj_~^>|>&W`**8T9!`s`fGslfQ=(*5tx`|Za0>8k72Ov0eN_2Yfpy;aGj&i(G) z{`1-X@`c^OQ^lln*tlQKt3|(@%>3+R(XO)a-B`(|Y16WH*}0?X(~{!JoafJs;KhKl z8Q}l`01|XkPE!E>Aqn@C$eNJq>f*@AS6AiY?m3*O000nzNkla|L*=giN+BBbe5C!%Z#1&KxX>kNQarCTXH?e ze?ILLpRdU+Vs5A8BloUha$SL+8iCz4cx zw1C|`-Qzp6I1j5r`(gRk(<_Pe0&eqVG0W%?S+DC?k$3aaqNDArH5Og9rn#GG|4_#b zo^w9S0*eGQ@*_St88m!r$;VhNs5^aX-61=B(0z87b2e`T7#66vp#l1ntdf-E~!-wP9{7Wh) zKIZ9M5z2-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e?XFz>7(=i#ve z715+CXBroM+Z#f3#_;?gwdQ4^V`5@e1yE<_&x z-_#7Z0tIHo%Zlz-`P=k!}M5jPs3E5WwMfUQ?D7D=jVvvkO*W`**HG5@lU?v;5vl|1{v$t*AD~m)11x*av|F3q?SyQLl%@pY8l+geG4|**?r)MQ2c;Z z^!sFA|Av{bUJ#@v24nrd7b|W7??OoLr090w-Ew><{+hFD8Y5?xj5g55&5il8Jl{;R zBn<5XSEd-JDtBEHWNcj^T#6D@^+a{+(i@~PjqnOERR`nH>7~cI*>MUdYALD zdRmBWjIfcc!9D1S4q(A(b7*LnP+tm;G*FBGkdnJ6Vs5Scf(!LHnJmE?Sx&XM_3!)>0 z;_H{QR@@Uznb!KYt6nJ-yI#>|LT#fz_TAn^$qxaD(drXtC$|~pMp4}Mq()Mbf$x)Y zVxZ&O3%M{m$IBp87cD3?R>CTqGd%~Y4jxstlbZ}mEmhbUZ+hlMwc*$I`OyH*C(M|3 Yi@9euP7^W&{#_`t!0nqGq{{67002OX!2kdN literal 0 HcmV?d00001 diff --git a/miniprogram/images/btn_reset.png b/miniprogram/images/btn_reset.png new file mode 100644 index 0000000000000000000000000000000000000000..2614c841e2a34b6acb59c6a04b1b1323b8dd68bd GIT binary patch literal 756 zcmVPx%u1Q2eR7gw3*GuS5c^t>_*S{eO8H<_7n8rqwQj^6jT#}6j(^$wQ8f7E7Bnzz6 zG!ePZghc)|MoOYwO0$t9Q;L%8EL^fdxn)R(zNg>w?>Npm&vWwpn_r#9^PKPb{@&+% z`TV}8NB7rQT*0Us*N-s+w~97B-RH3Ye_$3~m-ruu)7XZC{Q)!tTQL$R5ifZR=kcZj z=tr!@ef)y=xPabnL})%vq>X>Yaa_aDn&?O5rlxCGvJ3dZ?SKa00Opi9e}aivf}`nv zL?(U@#;_Wom-siOc2&-MI(gpMTCE7=raRqMduD~rZZ`DI<4!%UIp|O zB5l1`md>|0UaHpYoUCL(tMNPbAur=!;5#f&0$Fre1@tqXCCP{rKU6y!r)t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lgFMoqKI=o6ayy$51a78;|{~z>vcR4<34I|ukVPIL8^gRBSdCi?;qn8B@6ffsRm+= zkok|Rqkov{kbNklb#>;&e)!QtGg_B*Ss9Wz3rp`L-q2b~>quh?d%L{F6&o5?csYOB b!VvQdo%?bFZ{yCK00000NkvXXu0mjfVphjJ literal 0 HcmV?d00001 diff --git a/miniprogram/images/btn_upkeep_l.png b/miniprogram/images/btn_upkeep_l.png new file mode 100644 index 0000000000000000000000000000000000000000..74702ddf64b2658124476b254bcd978d297d5861 GIT binary patch literal 12959 zcmV;QGGNV#P)PyA07*naRCr$PeQU5~M|IxX`*G?XO?wu_)?`_-S ztwil*R1}v{)9$BYWaBN7yvslNV}3W^N6(#Z+P0;lD2RWm<_c=5m7l@(!7#a*q9D@E zb-(l9*{5A0;3djS%bHt ze>ekZ;hL=%v~gh4MFhrb1&o(8jM^JB|Ds!3v6@9or;gXrNT!poqIi6=r@Sd-y+&KC zJ3jsF+ZK!FVIsQR#2ZHIvtt@Z@}VV1Gv_>aJxde>`OT|%jN>x(8NRWizxUpiC!ZP9 z0{*XU6tup7(m6vs{i0kWO_b07wD~Y$T&WeSS~PU#cr%v&N6NCe?js+&^l$B6Mky9s zs^(1n(HOgcbd1um|yfx>nG}=0xHh76o<* zy%^q_bAO=&V3S!ZjjP!bu~HenHC0Qee^Coa6|<@) zUe(c(>uUjj6HRoEyE^9GrTbga??}2c>nMoy7NViWTiYmUO1D^dj;J@V_XE$1h#GP1Uimc<&&|ALBB#h&tw>=Gs|)|Wo{^lfcRzvBo0!{MP7+tqN4 z3kB;|^!{?Ef68$C z{s}eOTp4%JC>ILhkbe?-&OV?~1_m$AFx=jO7YK~$pBF`OV*eGFTohHTFMayiYuc** z?ih=JErug%j%0W%4pIzH@P?A@jVCuT1NEQz+*>18^bhcQm;ci>qKyO7PO&t`-^ltNeF~u@((&z0mY2abRKgEOuL78&#~^Z+ZIGwxy4%feqnq zFZXWA5Xf!cTk+joKd(OkZY(+e75(Ry{{pukn0B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RAQMSyT1) zB{xv_FUqBzBOANO;Qy(OjpB{hUw`p4NyXwJKXBKvPqa<*`{`AD=&JeKujo!$cZG3K zx+Q~Cw1UBnG-SfuDo~zrAFcr&#Wdl2AT<{ue}#Z){wA^>x=3+oKeVUt*VVdp`d$we96<!_dDny15kLH-@gwW&#oO5hG(&|J%e?rlyPtYn(-aRA(dAz7h6dtV z#mpGS->`L5$@e{7U&3Wg`h=LHcnH;linF5MS-8~nvnyy&ICGVc(klmr^*jP=UrTw0 z0>zumcyav#W}^osdRH&FUzNfCq9~4(=Z2jCU}W6bPz`&bg&6zZO=z$bO9y;`ID7+t~eJwMFz zK5o*^q7CnRwP?oizo6pr_4VQ=+frp)Eb|49xfcKY^zXH8^Rbp_pIR{TZZHH3xaVp@ zc-u>gL?=Acfd=_n6;;Nq9wX(W3Bi^$V%V6W`Rkw-g1!!SMozLbP<^Yrnvij zxmAR~itWwUOO*anr!?hStaC$uak41r7*TtSit;A~wGY1OO&34<%fDRAkJk6|002ovPDHLkV1kkb&wBs> literal 0 HcmV?d00001 diff --git a/miniprogram/images/btn_upkeep_r.png b/miniprogram/images/btn_upkeep_r.png new file mode 100644 index 0000000000000000000000000000000000000000..6697e420846e7ebb1689f503639dbf7051dbb5b8 GIT binary patch literal 4779 zcmV;c5>)MpP)KfRb{*RW*PuROb!V$`iczL`S5nqkweOU0jG(yT|rokhW% zUeT*Wz?(_Lo>k1HSIwtf(5h3*q)x}7P{^WL&Zt|@sZGY9QOToU$ggYAxI4O)XwJ8D z*S}!NuxQS;X3e!`&9h_5v0=!rWz4f<%d>COyKU0DY|*-5$+2qCw_3!ja@D?Y)4a_6 z?Zfxy$ocAV)V+1rzq<9~!T09C_vT#1t8vu3$oT2M_2tX^?8W%#T*RtU%A?Z!@5A}% z(EIJU^x}BgzsURRz4heP{qV~D?8W)%t?k*}{`AiL?acb@f7`xu*1XI4>t4&NT*sB{tFSFKoH2+wWabU?&9LoJxT^6cK1-pa@=lr%_4}CwpXX>Z%qPF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hg|7er literal 0 HcmV?d00001 diff --git a/miniprogram/images/cancel-icon.png b/miniprogram/images/cancel-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..2735122ad38b2f67a5cd4677360d609c905bfbf1 GIT binary patch literal 1643 zcmV-x29)`UP)Px*B}qg7#CiaLB~iGZPmR5WcSP&ow2UC-o%qLEYtW1%Y zQDiZkQv@cc)ISyZQqbT3oQ#Z|oNpjH2IRVa_+IPSUhqzNB_;``V~0{QUh37vn3Dq z^z^Lleel6Utsq+hRC$x|zYE|4e(FW3 zp`cKBq(zF%-JBRRNOCuT3k3MX6mY{5Yfp3nHq(|vLt#0c-bvs_kQ9+`hSrYGr8#E= zE4kbk9r-j#4`+k^{$UvznOX>3W8ac7n?QaKq^MMCeNZU;Vm9qr0n2yaz09Rj&jYwv zL<(UX=eq^gsFN7;Es_ri@GeEJjNZz?^@($0+h7& zk-JTRR|2J0&CKmH0L#YQ;>cY9j!#u8%P-uy^UZS+y}BlIx!#gXnaoQ7J}M%^VH|HemvD9Mk}+#Q?gj8xMX6<%77G8Vw>1GKT7Q+mlL8zLjvZUk z>8`(!!6aHAATS`n#>Q3M1X$Ag*8r}2FQa!x6h#h3ar~(>BFMqP3(A?yTL2cho}Tyj zZQFKqAra}culJv1GROSc9#*R#l=1O5rcbR?Qi(AGBo6?1A+q+9ojT}-eM#%50DOfa z-{_0uN1Fgkx!j#_ZU=yeB5T*5US-*AUm3WIKwmc?>KaO9Ql-;-dq+qA-Z0H0I8}^n ziLAY^8PJ$5AU7%CzQEcozLD$JElQ&3MZc=M3D=-C36a(H4Z5uLtqyot$lYPFcx&?% zYrTy?UPSU?92b0JNoya;o#zOyCaZw4z}jrhpE1{h+y`J^WbK-nIanZR0GP;H`+ot{ z`pW>G_P@y5Yi9!fkmNl|18!qkw6urRe%RVYrowDSjpu+Uv=(x0{kVkcA#BH-Ly-Ld6eW$An%BZ#aiy4j>z%#>lcSX z;0ptW)=h}BX(h%yLGo)LzaJHg_t$Nk%dJ!Q zh1UpVMC8UWj(_!D047?0hQOZzoD4-SmpJ~{tbo(gTr0x?yc+iRuUyEhKs$r;xtD1D z41g;k5=U{IYwUN%w!xvHbdpZ{rSC82KaZ@vy&XsMwJB?TzXSYL^jPTJav2-*71il) z)_tvH%oRfV0>) zw*WmHNxxHsjnzxrfZnjavrl*09!^f?WXF!lg+SJFE}QkMbhAI1W}aLf0ea(-*8bS@ zm!~uUUwYjWS^Jy$KqmS8YF4X11~A}X6(I71dfhjdUR!5tlFhD$$gXqX0{$RsD*4#=ll6 zk;6{p9gvP9OH$-AlB+0kHGrixd$J-TJA!n2vy6_u-3rdPw+&bqDeBQj{duyK6RUp0UO1WZ1zL`iNq?FkrA6q!)K5t1)gfdfmd peWeqqM%x7e&ev%t{my&9{{dEAokz{1%WVJv002ovPDHLkV1f*XCXoOD literal 0 HcmV?d00001 diff --git a/miniprogram/images/car.png b/miniprogram/images/car.png new file mode 100644 index 0000000000000000000000000000000000000000..24c41d4f618089afba921b0c4bd90dcec716c272 GIT binary patch literal 1239 zcmV;|1StE7P)2o z{EOGogghY? z4zRBI`S|qk@9XH}+Sk_9)6T}l!oakrp_Y}Ah<$fyWMfuLNiQl1_V%>556%Dp0>nu~ zK~zY`jgs|4B0&_#A0aK+-QBHsJ1#AVgosKAN7-k$XI%c}_l6B{UC_@DZ)U#l!!SF$ zAfakbHLUOL)eo!Ys-Oavss7~>`ll=)Pt|zSvV^8_*{x@^%Q9$Z-fw9Tn!h90mzUR( zU&7iT*;w6ax7#t_Johp@-t$d+flhU)S>09$H_wgjrWpOImIoA&gAsj}N_w(T`WmNn|yRQy4|q8Z&|%CHy3_80EB1{<=$lx2hV4S*=< z?1rhp4K);~j^X%Na!@Z%$#EZ183Ryiag2!Z&lAFP;uFINDq1C&Y&Msxm4hMg#xK-q%B zmT*=QXGCIzc=$JfN{bR;1jnSG``Yf~fub6S-*X>?KZ(i+04%zZ7*l~5H5LJ>!AWMf zyt$h}p#~_5dWXZ2UN2{^r?FkHfC5Gb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Mv>k*At4!F<@K3*fU9u5fIO- z+?SE*te4a$Vj++{!2W=qKf?{?W*eU6Y8#S{A;1sYl0`XFk%k^2Yf_4RHjTrSUZ)7jBkzfWC&NrQs za<4oF(&R%H$`fEx>ahcIcY(!{{Ke(2 zl)Z-I`Z7lAdo)eegNe`@`~*Foz}WNYP1( zNEVfGS-wn6F$~-XnqzrU`f4f)X0|BHm%#-vUgSJ4UME5q7N9H002ovPDHLkV1i@{TR8v# literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_cal.png b/miniprogram/images/icon_cal.png new file mode 100644 index 0000000000000000000000000000000000000000..0695cee74307053842176321d7883c65a12d7c50 GIT binary patch literal 535 zcmV+y0_gpTP)Px$(Md!>R9HvtSFwr{Q4~FA1SM4(u~AS6!6H?d8_>>9J1Yl7Vb@=aoaHS^*u>4uOLkxs^O{%8x%ZxX?tRR?M8$^{$H%`z zpx^J`_iDAB$HoBLQUfo~u$VPa-Q zQm@q_&N=Vb`#&_Zc_aUw1W108^lhya3&13=NxB`XK$)?ZeFc@^0Kn&xS=<8fG*p5A zya~6@aI3&pfvo~nDsVE8kbDxy@yjy*1h=1)X0!RT3=)IE;NoO5 z`4BRaEexfS9DtL3VADe~l4Jm`7Y?O9NTp->EXx&($wnfqy_jqiFMGaVsUzH@O7~!1D>OeUBcpg z0wMt--yQz_KR-oHSM%IsL;t-eb0^YS-g9JzW!40|}0{u7CiSW%9tWjEEEwjrd zXujZ~A4^;B3%Yb^Z20xI>^_&0C9Bv@`EJt-$Eu@Lwpgye@G?|viLcs~Z7S#Y@9}L- z3SzgMIe|N9Wn#oKAA^@0ZtPgEEF~ZNa))T?)DV-^MKNg2jR pb2nD)-!lLDzt6{iK6?E(%ePy0J4r-ARCr$PoC%Z_)tSft-*>BC)6F7_N?br(q9`f~B1T1VK?52y#u(9<=wxQ1 z(TL!viBS~PxDaJ=i<(J1Mi^rf9Wt53s0l(OZUF@pq6kVb!6hz8)34uBb-y{^t@rxv z?^QRPCZ0oKpC_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z(D#a1LH5;wk7H z_`JW=d-LbEbBTN{4s2=NymLEoB>bNND5eRYu~*wTOQvM0O#v3x@fBj;1?c+<+yT?M z0##}boKv>?MfI=FH-^wZq^2#N?&5=emo3!21m=TZtoB|&XI@%pRB5;UUZL)n9bvP< zJ}^1&Rr2Py{>3dOZk-L8sETNjNLq(XIjrA13~9nYA{<4KpY zL4W$> literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_customerFollow.png b/miniprogram/images/icon_customerFollow.png new file mode 100644 index 0000000000000000000000000000000000000000..0227c0b35a091caabb5fa12e7c27fc32904d54ee GIT binary patch literal 6957 zcmV+|8`9*7P)Py4=Sf6CRCr$HoC%mz)s=wHIrqL-OE)09f~a64B5GoS5FLhum}pcKjSD(6StrXx z3PM2wC}G$x`Fl_(0$Y9vt>rMs(Zd-tCC&V5zgRn@h1 z?D#R?ybr!^>fLwmeg8ZAI|V`ykKq^a6tvuo0AnrUI)!l2_NDl2J<|;P2FHouCPe;{ zjAzClSPNI|_%3$TbNxXV@FZrq6PS-;fb~o``|YLpbUoMh_89ERga^&wacucT0FHKE zhnQf4$Nc49+*oU_5i@u>So@W(ak4z#_ttmttF^8@@S8ju75oX98vr;r98*X*e*4|{ zTCMAQ`+SeU9Xx~YV73<*-#7px&VTD}yt>-vhF-!Aeh2SGUC}|`YITC6Jh+lo zEz}1NAO|k5sqU%$UjR4LEC+@H85+|yJDM~70EpyFcG1+Hn9S#Ar!bzVcTbaQhK z-0WbQwK;HrFXX|ExsZotRR|7CY@GJHz>S*KC2>U6!R6NP1lKe>d!n_K!2#l)&3Dqk zzYkUMRe0z{rc?lmMi9~28yDg#Crz_U!;#!jg!!AAl?z9j=J3C zaHKJ?dqt2+Hg4KAb%rBNv+a6jKHObT^o5p%_<;O==xlQXFm#g^L|V|&9EKyK=I~i) z?aFFkHr=Uu1 zEr^h6BN~*C(MDfvma{E(E(mbn#^zAf1a2Q|cL75fU?bexvQW)+P-gOIrTI_n0^rUE zmI9{nEzMy7+;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/icon_down.png new file mode 100644 index 0000000000000000000000000000000000000000..4fbc047b54d7824ed64b08f65cfb01b19dff153b GIT binary patch literal 1263 zcmVPx(sYygZR9HvVm}_VpRTRhn=T0^i5e+J>WG7n92f=`1vy;;7PH23zMH*351VKNl z5Eb$LqSoRgZ4(i-png;k#8$+J7^c9OvN0CW?;YHa|r0RD_Y?+$43biJ^30nW@WY%e&@9sqsyF67P6C_?P& z@9mt3Djx}OGP`hbjGea_xXo8gz!E?cL^zBBXOV9^(b4hSq8wjbyr=_h`EDqba2(!7 zgl!D82V@WBNZdb|==?PdG!*bi=4VYI@eu&;C|N?hmM7&vlm#S!++Z6Qh5V zTLw0%Uslss70|QXR}zj04l{P?n)*^BV5KsKX+2AXJWzP}7I40f=~??uFu(6XT6q%JR&tq&fYYXRFmNHBTPw>|vLt{P<^Kd6N@=Qp z^vhGr0KHK1x$kqjrrxoZma72yq3@H55IagkP#K_MTE~iUju%CH?8-(jMAS_cFHY`z z?{;T&P2C)nT?J@l7gAuyC{Ezry4LkV)P;$3BcvMRyZ+zB}#h#pEN;&1qq4AZ^=;Bf%wfW)hM zqVv&4AdT$87}$9Pz~2B3>00~?Ur#z~Kj<*O?tZU}b?a9btDt2coSC(D792|{fL-t~xJXA_>ylKmPPtFgUfl~pM%EqyvkM#r&IJs;BsIcJH6JU5B%+Zb z6uYr9Dx3=#3^Ryz`_0zsRA*KX)KMY*dG)|a86#tjgRrw|pmrxUnCi+dPK7vE>!y1> zPk5^H+DR`_*H1qDj{3C zz4r9(dLA%A;=N!y85Y3(@zCeDFhw<=fMc=ae)AKir`mYafQ>F3Rj%a$ Z{{bop)kizVP$vKY002ovPDHLkV1ivTR3QKW literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_filter.png b/miniprogram/images/icon_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..f8c8d086faea2a24f0b5dd14cfb0fb356232bb56 GIT binary patch literal 1237 zcmV;`1SPx(k4Z#9R9HvNm|biXRTRhnXJ%X55?hU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dY>$uq1IF;{BtTCsi8Z*Y- zaan-*hCAEL6JsJV7}{j_K4{-hxi^;y_+m34OccZz_<}(Dld<4uW&p|J!s-a1aWIdp zP7v_Ob%KQV^*QZ@k>kp@#&{(Gb3dF|jIoYZqU$`70nvycibHxPGgA0tML-}C3&otW z;Jl8vBk}<2Y&7H#mJnx+_`cVp;d71y76iQ=>f_Al1LMwx5CVkbL$R*iONCo@k}M|V z^ZBaus0QXT<5A+A7r>daMBXRe+ybM@4j zYbH-#HF@S5Aa~OAH9(QcP$>|5$}Er?AeuI7)x^0grp#J14X9uSRHe<@JH9}(#7lzw zf*C66f5!24SjxS4aq+^&4Redt#g5F*HRN{Cxd>EJ>FMGaqH+H2x#Ns220W}6`*S5H zA7=aYe##t`CrlOBck-<84bfe=x%pIC!{yC~k7Qp>4z#__rL8qD%kf5w&o!L~6QT^~ zK00*rrS$pbGk-;87lh2)s=}doKU?lV&hMhAch(xScA8z7VL5yIGnHBPwL0|+jlZ>b d{Nqn!*&{5)H{;&D6+lNYc)I$ztaD0e0stdCgo*$F literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_list.png b/miniprogram/images/icon_list.png new file mode 100644 index 0000000000000000000000000000000000000000..8dafe1df5b05983283dc2833e4f42788e064e878 GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U_3?xrvihTr9asfUeu0T3DyE!SV8A7Jy02xgQ z84U?p4M35<^@hnn6`UnOe!&bM>l3&gY!oC!bzU9>3R-)*IEHAPPwtr0$+hfKs7j!K zXosPQ=0c`YHZk##2L~K@GR)jq#b%W8ZtypZ^bP0l+XkKCjR&9`{g(JfAHl00YE{ZcA)x6|NSR|89;K< zAD~{KRKUbPKye@!geLw4q5u&2KXAfdAOf=eC;SeW^fwTKCjSMpfr3C?AZ3&O`cM4h zKMBePO99RK2QqUakc2S)0M&rFAoJm}KrKM@8$^Ok{^t+1`ZtgP7KhmawgO}$)Lw|y zAR7ZFfD8c|4kuv_1Bn3H5GjbO{7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8W#rE#GQ$WiUxF{A(515;zDDv)06c|j3yg!gme%>kKhDn7g9-ql>&E+_x@IaWdO7jB4 zi3G1MPp7^MS?51Js#=?zao-VmMO8z=qri%YDtzRoldrE7ne~(L-Dq-B8?%=4HOgaA zHj2GQIFoX$?M+Q$m&%p_85qZM`c(g$i^3p97`7a1ODWVGAkR%s-yO3|xjD|bX=_Wd z`{n>;Z0887yTeZRzs`$%*xG3ADd@Znl#eErZ=+n`-><-haj>s}2;5T->sz4t?)a$Y zq9;V#3(=PcGI?f`?VOJi+QSp@)|Y|_m(sDeMcLH`%}e5enUrv{(OPfvR32#Dc3yB* zyP~S;ABK;6{h?}8uEbvV8E9Ra zYLiQsXIF_NM}o>hPT}%ZX!3DGC8&p1D6egc1*A1K)@sSv?jAIEI7sy31iX7fcw>jM z>fZ8IK~To@Z@;W8Srh|G5_@ILc0N_rT|r`BoQAK?3JYuSh3fqYj`sOimfc&G$M260 zBqGNoV`tBzJRBr;xCc&;cpH{N_5KV;zYi{Rotuxp(XCiw*>G zJrrnY6b^kezwX0?erurZ{Xpe^~-4`8&=@y|oQ>aA2phtRb4L=dzGXZB+g6 z8@zX7epZSFmA}*>VP7~~&yUbG=wB|v&L0)(R@hfgjK!OsAA_y|nD{fkwM>G1vr}1A zTLIrB#<0>+DsD>2uTyYw60ZH@<)-EaSknTZ^uoDI!LZLhqCCGb5XdVXW_muw)lY5K zg%7%ep*F6Dz3qXS%PX!%aoqN!(w(UUwewNsxqxTGoc1G5gBEsy&Afp!8GdN=U-zZ! zm4h8n=aYiV8nnEXVzjVPpp0Wq{Q@IXu(%GMTnl$CESL0cVGGNus>wG{Rrd@sP*wF% zEV!Eu%wcL@GLdT6JM^V@6a7W%b`HS3TmS$707*qo IM6N<$g3PJ*!~g&Q literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_maintain1.png b/miniprogram/images/icon_maintain1.png new file mode 100644 index 0000000000000000000000000000000000000000..00dd9b8eabe6c6a75e439fac239e1ae3b1d7e470 GI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(b~6O})Z-J<4Z~0cM>>7&D5na{zd9i^L<(1J!szMAYa! z0<2Tf!iekzRO)551P?53O7w!MCCz%exFMGEnx(JH@)9y(T98E>RfiKiOYkBqN-W~E z_PEPzbBv2}r5^Ow=|c%mLz{Id5xMd$;#3bOmH}IY*2-%~ujJB$9OJ)M7Jqs>g^+(4 zaNMBALUND5>AW{O-YbsI9*+ug(axnK`t>}|Xr6V&+9C_dRpDwY!ckH_NorSNPU}eZ zREu$t7w}fJFt*xew<4&@IXAQ9)gTK!TcJv>u%TFIHouuArkdIg1wjwP*bbEv?_w3J z6`$$m4Vo1NHq(pMZ??W2DhA26p>8Ca#KuyQ9oGVlMx5e=8%KAYnKkg!2&T*?LL|!K_!PJ6m|^z z>u3tyni_|jFimuY^e!E7(bKCXxz|4r@nrW^5zW3qhkUk#H5gDJjcfb5+6=XBa_Dj@=kzu1VmeTKOPhK Ye|DvP{=r>i;s5{u07*qoM6N<$f~trLj{pDw literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_map.png b/miniprogram/images/icon_map.png new file mode 100644 index 0000000000000000000000000000000000000000..8df417cb7d1393f92ff05e420334e38327cb20db GIT binary patch literal 916 zcmeAS@N?(olHy`uVBq!ia0vp^Y9P$P3?%12mYf5mUIqAsxB}_a?AENThLo)4l-!o& z?Bhhj{MfET1tD&r}D_V}lt_gXqH*w-3{%D29 zTeS{Fn>^3-?{ZKLV}2tSyhlxKnT%wsfb)@v^?f~)*ws#|`X1PH>V%JaV2DEIfkzt! z&uDo4J#fH&&GXM+4=!J*bHKbuKeTPyIzGm}>i3KO3RZ|FvhIC3scCZfRl^^}`q%ET z%Oy_H_C8Y+$W<7xFm=<^#!2(VI9`=({IV}|=L1%!mNeg)94lJG-?zs(PCFVu*KYG+ z`{S3V-TlXNo$Zszyjr%0`weP#b*;T{v07k#UGknIo8Hc}jX8hJ+-uFYpO%?Y*Uhvp zg)g7U{2}r#_pA6r7mh#P`cU!yD>lt*IWf1-e>aHGH*kyU?X1WxsCV?*FlCmI^7eyQ z*nU`LHC}&|YOz)*tCVSF?jpZpr$5>`!a3f#wH*d0C62_`3&%@dxu31b^F`9-)?UL` zx#AXq8j5Q?Cb@pJwb>NIoA|&asmJ%*)1;KO9UFSI)$g=FuU!!8Dv`h7s=fa7=QmEY z%}fY5oW0|=;$kg^XL}C<)v$VQX1+Qvm2p$1cGP0Og|qUO>(B7{CA#-1*S4$g`!vng zWadT5r>rtI-?ZNc3$ZpRk+u6V=VRk(eF&`PV8m1lc7%AFTa_`!ev{Ii)0){2({ P6C8u5tDnm{r-UW|_#d)H literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_navigation.png b/miniprogram/images/icon_navigation.png new file mode 100644 index 0000000000000000000000000000000000000000..ede7e285499b59a9a8a637ed20e26a5847922fa3 GIT binary patch literal 1251 zcmV<91RVQ`P)Px(ok>JNRCr$9n?G)pF%ZRHBnnDO3M9xKC@7F16e+Px zu-4mu0o*E3I^Smis-UIzQSGVp&j38Cgvee3SnKUD#ZlZosY7I6BB0mX)P+zu=YKOi z{~N%)1n=?OU`)Kc>&<_J^)x7;=%CP+p#@tm!7v0prZxWuU!G? z4ROocX~fWYMnGDq4FteGOb5{8?c+_SX}D5yq8E&38`A*vdOH{5IS{#V&mj{+pWn6W zxr!hSXD;3%XzUn0O;7Q!wUk7U#>Z`1b-Odco)BlU(&}wh^tjSXhmR`&c08=JRj-w% zFSU)hUQP7UHoF1r(%Y#qis-ojm@Q~ZB&ed-1)xXJ80zZur5GI7X%W4&ZHhA^CoU)H zT7YA_Wmkob)iShJBXjjjnVuzj%>Z(uVs*${&=g3mqSpjKHGY=2Jw#6iV2zFV%e(Nl zGVaq%uNFmF4aiL?6teFF1+CU$e%>Q`as+UNlrACDG*aoTcb#6*OZ#I9{B{C6Qqwc(V{mDK-@3^P{7i)L@f$th+Yc70`77}#yoJ?Op#nqSY?*zDF9rq$XG{Ce7H3X zW{Tc40DO=YUMT>A`U&8+5f;jxo;t0zBw8*Jzz3RZ?Qj=w>Cq1WkB#2d^rF}B@O{%s zUN=M(9ry#_j$sXR2S&h}v%wZPLjmM;AOJ3neHt-i*=_E8c||}?2WlIy!IQ0-WJ?5? zJ71mv%pI3SALLtG1EXO$0Q2;9nGUUo*SvRep}AI3{Cqe7^9sr$aMraoCQ2L{rK31c zfgBEij<6m=Po}p=b2sy(c`Nk zkS%+W(*USCkTRgr=@MGmt|tWLw%IfQYi^m87DUSCtRj%p0MzpS)br|Uum-j!kkbID zLP!v*@d280jAsdCE=hBr21{%2)bndoU3EyrH&LepsD-O4T%{>a6-a`%j{LTw>zxOL z4wrPmbNfq)h8)D9Kb&mYC{+`gQoUNlS>N66S&oVTKJX)eH_Max`@OfDEwK+C)@IsJ z1TuW}VhD}|z=v_A_i(V`F%M-(T+*M>00ug|*mM99|8$u=lN5g-&=I?IJAVH^wUrr7G9h-pUZ>JU@ zqc7-DgH?c|$b%?<)C`h}gI1gSxInV#dq?h@A@vB#RJz5vtbJ;0;D&U6U>$@(~CanvU z&vH7<^-yh9;3F{y4bSa=|MgyVzqnt;*1Vy5@`?09CC@6x9R`gWyZQYmnPf5j4wIH+ zs7niL(B=NX$YHdZn>$=gfI%QV&EfN%c_wTMXYWS+zRDKFyd!P7T*vXU$<4RoS(1Nm zw5r#6ne+R@r;_wAw2$1nd@>38rzopr0PEs30{{R3 literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_plateNumber1.png b/miniprogram/images/icon_plateNumber1.png new file mode 100644 index 0000000000000000000000000000000000000000..f687740562064a60cc52dc14f57da6ac83cf67f9 GIT binary patch literal 1314 zcmV+-1>O3IP)Px(+(|@1RCr$PT>o*_Fbs7kDV+p53GD{n0J?!UpiDxUgfa=-`_AdPwq!~E@g-@J zJB~k^IQH|C^dvdojXSU52;2-G@f^^dpiUrx2~_X>rwMb|^pGKhSL*~tP`&rxopYa^ zb6>23e~|kDD*pWrApi^UVnL0p{Nqa|q#)yRiT@`p|Ehkq>^)eFy>WptvYd|D1kQMVBWoa8aQCQw@3E^b$h2 z7nvF(KA75iE%KxF`D;Jd6F1m^^^U0>paM)t4bsP48!7Gk;(8yPb1gAsI;gDE)-G_( z`@Hu6_J?r}Q$elD3*$srxxF#bnF=b*{&^KN2ENpLZ`I~gL1m@Iz%@@F%6o5>l2bty z)3)h|biSZ5Ku-k~OWLhpjesIZS>@GqPysAt)l>YxlRH;?96+|nsmpq~!pbO}dNmX_ z^r92g37cU86()g7KZ?^r4 z07V+EZUBmnzXjYzEw^`ev*o?o!qlK*kjBEpo`JoyFmzd{3DgLzHAmhnsLeHv7Elk- zX$>KmvFTwdq?Xhj;EL5P5)HEDZ_Lyn^;(t4B89N_TR}2*rQJ=tA(YA32^q_4Y>+V4 zKiRHCrSjiw`q;4Ssh^{w z@MxxrfGAvmX+hq5Zi7X(X9-RkfLCEEcQ!zrjF6p?o06C)fO?nNRM=WrOfnAKLXo#8 z8!nP#nD|#D0HRnHOqOiTB&`k(^g=sRk|<#{>1z|8FZ$xqpt9m$tL-W-pfLR`xN%_M z+-O>CCQaXapIR98t|2bK@sJGVYsgVm6*SV%}s7V#Z(2LjsXOq-cn~dDHkvhR1NSP zsClc}%-B&y>e{Yz!6i3Y&R^z|iDF@%I*$bP(&XzZQb);yfxa5fsgl|tra!EL(zgJn5rpV0ZSk9?VGk>F0?()T12h(Lu-GW%}UPl2!ChY|qb|K27h5h<%J*pUQt7z zKTKnzfGYLXv{T??d-S1g+S|K(+)pS`YdhMHeYKpT25zcu>h{R9?HQe*PS~Fl)Cr*e Y2lS;&ZvXQ{L;wH)07*qoM6N<$g7TDhn*aa+ literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_plateNumber_active.png b/miniprogram/images/icon_plateNumber_active.png new file mode 100644 index 0000000000000000000000000000000000000000..ab9d724f412c9e7bd392b7f389b01e9306a16c2e GIT binary patch literal 1319 zcmV+?1=#wDP)Px(;Ymb6RCr$PTv2kJFbp&&NplPS+MJ}}ByCSZdXlDp+@k48=;1|%?n+K=<626Nc;kkin;Stlrh+K=;h=iF!K z+!yQMALM?3ihsYSp#v7;#e(Wt`O7(XI(BAIdv(qY5_?Hd`*8*<0qAw52)s>0_m~5Q z0~LUt)!a2idYOi9;BHJn^*;2QX5^FK^E3?|+(B|tp#Hi1sERH>xWGk$I;)1fZhD=D z?nz{-kN99}>9xp@(&z8}+?u$-2CR2XT>&b1@!t7r*L8IbJ`*F5v^QNG((xT#;n-A5GvsFqq z1yxMjnj^CE1%&~+DX3V|Vg0HH6hX==ubP7jU?Ho1`2SaO=WdS!$PzhqTQ65wsijlz zhQf|sbb;DnGfbeuBv9!`aoXx<8q9rnL&DAd^yW`W$!t5tJ8}3NWE^L{Za}VXr-TTe zyv7PZk%p@qfMVls0k=@g9i825c`vsxHK-V*u<&qXU>_|ET^4Er)dOqIk&g;$aZRHH z)Khd?r=c@rvxcdVT2gm_D^{0CG{}~}K2w9#D^((k6vEmc1j)E6?Jn94p-je3$XH%u zgM_jE$#x|&mH%SX$BwlCm7S0w(1}b@0xMR~7+^O66;&P14B3dOlx1oeqZm)!=83FG z{TvmAYco{@MBxHV3+l(2+hCFHQGyc&;7ypyoedBtBV=dfrUWJmpx$LR8MY=C6O045 zkmT*bhKuB=CjJ!(fGCy)lOAQZAq( zs2booP~%p$nX$Es)VW>ff=g_&oWG1E6UD+fb*>5Ot;x5lNbMyL2Ks6^r%Gx|&v39f zsRdB%S29&&+OZQ)2HccBI1!jvdrD~BMMATZh7HH zzgN`I*ALU!D4OK!He@%R7$002ovPDHLkV1j5Ha#a8T literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_platenumber.png b/miniprogram/images/icon_platenumber.png new file mode 100644 index 0000000000000000000000000000000000000000..f6287406aaa1fab8db01661fbc0667e6547ffef9 GIT binary patch literal 806 zcmV+>1KIqEP)Px%;7LS5R7gwh)=NlKVH5}O|NomYwSo$Albb~6PB@$Lj*q!0Btb3Oge|01fo*Ej z3!;r+?TXT%B7`2)qJ=>&iV8PI){KMKL?KddGHnteT11*SGxs~;nC4@w85>%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o2AMYOSoT)$dF#*>FZY#q^K_pNJu z=vuZF_T@@={~m(icqCZ2VTzLO7LmOIv^59nj%729^_^cTY2y;WXxOSG+!&uBpP@3lCqoRIj!*(nOh4HC=y{nHbM}K1nVM&wa5)X z|H3gEheUL#(ue>DM;BDQxNh09+pajraVo}8wI7t78OY?a5{#x*`pFi5{gvB*dBvWy z19f9#=?6VzHhZm9I<4WZ3HW|3)uTdb?f(1WLA_GSm{@#)!QVoD^IWmrjGm`E0n0u6 Y2Zsv(EVIbF&j0`b07*qoM6N<$g59n*Bme*a literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_pw.png b/miniprogram/images/icon_pw.png new file mode 100644 index 0000000000000000000000000000000000000000..ee129fd8732bbbef9e5d96e206c6f17f48eec98a GIT binary patch literal 799 zcmV+)1K|9LP)Px%*-1n}R7gw3)munYaU2Km@9%$Rl1K%W*bTZP**zo3AorAR86{-)Qmsu%r&7>c z214}~6zVi|Yt>6;V1aGg(+o0*?iWM4KV*p&REVMO{C{zdnPzjI>9qgL2Iu$xe*U-f zKZHqc6shO(`VuL~^R#|!qIRdv+7U^HA@Gd%+6W(1&(xIxVo^Q%j4h2%w7OOTR{T+3~?1gw&|f#BoX9p z1}p%yEJ;K*r`>XCBy>dZoX3~a$7ms73K*RvlpLo$JrF9$8dKwXm5EyecCC*hW=%+s(&uyPyVcp}_!+O4UE!78_ZoeF-apG4-8 zqTKDLMmr4J^YWS-$B5{p_Fn<5&v#fJ4eu9nh81pK34jv-RHd(HZhn4NrxCEKsy;!D ziT$X1!0|$dRmX?6(4fbE9?UiXZwnpPB}TA;nhLk?4S>ZU@)p`H2S)@0fq?17>+Yj0 zkORgt0C50%0DOuB1TY6cEP!qhUXeuYiluR<&1Q2@%lR|Iiosb$m~Wtb$ZU16%G6Clu7fP0C9BH>f^0g7xqB7?U+6JphwLIurj&vM+aBmIerajIG;2ZkGcb~(1^ku6X#3J0x2m+%931>w zR5v9<$SVLRM;E15$l#vBydACm*Wr*>S68QW{D@yotWJ*x%A|ZxoYwU;J3Ct)$TNJ~ dM`Hk5#xKmwIxL6gJa_;A002ovPDHLkV1hHmc*6hy literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_reload.png b/miniprogram/images/icon_reload.png new file mode 100644 index 0000000000000000000000000000000000000000..6d58207dc9a8668b5f410e440ed1e301fdfbd58c GIT binary patch literal 1079 zcmV-71jze|P)Px&@kvBMR7gv`mT!m@br{FL&&;x?mgWf(gl5!Hc(;E}&P!*mi+gchT-45LE`(GN zm7ow2l92}WqU0zE3twoFZxo_5Z)Ow4dl9FwGbwF(vvLv{nC0njFca+HxsCyFt7Tz->RQ0Lc+yZ{SvN zM>>7zdM$9xK<$dA3c?Wp_xmYR4b4RX>OE)bzegf{_h8}tHz%^ro(rds->3qH)!35& z4H3{(6^QvJh|Ul&#()gMaxhk-mKGQT@n$f62q4T5@r?PsQ3h;Z8-GYh;tW7b%V5mE z0n+<7n#Kn!hoikGzF0WC5#SH1e4Zf0{OX96++PNas_`KPKUD$yDtob^me4-qNy|!g+_S?r*-Tg~*x!|t=nkzjF-kLF! zpO%0TRXYWsyC@{^NMP!6XF8pp_5*BFVl6UJ62QuuddAzfW$elWBWu<#gPgnM9e*Zz zCX>>S`+?LV7=1o1GV`-HHG9V!}WsWxP9ApgS9~4EY!H$RD%AnD3!Bz`#2m zzyaGdUY-jus>Zhp=8uU$AR4e!dcI}(48yAS3IY2)fJ?S%thifX%bNa03#8x`5EkTP zFvNs#noE0WNR2-tfiHLg%u-Lr8a#P7(6AEUM8x|%-pTBEaIw2v%`SXJ`w4^&kI1r3 zqw7wVhU;|?>VV^%2e7O(6QF|`Q-7&c(wU_Ze;(k&6&dZcO=HI$WJwWK`xd|kkB243 z6K5^MECUwSqx(|viVF>Y4}fR{R+Pm2o8-82@Ir;|ux%QNvMDY8h;}{KCRnlvSXgFa zxJTA@+tPoiDsdtqhyTj12Z@~ov{d-65^}3YtfQA}0`pmR#bPXIkO)#`Mhsjb;1n^& zW`>VffTV7K%g@glIW-{X%1F>_3zIknRFGmq|T?i2F39!~D zrzkr%jp;4t&10qA#TT$BDon4tuXZ-Lz2yL$Akb$crasi@1N~nA(9!kmgASx_2zpe? xUxeWhiND>8upH!*XNUE1Kb7ze^b^dF=0ADbcr3p;7J>i(002ovPDHLkV1hIt|G)qM literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_search.png b/miniprogram/images/icon_search.png new file mode 100644 index 0000000000000000000000000000000000000000..687f7437972faeac0a3b43790e20c903cfefac64 GIT binary patch literal 1322 zcmV+_1=aeAP)Px(ijlWm=8Kp3 zPoiH-%nJ;x>|Vs9IGZ{hwb*n1_x;`EMnV1p()_ zCU-)y$d$zd*hgwt^@PCd2by_4-`V_5y(*bVE{Cvzz*KKwLcHG{3M?KKzy~6BnFHOH zBF_K{dnF(X54G^8QcmjDYfX~QKB~_0?oTmhX}pndmRg_xJV(Jh>UHweNzQ3Nr)7)_ z*!!2r+}Uh``=3pgiY>#4eFP(j9yx0|qELq!2&wgal6l!B>ai}m}P%@)6Q z$3Q_Wi8lw{DI0KhOR`RYxM#0inms6(7jFvmln)rbSRt^?t~qH)uAwUP?({fL#*CTJQm)64>l z?8!^_m;kzvk9OMC6l|gknfXT)0RbbsJ&KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^j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$%qXwTJU=-kS z2WcjBB~BHXk`Rm@Tf6GXwrO===4nFR#%{Xu9FisvkD_hgLsSKd-%XO$fg-RdVHhpK zpViC*FE5*VmQdw>y4w6-G7pcV9gkN8Ld)}nbRZ2(0yFMX7-DQk4TVVLPj;N=N!8c0 zx&VosYKgUR#stbhI-nD|xqzVqA5f1iR)Bd4&G1sKt2`yQcRI%lZKzK-sT2?a!uOZS zPESzQ13KYa<7?C01TIR>GkoMLDhX~k^PnHDy0@n^5dQfp;k!%3fUJJ$0@2+nPNh!C zamWF8Bh($07*qoM6N<$ Eg8yAK^#A|> literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_select.png b/miniprogram/images/icon_select.png new file mode 100644 index 0000000000000000000000000000000000000000..b35d5151e92b3a98d4f4e42552fc69447c7f6f96 GIT binary patch literal 3954 zcmV-&4~_7NP)KLZ*U+5Lu!Sk^o_Z5E4Meg@_7P6crJiNL9pw)e1;Xm069{HJUZAPk55R%$-RIA z6-eL&AQ0xu!e<4=008gy@A0LT~suv4>S3ILP<0Bm`DLLvaF4FK%)Nj?Pt*r}7;7Xa9z9H|HZjR63e zC`Tj$K)V27Re@400>HumpsYY5E(E}?0f1SyGDiY{y#)Yvj#!WnKwtoXnL;eg03bL5 z07D)V%>y7z1E4U{zu>7~aD})?0RX_umCct+(lZpemCzb@^6=o|A>zVpu|i=NDG+7} zl4`aK{0#b-!z=TL9Wt0BGO&T{GJWpjryhdijfaIQ&2!o}p04JRKYg3k&Tf zVxhe-O!X z{f;To;xw^bEES6JSc$k$B2CA6xl)ltA<32E66t?3@gJ7`36pmX0IY^jz)rRYwaaY4 ze(nJRiw;=Qb^t(r^DT@T3y}a2XEZW-_W%Hszxj_qD**t_m!#tW0KDiJT&R>6OvVTR z07RgHDzHHZ48atvzz&?j9lXF70$~P3Knx_nJP<+#`N z#-MZ2bTkiLfR>_b(HgWKJ%F~Nr_oF3b#wrIijHG|(J>BYjM-sajE6;FiC7vY#};Gd zST$CUHDeuEH+B^pz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644 index 0000000000000000000000000000000000000000..a6c2dd53e54664ddac1935f42719e5dd2b2006b4 GIT binary patch literal 1091 zcmV-J1ibr+P)?00001b5ch_0Itp) z=>Px&{YgYYR9Hvtm|KWjRTPH*wG$>&G)~5%^+oU!uQS6WXP*Q@rHn74=$l{_9~5mX z)YA5`6@`jaP!MmWR>d2LPve6X!3&mokdB(Ol9{oFqP}TG6ooQEn#=4Z8-G1SmzU4{TNxWz(R4a} zt5WK90JjC8&H*?K;5lZl4GP>hXfm0MO-xKY0pI|Du?`^LE2Vbj^ZAp5!1e{|y6&8a z90PDuAowo;egv=$K%_Y*B8G_GuphhkgN@#g_N0<2qzH4%9+7K%$(~8sX19TrO65eURQkIKF*`eZV>BAwE+Tt~=*q_P519GEk$_H5Pj89E zV)k@-{;1IiY(Fo0(6HF-MBU;+O5dW+*k+1nL1K@4|mkk=dlYip^?FRtI8n-SN9F?tq z=#@?`m)lgWRzvOj{g`sOTrZVM)iD2|0fYtab$$c1SH;5Y{{iWf^*D7Af>i(j002ov JPDHLkV1hB=5vTwF literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_tabbar_hs.png b/miniprogram/images/icon_tabbar_hs.png new file mode 100644 index 0000000000000000000000000000000000000000..720a29c47a9cff14eb86ef2dc671b38b6e46314b GIT binary patch literal 1092 zcmV-K1iSl*P)Px&{z*hZR9Hvtm|tiUSro>!Rm3=A;Vufl^5fqgb zLECJRv`*JT1&gS-DEgq{AJimTQ4mDYM@5!>5LQ`ML{OH6f+$#PlbIuvWTrEdnPk#h z^})O)x%cFEzjMxa&xH8KUK|fklP-x#n$b#f2?$Y85A$!3zSGb5V~smzpr3o?7ctG_ zpv<;{6ao<-`3jU>xA(;c#sXC{&`-TXvy_=Q1~J#r0pk<8A+iE(B&N|zh{&2{Y9XZaRHDG zj&F?SxY*V~3ROr)B!&IPN?gu##9B)V<*!oEQlr_`=0nxetdP#M$JRMO5VW`z@}Dv^ zh2eKu@v;q3xGcUxI_n2=`9$F9KbsE)H%U61bSdOd*%$F4udf9Fxfhfdou}0!by*Z2 zveyLGkPY}D-H^Qn-QmxC1zn)XX9;Yoc->S}C_v(i_w`tte}-u}ER)~9$4u+<5d;4P4PVWD#u-31dq!UWRaC1F zSr;I{P7~_L1D*Mx;i?Q)m%0yi*h3n~Zo`us zO_aHt!nr|nc)++jZXe1i;x7Q!*fI#Epb4f6Wg&q@0Ae*=Mc;j>+C1e}Xn87sNr2X` zIu9vc%(QE5_Qcptk)E$Q4^i|?N4%#1v@9h*62{*o>cZT2V&@@_7|7KRBooh_r;f&y zu|tUC*1sx_Df({z37Ut5iaWFI+DYfB!}gMfZdt9tNI|d^MBH)K33x6eF#_U|2IbIL0(=7hvr05<&%SN|0000< KMNUMnLSTXEeU literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_tabbar_n.png b/miniprogram/images/icon_tabbar_n.png new file mode 100644 index 0000000000000000000000000000000000000000..e947d0b6c0a74b39952294e9f198b5794c541012 GIT binary patch literal 1035 zcmV+m1oZofP)?00001b5ch_0Itp) z=>Px&#Ysd#R9Hvtm`!LTMHI*Xue;O9K!UJrP*7QwXk=!UbgD;*2SE@IA|8Y+EW!#a zvVwvh{5b7p4|-9&D5!|KprD8c!Gj;50hLkHRbhri*xfM;!4+I&FM(MyJ>74qWjeIu zbWcsPJutBE*!AA4U%yw?RsAQ7iP5#}h0PIx04uGG-Fg)I9G|n$AEtOiW)*X)HSWy(&wrwu~cpbnE-I%77^3I_^g%I}u zXe2>IbTkNp&+=Ncyu560Zf@>wCMjhEKyRo_^L_sWGrya1I3%Uq>KD+r^`7TFY+2U# zCJ6>@g1qtGg2ZuLU0YiVj6sDEj{x{K3Fve>w+!h z6}=AHQ>Q{Js!ymWiryxo+f7@X@;eiT;d6~feOKNP-3g%FI39ofkwgcy&r zer#?}sr%@E1PQ~ndv;{^Q9~djx9hv!s7ymR?Yp823kwg}w*5 zaP@+st<&iouGj0kzt8C;eSeoLmCAvssi}VeI9=zjUDrKQtJN+W5g0hl&(F_HPfvdZ zK*MTlxvqOKYmPjT>`P{TA~mPhpZ@6To(3qnE?T3i0636%Y5htm^>kKLCaC9mhb+rl z?bS5*OPCS=*Urw4zrMb%yV%!qh1~99{~W;Kf&g_|tq>krU0vPGn`4mTtYhuP#l=U7 z=s^Gn0qiPv`+(Qdx)vdRR7z=$iwEU00UeZMB;#WPdIe?~jYmKONY?-W002ovPDHLk FV1iih=S~0s literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_tabbar_ns.png b/miniprogram/images/icon_tabbar_ns.png new file mode 100644 index 0000000000000000000000000000000000000000..43944b6d07af50d1cbf1179f5e10f0cdb1662cb3 GIT binary patch literal 1280 zcmV+b1^@bqP)Px(x=BPqR9HvVSW9SJRT%!h|J(^l11%JVs0ejoB8tV*mF+}}ix#nIirVTz@Uc+4 zFoHTWu_n!|OjN}9ShN;gSfrv8M+8ypqXi+_O+iH(2u0ku5TT+mubFd?oICg4+}zBa z%uFUFy$sBKoqxXbKfeF_huGi;TZM1$Yo>GYKX~@81#lZMo6pl-tNpqF?#Y{W0NW_& z41RFd#q{|+|G9fu4~Uo%A+{<3L;yv=QJfLDCyP1fd5~uRtLA1$W3ydP2MgN8@1N!P z?`j*U39$F5xeiLdOyV$!P4;DP0qw`^E0vtTA^Jxppa+hC{k8xtP)EFXA1!8`_xnc6 zUjf)lZ!JKg1ma5?l`H0WF$riQz;xbpL%U}QbA7~UU>pXxuTLKEgvB&X~>uP$mlPx2tipC&Tuj=BJ*hsz(q;83MnBMI#%cRYud z6;YKOtNA?KIDaW*)%Lmo?)CxNoLb?jBo8%tKk&AoL4dR#j8Z}*#7UlA&XY@?uM|PT zX8mw92e3+rg*XkUagoKjcsSaU*tQK2&6Efq2AGNQpqEDt1GG7~f}nwgj%(DGF9x`< zT8m10-an=<0_K)zZZ`$chB#i0Alx>p8^6x;k7fYcp1!$V|3;u|T>w@>!zmG*qJbA; z+jD~>JoQh!FH72$TuuR|9|pVPk!g(w*O>YN{7+SRPCdmEQyK_?4WC zh4`V6aXbo&9##MPNDu4hV9e`RbS@@N7BbG0bpgEdrP&*VZPP+@Bo#xe?t4)pjc7Mr z7)(vp1<<~9*D?L9>zeU!L|n(Yn8fjktaGHALaO}-<}v*Y4MsuJ8L!$#Js7MH*Ht!L z7MgL{<_vy(n7UzrcEO(fOc!*=gNEi-5S^CGqVnEegx6u)^5uUp-9@H6e=?kh!6k@H qe46E@TH3Ov2b&S4tzNU?0sap`(vvvzBu$3^0000Px%@JU2LR7gv;mR(2`Q547j=T0hykb($VkU>EfzLby^g+2s1n_vo|6-4ZqwX+&Q z5IqN;~`*IhB%b!Jzbhk3dG zbAIRCd(ORwVC7>bSGT_$kdA`62tW=PQy>}vIDnbi8%}4%gcVn0ChGL{Z=Kgg4}e|E zXeWv2f@+t$%=|42bo;b|ppNGNGR+)C)|;J*tzkKBT%g^ z58~Ox1$KC}O9s%A2rQxk@ub;n} z*|ex)2E;h$tg&6Q40O96uMbN4w`8&l*$|;owcDC30~-eh)?|-P&j65;ff8^=Rcvm{ zz>v`8)rP=0kPJ|e*yga8en|+}?hPDg=G%z^iD*c*%f$(|1;W=^;29Vt2|%X>i#?8- z(hrFP0d(B)XBji%DVTSfLK%OA5LFI)>7%4>ny680Yj1k$x{MYup9PQ>+Zhd$!4CDb z?VVX*miw&D`!H9qR1OlmnK=iN{V1=)0x1xazx~nPQ|}0rScDXJ(QIW0nA)o=z9* zPso!?)&FGJ*&W!fGi%JqGus-A>tie#wz^YgpZ`0<>o@y1=t1!sz($MCEXf%7nyO1h zwUI4e%+Tf0?g6N@FT8o66eKpP)SAP6i*3=~<OYC)oq!FeELfhhyv6o4ec!a&85%3jjQ zyf6=j#zNK!m@|MW022Z<&fqtOPCfOt@@Po)7pD&gEEh2KbN~PV07*qoM6N<$f`vtP AzyJUM literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_up.png b/miniprogram/images/icon_up.png new file mode 100644 index 0000000000000000000000000000000000000000..e6edef93635a5df15220db60ae8df71f438d28d2 GIT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yRuu905PWdHZ%NI=&^1m!Qi|kytwf9o9mJk1b3wM7v zE#3O42&7fbBL>C=QRC(j^Nj>-|JRyF<$lq!?YBzj^~%$`qcku<;=S^6GHg%}Y`+C9 v)UX8{iyilipP+T>&954;S;b-HS|0Ep>Za6399U=o00000NkvXXu0mjfhjm2W literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_upload.png b/miniprogram/images/icon_upload.png new file mode 100644 index 0000000000000000000000000000000000000000..e1683bae13fbe2d7d3cfcd3bfe8b0d9cb1ecbd71 GIT binary patch literal 861 zcmV-j1ETziP)Px&7fD1xR9Hvtn6YjXK@f)j*>j8pAvBcf(jm%7B%QGn6og1cQb3usG|*6hZ;wz= zAn^jUP$V>n6p3Uz?i_>=Pe2zQASi&6cz4h`IcM*D=kxgtwotCU+1YRZnVsDo!iaw~ z;(Qo=z&WqEKFTUm$!qdCU?6p6lr`7!(kPi^TlADm z;8t`J0qwBHIcCsbgX{_z6;=QZAsne$uY>u@nUd_)+_7{y=`~jl*xC3b=||M!TT0sZ zLHn{06V}E7I}66)+zXyzt+#@Zy(?Mtlq9fg7VP_sf{X-Ag7Y2q3u(dmu3{lO0DrQx zJx(gTAz~e*g^Ymf3K_nzt^#7k)HzG;t|2gX9gsx(N*`XY%Zq`_Zx^^&$S|Nu)`>K5 z9pN^mL92y|%B4(>bljWq~wYE z-!551*X-Pks=raTiAP;OP~kCV;>+TAs#4B>_5XD{AZ*)z0vNT(IKZ&&Ibd9h^rfIV zxU;rCDsFDMm%J^l@jc&8so%TdQ^)@|@a|UC%?-5YIQoEtZeZFWELp+LwK0olpanv}MgZPwoZ1)Vj)!}{llL<2 nzX61Bma5O_y;*cXK_dPG5L%NdNc#VX00000NkvXXu0mjf3iOvW literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_vehicleDispatch.png b/miniprogram/images/icon_vehicleDispatch.png new file mode 100644 index 0000000000000000000000000000000000000000..76c9277e882c158ceda3f27fabfe469a75913c7d GIT binary patch literal 2933 zcm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+|I%%<>gUNXn%O$Px&y-7qtR9HvNm}zWGQ547jXWpBVQ0okuGPV$nB|=NIQa&{82TLs_8X|n41c``* zPsA6ANJN6v5+Oo}qSg8Lo3W1s!bU)4Oxjk$Ez3$EuOqm+8!#0puEMyAlTQKq5L^>ys*$6X{N)94CGs3>AdKIK;pNr^)R86VUAOU`wXY zTkW7{{`)m^Zz-rBBw#%=JA%7`B_d|vxbBm-jwWg~8)LfAhY#!z$=WS2a@;J`Z5=|L zSCi*uWRRLTwhNGe(PXWLxo0kNf+Rw-tjYO_P;o$po3xt$W|^+$sMCFNeyscAfD~0b z3g$AW-6i!u(XoJE-VmL$11NHun5vQyz*UXFokn12e_+iVz}L@u3nI`x#D&q*7XcD^ zW|pcwH#^$T6yVf7!q;E%lgb`o>L|wg0>CSE{=4!RxKZC}_`!XF9mNd49Td>~&@WFC zc`7pUy{fIyna`W;W80aoFtK`T=Q8rMj4z2WQ9UaWUU%n6lQd&ay0pythtu41t zLB-jOML9s_W8iv>WfJESP&P^a_EYN^BI%`7IdB6saRjip(m8id9M0Ij zz%rgVElnOvimGn_hs&+h+yIH7J$cs|$d}I8zslx}l4m2mQ?;|qys{@ig;RiC6@=Qz19z*C_2@#zmMGe)1G0jS8-7$g|ww`3^Ove0afchQSca8A*r@8Ke>5L^a95NW8 zf!?)fDuaDisz+`EPhOe3!$ZLC5=NkXv=x*qm`D&)kdzj!72sZ0K$;FbcmaG#*tskL zQv&FKiH?szUGH??!s(2~PL}CdoZ1|L{-sR(ZUY+L7@2z9uq7}3ayyp<@XEo@XNrJ8&Jm2%f00hLl0#i;92>M9+DN~y<& x*prYl&oQx3DfM8Lm^Vc2lRVx+{!dSOe*she28BX;(`f(z002ovPDHLkV1m;~-p2p{ literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_workbench1.png b/miniprogram/images/icon_workbench1.png new file mode 100644 index 0000000000000000000000000000000000000000..ac6b384baccab0016da778e868e255f3e82a46df GIT binary patch literal 2395 zcmWkv3pmu-8y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+)hKoO;aaQRFCmyjN)Nn#^gJ%`F7lRO@PJl z7L7MO{K)CKE#HjCQ^ebT@7|VL?v-*eie7l|o}iy;wl7MC{}N>25QNsIKjEkKy~M68 zOH(|BG>6;H1)IvelU&Veg?h!=Ix)j5+ke1^8GaCUnxiH9X&wO%#w3B*IcltDC8$f7 z->+lR{$5+(=c%=sTScI>EN#FdPT1FGc5`!8DrrXh%!rk}_ANG#XeJnI{^8%~FxkiF z@=Ej|Z=GvN6~*EbmqgCNmxWACAK$+b(|$MO?Wct^ce%qg%u;Da2%2^I+}kYI=~Fuo z<~xr^PD{$RG%&dRZxRx6nP`cvef~WU4Znh(&*qMI*xm-VoQPKZQubm03#$)&942EE z9QBxcOy8j@&o(nAJ6l)eg~ug6Mn;Q^i_yK(Uh=8(PMl<-39J84$Y5#a&cb!|G1N^5 zzQsAe(f#9&+eQ0aP9yNJU9$#d68fjt+6^bC<0-z~);rEKnkX8g7L;qaR()tc>Mz&K zh+J#`4ZSz5yb{6Dh+tHp_o-Ky8(Q~nfurV38!VRkc$aRS;e&%|54|TjqasYmJB z&ooD1@7CEZG>}Hy&W;grx+zY%AOE=Q&yLvEp_mfw+gLUa{D@oD)lII@ja2^=D0jRE JuF5$u`9I7qDS!X~ literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_workbench2.png b/miniprogram/images/icon_workbench2.png new file mode 100644 index 0000000000000000000000000000000000000000..b5410818fc3ce515f2c83e26b0133ba17408024a GIT binary patch literal 2612 zcmXw42|QH$7az>Cm6DVeyh4^tyEbB!T^b=h>tdS>-hW-^)jft{ z&bdg81!(($s`JE~vsi;7CP2^rNRjkd%5%H&iDaNvs8Tp9A-2$kj{)LyM8si$t^^ zVS|7bJ|6rqECQ!X7B%=vn8rJuqz2j(e zKWd+fxIM)vBk2w6n2Xy{jA>;TN@D=>D{wdvAq0X8c`%BiM?xSqKUm`tr0N47dI%r+ z3pyGKsr$o99>_jV_*fXM;tgxY@J~cQx{rB#?qIB8{dAtvd?gb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(_5{g1M_z+~8l^&KVcd7+%k0SdXh%T|$r5juE|DeBTo z11=l5lu%CnvL?*w@QyoWK_Cg05!Pmw#dqAr6ww#-kg_HYjpE(=B_&}2W+gX3_xB?;ei)hX?s`( zd1KQSQA@E+4Onan^;6Bj#8{i+xuy>o3l$tsK>e`rVPEk|>I-aB-}%1zb5ra$RkhWN z;q_kHXDi|*n~Fy+pU?5nSC+hXbBUG$eEVwE6CpJNirZ(W{ce0p;ZVS2-z(&!1?`(6 zVq%DIb|%=n)Tud)~)juQSQkNV4iFfIR&Ot>bnnL1e zKqCeHy6&}x9Jh(TGzYR=aRSjR-zp_;wz|98tj6zddKsb--F-Ct^TnIN!3B(v#;q5v zO#VyVI=S+g-q9A46gHfHn%~{ryL33%J`xeJt;^`OOcOg_JY%SO3xFMo+uIXCB3*QM z=lOkQ>`JTqtbO;l_Mz|27!q$yiBP%aD#;ceQ+5PpnG;dVT< zO|@YP1A=BeKkEr|S@H2j6aH2EBknu$onVI(92bLKQPHY9Wp1gDYt3_m_(w<)+m4&g zKe3L_b`)Mz>S2Q4G(J@?WoEKiCQSH=1!L|NV2+u>_KyYjp3 z@^$3_L}Ji_YV%*)r>3UJ;9HXnQQ!+FL+@>1p3}~SakJJ?vA9)qW>%Si@djfzUn)wPtVHqTmp<&FXjc z?#8%03SK-gZ?s>~eXQ$Jr|Grx)WZr2`Pshu>L&Z>`L8CI`F?%Z4L#iJ52SM~r|SJG zj#W6tZl_rO7I*AR#FYti?)Yn_R<<_tte@KVu6ix@#UnoYR%xdQVXsDg5}RdKpUxz4 z^$4`gEBf?5=O>QNgE`p(uLjNqnM}Qtsg>-w-lj>pt$Te2JI{s{H6~l{IQrQ*Y-05= v-6xq4mfWZxB@W{L(RoNz-JUnn*$Ho|#eHPrD;VAAPl_SfIop<7U#I*7c|cPM literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_workbench5.png b/miniprogram/images/icon_workbench5.png new file mode 100644 index 0000000000000000000000000000000000000000..efd2fcf1f880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3r1UApJ#m7Dvo_Z`2SU61q#IKC2gp)86A`xhs#F-|67?{@Zge#0+8DQ$P&pV0(9tfTB+duLt-2HE zaq6TZz~)h}WTRgI1q;nSI7^^!cD(9}5s2vMMM+O0k%$qJpp^RIALwWduO8I%q9447 z>s7~ReZG+(Dz*WxFWxqXqTz@6|JZ(G=rwN_*8#RsFgOwn`Up&~uPsiJSV^@4NiR&p z-;aR@kN-UeG;cD{N>#|4TwGgE6X**DN4}wAyS9K)Z)0~TM($QXjwfu8f@Xj$@3#F4usNmeVU-QhKcc7yTPohLz=%)~bzHmw+WL=JX@CZ8Q8gzW~z zc~R?a4)|h|(TSCWxJaEfk&`V<*By`Hc7>O&3vD|gZtbKCc(S4c0h;DfN&+G3v+2~p znJ|&tk$UNQ5w4rgba(_xc?89jIO2RM#Ue}{$M^Lt%M8PakcTDjspy)4vP}1V$4SG5 zkW0x&%2Q&+xs)OdK`K*M>Wea1I%(jrCZy!NYCUE)95*hPL@IOcLwy+r=1L~>WhZwcHE;r-l?aGZLDb*c+Xj7Q3MLLdv9hdEGUZ7 zVn5ZCg{I|NoBa^&x3x2Qt`%j&x~li(IY-)C<>*}QYxdvY_6@w)eHQbu$HV{t002ov JPDHLkV1m4b`mg{1 literal 0 HcmV?d00001 diff --git a/miniprogram/images/icon_workbench6.png b/miniprogram/images/icon_workbench6.png new file mode 100644 index 0000000000000000000000000000000000000000..1d58c99383430140e27ca15f6845d7257c545fe9 GIT binary patch literal 2689 zcmV-{3V!v8P)w&Glcv_m-!!T|1Ny}N16FZn)o7c{~l`pN}l*WkNZua z_%D6^HHG{rcK$$;`8J3AJdXQ2jQkyF|5A+SF@F6WY5z%_`9qfaLX-Jgr}$Nk=N)MN zPNDfZi2O>2=Wek3KalxAlKW7g_&SOFg1P%)sQK~s{!yIuc(nUZo%Htk|4o$eO_=gg zo%Cj_`AC}iioN?&p7wUK`dy~^QKR^HtNlKY`AwJfPMr6W!213E|NQ;`@%H~nhvt{Q z_o2r7r_1|Rj^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 HcmV?d00001 diff --git a/miniprogram/images/info-bottom.png b/miniprogram/images/info-bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..793981c46b69cc5e54655f0a104dddb55a80e95e GIT binary patch literal 337 zcmV-X0j~auP)Px$3rR#lRA@u(+p%o|K@>&N`y=BXsKFuvns5h>ota`FBc=nI07sTN6A7Bk^fY0b>Y^_azEilfR-Bb!F zP*~s#c#epVi@{X^c0bQ0xN{{~c$yepfqVkp%5UB;zb@iU0iH{63B2VqFp&ZZ6ct!S z#Nv1MzY1^)?2AGfTLA^~3CtqmeP{u82P21k1}0KKfuaJB5%FyS79D+KD^OhEt^#xm zTzs||Ux8!-cWr?^1W7jf#!;ZSz_3FQufY_bCdOAFr@;T$V7v&ObL35>fC49h+l$aX jg>z~spgPx$%t=H+RA@u(+P_NzVHgMS?{k*@z|w*!5TX{T7LkTp8lvWg<{G20f1v(?`Ui4p zthI*bqM@aR1{V#Ngb<3LR3y~WCtd;}(tNLou)a4Q&wF?8hr92+@4Y7g5MD`!97nex zms)x&nD9j;mGKjPH)8#002#^jv^Gf>D416rg~efC7(Nk!gvnCJrE2 zv}?vH3Q&Lo6sQR(4kfad$hn=u5A~EVIh@02{}cROWq3rXN&yN`pd|$=RYA7sMf#x| zmp6Xg<~!W8yTi$v)Zvr$r zS3qd++2Xh?p#TLa(7FPtyLQA*e9eQ@Oy_MEmX>E;FgsCcT@_wA1t>rP7XqgV5BAR5 z8n&n{ESZXCzc`Hy2)36T7pDhA-iE@eU;AFl_VnZZ!{_HW^TR~f#(o9q`wtoR{ud{k zWXxnTJE|JBsbviXC_sU~A|N8MU@*A;S%0j)oMyAxq^ge98yT1pqs`l*(a4hR>Bsx0 z`D~5PPyLzMPv?i@I9Gu{VEo%5S}vE1s_JUp|F67>*bfR&;QtDUNXhH_f(H$@KwyJQfZ)EkyGwqa z_p86UYG$hLoxZ2RfDlzM=T& ztH=YYM`?Ef00w}XqMTuX^`TWDgx09>Y4k9EfQ8L5zq)!9)iLNpB*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`ckN7)?d4`B2AsyGD0~&zrZ_+n)Da@c2M;>4lXfqFV^jhlP3n6SE+AoZivbeh zcqAWiD{09ac-xQMHdOQZ(CZ9ga_MjbL} zvmhk^RPBN&Qe=%aQz3Cag??15y;<8j{22IAPBzBv@{`<1scXCHX-L&|m;w+@ZJ&&?;R;mlzCSrU?XBDjOrny#Qc@ zv0Q+v3lG-9HCBd)R*_0CT*RJSM*+|!jxOD5X4F?=sB-!GN{zMVl)HDJ6_rKYrtz55!2@f05Rxo!*~AyZ@0y6GygvS00000NkvXX Hu0mjfy?-e? literal 0 HcmV?d00001 diff --git a/miniprogram/images/num_subtract.png b/miniprogram/images/num_subtract.png new file mode 100644 index 0000000000000000000000000000000000000000..11faa13cec937224d491dcab05381a219fb7c7e7 GIT binary patch literal 1169 zcmV;C1aA9@P)Px(OG!jQRCr$Pn`=%RF%W>qNjOBMpu!yrQl;|9Nr008Cjm}EAeAbS-hm(@^%7a8 z@;=J0Gqz{e-bb439}w(%J>NV$9?vS+@=I;G{ICPCvw$rp(3%T8{`zyES&v35{qtP^ zu9W(!eW0SSW=L05EM5NOS;&(1_|n zDM+;*dKEBEj`nXt$15?e|V0(GCR*xqVK|=1eSwkHqhycvyORae$LN{abK0q!Ar^n+%-}A-) z*#P<^d|5au_fQJ%e|#HXaUie&Jijb2l>!~{%U7#rZxcpa!roqTy}n%HgcA?A0A9;M zNBf$@%s83|xrd5P+&Ovy(AwwG4G~KEEVVQv!qw^V_}(=Z2S7#p691A45qiIwm2#}W z34jVPCr4v1v`|6nK2IlT?p4Yu%=62#qJ4mFmOKd%(`9{D;IV)umS5gy?HBX3Sb=p# zumUhi_SyGM3t7)u?3QZBryu}a^Pw#utr_YHuCul;wTV_;fJ;v*M4R_> z-T1%F1GXN3xsw%Tg4B*`lTu;rYO{HDCo2Mw4^SzAZ}MiywUc#hhSrX{H)cP;^?$8s zD*)3CBuPk{(cY4bv3Ih*ijZ*<#7~L4f*`G9`f7re1CcssZ*7AxgP*UC=>$L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DCC(CUCOg1^=*P6fjfdC z9s0*WyCDL$`$Aw{Z(}l2pUClY&gOq3V19iLxoZuX(YyxJuy%UZmni%;0KLGzz3Yq& zyEShGPsZU0HvFnVI9R&w$mhnLuk-6?IzeKyq{l-?^SSZ-xT zqpsVeSX?(4z;Q6@3@}nXF}u?B#GnROQ>&tc$>(rWDy^J$lRUWy<1K4M5}-^7LO%a` ze6YymGBq$e_?3MO#MU`Zv{g@2b58BJ;HcHGO=oaruqAlS4J!UUH#@TO%~*x;OMRs~ zCwSAUw{qJxGVmX;;)imCXU&FZNI>Nr!>N& zgaPwmOdjs(i}Ho3<2sB^QZ07O08umN;~-CQSa;WtixMgn`I@T>oXU5o@jc`J@>cW+ z=Ky^L_iaNaETTq^W(y>sVQbu+Zf;G|FZo0-l zSiif1T-6-sax=l3c1~*?x6zF{V+hMKW%A|T{-Ur^nQL~sm_YP#i4*0`L?0V`*Dv4o zySt1eJN`K8OoKCpdo(V*8sTFme^e)+Hb2R7?RN8;JFT%lw!Z4E0jZ?=vo~!}s}IL? zyno#v8S#G9_egkdqpjD?D4~;cT)zF5wR%(XY!$T6O7ps+-n|v#ZRq>akMHlng)>8eJ0D(zMYRzXWVn9O_2_3lAyOVgQ`^IMsN!ZEu4?zd-rN{|zIx-lYHl literal 0 HcmV?d00001 diff --git a/miniprogram/images/wechat.png b/miniprogram/images/wechat.png new file mode 100644 index 0000000000000000000000000000000000000000..976fbdf9cedf98e13bed393403580f6ab4c49ad5 GIT binary patch literal 2644 zcmV-a3aj;rP)Px<4oO5oRCwC$U3+X4MHnB`?(9{JL4$8&eB&dENQ|!-U(u*h1cO9~Cis>=jNl`h z_@Iek4Mt5c+9<{cMnn=dLMYwaD~hxriabj|1x2V*Xt6@otI)E3zb#h}yLY#HH#0kX z-7lH6X?JILzTbY|e6N{dOn0)_Afw*6uqw&NC2U?zZBD{A8|mlTMAH1Z%I59#`(8Bn zclz6b|26hr%d0uvYuLtc^u=NdNcHSUZt+p3ZM;ehUX@7lo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VQ{^0Kt!u7*^@h* zy-6D;`TBzYA3Ow@`D(j@1}Xut*vb~ZOZcRo9rZ;-Rcs2j$#;0hi^2JlX3b>Q7L!{+ zpF$^f(V4>RcFi|e3w0D>!QqSaOEo{e&?hB`SrvMhjDv}WIm(Y;;{|*P60$~0rAc-h z?{i>&=r)Qmq0laUI^FQ|4};E6w>6W!`$2 zyAS4G7CoO0iTb|nh%2FrQM7c(Si0aYi_UoGxut|pFNY0YpvK@p7E^2NwO%pfl&al0 zK+)D3DjUA+%a>p31|<EssmdEfp4vPBcOmTo55;cA zuc&^jOaZA8e_X{}RzVKqqL{&f&k$Jz-pM+vaB$Qziy=$Kdhkr{VPJIDIPLVmEoOMZ z(-5{LY<7~GvkPs09zw@4<8w;JZl2=jD?O>L(yqKJKB>(Uj6L8@I0s8EGDeVS?udc- z&(|=L#s%S@gKL|cV#(k?=yRlZJv%O{1rmZnB45+dP)F%?eD?}wn3gdkils!QR2))a z$PA2K-vjQgiZKIYvgaKwpusn5bV@<9yEK6ODmIXbLNLQnR+$JPii~IC*`bF#bhXSV zN_q|~nMBH*3F#4;I!0f;Qb2vvGw`fvTTEe)#ReI+F`UY0#*vDvrZ$JZ>PGsxws&hO z-tJDm)ZE|cZ|?tW_nJ8bz;m1yRJsx{pB<|EaQ_8+PGai$3>`uM0000 { + let arr: any = []; + for (let i = 0; i < item.length; i++) { + arr.push({ remark: '' }); + } + data.validateObj.baseInfo.partList.push(arr); + }); + } + // 获取巡检模板数据 + else if (fieldname == 'inspectionTemplateId') { + data.inspectionTemplatePartList = this.changeTemplate( + detail.value.partList, + 'name', + 'content', + 'normal' + ); + data.validateObj.inspectionTaskInfo.partList = []; + data.inspectionTemplatePartList.forEach((item: any) => { + let arr: any = []; + for (let i = 0; i < item.length; i++) { + arr.push({ remark: '' }); + } + data.validateObj.inspectionTaskInfo.partList.push(arr); + }); + } + + this.setData(data); + this.hidePicker(); + }, + // 选中满意度 + pleasedStatusPickerConfirm(event: any) { + let data: any = this.data; + data.customerFollowTemplatePartList[data.currentIndex.index][ + data.currentIndex.idx + ].pleasedStatus = event.detail.value.value; + this.setData(data); + this.hidePicker(); + }, + // 是否正常单选 + templateOnChange(event: any) { + let { index, idx } = event.currentTarget.dataset; + let data: any = this.data; + data.inspectionTemplatePartList[index][idx].normal = event.detail; + this.setData(data); + }, + // 巡检车辆结果单选 + vehicleOnChange(event: any) { + let { index } = event.currentTarget.dataset; + let data: any = this.data; + data.vehicleList[index].isNormal = event.detail; + this.setData(data); + }, + // 车辆异常备注 + vehicleRemarkChange(event: any) { + let { index } = event.currentTarget.dataset; + let data: any = this.data; + data.vehicleList[index].abnormalMsg = event.detail.value; + let regex = /[!@#$%^&*?><|\\\\]/; + let spaceRegex = new RegExp(/\s+/g); + let message = ''; + // 有填写内容,校验特殊字符 + if (event.detail.value) { + if (regex.test(event.detail.value)) { + message = '不支持特殊字符'; + } else if (spaceRegex.test(event.detail.value)) + message = '不支持含有空格'; + else if (event.detail.value.length > 200) + message = '输入长度不得超过200个字符'; + } + data.validateObj.inspectionTaskInfo.vehicles[index].remark = message; + this.setData(data); + }, + // 删除车辆 + deleteVehicle(event: any) { + let { index } = event.currentTarget.dataset; + let data: any = this.data; + data.vehicleList.splice(index, 1); + data.validateObj.inspectionTaskInfo.vehicles.splice(index, 1); + this.setData(data); + }, + // 重置车辆 + resetVehicle() { + let data: any = this.data; + // 将删除的数据恢复 + data.originVehicleList.forEach((item: any, index: number) => { + let res = data.vehicleList.some((el: any) => { + return el.vehicleId == item.vehicleId; + }); + if (!res) { + data.vehicleList.splice(index, 0, item); + data.validateObj.inspectionTaskInfo.vehicles.splice(index, 0, { + remark: '' + }); + } + }); + this.setData(data); + }, + // 模板数据格式修改(提交改为编辑) + changeTemplate(data: any, name: string, childNmae: string, status: string) { + let arr = [] as any; + if (data.length > 0) { + data.forEach((item: any) => { + let res = { + [name]: item[name], + [childNmae]: item[childNmae], + [status]: this.data.isEdit ? item[status] : '1', + remark: this.data.isEdit ? item.remark : '' + }; + // 没数据时,放第一位 + if (arr.length == 0) { + arr.push([res]); + } + // 按某个字段分类模板 + else { + let result = false; + for (const el of arr) { + // 存在相同数据 + if (el[0][name] == item[name]) { + el.push(res); + result = true; + break; + } + } + // 存在不同 + if (!result) { + arr.push([res]); + } + } + }); + } + return arr; + }, + // 模板数据格式修改(编辑改为提交) + changeTemplate2(data: any) { + let arr: any = []; + + return arr; + }, + // 项目过滤 + filterProject(event: any) { + let list = [] as any; + this.data.projectList.forEach((item: any) => { + if (item.text.toLowerCase().indexOf(event.detail.toLowerCase()) >= 0) { + list.push(item); + } + }); + this.setData({ + filterProjectList: list, + projectSearchVal: event.detail + }); + }, + // 处理人过滤 + filterUser(event: any) { + let list = [] as any; + this.data.userList.forEach((item: any) => { + if (item.text.toLowerCase().indexOf(event.detail.toLowerCase()) >= 0) { + list.push(item); + } + }); + this.setData({ + filterUserList: list, + userSearchVal: event.detail + }); + }, + // 回访人过滤 + filterReviewUser(event: any) { + let list = [] as any; + this.data.reviewUserList.forEach((item: any) => { + if (item.text.toLowerCase().indexOf(event.detail.toLowerCase()) >= 0) { + list.push(item); + } + }); + this.setData({ + filterReviewUserList: list, + reviewUserSearchVal: event.detail + }); + }, + // 回访模板过滤 + filterCustomerFollowTemplate(event: any) { + let list = [] as any; + this.data.customerFollowTemplateList.forEach((item: any) => { + if (item.text.toLowerCase().indexOf(event.detail.toLowerCase()) >= 0) { + list.push(item); + } + }); + this.setData({ + filterCustomerFollowTemplateList: list, + customerFollowTemplateSearchVal: event.detail + }); + }, + //下拉框切换是否展示 + pickerChange(event: any) { + let { fieldname, index, idx } = event.currentTarget.dataset; + let data: any = { ...this.data }; + data.showList[fieldname] = true; + // 选中的是满意度 + if (fieldname == 'pleasedStatusShow') { + let currentIndex = { + index, + idx + }; + data.currentIndex = currentIndex; + } + this.setData(data); + }, + // 关闭下拉选择/日期选择 + hidePicker() { + let keys = Object.keys(this.data.showList); + let list = this.data.showList as any; + keys.forEach(item => { + list[item] = false; + }); + this.setData({ + showList: list + }); + }, + // input输入 + inputChange(event: any) { + let { fieldname, type, require, texttype } = event.currentTarget.dataset; + let data: any = this.data; + let result = event.detail.value; + let regex = /[!@#$%^&*?><|\\\\]/; + let phoneRegex = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/; + let spaceRegex = new RegExp(/\s+/g); + let message = ''; + // 有填写内容,校验特殊字符 + if (result && regex.test(result)) { + message = '不支持特殊字符'; + } else if (spaceRegex.test(result)) message = '不支持含有空格'; + else if (texttype != 'textarea' && result.length > 32) + message = '输入长度不得超过32个字符'; + else if (texttype == 'textarea' && result.length > 500) + message = '输入长度不得超过500个字符'; + else if (result && fieldname == 'phone' && !phoneRegex.test(result)) { + message = '联系电话格式错误'; + } + // 没有填写内容且不为必填 + else if (!result && require != 'norequire') { + message = '请填写必填项'; + } else if (result) { + message = ''; + } + if (type) { + data.params[type][fieldname] = result; + } else { + data.params[fieldname] = result; + } + if (type) { + if ( + Object.prototype.hasOwnProperty.call( + data.requireObj[type + 'Info'], + fieldname + ) + ) + data.requireObj[type + 'Info'][fieldname] = message; + if ( + Object.prototype.hasOwnProperty.call( + data.validateObj[type + 'Info'], + fieldname + ) + ) + data.validateObj[type + 'Info'][fieldname] = message; + } else { + if ( + Object.prototype.hasOwnProperty.call( + data.requireObj.baseInfo, + fieldname + ) + ) + data.requireObj.baseInfo[fieldname] = message; + if ( + Object.prototype.hasOwnProperty.call( + data.validateObj.baseInfo, + fieldname + ) + ) + data.validateObj.baseInfo[fieldname] = message; + } + this.setData(data); + }, + // 模板备注输入 + partListRemarkChange(event: any) { + let { fieldname, index, idx } = event.currentTarget.dataset; + // let idx = event.currentTarget.dataset.index + let data: any = this.data; + data[fieldname][index][idx].remark = event.detail.value; + let message = ''; + if (event.detail.value) { + let regex = /[!@#$%^&*?><|\\\\]/; + let spaceRegex = new RegExp(/\s+/g); + if (regex.test(event.detail.value)) message = '不支持特殊字符'; + else if (spaceRegex.test(event.detail.value)) message = '不支持含有空格'; + else if (event.detail.value.length > 200) + message = '输入长度不得超过200个字符'; + } else message = ''; + if (fieldname == 'customerFollowTemplatePartList') + data.validateObj.baseInfo.partList[index][idx].remark = message; + if (fieldname == 'inspectionTemplatePartList') + data.validateObj.inspectionTaskInfo.partList[index][idx].remark = message; + this.setData(data); + }, + // 文件上传 + fileAfterRead(event: any) { + const file = event.detail; + let index: any = event.detail.index; + let { list, type } = event.currentTarget.dataset; + let data: any = this.data; + let option = { + name: 'file', + filePath: event.detail.file.url + }; + data[list][index] = { + status: 'uploading', + message: '上传中' + }; + data.uploading = true; + this.setData(data); + upload('api/customerFollow/upload', option) + .then((res: any) => { + let tempData = JSON.parse(res.data); + if (!tempData.success) { + wx.showToast({ + title: tempData.message, + icon: 'none' + }); + data[list][index] = { + status: 'failed', + message: '上传失败' + }; + data.uploading = false; + this.setData(data); + return; + } + data[list][index] = { + ...file, + url: tempData.message, + status: 'done', + message: '上传完成' + }; + console.log(data[list]); + + data.uploading = false; + // 地址拼接 + let fileUrl; + if (type) { + fileUrl = data.params[type].fileUrl + ? data.params[type].fileUrl + ',' + tempData.message + : tempData.message; + data.params[type].fileUrl = fileUrl; + } else { + fileUrl = data.params.fileUrl + ? data.params.fileUrl + ',' + tempData.message + : tempData.message; + data.params.fileUrl = fileUrl; + } + this.setData(data); + }) + .catch(err => { + data.uploading = false; + }); + }, + // 删除文件 + deleteFile(event: any) { + let { list, type } = event.currentTarget.dataset; + let data: any = this.data; + let index = event.detail.index; + data[list].splice(index, 1); + if (data.params[type]?.fileUrl) { + data.params[type].fileUrl = data[list] + .map((item: any) => { + return item.url; + }) + .join(','); + } else if (data.params.fileUrl) { + data.params.fileUrl = data[list] + .map((item: any) => { + return item.url; + }) + .join(','); + } + this.setData(data); + }, + // 校验 + validateFn() { + let data: any = this.data; + let result = true; + // 校验基础信息和回访信息 + let baseInfoKeys = Object.keys(data.requireObj.baseInfo); + baseInfoKeys.forEach((item: any) => { + if (data.requireObj.baseInfo[item]) result = false; + if (!data.params[item]) { + data.requireObj.baseInfo[item] = '请填写必填项'; + result = false; + } + }); + // 校验车辆巡检 + if (data.contentItem.inspectionTask) { + let inspectionTaskKeys = Object.keys(data.requireObj.inspectionTaskInfo); + inspectionTaskKeys.forEach((item: any) => { + // 没有填写异常处理 + if ( + !data.contentItem.handle && + (item == 'handlePlan' || item == 'handleType' || item == 'handleTime') + ) + return; + if (data.requireObj.inspectionTaskInfo[item]) result = false; + if (!data.params.inspectionTask[item]) { + data.requireObj.inspectionTaskInfo[item] = '请填写必填项'; + result = false; + return; + } + // 处理方案 + if (data.contentItem.handle && item == 'handlePlan') { + let regex = /[!@#$%^&*?><|\\\\]/; + let spaceRegex = new RegExp(/\s+/g); + let message = ''; + // 有填写内容,校验特殊字符 + if (result && regex.test(data.params.inspectionTask[item])) { + message = '不支持特殊字符'; + result = false; + } else if (spaceRegex.test(data.params.inspectionTask[item])) { + message = '不支持含有空格'; + result = false; + } else if (data.params.inspectionTask[item].length > 500) { + message = '输入长度不得超过500个字符'; + result = false; + } + data.requireObj.inspectionTaskInfo[item] = message; + } + }); + } + // 校验意见反馈 + if (data.contentItem.opinion) { + let opinionKeys = Object.keys(data.requireObj.opinionInfo); + opinionKeys.forEach((item: any) => { + if (data.requireObj.opinionInfo[item]) result = false; + if (!data.params.opinion[item]) { + data.requireObj.opinionInfo[item] = '请填写必填项'; + result = false; + } + }); + } + // 校验非必填特殊字符 + if ( + data.validateObj.baseInfo.remark || + data.validateObj.inspectionTaskInfo.remark || + data.validateObj.opinionInfo.remark + ) + result = false; + // 模板校验 + for (const item of data.validateObj.baseInfo.partList) { + let res = item.some((el: any) => { + return el.remark !== ''; + }); + if (res) { + result = false; + break; + } + } + for (const item of data.validateObj.inspectionTaskInfo.partList) { + let res = item.some((el: any) => { + return el.remark !== ''; + }); + if (res) { + result = false; + break; + } + } + // 车辆校验 + for (const item of data.validateObj.inspectionTaskInfo.vehicles) { + if (item.remark != '') { + result = false; + break; + } + } + this.setData(data); + return result; + }, + // 校验文件 + checkFile() { + let { baseInfoFileList, inspectionTaskFileList, opinionFileList } = + this.data; + let result = true; + if ( + baseInfoFileList && + baseInfoFileList.some((item: any) => { + return item.status == 'failed'; + }) + ) + result = false; + if ( + inspectionTaskFileList && + inspectionTaskFileList.some((item: any) => { + return item.status == 'failed'; + }) + ) + result = false; + if ( + opinionFileList && + opinionFileList.some((item: any) => { + return item.status == 'failed'; + }) + ) + result = false; + return result; + }, + // 提交 + formSubmit() { + // 防止重复提交 + if (this.data.isSubmit) return; + // 校验 + if (!this.validateFn()) return; + // 校验文件是否正在上传 + if (this.data.uploading) { + wx.showToast({ + title: '文件上传中,请稍后', + icon: 'none' + }); + return; + } + // 校验是否有错误文件 + if (!this.checkFile()) { + wx.showToast({ + title: '请删除错误文件', + icon: 'none' + }); + return; + } + let params: any = JSON.parse(JSON.stringify(this.data.params)); + // 回访模板 + params.partList = [].concat(...this.data.customerFollowTemplatePartList); + // 有勾选车辆巡检 + if (this.data.contentItem.inspectionTask) { + // 巡检模板 + params.inspectionTask.partList = [].concat( + ...this.data.inspectionTemplatePartList + ); + // 车辆信息 + params.inspectionTask.vehicles = this.data.vehicleList; + params.inspectionTask.attachment = params.inspectionTask.fileUrl; + delete params.inspectionTask.fileUrl; + } else { + delete params.inspectionTask; + } + // 没有有勾选意见反馈 + if (!this.data.contentItem.opinion) { + delete params.opinion; + } + // 没有填写异常处理 + if (!this.data.contentItem.handle && params.inspectionTask) { + params.inspectionTask.handlePlan = ''; + params.inspectionTask.handleType = ''; + params.inspectionTask.handleTime = ''; + } + wx.showLoading({ + title: '加载中' + }); + this.setData({ + isSubmit: true + }); + let url, action; + // 编辑 + if (this.data.isEdit) { + url = 'api/customerFollow/edit'; + action = putAction; + } + // 新增 + else { + url = 'api/customerFollow/add'; + action = postAction; + delete params.id; + } + action(url, params) + .then((res: any) => { + wx.hideLoading(); + if (res.code == 200) { + wx.showToast({ + title: '提交成功', + icon: 'success' + }); + if (this.data.isEdit) { + setTimeout(() => { + wx.navigateTo({ + url: '../../../pages/backlog/backlogFeedback/backlogFeedback', + fail: e => { + console.log(e); + } + }); + this.setData({ + isSubmit: false + }); + wx.hideToast(); + }, 1000); + } else { + setTimeout(() => { + wx.navigateBack({ + delta: 1 + }); + this.setData({ + isSubmit: false + }); + wx.hideToast(); + }, 1000); + } + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + this.setData({ + isSubmit: false + }); + } + }) + .catch(err => { + console.log(err); + this.setData({ + isSubmit: false + }); + }); + }, + // 获取项目 + getProjectOptions() { + getAction('api/projects/list').then((res: any) => { + if (res.code == 200) { + let arr = [] as any; + res.result.forEach((item: any, index: number) => { + arr.push({ + text: item.projectName, + value: item.id + }); + }); + this.setData({ + projectList: arr, + filterProjectList: arr + }); + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + } + }); + }, + // 获取用户 + getUser() { + getAction('api/sys/user/list?pageSize=-1&pageNo=1').then((res: any) => { + if (res.success) { + let arr = [] as any; + res.result.records.forEach((item: any, index: number) => { + arr.push({ + text: item.realname, + value: item.id + }); + }); + this.setData({ + userList: arr, + reviewUserList: arr, + filterUserList: arr, + filterReviewUserList: arr + }); + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + } + }); + }, + // 获取客户回访模板 + getCustomerFollowTemplate() { + getAction('api/customerFollowTemplate/list?pageNo=1&pageSize=-1').then( + (res: any) => { + if (res.success) { + let arr = [] as any; + res.result.records.forEach((item: any, index: number) => { + arr.push({ + text: item.name, + value: item.id, + partList: item.partList + }); + }); + this.setData({ + customerFollowTemplateList: arr, + filterCustomerFollowTemplateList: arr + }); + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + } + } + ); + }, + // 获取巡检模板模板 + getInspectionTemplate() { + getAction('api/inspectionTemplate/list?pageNo=1&pageSize=-1').then( + (res: any) => { + if (res.success) { + let arr = [] as any; + res.result.records.forEach((item: any, index: number) => { + arr.push({ + text: item.name, + value: item.id, + partList: item.projectList + }); + }); + this.setData({ + inspectionTemplateList: arr, + filterInspectionTemplateList: arr + }); + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + } + } + ); + }, + // 获取车辆数据 + getVehicle(projectId: any) { + getAction( + `api/vehicle/listByProjectId?pageSize=-1&pageNo=1&projectId=${projectId}` + ).then((res: any) => { + if (res.success) { + let arr: any = []; + let validate: any = []; + let data: any = this.data; + res.result.forEach((item: any) => { + arr.push({ + vehicleId: item.id, + plateNumber: item.plateNumber, + isNormal: '1', + abnormalMsg: '' + }); + validate.push({ remark: '' }); + }); + data.vehicleList = JSON.parse(JSON.stringify(arr)); + data.originVehicleList = JSON.parse(JSON.stringify(arr)); + data.validateObj.inspectionTaskInfo.vehicles = validate; + this.setData({ + vehicleList: arr, + originVehicleList: JSON.parse(JSON.stringify(arr)) + }); + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + } + }); + }, + // 获取字典 + getDict() { + getAction('api/sys/dict/queryAllDictItems').then((res: any) => { + let result: any = res.result; + this.setData({ + reviewTypeList: result.review_type, // 回访方式 + resultStatusList: result.result_status, // 回访结果 + opinionStatusList: result.opinion_status, // 回访结果(编辑状态用) + inspectionResultList: result.inspection_result, // 巡检结果 + opinionTypeList: result.opinion_type // 意见分类 + }); + }); + }, + getInf() { + let info = wx.getStorageSync('customerFollowData'); + let data: any = this.data; + wx.removeStorageSync('customerFollowData'); + if (info) { + getAction(`api/vehicles/backlog/getFollowInfoById?id=${info}`).then( + (res: any) => { + let result: any = res.result; + // 编辑模式 + data.isEdit = true; + // 勾选 + if (result.inspectionTask) data.contentItem.inspectionTask = true; + if (result.opinion) data.contentItem.opinion = true; + // 基本信息和回访信息 + for (const key in data.params) { + if ( + key != 'inspectionTask' && + key != 'opinion' && + key != 'partList' + ) { + data.params[key] = result[key]; + } + } + // 翻译 + data.dictTextList.projectId_dictText = result.projectId_dictText; + data.dictTextList.reviewType_dictText = result.reviewType_dictText; + data.dictTextList.reviewUserId_dictText = + result.reviewUserId_dictText; + data.dictTextList.resultStatus_dictText = + result.resultStatus_dictText; + data.dictTextList.customerFollowTemplate_dictText = + result.templateId_dictText; + // 如果回访结果是未开始,清空 + if (result.resultStatus === '0') { + data.params.resultStatus = ''; + data.dictTextList.resultStatus_dictText = ''; + } + // 回访模板 + data.customerFollowTemplatePartList = this.changeTemplate( + result.partList, + 'categoryName', + 'followName', + 'pleasedStatus' + ); + // 回访模板校验 + data.validateObj.baseInfo.partList = []; + data.customerFollowTemplatePartList.forEach((item: any) => { + let arr: any = []; + for (let i = 0; i < item.length; i++) { + arr.push({ remark: '' }); + } + data.validateObj.baseInfo.partList.push(arr); + }); + // 回访附件 + data.baseInfoFileList = this.changeUrl(result.fileUrl); + // 车辆巡检 + if (result.inspectionTask) { + for (const key in data.params.inspectionTask) { + data.params.inspectionTask[key] = result.inspectionTask[key]; + } + // 巡检附件 + data.inspectionTaskFileList = this.changeUrl( + result.inspectionTask.attachment + ); + // 翻译 + data.dictTextList.inspectionTemplate_dictText = + result.inspectionTask.inspectionTemplateId_dictText; + data.dictTextList.inspectionResult_dictText = + result.inspectionTask.inspectionResult_dictText; + // 车辆数据 + data.vehicleList = result.inspectionTask.vehicleList; + // 巡检模板 + data.inspectionTemplatePartList = this.changeTemplate( + result.inspectionTask.partList, + 'name', + 'content', + 'normal' + ); + // 异常处理 + if (result.inspectionTask.inspectionResult === '0') + data.contentItem.handle = true; + data.dictTextList.handleType_dictText = + result.inspectionTask.handleType_dictText; + } + // 意见反馈 + if (result.opinion) { + for (const key in data.params.opinion) { + data.params.opinion[key] = result.opinion[key]; + } + // 反馈附件 + data.opinionFileList = this.changeUrl(result.opinion.fileUrl); + // 翻译 + data.dictTextList.opinionType_dictText = + result.opinion.opinionType_dictText; + data.dictTextList.handleId_dictText = + result.opinion.handleId_dictText; + } + this.setData(data); + } + ); + } + }, + // 附件翻译 + changeUrl(data: any) { + if (!data) return; + let urls = data.split(','); + let result = [] as any; + urls.forEach((item: any, index: number) => { + result.push({ + index: index, + message: '上传完成', + name: '', + status: 'done', + url: item, + file: { + url: item + } + }); + }); + return result; + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + this.getProjectOptions(); + this.getUser(); + this.getCustomerFollowTemplate(); + this.getInspectionTemplate(); + this.getDict(); + this.getInf(); + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {} +}); diff --git a/miniprogram/packageA/pages/customerFollow/customerFollow.wxml b/miniprogram/packageA/pages/customerFollow/customerFollow.wxml new file mode 100644 index 0000000..81825ea --- /dev/null +++ b/miniprogram/packageA/pages/customerFollow/customerFollow.wxml @@ -0,0 +1,600 @@ + + + + + + + 基本信息 + + + + + 收起 + + + + 展开 + + + + + + + + * + 项目 + + + {{dictTextList.projectId_dictText}} + 请选择 + + + {{dictTextList.projectId_dictText}} + + {{requireObj.baseInfo.projectId}} + + + + + + + + + + + * + 回访方式 + + + {{dictTextList.reviewType_dictText}} + 请选择 + + + + {{requireObj.baseInfo.reviewType}} + + + + + + + + * + 回访时间 + + + {{params.reviewTime}} + 请选择 + + + + {{requireObj.baseInfo.reviewTime}} + + + + + + + + * + 内容 + + + + + + + 回访信息 + + + + + + + 车辆巡检 + + + 车辆巡检 + + + + + + + 意见反馈 + + + 意见反馈 + + + + {{requireObj.director}} + + + + + + + + 回访信息 + + + + + 收起 + + + + 展开 + + + + + + + + * + 回访模板 + + + {{dictTextList.customerFollowTemplate_dictText}} + 请选择 + + + {{dictTextList.customerFollowTemplate_dictText}} + + {{requireObj.baseInfo.templateId}} + + + + + + + + + + {{item[0].categoryName}} + + {{el.followName}} + + + + * + 满意度 + + + {{el.pleasedStatus === '1' ? '满意' : '不满意'}} + 请选择 + + + + + + + + 备注 + + + + {{tips.accidentLocation}} + + + + * + 事故发生经过 + + + {{submitParam.accidentDetails ? submitParam.accidentDetails : '请输入'}} + + + {{tips.accidentDetails}} + + + + * + 事故预估损失 + + + {{submitParam.accidentEstimatedLoss ? submitParam.accidentEstimatedLoss : '请输入'}} + + + {{tips.accidentEstimatedLoss}} + + + + + 需要更换配件 + + + + + + {{validate.replacedParts}} + + + + + * + 事故发生类型 + + + {{accidentFormText}} + 请选择 + + + + {{tips.accidentForm}} + + + + + + + + + * + 事故类型 + + + {{accidentTypeText}} + 请选择 + + + + {{tips.accidentType}} + + + + + + + + + 事故损失 + + + + {{item.text}} + + + + + + + + * + 伤亡类型 + + + {{accidentInjuryTypeText}} + 请选择 + + + + {{tips.accidentInjuryType}} + + + + + + + + + * + 初步预估责任 + + + {{liabilityEstimateText}} + 请选择 + + + + {{tips.liabilityEstimate}} + + + + + + + + + * + 初步预估性质 + + + {{natureEstimateText}} + 请选择 + + + + {{tips.natureEstimate}} + + + + + + + + * + 事故现场图片 + + + + + {{tips.accidentScenePhoto}} + + + + + 事故现场视频 + + + + + + + + * + 保险公司现场勘察报告 + + + + + {{tips.insuranceInvestigationReport}} + + + + + + + + + + + 保险定损 + + + + + {{lossAccessmentExpand?'收起':'展开'}} + + + + + + + * + 保险单号 + + + + + + {{validate.caseReceiptNumber}} + {{insureTips.caseReceiptNumber}} + + + + + * + 是否出险 + + + + + + + + + + + + + * + 保险公司 + + + {{companyText}} + 请选择 + + + + {{insureTips.companyId}} + + + + + + + + * + 出险日期 + + + {{insureParam.insuranceDate}} + 请选择 + + + + {{insureTips.insuranceDate}} + + + + + + + + * + 确认事故责任 + + + {{liabilityConfirmText}} + 请选择 + + + + {{insureTips.liabilityConfirm}} + + + + + + + + + * + 确认事故性质 + + + {{natureConfirmText}} + 请选择 + + + + {{insureTips.natureConfirm}} + + + + + + + + + + + + 损失情况 + + + + + {{lossSituationExpand?'收起':'展开'}} + + + + + + + * + 标的车损失金额(元) + + + + + + {{validate.vehicleLossAmount}} + {{insureTips.vehicleLossAmount}} + + + + + * + 第三方物损金额(元) + + + + + + {{validate.thirdPropertyDamageAmount}} + {{insureTips.thirdPropertyDamageAmount}} + + + + + * + 标的车人伤金额(元) + + + + + + {{validate.vehiclePersonalInjuryAmount}} + {{insureTips.vehiclePersonalInjuryAmount}} + + + + + * + 第三方人伤金额(元) + + + + + + {{validate.thirdPersonalInjuryAmount}} + {{insureTips.thirdPersonalInjuryAmount}} + + + + * + 预估损失总金额(元) + + + + + + + + + + + + 保险理赔 + + + + + {{settleAClaimExpand?'收起' :'展开'}} + + + + + + + * + 理赔至公司账户日期 + + + {{insureParam.claimToCompanyAccountDate}} + 请选择 + + + + {{insureTips.claimToCompanyAccountDate}} + + + + + + + + * + 理赔至第三方账户日期 + + + {{insureParam.claimToThirdAccountDate}} + 请选择 + + + + {{insureTips.claimToThirdAccountDate}} + + + + + + + + * + 理赔至公司账户金额(元) + + + + + + {{validate.claimToCompanyAccountAmount}} + {{insureTips.claimToCompanyAccountAmount}} + + + + + * + 理赔至第三方账户金额(元) + + + + + + {{validate.claimToThirdAccountAmount}} + {{insureTips.claimToThirdAccountAmount}} + + + + 理赔单据 + + + + + + + + + + + + 理赔金额统计 + + + + + {{accountOfMoneyExpand?'收起':'展开'}} + + + + + + * + 出险理赔总金额(元) + + + + + + + + + * + 出险未理赔金额(元) + + + + + + {{validate.uncompensatedAmount}} + {{insureTips.uncompensatedAmount}} + + + + * + 案件实际发生总金额(元) + + + + + + + + + + + + + + + 案件进度 + + + + + 是否结案 + + + {{caseClosedText}} + 请选择 + + + + + + + + + + 结案时间 + + + {{caseParam.closingTime}} + 请选择 + + + + + + + + + + 备注 + + + + + + {{validate.remarks}} + + + + 事故认定书 + + + + + + + + 赔偿协议书 + + + + + + + + 定损单 + + + + + + + + 其他定损理赔资料 + + + + + + + + + + + 下一步 + 跳过下一步,直接提交 + + + 提交 + + \ No newline at end of file diff --git a/miniprogram/pages/addressBook/addressBook.json b/miniprogram/pages/addressBook/addressBook.json new file mode 100644 index 0000000..0f76c43 --- /dev/null +++ b/miniprogram/pages/addressBook/addressBook.json @@ -0,0 +1,9 @@ +{ + "usingComponents": { + "van-index-bar": "@vant/weapp/index-bar/index", + "van-cell": "@vant/weapp/cell/index", + "van-index-anchor": "@vant/weapp/index-anchor/index" + }, + "enablePullDownRefresh": true, + "navigationBarTitleText": "通讯录" +} \ No newline at end of file diff --git a/miniprogram/pages/addressBook/addressBook.less b/miniprogram/pages/addressBook/addressBook.less new file mode 100644 index 0000000..2063d4c --- /dev/null +++ b/miniprogram/pages/addressBook/addressBook.less @@ -0,0 +1,84 @@ +/* pages/addressBook/addressBook.wxss */ + +.search-box { + width: 100%; + padding: 8px 10px; + box-sizing: border-box; + background: #fff; + // position: fixed; + // top: 0; + // z-index: 2; + >.search { + width: 100%; + height: 36px; + padding: 8px 10px; + box-sizing: border-box; + border-radius: 4px; + border: 1px solid #E6EAF2; + display: flex; + align-items: center; + .icon { + width: 20px; + height: 20px; + margin-right: 8px; + image { + width: 100%; + height: 100%; + } + } + input { + flex: 1; + font-size: 14px; + } + } +} +.list { + // padding: 50px 0 120px; + padding-bottom: 120px; + min-height: calc(100vh - 170px); + background: #EFF1F4; + position: relative; + .van-index-anchor--active { + font-weight: bold; + // top: 50px !important; + } + .item { + padding: 24rpx 24rpx 0; + background: #fff; + .row { + margin-bottom: 8px; + color: #2E3A4F; + display: flex; + justify-content: space-between; + align-items: center; + .title { + font-size: 15px; + font-weight: bold; + } + .tel { + font-size: 15px; + } + .label { + color: #858CA0; + font-size: 14px; + } + .val { + font-size: 14px; + } + } + .row:last-child { + margin-bottom: 0; + } + .line { + width: 100%; + height: 2rpx; + background: #E6EAF2; + } + } + .total { + padding: 6px 0; + color: #858CA0; + font-size: 16px; + text-align: center; + } +} \ No newline at end of file diff --git a/miniprogram/pages/addressBook/addressBook.ts b/miniprogram/pages/addressBook/addressBook.ts new file mode 100644 index 0000000..1d28158 --- /dev/null +++ b/miniprogram/pages/addressBook/addressBook.ts @@ -0,0 +1,124 @@ +// pages/addressBook/addressBook.ts +import { getAction, postAction } from '../../api/base'; + +Page({ + /** + * 页面的初始数据 + */ + data: { + name: '', + indexList: [] as any, + dataList: [] as any, + scrollTop: 0, + total: 0 + }, + onPageScroll(e: any) { + this.setData({ + scrollTop: e.scrollTop + }); + }, + searchName(e: any) { + console.log(e); + this.getList({ + userName: e.detail.value + }); + }, + getList(parms: any) { + console.log(parms); + if (parms.userName == '') { + parms = {}; + } + wx.showLoading({ + title: '数据加载中' + }); + getAction('api/externalAddressBook/list', parms).then((res: any) => { + wx.hideLoading(); + if (res.code == 200) { + let indexList = [] as any; + let dataList = [] as any; + let total = 0; + for (let key in res.result) { + console.log(); + indexList.push(key); + dataList.push({ + key: key, + list: res.result[key] + }); + total += res.result[key].length; + } + // res.result.forEach((key, item) => { + // console.log(item) + // indexList.push(key) + // dataList.push({ + // key: key, + // list: res.result[key] + // }) + // }); + this.setData({ + indexList: indexList, + dataList: dataList, + total: total + }); + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad() {}, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() {}, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + if (typeof this.getTabBar === 'function' && this.getTabBar()) { + this.getTabBar().setData({ + selected: 2 + }); + } + this.getList({}); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + this.setData({ + name: '' + }); + this.getList({}); + + //停止下拉刷新 + wx.stopPullDownRefresh(); + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {} +}); diff --git a/miniprogram/pages/addressBook/addressBook.wxml b/miniprogram/pages/addressBook/addressBook.wxml new file mode 100644 index 0000000..b62ac42 --- /dev/null +++ b/miniprogram/pages/addressBook/addressBook.wxml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + {{sItem.userName}} + {{sItem.phone}} + + + 所属公司 + {{sItem.company}} + + + 职位 + {{sItem.position}} + + + + + {{total}}个朋友 + + \ No newline at end of file diff --git a/miniprogram/pages/backlog/accident/accident.json b/miniprogram/pages/backlog/accident/accident.json new file mode 100644 index 0000000..92b89aa --- /dev/null +++ b/miniprogram/pages/backlog/accident/accident.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "van-tab": "@vant/weapp/tab/index", + "van-tabs": "@vant/weapp/tabs/index" + }, + "navigationBarTitleText": "事故详情" +} \ No newline at end of file diff --git a/miniprogram/pages/backlog/accident/accident.less b/miniprogram/pages/backlog/accident/accident.less new file mode 100644 index 0000000..558ad1e --- /dev/null +++ b/miniprogram/pages/backlog/accident/accident.less @@ -0,0 +1,210 @@ +/* pages/backlog/accident/accident.wxss */ +.container { + height: 100vh; + padding-top: 2px; + box-sizing: border-box; + background: #EFF1F4; + overflow: hidden; + position: relative; + >.bg { + width: 100%; + height: 250px; + position: absolute; + top: 0; + image { + width: 100%; + height: 100%; + display: block; + } + } + .top { + margin: 8px 8px 10px; + padding: 12px 10px; + margin-bottom: 8px; + background: #fff; + border-radius: 8px; + position: relative; + padding: 12px 10px; + .row:first-child { + margin-bottom: 8px; + } + .row { + color: #2E3A4F; + display: flex; + justify-content: space-between; + align-items: center; + .number-plate { + display: flex; + .status { + padding: 0 6px; + margin-right: 4px; + border-radius: 2px; + color: #FFFFFF; + font-size: 14px; + } + .status1 { + background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%); + } + .status2 { + background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%); + } + .status3 { + background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%); + } + .val { + font-size: 16px; + font-weight: bold; + } + } + .project-name, .code { + font-size: 14px; + } + .time { + font-size: 14px; + color: #858CA0; + } + .type-list { + display: flex; + .type { + height: 22px; + line-height: 22px; + padding: 0 8px; + margin-left: 5px; + background: #FFF1F0; + border-radius: 4px; + border: 1px solid #FFA39E; + color: #FF4D4F; + font-size: 12px; + } + } + } + } + .detail-container { + max-height: calc(100vh - 72px - 80px - 20px); + box-sizing: border-box; + padding: 0px 8px 0px; + overflow: hidden; + position: relative; + .tabs { + display: flex; + background: #E2F3FE; + border-radius: 8px 8px 0 0; + overflow: hidden; + .tab { + width: 50%; + height: 40px; + line-height: 40px; + color: #959595; + font-size: 16px; + font-weight: bold; + text-align: center; + position: relative; + .bg { + width: 100%; + height: 100%; + position: absolute; + image { + width: 100%; + height: 100%; + display: block; + } + } + .value { + position: relative; + } + } + .active { + // background: #fff; + color: #4381FC; + } + .active::after { + content: ''; + width: 26px; + height: 4px; + background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%); + border-radius: 2px; + position: absolute; + bottom: 2px; + left: 50%; + transform: translateX(-50%); + } + } + .content-borderall { + border-radius: 8px; + } + .content { + max-height: calc(100vh - 72px - 80px - 100px); + padding: 12px 10px; + // box-sizing: border-box; + border-radius: 0px 0px 8px 8px; + background: #fff; + overflow-y: auto; + .row { + margin-bottom: 8px; + display: flex; + justify-content: space-between; + // align-items: center; + .label { + margin-right: 4px; + color: #858CA0; + font-size: 14px; + white-space: nowrap; + } + .val { + color: #2E3A4F; + font-size: 14px; + } + .pic-box { + max-width: 70%; + display: flex; + justify-content: flex-end; + flex-wrap: wrap; + .item { + width: 84px; + height: 84px; + padding-left: 8px; + margin-bottom: 8px; + display: flex; + align-items: center; + image { + width: 100%; + height: 100%; + display: block; + } + video{ + width: 100%; + height: 100%; + display: block; + } + } + } + } + } + } + .bottom { + width: 100%; + padding: 10px 8px 30px; + background: #fff; + box-sizing: border-box; + border-radius: 8px 8px 0 0; + box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2); + position: absolute; + bottom: 0; + left: 0; + .btn-box { + width: 100%; + display: flex; + justify-content: space-between; + .btn { + width: 100%; + height: 40px; + line-height: 40px; + border-radius: 8px; + background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%); + color: #fff; + font-weight: bold; + text-align: center; + } + } + } +} \ No newline at end of file diff --git a/miniprogram/pages/backlog/accident/accident.ts b/miniprogram/pages/backlog/accident/accident.ts new file mode 100644 index 0000000..23c05ff --- /dev/null +++ b/miniprogram/pages/backlog/accident/accident.ts @@ -0,0 +1,148 @@ +// pages/backlog/accident/accident.ts +import { getAction } from '../../../api/base'; + +Page({ + /** + * 页面的初始数据 + */ + data: { + tabActive: 0, + id: '', + item: {} as any + }, + + // 变更tab + changeTab(e: any) { + console.log(e.currentTarget.dataset.tab); + this.setData({ + tabActive: e.currentTarget.dataset.tab + }); + }, + getDetailInf() { + let parms = { + id: this.data.id + }; + getAction('api/vehicles/backlog/getAccidentInfoById', parms).then( + (res: any) => { + if (res.code == 200) { + console.log(res.result); + res.result.accidentScenePhotoList = res.result.accidentScenePhoto + ? res.result.accidentScenePhoto.split(',') + : []; + res.result.accidentSceneVideoList = res.result.accidentSceneVideo + ? res.result.accidentSceneVideo.split(',') + : []; + res.result.insuranceInvestigationReportList = res.result + .insuranceInvestigationReport + ? res.result.insuranceInvestigationReport.split(',') + : []; + res.result.accidentInsuranceInfo.documentImageList = res.result + .accidentInsuranceInfo.documentImage + ? res.result.accidentInsuranceInfo.documentImage.split(',') + : []; + this.setData({ + item: res.result + }); + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + } + } + ); + }, + previewImg(e: any) { + let that = this; + let { index, key, key2 } = e.currentTarget.dataset; + if (key2) { + wx.previewImage({ + current: that.data.item[key][key2][index | 0], // 当前显示图片的http链接 默认urls[0] + urls: that.data.item[key][key2] // 需要预览的图片http链接列表 + }); + } else { + wx.previewImage({ + current: that.data.item[key][index | 0], // 当前显示图片的http链接 默认urls[0] + urls: that.data.item[key] // 需要预览的图片http链接列表 + }); + } + }, + previewVidoe(e: any) { + let that = this; + let { index, key } = e.currentTarget.dataset; + let sources: any = that.data.item[key].map((item: any) => { + return { + type: 'video', + url: item + }; + }); + wx.previewMedia({ + current: index, + sources: sources + }); + }, + toFeedback() { + let that = this; + // 违章信息 + wx.setStorageSync('violation', ''); + // 跳转到违章处理反馈 + wx.navigateTo({ + url: '../accidentFeedback/accidentFeedback', + success: function (res) { + // 通过eventChannel向被打开页面传送数据 + res.eventChannel.emit('eventName', { ...that.data.item }); + }, + fail: e => { + console.log(e); + } + }); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad() { + const eventChannel = this.getOpenerEventChannel(); + getApp().EventChannel = eventChannel; + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + let id = wx.getStorageSync('backlogInf').id; + this.setData({ + id: id + }); + this.getDetailInf(); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {} +}); diff --git a/miniprogram/pages/backlog/accident/accident.wxml b/miniprogram/pages/backlog/accident/accident.wxml new file mode 100644 index 0000000..88fce4d --- /dev/null +++ b/miniprogram/pages/backlog/accident/accident.wxml @@ -0,0 +1,254 @@ + + + + + + + + + {{item.plateNumber}} + + {{item.projectId_dictText}} + + + 事故时间: {{item.accidentTime}} + + {{item.natureEstimate_dictText}} + + + + + + + + 基础信息 + + + + 保险信息 + + + + + 车牌信息 + {{item.plateNumber}} + + + 所属项目 + {{item.projectId_dictText ? item.projectId_dictText : '/'}} + + + 处理人 + {{item.processedPerson ? item.processedPerson : '/'}} + + + 报备号 + {{item.reportNumber ? item.reportNumber : '/'}} + + + 事故发生时间 + {{item.accidentTime ? item.accidentTime : '/'}} + + + 驾驶员 + {{item.driver ? item.driver : '/'}} + + + 驾驶员证件 + {{item.driverLicenseNumber ? item.driverLicenseNumber : '/'}} + + + 驾驶员电话 + {{item.driverPhoneNumber ? item.driverPhoneNumber : '/'}} + + + 第三方车牌 + {{item.thirdPlateNumber ? item.thirdPlateNumber : '/'}} + + + 第三方保险公司 + {{item.thirdInsuranceCompany ? item.thirdInsuranceCompany : '/'}} + + + 第三方电话 + {{item.thirdPhoneNumber ? item.thirdPhoneNumber : '/'}} + + + 事故发生地点 + {{item.accidentLocation ? item.accidentLocation : '/'}} + + + 事故发生经过 + {{item.accidentDetails ? item.accidentDetails : '/'}} + + + 事故发生损失 + {{item.accidentEstimatedLoss ? item.accidentEstimatedLoss : '/'}} + + + 事故发生类型 + {{item.accidentForm_dictText ? item.accidentForm_dictText : '/'}} + + + 事故类型 + {{item.accidentType_dictText ? item.accidentType_dictText : '/'}} + + + 事故损失 + {{item.accidentLossType_dictText ? item.accidentLossType_dictText : '/'}} + + + 需要更换配件 + {{item.replacedParts ? item.replacedParts : '/'}} + + + 伤亡类型 + {{item.accidentInjuryType_dictText ? item.accidentInjuryType_dictText : '/'}} + + + 初步预估责任 + {{item.liabilityEstimate_dictText ? item.liabilityEstimate_dictText : '/'}} + + + 初步预估性质 + {{item.natureEstimate_dictText ? item.natureEstimate_dictText : '/'}} + + + 事故现场图片 + + + + + + + + + 事故现场视频 + + + + + + + + 保险公司现场勘察报告 + + + + + + + + + + + 交案回执单号 + {{item.accidentInsuranceInfo.caseReceiptNumber ? item.accidentInsuranceInfo.caseReceiptNumber : '/'}} + + + 确定事故责任 + {{item.accidentInsuranceInfo.liabilityConfirm_dictText ? item.accidentInsuranceInfo.liabilityConfirm_dictText : '/'}} + + + 确定事故性质 + {{item.accidentInsuranceInfo.natureConfirm_dictText ? item.accidentInsuranceInfo.natureConfirm_dictText : '/'}} + + + 标的车损金额(元) + {{item.accidentInsuranceInfo.vehicleLossAmount ? item.accidentInsuranceInfo.vehicleLossAmount : '/'}} + + + 标的车人伤金额 + {{item.accidentInsuranceInfo.vehiclePersonalInjuryAmount ? item.accidentInsuranceInfo.vehiclePersonalInjuryAmount : '/'}} + + + 第三方物损金额 + {{item.accidentInsuranceInfo.thirdPropertyDamageAmount ? item.accidentInsuranceInfo.thirdPropertyDamageAmount : '/'}} + + + 第三方人损金额 + {{item.accidentInsuranceInfo.thirdPersonalInjuryAmount ? item.accidentInsuranceInfo.thirdPersonalInjuryAmount : '/'}} + + + 预估损失总金额 + {{item.accidentInsuranceInfo.estimatedTotalLossAmount ? item.accidentInsuranceInfo.estimatedTotalLossAmount : '/'}} + + + 理赔至公司账户日期 + {{item.accidentInsuranceInfo.claimToCompanyAccountDate ? item.accidentInsuranceInfo.claimToCompanyAccountDate : '/'}} + + + 理赔至公司账户金额 + {{item.accidentInsuranceInfo.claimToCompanyAccountAmount ? item.accidentInsuranceInfo.claimToCompanyAccountAmount : '/'}} + + + 理赔至第三方账户日期 + {{item.accidentInsuranceInfo.claimToCompanyAccountDate ? item.accidentInsuranceInfo.claimToCompanyAccountDate : '/'}} + + + 理赔至第三方账户金额 + {{item.accidentInsuranceInfo.claimToThirdAccountAmount ? item.accidentInsuranceInfo.claimToThirdAccountAmount : '/'}} + + + 出险理赔总金额 + {{item.accidentInsuranceInfo.totalCompensationAmount ? item.accidentInsuranceInfo.totalCompensationAmount : '/'}} + + + 出险未理赔金额 + {{item.accidentInsuranceInfo.uncompensatedAmount ? item.accidentInsuranceInfo.uncompensatedAmount : '/'}} + + + 案件实际发生总金额 + {{item.accidentInsuranceInfo.totalAmountActuallyIncurred ? item.accidentInsuranceInfo.totalAmountActuallyIncurred : '/'}} + + + 理赔单据 + + + + + + + + + + + + 结案 + + + \ No newline at end of file diff --git a/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.json b/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.json new file mode 100644 index 0000000..ede4e91 --- /dev/null +++ b/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "g-upload": "/components/uploadPic/uploadPic", + "van-popup": "@vant/weapp/popup/index", + "van-datetime-picker": "@vant/weapp/datetime-picker/index" + }, + "navigationBarTitleText": "事故处理反馈" +} \ No newline at end of file diff --git a/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.less b/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.less new file mode 100644 index 0000000..83d19b5 --- /dev/null +++ b/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.less @@ -0,0 +1,142 @@ +/* pages/backlog/accidentFeedback/accidentFeedback.wxss */ +.container { + height: 100vh; + padding-top: 2px; + box-sizing: border-box; + background: #EFF1F4; + overflow: hidden; + position: relative; + .content { + max-height: calc(100vh - 110px); + padding: 12px 8px 4px; + background: #fff; + border-radius: 0 0 8px 8px; + overflow-y: auto; + .row { + width: 100%; + min-height: 36px; + padding: 8px 10px; + margin-bottom: 8px; + box-sizing: border-box; + box-shadow: 0px 1px 0px 0px #E6EAF2; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + position: relative; + .label { + color: #2F3B50; + font-size: 14px; + } + .select { + width: 70%; + position: absolute; + right: 10px; + picker { + width: 100%; + text-align: right; + position: relative; + .picker { + width: 100%; + height: 38px; + padding-right: 20px; + box-sizing: border-box; + // border: 1px solid #E6EAF2; + border-radius: 4px; + font-size: 14px; + display: flex; + justify-content: flex-end; + align-items: center; + } + .picker::after { + content: ''; + width: 0; + height: 0; + border-top: 6px solid #636B83; + border-right: 6px solid transparent; + border-bottom: 6px solid transparent; + border-left: 6px solid transparent; + position: absolute; + top: 50%; + right: 4px; + transform: translateY(-2px); + } + } + } + .date-select { + width: 70%; + padding-right: 20px; + text-align: right; + position: relative; + .arrow { + width: 0; + height: 0; + border-top: 6px solid #636B83; + border-right: 6px solid transparent; + border-bottom: 6px solid transparent; + border-left: 6px solid transparent; + position: absolute; + top: 50%; + right: 4px; + transform: translateY(-2px); + } + } + .marker { + width: 100%; + margin-top: 8px; + color: #949CB5; + font-size: 14px; + } + .upload { + width: 100%; + margin-top: 8px; + .upload-btn { + width: 64px; + height: 64px; + background: #ECF1FF; + border-radius: 4px; + border: 1px dashed #4381FC; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + image { + width: 20px; + height: 20px; + margin: 16rpx 0 8rpx; + } + .val { + color: #4381FC; + font-size: 14px; + } + } + } + } + } + .bottom { + width: 100%; + padding: 22px 10px; + background: #fff; + box-sizing: border-box; + border-radius: 8px 8px 0 0; + box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2); + position: absolute; + bottom: 0; + left: 0; + .btn-box { + width: 100%; + display: flex; + justify-content: space-between; + .btn { + width: 100%; + height: 40px; + line-height: 40px; + border-radius: 8px; + background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%); + color: #fff; + font-weight: bold; + text-align: center; + } + } + } +} \ No newline at end of file diff --git a/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.ts b/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.ts new file mode 100644 index 0000000..9cb8647 --- /dev/null +++ b/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.ts @@ -0,0 +1,211 @@ +// pages/backlog/accidentFeedback/accidentFeedback.ts +import { putAction } from '../../../api/base'; +const dayjs = require('dayjs'); + +Page({ + /** + * 页面的初始数据 + */ + data: { + detailInf: {} as any, + currentDate: new Date().getTime(), + dateTimeStr: '请选择时间', + options: [ + { + name: '请选择', + type: '' + }, + { + name: '是', + type: 1 + }, + { + name: '否', + type: 0 + } + ], + selectIndex: 0, + selectOption: {} as any, + marker: '', + photoList: { + accidentCertificatePhoto: [], + compensationAgreementPhoto: [], + lossAssessmentPhoto: [], + otherPhoto: [] + } as any, + uploadUrl: 'api/vehicles/accidentInfo/upload' + }, + bindPicker(e: any) { + console.log(e.detail.value); + let index = Number(e.detail.value); + this.setData({ + selectIndex: index, + selectOption: this.data.options[index] + }); + }, + showDateTimePicker() { + this.setData({ + show: true + }); + }, + dateOnInput(event: any) { + console.log(event.detail); + + this.setData({ + currentDate: event.detail, + dateTimeStr: dayjs(new Date(event.detail)).format('YYYY-MM-DD HH:mm'), + show: false + }); + }, + getMarker(e: any) { + this.setData({ + marker: e.detail.value + }); + }, + onClose() { + this.setData({ + show: false + }); + }, + returnPic(e: any) { + console.log(e.detail.photoList); + let urlList = [] as any; + e.detail.photoList.forEach((item: any) => { + urlList.push(item.fileUrl); + }); + let tmp = this.data.photoList; + tmp[e.currentTarget.dataset.key] = urlList; + this.setData({ + photoList: tmp + }); + }, + + checkStr(str: string) { + let returnStr = ''; + let spaceRegex = /^\S*$/; + let regex = /[!@#$%^&*?><|\\\\]/; + let tooLong = str.length > 32; + if (!spaceRegex.test(str)) { + returnStr = '不支持含有空格'; + } else if (regex.test(str)) { + returnStr = '不支持特殊字符'; + } else if (tooLong) { + returnStr = '输入长度不得超过32个字符'; + } else { + returnStr = ''; + } + return returnStr; + }, + bindSend() { + let parms = this.data.detailInf; + parms.accidentProgress = Object.assign(parms.accidentProgress, { + accidentCertificatePhoto: + this.data.photoList.accidentCertificatePhoto.join(','), + compensationAgreementPhoto: + this.data.photoList.compensationAgreementPhoto.join(','), + lossAssessmentPhoto: this.data.photoList.lossAssessmentPhoto.join(','), + otherPhoto: this.data.photoList.otherPhoto.join(','), + remark: this.data.marker, + closingTime: this.data.dateTimeStr, + caseClosed: this.data.selectOption.type + }); + if (this.data.selectIndex == 0) { + wx.showToast({ + title: '请选择是否结案', + icon: 'none' + }); + return; + } + if (parms.accidentProgress.closingTime == '请选择时间') { + wx.showToast({ + title: '请选择结案时间', + icon: 'none' + }); + return; + } + // 验证非必填 + if (parms.accidentProgress.remark) { + let msg = this.checkStr(parms.accidentProgress.remark); + if (msg) { + wx.showToast({ + title: '备注:' + msg, + icon: 'none' + }); + return; + } + } + console.log(parms); + putAction('api/vehicles/accidentInfo/smallprogramEdit', parms).then( + (res: any) => { + if (res.code == 200) { + console.log(res.result); + // setTimeout(() => { + // wx.navigateBack({ delta: 2 }); + // }, 1500); + wx.navigateTo({ + url: '../backlogFeedback/backlogFeedback', + fail: e => { + console.log(e); + } + }); + } else { + wx.showToast({ + title: res.message, + icon: 'none' + }); + } + } + ); + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad() {}, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + // 接收传参 + const eventChannel = this.getOpenerEventChannel(); + + eventChannel && + eventChannel.on && + eventChannel.on('eventName', (data: any) => { + console.log('接收参数', data); + this.setData({ + detailInf: data + }); + }); + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() {}, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() {}, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() {}, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() {}, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() {}, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() {} +}); diff --git a/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.wxml b/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.wxml new file mode 100644 index 0000000..8a332da --- /dev/null +++ b/miniprogram/pages/backlog/accidentFeedback/accidentFeedback.wxml @@ -0,0 +1,86 @@ + + + + + 是否结案 + + + + {{options[selectIndex].name}} + + + + + + 结案时间 + + {{ dateTimeStr }} + + + + + 备注 + + + + {{validate.message}} + 识别 + + + + + + + 基本信息 + + + + + + * + 车牌号码 + + + {{params.plateNumber}} + 请选择 + + + + {{requireObj.plateNumber}} + + + + + + + + + + + + + + 所属项目 + + + + + + {{requireObj.projectId}} + + + + + * + 责任人 + + + + + + {{requireObj.director}} + + + + + + + 违章信息 + + + + + + * + 违章时间 + + + {{params.violationTime}} + 请选择 + + + + {{requireObj.violationTime}} + + + + + + + + * + 违章地点 + + + + + + {{requireObj.violationAddress}} + + + + + * + 违章行为 + + + {{params.violationActText}} + 请选择 + + + + {{requireObj.violationActText}} + + + + + + + + + 违章司机 + + + + + + {{validate.violationDriver}} + + + + + 违章计分 + + + + + + {{validate.violationScore}} + + + + + 违章费用(元) + + + + + + {{validate.violationCost}} + + + + + 处理期限(天) + + + + + + {{validate.handleTerm}} + + + + + 违章行为描述 + + + + + + {{validate.violationActDes}} + + + + 提交 + + + \ No newline at end of file diff --git a/miniprogram/sitemap.json b/miniprogram/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/miniprogram/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/miniprogram/utils/base64.js b/miniprogram/utils/base64.js new file mode 100644 index 0000000..07482d3 --- /dev/null +++ b/miniprogram/utils/base64.js @@ -0,0 +1,109 @@ +export default function Base64() { + // 私钥 + let _keyStr = + 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + // 加密 + this.encode = function (input) { + var output = ''; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + input = _utf8_encode(input); + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + output = + output + + _keyStr.charAt(enc1) + + _keyStr.charAt(enc2) + + _keyStr.charAt(enc3) + + _keyStr.charAt(enc4); + } + return output; + }; + // 解密 + this.decode = input => { + var output = ''; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + if (input == undefined || input == null) { + } else { + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ''); + while (i < input.length) { + enc1 = _keyStr.indexOf(input.charAt(i++)); + enc2 = _keyStr.indexOf(input.charAt(i++)); + enc3 = _keyStr.indexOf(input.charAt(i++)); + enc4 = _keyStr.indexOf(input.charAt(i++)); + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + output = output + String.fromCharCode(chr1); + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + } + output = _utf8_decode(output); + return output; + } + }; + // private method for UTF-8 encoding + let _utf8_encode = string => { + string = string.replace(/\r\n/g, '\n'); + var utftext = ''; + for (var n = 0; n < string.length; n++) { + var c = string.charCodeAt(n); + if (c < 128) { + utftext += String.fromCharCode(c); + } else if (c > 127 && c < 2048) { + utftext += String.fromCharCode((c >> 6) | 192); + utftext += String.fromCharCode((c & 63) | 128); + } else { + utftext += String.fromCharCode((c >> 12) | 224); + utftext += String.fromCharCode(((c >> 6) & 63) | 128); + utftext += String.fromCharCode((c & 63) | 128); + } + } + return utftext; + }; + // private method for UTF-8 decoding + let _utf8_decode = utftext => { + var string = ''; + var i = 0; + var c = (c1 = c2 = 0); + var c1 = 0; + var c2 = 0; + var c3 = 0; + while (i < utftext.length) { + c = utftext.charCodeAt(i); + if (c < 128) { + string += String.fromCharCode(c); + i++; + } else if (c > 191 && c < 224) { + c2 = utftext.charCodeAt(i + 1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } else { + c2 = utftext.charCodeAt(i + 1); + c3 = utftext.charCodeAt(i + 2); + string += String.fromCharCode( + ((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63) + ); + i += 3; + } + } + return string; + }; +} diff --git a/miniprogram/utils/qqmap-wx-jssdk.min.js b/miniprogram/utils/qqmap-wx-jssdk.min.js new file mode 100644 index 0000000..fe33d58 --- /dev/null +++ b/miniprogram/utils/qqmap-wx-jssdk.min.js @@ -0,0 +1,1015 @@ +var ERROR_CONF = { + KEY_ERR: 311, + KEY_ERR_MSG: 'key格式错误', + PARAM_ERR: 310, + PARAM_ERR_MSG: '请求参数信息有误', + SYSTEM_ERR: 600, + SYSTEM_ERR_MSG: '系统错误', + WX_ERR_CODE: 1000, + WX_OK_CODE: 200 +}; +var BASE_URL = 'https://apis.map.qq.com/ws/'; +var URL_SEARCH = BASE_URL + 'place/v1/search'; +var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion'; +var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/'; +var URL_CITY_LIST = BASE_URL + 'district/v1/list'; +var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren'; +var URL_DISTANCE = BASE_URL + 'distance/v1/'; +var URL_DIRECTION = BASE_URL + 'direction/v1/'; +var MODE = { driving: 'driving', transit: 'transit' }; +var EARTH_RADIUS = 6378136.49; +var Utils = { + safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff); + var msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xffff); + }, + bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + }, + md5cmn(q, a, b, x, s, t) { + return this.safeAdd( + this.bitRotateLeft( + this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), + s + ), + b + ); + }, + md5ff(a, b, c, d, x, s, t) { + return this.md5cmn((b & c) | (~b & d), a, b, x, s, t); + }, + md5gg(a, b, c, d, x, s, t) { + return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t); + }, + md5hh(a, b, c, d, x, s, t) { + return this.md5cmn(b ^ c ^ d, a, b, x, s, t); + }, + md5ii(a, b, c, d, x, s, t) { + return this.md5cmn(c ^ (b | ~d), a, b, x, s, t); + }, + binlMD5(x, len) { + x[len >> 5] |= 0x80 << len % 32; + x[(((len + 64) >>> 9) << 4) + 14] = len; + var i; + var olda; + var oldb; + var oldc; + var oldd; + var a = 1732584193; + var b = -271733879; + var c = -1732584194; + var d = 271733878; + for (i = 0; i < x.length; i += 16) { + olda = a; + oldb = b; + oldc = c; + oldd = d; + a = this.md5ff(a, b, c, d, x[i], 7, -680876936); + d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = this.md5gg(b, c, d, a, x[i], 20, -373897302); + a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = this.md5hh(d, a, b, c, x[i], 11, -358537222); + c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = this.md5ii(a, b, c, d, x[i], 6, -198630844); + d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = this.safeAdd(a, olda); + b = this.safeAdd(b, oldb); + c = this.safeAdd(c, oldc); + d = this.safeAdd(d, oldd); + } + return [a, b, c, d]; + }, + binl2rstr(input) { + var i; + var output = ''; + var length32 = input.length * 32; + for (i = 0; i < length32; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff); + } + return output; + }, + rstr2binl(input) { + var i; + var output = []; + output[(input.length >> 2) - 1] = undefined; + for (i = 0; i < output.length; i += 1) { + output[i] = 0; + } + var length8 = input.length * 8; + for (i = 0; i < length8; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32; + } + return output; + }, + rstrMD5(s) { + return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)); + }, + rstrHMACMD5(key, data) { + var i; + var bkey = this.rstr2binl(key); + var ipad = []; + var opad = []; + var hash; + ipad[15] = opad[15] = undefined; + if (bkey.length > 16) { + bkey = this.binlMD5(bkey, key.length * 8); + } + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5c5c5c5c; + } + hash = this.binlMD5( + ipad.concat(this.rstr2binl(data)), + 512 + data.length * 8 + ); + return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)); + }, + rstr2hex(input) { + var hexTab = '0123456789abcdef'; + var output = ''; + var x; + var i; + for (i = 0; i < input.length; i += 1) { + x = input.charCodeAt(i); + output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f); + } + return output; + }, + str2rstrUTF8(input) { + return unescape(encodeURIComponent(input)); + }, + rawMD5(s) { + return this.rstrMD5(this.str2rstrUTF8(s)); + }, + hexMD5(s) { + return this.rstr2hex(this.rawMD5(s)); + }, + rawHMACMD5(k, d) { + return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)); + }, + hexHMACMD5(k, d) { + return this.rstr2hex(this.rawHMACMD5(k, d)); + }, + md5(string, key, raw) { + if (!key) { + if (!raw) { + return this.hexMD5(string); + } + return this.rawMD5(string); + } + if (!raw) { + return this.hexHMACMD5(key, string); + } + return this.rawHMACMD5(key, string); + }, + getSig(requestParam, sk, feature, mode) { + var sig = null; + var requestArr = []; + Object.keys(requestParam) + .sort() + .forEach(function (key) { + requestArr.push(key + '=' + requestParam[key]); + }); + if (feature == 'search') { + sig = '/ws/place/v1/search?' + requestArr.join('&') + sk; + } + if (feature == 'suggest') { + sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk; + } + if (feature == 'reverseGeocoder') { + sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'geocoder') { + sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'getCityList') { + sig = '/ws/district/v1/list?' + requestArr.join('&') + sk; + } + if (feature == 'getDistrictByCityId') { + sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk; + } + if (feature == 'calculateDistance') { + sig = '/ws/distance/v1/?' + requestArr.join('&') + sk; + } + if (feature == 'direction') { + sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk; + } + sig = this.md5(sig); + return sig; + }, + location2query(data) { + if (typeof data == 'string') { + return data; + } + var query = ''; + for (var i = 0; i < data.length; i++) { + var d = data[i]; + if (!!query) { + query += ';'; + } + if (d.location) { + query = query + d.location.lat + ',' + d.location.lng; + } + if (d.latitude && d.longitude) { + query = query + d.latitude + ',' + d.longitude; + } + } + return query; + }, + rad(d) { + return (d * Math.PI) / 180.0; + }, + getEndLocation(location) { + var to = location.split(';'); + var endLocation = []; + for (var i = 0; i < to.length; i++) { + endLocation.push({ + lat: parseFloat(to[i].split(',')[0]), + lng: parseFloat(to[i].split(',')[1]) + }); + } + return endLocation; + }, + getDistance(latFrom, lngFrom, latTo, lngTo) { + var radLatFrom = this.rad(latFrom); + var radLatTo = this.rad(latTo); + var a = radLatFrom - radLatTo; + var b = this.rad(lngFrom) - this.rad(lngTo); + var distance = + 2 * + Math.asin( + Math.sqrt( + Math.pow(Math.sin(a / 2), 2) + + Math.cos(radLatFrom) * + Math.cos(radLatTo) * + Math.pow(Math.sin(b / 2), 2) + ) + ); + distance = distance * EARTH_RADIUS; + distance = Math.round(distance * 10000) / 10000; + return parseFloat(distance.toFixed(0)); + }, + getWXLocation(success, fail, complete) { + wx.getLocation({ + type: 'gcj02', + success: success, + fail: fail, + complete: complete + }); + }, + getLocationParam(location) { + if (typeof location == 'string') { + var locationArr = location.split(','); + if (locationArr.length === 2) { + location = { + latitude: location.split(',')[0], + longitude: location.split(',')[1] + }; + } else { + location = {}; + } + } + return location; + }, + polyfillParam(param) { + param.success = param.success || function () {}; + param.fail = param.fail || function () {}; + param.complete = param.complete || function () {}; + }, + checkParamKeyEmpty(param, key) { + if (!param[key]) { + var errconf = this.buildErrorConfig( + ERROR_CONF.PARAM_ERR, + ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误' + ); + param.fail(errconf); + param.complete(errconf); + return true; + } + return false; + }, + checkKeyword(param) { + return !this.checkParamKeyEmpty(param, 'keyword'); + }, + checkLocation(param) { + var location = this.getLocationParam(param.location); + if (!location || !location.latitude || !location.longitude) { + var errconf = this.buildErrorConfig( + ERROR_CONF.PARAM_ERR, + ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误' + ); + param.fail(errconf); + param.complete(errconf); + return false; + } + return true; + }, + buildErrorConfig(errCode, errMsg) { + return { status: errCode, message: errMsg }; + }, + handleData(param, data, feature) { + if (feature == 'search') { + var searchResult = data.data; + var searchSimplify = []; + for (var i = 0; i < searchResult.length; i++) { + searchSimplify.push({ + id: searchResult[i].id || null, + title: searchResult[i].title || null, + latitude: + (searchResult[i].location && searchResult[i].location.lat) || null, + longitude: + (searchResult[i].location && searchResult[i].location.lng) || null, + address: searchResult[i].address || null, + category: searchResult[i].category || null, + tel: searchResult[i].tel || null, + adcode: + (searchResult[i].ad_info && searchResult[i].ad_info.adcode) || null, + city: + (searchResult[i].ad_info && searchResult[i].ad_info.city) || null, + district: + (searchResult[i].ad_info && searchResult[i].ad_info.district) || + null, + province: + (searchResult[i].ad_info && searchResult[i].ad_info.province) || + null + }); + } + param.success(data, { + searchResult: searchResult, + searchSimplify: searchSimplify + }); + } else if (feature == 'suggest') { + var suggestResult = data.data; + var suggestSimplify = []; + for (var i = 0; i < suggestResult.length; i++) { + suggestSimplify.push({ + adcode: suggestResult[i].adcode || null, + address: suggestResult[i].address || null, + category: suggestResult[i].category || null, + city: suggestResult[i].city || null, + district: suggestResult[i].district || null, + id: suggestResult[i].id || null, + latitude: + (suggestResult[i].location && suggestResult[i].location.lat) || + null, + longitude: + (suggestResult[i].location && suggestResult[i].location.lng) || + null, + province: suggestResult[i].province || null, + title: suggestResult[i].title || null, + type: suggestResult[i].type || null + }); + } + param.success(data, { + suggestResult: suggestResult, + suggestSimplify: suggestSimplify + }); + } else if (feature == 'reverseGeocoder') { + var reverseGeocoderResult = data.result; + var reverseGeocoderSimplify = { + address: reverseGeocoderResult.address || null, + latitude: + (reverseGeocoderResult.location && + reverseGeocoderResult.location.lat) || + null, + longitude: + (reverseGeocoderResult.location && + reverseGeocoderResult.location.lng) || + null, + adcode: + (reverseGeocoderResult.ad_info && + reverseGeocoderResult.ad_info.adcode) || + null, + city: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.city) || + null, + district: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.district) || + null, + nation: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.nation) || + null, + province: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.province) || + null, + street: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.street) || + null, + street_number: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.street_number) || + null, + recommend: + (reverseGeocoderResult.formatted_addresses && + reverseGeocoderResult.formatted_addresses.recommend) || + null, + rough: + (reverseGeocoderResult.formatted_addresses && + reverseGeocoderResult.formatted_addresses.rough) || + null + }; + if (reverseGeocoderResult.pois) { + var pois = reverseGeocoderResult.pois; + var poisSimplify = []; + for (var i = 0; i < pois.length; i++) { + poisSimplify.push({ + id: pois[i].id || null, + title: pois[i].title || null, + latitude: (pois[i].location && pois[i].location.lat) || null, + longitude: (pois[i].location && pois[i].location.lng) || null, + address: pois[i].address || null, + category: pois[i].category || null, + adcode: (pois[i].ad_info && pois[i].ad_info.adcode) || null, + city: (pois[i].ad_info && pois[i].ad_info.city) || null, + district: (pois[i].ad_info && pois[i].ad_info.district) || null, + province: (pois[i].ad_info && pois[i].ad_info.province) || null + }); + } + param.success(data, { + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify, + pois: pois, + poisSimplify: poisSimplify + }); + } else { + param.success(data, { + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify + }); + } + } else if (feature == 'geocoder') { + var geocoderResult = data.result; + var geocoderSimplify = { + title: geocoderResult.title || null, + latitude: + (geocoderResult.location && geocoderResult.location.lat) || null, + longitude: + (geocoderResult.location && geocoderResult.location.lng) || null, + adcode: + (geocoderResult.ad_info && geocoderResult.ad_info.adcode) || null, + province: + (geocoderResult.address_components && + geocoderResult.address_components.province) || + null, + city: + (geocoderResult.address_components && + geocoderResult.address_components.city) || + null, + district: + (geocoderResult.address_components && + geocoderResult.address_components.district) || + null, + street: + (geocoderResult.address_components && + geocoderResult.address_components.street) || + null, + street_number: + (geocoderResult.address_components && + geocoderResult.address_components.street_number) || + null, + level: geocoderResult.level || null + }; + param.success(data, { + geocoderResult: geocoderResult, + geocoderSimplify: geocoderSimplify + }); + } else if (feature == 'getCityList') { + var provinceResult = data.result[0]; + var cityResult = data.result[1]; + var districtResult = data.result[2]; + param.success(data, { + provinceResult: provinceResult, + cityResult: cityResult, + districtResult: districtResult + }); + } else if (feature == 'getDistrictByCityId') { + var districtByCity = data.result[0]; + param.success(data, districtByCity); + } else if (feature == 'calculateDistance') { + var calculateDistanceResult = data.result.elements; + var distance = []; + for (var i = 0; i < calculateDistanceResult.length; i++) { + distance.push(calculateDistanceResult[i].distance); + } + param.success(data, { + calculateDistanceResult: calculateDistanceResult, + distance: distance + }); + } else if (feature == 'direction') { + var direction = data.result.routes; + param.success(data, direction); + } else { + param.success(data); + } + }, + buildWxRequestConfig(param, options, feature) { + var that = this; + options.header = { 'content-type': 'application/json' }; + options.method = 'GET'; + options.success = function (res) { + var data = res.data; + if (data.status === 0) { + that.handleData(param, data, feature); + } else { + param.fail(data); + } + }; + options.fail = function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE; + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + }; + options.complete = function (res) { + var statusCode = +res.statusCode; + switch (statusCode) { + case ERROR_CONF.WX_ERR_CODE: { + param.complete( + that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg) + ); + break; + } + case ERROR_CONF.WX_OK_CODE: { + var data = res.data; + if (data.status === 0) { + param.complete(data); + } else { + param.complete(that.buildErrorConfig(data.status, data.message)); + } + break; + } + default: { + param.complete( + that.buildErrorConfig( + ERROR_CONF.SYSTEM_ERR, + ERROR_CONF.SYSTEM_ERR_MSG + ) + ); + } + } + }; + return options; + }, + locationProcess(param, locationsuccess, locationfail, locationcomplete) { + var that = this; + locationfail = + locationfail || + function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE; + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)); + }; + locationcomplete = + locationcomplete || + function (res) { + if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { + param.complete( + that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg) + ); + } + }; + if (!param.location) { + that.getWXLocation(locationsuccess, locationfail, locationcomplete); + } else if (that.checkLocation(param)) { + var location = Utils.getLocationParam(param.location); + locationsuccess(location); + } + } +}; +class QQMapWX { + constructor(options) { + if (!options.key) { + throw Error('key值不能为空'); + } + this.key = options.key; + } + search(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (!Utils.checkKeyword(options)) { + return; + } + var requestParam = { + keyword: options.keyword, + orderby: options.orderby || '_distance', + page_size: options.page_size || 10, + page_index: options.page_index || 1, + output: 'json', + key: that.key + }; + if (options.address_format) { + requestParam.address_format = options.address_format; + } + if (options.filter) { + requestParam.filter = options.filter; + } + var distance = options.distance || '1000'; + var auto_extend = options.auto_extend || 1; + var region = null; + var rectangle = null; + if (options.region) { + region = options.region; + } + if (options.rectangle) { + rectangle = options.rectangle; + } + var locationsuccess = function (result) { + if (region && !rectangle) { + requestParam.boundary = + 'region(' + + region + + ',' + + auto_extend + + ',' + + result.latitude + + ',' + + result.longitude + + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } else if (rectangle && !region) { + requestParam.boundary = 'rectangle(' + rectangle + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } else { + requestParam.boundary = + 'nearby(' + + result.latitude + + ',' + + result.longitude + + ',' + + distance + + ',' + + auto_extend + + ')'; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search'); + } + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_SEARCH, data: requestParam }, + 'search' + ) + ); + }; + Utils.locationProcess(options, locationsuccess); + } + getSuggestion(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (!Utils.checkKeyword(options)) { + return; + } + var requestParam = { + keyword: options.keyword, + region: options.region || '全国', + region_fix: options.region_fix || 0, + policy: options.policy || 0, + page_size: options.page_size || 10, + page_index: options.page_index || 1, + get_subpois: options.get_subpois || 0, + output: 'json', + key: that.key + }; + if (options.address_format) { + requestParam.address_format = options.address_format; + } + if (options.filter) { + requestParam.filter = options.filter; + } + if (options.location) { + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_SUGGESTION, data: requestParam }, + 'suggest' + ) + ); + }; + Utils.locationProcess(options, locationsuccess); + } else { + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest'); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_SUGGESTION, data: requestParam }, + 'suggest' + ) + ); + } + } + reverseGeocoder(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + var requestParam = { + coord_type: options.coord_type || 5, + get_poi: options.get_poi || 0, + output: 'json', + key: that.key + }; + if (options.poi_options) { + requestParam.poi_options = options.poi_options; + } + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig( + requestParam, + options.sig, + 'reverseGeocoder' + ); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_GET_GEOCODER, data: requestParam }, + 'reverseGeocoder' + ) + ); + }; + Utils.locationProcess(options, locationsuccess); + } + geocoder(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (Utils.checkParamKeyEmpty(options, 'address')) { + return; + } + var requestParam = { + address: options.address, + output: 'json', + key: that.key + }; + if (options.region) { + requestParam.region = options.region; + } + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder'); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_GET_GEOCODER, data: requestParam }, + 'geocoder' + ) + ); + } + getCityList(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + var requestParam = { output: 'json', key: that.key }; + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList'); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_CITY_LIST, data: requestParam }, + 'getCityList' + ) + ); + } + getDistrictByCityId(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (Utils.checkParamKeyEmpty(options, 'id')) { + return; + } + var requestParam = { id: options.id || '', output: 'json', key: that.key }; + if (options.sig) { + requestParam.sig = Utils.getSig( + requestParam, + options.sig, + 'getDistrictByCityId' + ); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_AREA_LIST, data: requestParam }, + 'getDistrictByCityId' + ) + ); + } + calculateDistance(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (Utils.checkParamKeyEmpty(options, 'to')) { + return; + } + var requestParam = { + mode: options.mode || 'walking', + to: Utils.location2query(options.to), + output: 'json', + key: that.key + }; + if (options.from) { + options.location = options.from; + } + if (requestParam.mode == 'straight') { + var locationsuccess = function (result) { + var locationTo = Utils.getEndLocation(requestParam.to); + var data = { message: 'query ok', result: { elements: [] }, status: 0 }; + for (var i = 0; i < locationTo.length; i++) { + data.result.elements.push({ + distance: Utils.getDistance( + result.latitude, + result.longitude, + locationTo[i].lat, + locationTo[i].lng + ), + duration: 0, + from: { lat: result.latitude, lng: result.longitude }, + to: { lat: locationTo[i].lat, lng: locationTo[i].lng } + }); + } + var calculateResult = data.result.elements; + var distanceResult = []; + for (var i = 0; i < calculateResult.length; i++) { + distanceResult.push(calculateResult[i].distance); + } + return options.success(data, { + calculateResult: calculateResult, + distanceResult: distanceResult + }); + }; + Utils.locationProcess(options, locationsuccess); + } else { + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig( + requestParam, + options.sig, + 'calculateDistance' + ); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_DISTANCE, data: requestParam }, + 'calculateDistance' + ) + ); + }; + Utils.locationProcess(options, locationsuccess); + } + } + direction(options) { + var that = this; + options = options || {}; + Utils.polyfillParam(options); + if (Utils.checkParamKeyEmpty(options, 'to')) { + return; + } + var requestParam = { output: 'json', key: that.key }; + if (typeof options.to == 'string') { + requestParam.to = options.to; + } else { + requestParam.to = options.to.latitude + ',' + options.to.longitude; + } + var SET_URL_DIRECTION = null; + options.mode = options.mode || MODE.driving; + SET_URL_DIRECTION = URL_DIRECTION + options.mode; + if (options.from) { + options.location = options.from; + } + if (options.mode == MODE.driving) { + if (options.from_poi) { + requestParam.from_poi = options.from_poi; + } + if (options.heading) { + requestParam.heading = options.heading; + } + if (options.speed) { + requestParam.speed = options.speed; + } + if (options.accuracy) { + requestParam.accuracy = options.accuracy; + } + if (options.road_type) { + requestParam.road_type = options.road_type; + } + if (options.to_poi) { + requestParam.to_poi = options.to_poi; + } + if (options.from_track) { + requestParam.from_track = options.from_track; + } + if (options.waypoints) { + requestParam.waypoints = options.waypoints; + } + if (options.policy) { + requestParam.policy = options.policy; + } + if (options.plate_number) { + requestParam.plate_number = options.plate_number; + } + } + if (options.mode == MODE.transit) { + if (options.departure_time) { + requestParam.departure_time = options.departure_time; + } + if (options.policy) { + requestParam.policy = options.policy; + } + } + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude; + if (options.sig) { + requestParam.sig = Utils.getSig( + requestParam, + options.sig, + 'direction', + options.mode + ); + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: SET_URL_DIRECTION, data: requestParam }, + 'direction' + ) + ); + }; + Utils.locationProcess(options, locationsuccess); + } +} +module.exports = QQMapWX; diff --git a/miniprogram/utils/util.ts b/miniprogram/utils/util.ts new file mode 100644 index 0000000..47d87a7 --- /dev/null +++ b/miniprogram/utils/util.ts @@ -0,0 +1,19 @@ +export const formatTime = (date: Date) => { + const year = date.getFullYear(); + const month = date.getMonth() + 1; + const day = date.getDate(); + const hour = date.getHours(); + const minute = date.getMinutes(); + const second = date.getSeconds(); + + return ( + [year, month, day].map(formatNumber).join('/') + + ' ' + + [hour, minute, second].map(formatNumber).join(':') + ); +}; + +const formatNumber = (n: number) => { + const s = n.toString(); + return s[1] ? s : '0' + s; +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..30e597f --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "miniprogram-ts-less-quickstart", + "version": "1.0.0", + "description": "", + "scripts": { + "preinstall": "npx only-allow pnpm", + "prepare": "husky install" + }, + "keywords": [], + "author": "", + "license": "", + "dependencies": { + "@vant/weapp": "^1.10.25", + "crypto-js": "^4.2.0", + "dayjs": "^1.11.9" + }, + "devDependencies": { + "@commitlint/cli": "^17.7.1", + "@commitlint/config-conventional": "^17.7.0", + "@gci/prettier-config": "^1.0.1", + "husky": "^8.0.0", + "lint-staged": "^14.0.1", + "miniprogram-api-typings": "^2.12.0", + "prettier": "^3.0.3" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..8b17db2 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,1661 @@ +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +dependencies: + '@vant/weapp': + specifier: ^1.10.25 + version: 1.10.25 + crypto-js: + specifier: ^4.2.0 + version: 4.2.0 + dayjs: + specifier: ^1.11.9 + version: 1.11.9 + +devDependencies: + '@commitlint/cli': + specifier: ^17.7.1 + version: 17.7.1 + '@commitlint/config-conventional': + specifier: ^17.7.0 + version: 17.7.0 + '@gci/prettier-config': + specifier: ^1.0.1 + version: 1.0.1 + husky: + specifier: ^8.0.0 + version: 8.0.0 + lint-staged: + specifier: ^14.0.1 + version: 14.0.1 + miniprogram-api-typings: + specifier: ^2.12.0 + version: 2.12.0 + prettier: + specifier: ^3.0.3 + version: 3.0.3 + +packages: + + /@babel/code-frame@7.22.13: + resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.22.13 + chalk: 2.4.2 + dev: true + + /@babel/helper-validator-identifier@7.22.15: + resolution: {integrity: sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/highlight@7.22.13: + resolution: {integrity: sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.22.15 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@commitlint/cli@17.7.1: + resolution: {integrity: sha512-BCm/AT06SNCQtvFv921iNhudOHuY16LswT0R3OeolVGLk8oP+Rk9TfQfgjH7QPMjhvp76bNqGFEcpKojxUNW1g==} + engines: {node: '>=v14'} + hasBin: true + dependencies: + '@commitlint/format': 17.4.4 + '@commitlint/lint': 17.7.0 + '@commitlint/load': 17.7.1 + '@commitlint/read': 17.5.1 + '@commitlint/types': 17.4.4 + execa: 5.1.1 + lodash.isfunction: 3.0.9 + resolve-from: 5.0.0 + resolve-global: 1.0.0 + yargs: 17.7.2 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + dev: true + + /@commitlint/config-conventional@17.7.0: + resolution: {integrity: sha512-iicqh2o6et+9kWaqsQiEYZzfLbtoWv9uZl8kbI8EGfnc0HeGafQBF7AJ0ylN9D/2kj6txltsdyQs8+2fTMwWEw==} + engines: {node: '>=v14'} + dependencies: + conventional-changelog-conventionalcommits: 6.1.0 + dev: true + + /@commitlint/config-validator@17.6.7: + resolution: {integrity: sha512-vJSncmnzwMvpr3lIcm0I8YVVDJTzyjy7NZAeXbTXy+MPUdAr9pKyyg7Tx/ebOQ9kqzE6O9WT6jg2164br5UdsQ==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/types': 17.4.4 + ajv: 8.12.0 + dev: true + + /@commitlint/ensure@17.6.7: + resolution: {integrity: sha512-mfDJOd1/O/eIb/h4qwXzUxkmskXDL9vNPnZ4AKYKiZALz4vHzwMxBSYtyL2mUIDeU9DRSpEUins8SeKtFkYHSw==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/types': 17.4.4 + lodash.camelcase: 4.3.0 + lodash.kebabcase: 4.1.1 + lodash.snakecase: 4.1.1 + lodash.startcase: 4.4.0 + lodash.upperfirst: 4.3.1 + dev: true + + /@commitlint/execute-rule@17.4.0: + resolution: {integrity: sha512-LIgYXuCSO5Gvtc0t9bebAMSwd68ewzmqLypqI2Kke1rqOqqDbMpYcYfoPfFlv9eyLIh4jocHWwCK5FS7z9icUA==} + engines: {node: '>=v14'} + dev: true + + /@commitlint/format@17.4.4: + resolution: {integrity: sha512-+IS7vpC4Gd/x+uyQPTAt3hXs5NxnkqAZ3aqrHd5Bx/R9skyCAWusNlNbw3InDbAK6j166D9asQM8fnmYIa+CXQ==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/types': 17.4.4 + chalk: 4.1.2 + dev: true + + /@commitlint/is-ignored@17.7.0: + resolution: {integrity: sha512-043rA7m45tyEfW7Zv2vZHF++176MLHH9h70fnPoYlB1slKBeKl8BwNIlnPg4xBdRBVNPaCqvXxWswx2GR4c9Hw==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/types': 17.4.4 + semver: 7.5.4 + dev: true + + /@commitlint/lint@17.7.0: + resolution: {integrity: sha512-TCQihm7/uszA5z1Ux1vw+Nf3yHTgicus/+9HiUQk+kRSQawByxZNESeQoX9ujfVd3r4Sa+3fn0JQAguG4xvvbA==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/is-ignored': 17.7.0 + '@commitlint/parse': 17.7.0 + '@commitlint/rules': 17.7.0 + '@commitlint/types': 17.4.4 + dev: true + + /@commitlint/load@17.7.1: + resolution: {integrity: sha512-S/QSOjE1ztdogYj61p6n3UbkUvweR17FQ0zDbNtoTLc+Hz7vvfS7ehoTMQ27hPSjVBpp7SzEcOQu081RLjKHJQ==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/config-validator': 17.6.7 + '@commitlint/execute-rule': 17.4.0 + '@commitlint/resolve-extends': 17.6.7 + '@commitlint/types': 17.4.4 + '@types/node': 20.4.7 + chalk: 4.1.2 + cosmiconfig: 8.3.4(typescript@5.2.2) + cosmiconfig-typescript-loader: 4.4.0(@types/node@20.4.7)(cosmiconfig@8.3.4)(ts-node@10.9.1)(typescript@5.2.2) + lodash.isplainobject: 4.0.6 + lodash.merge: 4.6.2 + lodash.uniq: 4.5.0 + resolve-from: 5.0.0 + ts-node: 10.9.1(@types/node@20.4.7)(typescript@5.2.2) + typescript: 5.2.2 + transitivePeerDependencies: + - '@swc/core' + - '@swc/wasm' + dev: true + + /@commitlint/message@17.4.2: + resolution: {integrity: sha512-3XMNbzB+3bhKA1hSAWPCQA3lNxR4zaeQAQcHj0Hx5sVdO6ryXtgUBGGv+1ZCLMgAPRixuc6en+iNAzZ4NzAa8Q==} + engines: {node: '>=v14'} + dev: true + + /@commitlint/parse@17.7.0: + resolution: {integrity: sha512-dIvFNUMCUHqq5Abv80mIEjLVfw8QNuA4DS7OWip4pcK/3h5wggmjVnlwGCDvDChkw2TjK1K6O+tAEV78oxjxag==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/types': 17.4.4 + conventional-changelog-angular: 6.0.0 + conventional-commits-parser: 4.0.0 + dev: true + + /@commitlint/read@17.5.1: + resolution: {integrity: sha512-7IhfvEvB//p9aYW09YVclHbdf1u7g7QhxeYW9ZHSO8Huzp8Rz7m05aCO1mFG7G8M+7yfFnXB5xOmG18brqQIBg==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/top-level': 17.4.0 + '@commitlint/types': 17.4.4 + fs-extra: 11.1.1 + git-raw-commits: 2.0.11 + minimist: 1.2.8 + dev: true + + /@commitlint/resolve-extends@17.6.7: + resolution: {integrity: sha512-PfeoAwLHtbOaC9bGn/FADN156CqkFz6ZKiVDMjuC2N5N0740Ke56rKU7Wxdwya8R8xzLK9vZzHgNbuGhaOVKIg==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/config-validator': 17.6.7 + '@commitlint/types': 17.4.4 + import-fresh: 3.3.0 + lodash.mergewith: 4.6.2 + resolve-from: 5.0.0 + resolve-global: 1.0.0 + dev: true + + /@commitlint/rules@17.7.0: + resolution: {integrity: sha512-J3qTh0+ilUE5folSaoK91ByOb8XeQjiGcdIdiB/8UT1/Rd1itKo0ju/eQVGyFzgTMYt8HrDJnGTmNWwcMR1rmA==} + engines: {node: '>=v14'} + dependencies: + '@commitlint/ensure': 17.6.7 + '@commitlint/message': 17.4.2 + '@commitlint/to-lines': 17.4.0 + '@commitlint/types': 17.4.4 + execa: 5.1.1 + dev: true + + /@commitlint/to-lines@17.4.0: + resolution: {integrity: sha512-LcIy/6ZZolsfwDUWfN1mJ+co09soSuNASfKEU5sCmgFCvX5iHwRYLiIuoqXzOVDYOy7E7IcHilr/KS0e5T+0Hg==} + engines: {node: '>=v14'} + dev: true + + /@commitlint/top-level@17.4.0: + resolution: {integrity: sha512-/1loE/g+dTTQgHnjoCy0AexKAEFyHsR2zRB4NWrZ6lZSMIxAhBJnmCqwao7b4H8888PsfoTBCLBYIw8vGnej8g==} + engines: {node: '>=v14'} + dependencies: + find-up: 5.0.0 + dev: true + + /@commitlint/types@17.4.4: + resolution: {integrity: sha512-amRN8tRLYOsxRr6mTnGGGvB5EmW/4DDjLMgiwK3CCVEmN6Sr/6xePGEpWaspKkckILuUORCwe6VfDBw6uj4axQ==} + engines: {node: '>=v14'} + dependencies: + chalk: 4.1.2 + dev: true + + /@cspotcode/source-map-support@0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + dev: true + + /@gci/prettier-config@1.0.1: + resolution: {integrity: sha512-NEzPeqM9Gner2UA37ldnPz80Oh1/WJaxRBJNomCmlIj+Nvg+YisBpeT+equby/YX2nTteseByHnFCImI/KZMyg==} + dev: true + + /@jridgewell/resolve-uri@3.1.1: + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + + /@jridgewell/trace-mapping@0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + + /@tsconfig/node10@1.0.9: + resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} + dev: true + + /@tsconfig/node12@1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + dev: true + + /@tsconfig/node14@1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + dev: true + + /@tsconfig/node16@1.0.4: + resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + dev: true + + /@types/minimist@1.2.2: + resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} + dev: true + + /@types/node@20.4.7: + resolution: {integrity: sha512-bUBrPjEry2QUTsnuEjzjbS7voGWCc30W0qzgMf90GPeDGFRakvrz47ju+oqDAKCXLUCe39u57/ORMl/O/04/9g==} + dev: true + + /@types/normalize-package-data@2.4.1: + resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} + dev: true + + /@vant/weapp@1.10.25: + resolution: {integrity: sha512-UGtEZdyaYNDfZ2GJ4qHU1ch23s2iYaPhxd+kx/baPvtPOlIllCLw0yk5v+4mMG6ZyMmIZCQd3nbLIEwDezLWYA==} + dev: false + + /JSONStream@1.3.5: + resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} + hasBin: true + dependencies: + jsonparse: 1.3.1 + through: 2.3.8 + dev: true + + /acorn-walk@8.2.0: + resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /ajv@8.12.0: + resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + dev: true + + /ansi-escapes@5.0.0: + resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==} + engines: {node: '>=12'} + dependencies: + type-fest: 1.4.0 + dev: true + + /ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-regex@6.0.1: + resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + engines: {node: '>=12'} + dev: true + + /ansi-styles@3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: true + + /ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + dev: true + + /arg@4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: true + + /argparse@2.0.1: + resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + dev: true + + /array-ify@1.0.0: + resolution: {integrity: sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==} + dev: true + + /arrify@1.0.1: + resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} + engines: {node: '>=0.10.0'} + dev: true + + /braces@3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /callsites@3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + + /camelcase-keys@6.2.2: + resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} + engines: {node: '>=8'} + dependencies: + camelcase: 5.3.1 + map-obj: 4.3.0 + quick-lru: 4.0.1 + dev: true + + /camelcase@5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + dev: true + + /chalk@2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + + /chalk@4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /chalk@5.3.0: + resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + dev: true + + /cli-cursor@4.0.0: + resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + restore-cursor: 4.0.0 + dev: true + + /cli-truncate@3.1.0: + resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + slice-ansi: 5.0.0 + string-width: 5.1.2 + dev: true + + /cliui@8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /color-convert@1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: true + + /color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name@1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true + + /color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /colorette@2.0.20: + resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + dev: true + + /commander@11.0.0: + resolution: {integrity: sha512-9HMlXtt/BNoYr8ooyjjNRdIilOTkVJXB+GhxMTtOKwk0R4j4lS4NpjuqmRxroBfnfTSHQIHQB7wryHhXarNjmQ==} + engines: {node: '>=16'} + dev: true + + /compare-func@2.0.0: + resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} + dependencies: + array-ify: 1.0.0 + dot-prop: 5.3.0 + dev: true + + /conventional-changelog-angular@6.0.0: + resolution: {integrity: sha512-6qLgrBF4gueoC7AFVHu51nHL9pF9FRjXrH+ceVf7WmAfH3gs+gEYOkvxhjMPjZu57I4AGUGoNTY8V7Hrgf1uqg==} + engines: {node: '>=14'} + dependencies: + compare-func: 2.0.0 + dev: true + + /conventional-changelog-conventionalcommits@6.1.0: + resolution: {integrity: sha512-3cS3GEtR78zTfMzk0AizXKKIdN4OvSh7ibNz6/DPbhWWQu7LqE/8+/GqSodV+sywUR2gpJAdP/1JFf4XtN7Zpw==} + engines: {node: '>=14'} + dependencies: + compare-func: 2.0.0 + dev: true + + /conventional-commits-parser@4.0.0: + resolution: {integrity: sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg==} + engines: {node: '>=14'} + hasBin: true + dependencies: + JSONStream: 1.3.5 + is-text-path: 1.0.1 + meow: 8.1.2 + split2: 3.2.2 + dev: true + + /cosmiconfig-typescript-loader@4.4.0(@types/node@20.4.7)(cosmiconfig@8.3.4)(ts-node@10.9.1)(typescript@5.2.2): + resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} + engines: {node: '>=v14.21.3'} + peerDependencies: + '@types/node': '*' + cosmiconfig: '>=7' + ts-node: '>=10' + typescript: '>=4' + dependencies: + '@types/node': 20.4.7 + cosmiconfig: 8.3.4(typescript@5.2.2) + ts-node: 10.9.1(@types/node@20.4.7)(typescript@5.2.2) + typescript: 5.2.2 + dev: true + + /cosmiconfig@8.3.4(typescript@5.2.2): + resolution: {integrity: sha512-SF+2P8+o/PTV05rgsAjDzL4OFdVXAulSfC/L19VaeVT7+tpOOSscCt2QLxDZ+CLxF2WOiq6y1K5asvs8qUJT/Q==} + engines: {node: '>=14'} + peerDependencies: + typescript: '>=4.9.5' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + import-fresh: 3.3.0 + js-yaml: 4.1.0 + parse-json: 5.2.0 + path-type: 4.0.0 + typescript: 5.2.2 + dev: true + + /create-require@1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + + /cross-spawn@7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /crypto-js@4.2.0: + resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==} + dev: false + + /dargs@7.0.0: + resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} + engines: {node: '>=8'} + dev: true + + /dayjs@1.11.9: + resolution: {integrity: sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==} + dev: false + + /debug@4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /decamelize-keys@1.1.1: + resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} + engines: {node: '>=0.10.0'} + dependencies: + decamelize: 1.2.0 + map-obj: 1.0.1 + dev: true + + /decamelize@1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + dev: true + + /diff@4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: true + + /dot-prop@5.3.0: + resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} + engines: {node: '>=8'} + dependencies: + is-obj: 2.0.0 + dev: true + + /eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + dev: true + + /emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: true + + /error-ex@1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true + + /escalade@3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /escape-string-regexp@1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: true + + /eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + dev: true + + /execa@5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + + /execa@7.2.0: + resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} + engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 4.3.1 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.1.0 + onetime: 6.0.0 + signal-exit: 3.0.7 + strip-final-newline: 3.0.0 + dev: true + + /fast-deep-equal@3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + dev: true + + /fill-range@7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /find-up@4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + + /find-up@5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: true + + /fs-extra@11.1.1: + resolution: {integrity: sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==} + engines: {node: '>=14.14'} + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.0 + dev: true + + /function-bind@1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /get-caller-file@2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-stream@6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + + /git-raw-commits@2.0.11: + resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + dargs: 7.0.0 + lodash: 4.17.21 + meow: 8.1.2 + split2: 3.2.2 + through2: 4.0.2 + dev: true + + /global-dirs@0.1.1: + resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} + engines: {node: '>=4'} + dependencies: + ini: 1.3.8 + dev: true + + /graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + dev: true + + /hard-rejection@2.1.0: + resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} + engines: {node: '>=6'} + dev: true + + /has-flag@3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + dev: true + + /has-flag@4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has@1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + + /hosted-git-info@2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: true + + /hosted-git-info@4.1.0: + resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} + engines: {node: '>=10'} + dependencies: + lru-cache: 6.0.0 + dev: true + + /human-signals@2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: true + + /human-signals@4.3.1: + resolution: {integrity: sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ==} + engines: {node: '>=14.18.0'} + dev: true + + /husky@8.0.0: + resolution: {integrity: sha512-4qbE/5dzNDNxFEkX9MNRPKl5+omTXQzdILCUWiqG/lWIAioiM5vln265/l6I2Zx8gpW8l1ukZwGQeCFbBZ6+6w==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /import-fresh@3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + dev: true + + /indent-string@4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + dev: true + + /inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + dev: true + + /is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true + + /is-core-module@2.13.0: + resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==} + dependencies: + has: 1.0.3 + dev: true + + /is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /is-fullwidth-code-point@4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + dev: true + + /is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-obj@2.0.0: + resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} + engines: {node: '>=8'} + dev: true + + /is-plain-obj@1.1.0: + resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} + engines: {node: '>=0.10.0'} + dev: true + + /is-stream@2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: true + + /is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /is-text-path@1.0.1: + resolution: {integrity: sha512-xFuJpne9oFz5qDaodwmmG08e3CawH/2ZV8Qqza1Ko7Sk8POWbkRdwIoAWVhqvq0XeUzANEhKo2n0IXUGBm7A/w==} + engines: {node: '>=0.10.0'} + dependencies: + text-extensions: 1.9.0 + dev: true + + /isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true + + /js-yaml@4.1.0: + resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} + hasBin: true + dependencies: + argparse: 2.0.1 + dev: true + + /json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: true + + /json-schema-traverse@1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + dev: true + + /jsonfile@6.1.0: + resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + dependencies: + universalify: 2.0.0 + optionalDependencies: + graceful-fs: 4.2.11 + dev: true + + /jsonparse@1.3.1: + resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} + engines: {'0': node >= 0.2.0} + dev: true + + /kind-of@6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + dev: true + + /lilconfig@2.1.0: + resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} + engines: {node: '>=10'} + dev: true + + /lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + dev: true + + /lint-staged@14.0.1: + resolution: {integrity: sha512-Mw0cL6HXnHN1ag0mN/Dg4g6sr8uf8sn98w2Oc1ECtFto9tvRF7nkXGJRbx8gPlHyoR0pLyBr2lQHbWwmUHe1Sw==} + engines: {node: ^16.14.0 || >=18.0.0} + hasBin: true + dependencies: + chalk: 5.3.0 + commander: 11.0.0 + debug: 4.3.4 + execa: 7.2.0 + lilconfig: 2.1.0 + listr2: 6.6.1 + micromatch: 4.0.5 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.3.1 + transitivePeerDependencies: + - enquirer + - supports-color + dev: true + + /listr2@6.6.1: + resolution: {integrity: sha512-+rAXGHh0fkEWdXBmX+L6mmfmXmXvDGEKzkjxO+8mP3+nI/r/CWznVBvsibXdxda9Zz0OW2e2ikphN3OwCT/jSg==} + engines: {node: '>=16.0.0'} + peerDependencies: + enquirer: '>= 2.3.0 < 3' + peerDependenciesMeta: + enquirer: + optional: true + dependencies: + cli-truncate: 3.1.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 5.0.1 + rfdc: 1.3.0 + wrap-ansi: 8.1.0 + dev: true + + /locate-path@5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + dependencies: + p-locate: 4.1.0 + dev: true + + /locate-path@6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: true + + /lodash.camelcase@4.3.0: + resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} + dev: true + + /lodash.isfunction@3.0.9: + resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} + dev: true + + /lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + dev: true + + /lodash.kebabcase@4.1.1: + resolution: {integrity: sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==} + dev: true + + /lodash.merge@4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + dev: true + + /lodash.mergewith@4.6.2: + resolution: {integrity: sha512-GK3g5RPZWTRSeLSpgP8Xhra+pnjBC56q9FZYe1d5RN3TJ35dbkGy3YqBSMbyCrlbi+CM9Z3Jk5yTL7RCsqboyQ==} + dev: true + + /lodash.snakecase@4.1.1: + resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} + dev: true + + /lodash.startcase@4.4.0: + resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + dev: true + + /lodash.uniq@4.5.0: + resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} + dev: true + + /lodash.upperfirst@4.3.1: + resolution: {integrity: sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==} + dev: true + + /lodash@4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /log-update@5.0.1: + resolution: {integrity: sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + ansi-escapes: 5.0.0 + cli-cursor: 4.0.0 + slice-ansi: 5.0.0 + strip-ansi: 7.1.0 + wrap-ansi: 8.1.0 + dev: true + + /lru-cache@6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: true + + /make-error@1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + + /map-obj@1.0.1: + resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} + engines: {node: '>=0.10.0'} + dev: true + + /map-obj@4.3.0: + resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} + engines: {node: '>=8'} + dev: true + + /meow@8.1.2: + resolution: {integrity: sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==} + engines: {node: '>=10'} + dependencies: + '@types/minimist': 1.2.2 + camelcase-keys: 6.2.2 + decamelize-keys: 1.1.1 + hard-rejection: 2.1.0 + minimist-options: 4.1.0 + normalize-package-data: 3.0.3 + read-pkg-up: 7.0.1 + redent: 3.0.0 + trim-newlines: 3.0.1 + type-fest: 0.18.1 + yargs-parser: 20.2.9 + dev: true + + /merge-stream@2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: true + + /micromatch@4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /mimic-fn@2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + + /mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + dev: true + + /min-indent@1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + dev: true + + /minimist-options@4.1.0: + resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} + engines: {node: '>= 6'} + dependencies: + arrify: 1.0.1 + is-plain-obj: 1.1.0 + kind-of: 6.0.3 + dev: true + + /minimist@1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + + /miniprogram-api-typings@2.12.0: + resolution: {integrity: sha512-ibvbqeslVFur0IAvTxLMvsbtvVcMo6gwvOnj0YZHV7aeDLu091VQRrETT2QuiG9P6aZWRcxeNGJChRKVPCp9VQ==} + dev: true + + /ms@2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + + /normalize-package-data@2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.4 + semver: 5.7.2 + validate-npm-package-license: 3.0.4 + dev: true + + /normalize-package-data@3.0.3: + resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} + engines: {node: '>=10'} + dependencies: + hosted-git-info: 4.1.0 + is-core-module: 2.13.0 + semver: 7.5.4 + validate-npm-package-license: 3.0.4 + dev: true + + /npm-run-path@4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: true + + /npm-run-path@5.1.0: + resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + path-key: 4.0.0 + dev: true + + /onetime@5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + + /onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + dependencies: + mimic-fn: 4.0.0 + dev: true + + /p-limit@2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + dependencies: + p-try: 2.2.0 + dev: true + + /p-limit@3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate@4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-locate@5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: true + + /p-try@2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + dev: true + + /parent-module@1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + dev: true + + /parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + dependencies: + '@babel/code-frame': 7.22.13 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + dev: true + + /path-exists@4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + dev: true + + /path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /path-type@4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true + + /picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /pidtree@0.6.0: + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} + engines: {node: '>=0.10'} + hasBin: true + dev: true + + /prettier@3.0.3: + resolution: {integrity: sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==} + engines: {node: '>=14'} + hasBin: true + dev: true + + /punycode@2.3.0: + resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + engines: {node: '>=6'} + dev: true + + /quick-lru@4.0.1: + resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} + engines: {node: '>=8'} + dev: true + + /read-pkg-up@7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + dev: true + + /read-pkg@5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + dependencies: + '@types/normalize-package-data': 2.4.1 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + dev: true + + /readable-stream@3.6.2: + resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} + engines: {node: '>= 6'} + dependencies: + inherits: 2.0.4 + string_decoder: 1.3.0 + util-deprecate: 1.0.2 + dev: true + + /redent@3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 + dev: true + + /require-directory@2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /require-from-string@2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + dev: true + + /resolve-from@4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + dev: true + + /resolve-from@5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + dev: true + + /resolve-global@1.0.0: + resolution: {integrity: sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==} + engines: {node: '>=8'} + dependencies: + global-dirs: 0.1.1 + dev: true + + /resolve@1.22.4: + resolution: {integrity: sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==} + hasBin: true + dependencies: + is-core-module: 2.13.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /restore-cursor@4.0.0: + resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + onetime: 5.1.2 + signal-exit: 3.0.7 + dev: true + + /rfdc@1.3.0: + resolution: {integrity: sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==} + dev: true + + /safe-buffer@5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: true + + /semver@5.7.2: + resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} + hasBin: true + dev: true + + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /signal-exit@3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + + /slice-ansi@5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + dev: true + + /spdx-correct@3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.13 + dev: true + + /spdx-exceptions@2.3.0: + resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} + dev: true + + /spdx-expression-parse@3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.3.0 + spdx-license-ids: 3.0.13 + dev: true + + /spdx-license-ids@3.0.13: + resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} + dev: true + + /split2@3.2.2: + resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} + dependencies: + readable-stream: 3.6.2 + dev: true + + /string-argv@0.3.2: + resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} + engines: {node: '>=0.6.19'} + dev: true + + /string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.0 + dev: true + + /string_decoder@1.3.0: + resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + dependencies: + ansi-regex: 6.0.1 + dev: true + + /strip-final-newline@2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: true + + /strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + dev: true + + /strip-indent@3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + dependencies: + min-indent: 1.0.1 + dev: true + + /supports-color@5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color@7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /text-extensions@1.9.0: + resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==} + engines: {node: '>=0.10'} + dev: true + + /through2@4.0.2: + resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} + dependencies: + readable-stream: 3.6.2 + dev: true + + /through@2.3.8: + resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} + dev: true + + /to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /trim-newlines@3.0.1: + resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} + engines: {node: '>=8'} + dev: true + + /ts-node@10.9.1(@types/node@20.4.7)(typescript@5.2.2): + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.4.7 + acorn: 8.10.0 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 5.2.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + + /type-fest@0.18.1: + resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} + engines: {node: '>=10'} + dev: true + + /type-fest@0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + dev: true + + /type-fest@0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + dev: true + + /type-fest@1.4.0: + resolution: {integrity: sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==} + engines: {node: '>=10'} + dev: true + + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + + /universalify@2.0.0: + resolution: {integrity: sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==} + engines: {node: '>= 10.0.0'} + dev: true + + /uri-js@4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.3.0 + dev: true + + /util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: true + + /v8-compile-cache-lib@3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + dev: true + + /validate-npm-package-license@3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.2.0 + spdx-expression-parse: 3.0.1 + dev: true + + /which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + dev: true + + /y18n@5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yallist@4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true + + /yaml@2.3.1: + resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} + engines: {node: '>= 14'} + dev: true + + /yargs-parser@20.2.9: + resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} + engines: {node: '>=10'} + dev: true + + /yargs-parser@21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs@17.7.2: + resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true + + /yn@3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: true + + /yocto-queue@0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..0fff561 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1 @@ +module.exports = require('@gci/prettier-config'); diff --git a/project.config.json b/project.config.json new file mode 100644 index 0000000..97ee96e --- /dev/null +++ b/project.config.json @@ -0,0 +1,42 @@ +{ + "appid": "wxf848010c564e297c", + "description": "项目配置文件", + "packOptions": { + "ignore": [], + "include": [] + }, + "miniprogramRoot": "miniprogram/", + "compileType": "miniprogram", + "projectname": "ts-less-demo", + "setting": { + "useCompilerPlugins": [ + "typescript", + "less" + ], + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + }, + "condition": false, + "packNpmManually": true, + "packNpmRelationList": [ + { + "packageJsonPath": "./package.json", + "miniprogramNpmDistDir": "./miniprogram" + } + ], + "es6": true, + "enhance": true, + "minified": true + }, + "simulatorType": "wechat", + "simulatorPluginLibVersion": {}, + "condition": {}, + "srcMiniprogramRoot": "miniprogram/", + "libVersion": "3.0.1", + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 2 + } +} \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json new file mode 100644 index 0000000..924f377 --- /dev/null +++ b/project.private.config.json @@ -0,0 +1,8 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "weapp-ts-less", + "setting": { + "compileHotReLoad": true, + "urlCheck": false + } +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..105f0c7 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,35 @@ +{ + "compilerOptions": { + "strictNullChecks": true, + "noImplicitAny": true, + "module": "CommonJS", + "target": "ES2020", + "allowJs": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "experimentalDecorators": true, + "noImplicitThis": true, + "noImplicitReturns": true, + "alwaysStrict": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + "strictPropertyInitialization": true, + "lib": ["ES2020"], + "typeRoots": [ + "./typings" + ], + "baseUrl": ".", + "types": ["miniprogram-api-typings"], + "paths": { + "@vant/weapp/*": ["node_modules/@vant/weapp/dist/*"], + }, + }, + "include": [ + "./**/*.ts" +, "miniprogram/api/login/index.js", "miniprogram/api/login/types.js" ], + "exclude": [ + "node_modules" + ] +} diff --git a/typings/index.d.ts b/typings/index.d.ts new file mode 100644 index 0000000..8f7e1ac --- /dev/null +++ b/typings/index.d.ts @@ -0,0 +1,8 @@ +/// + +interface IAppOption { + globalData: { + userInfo?: WechatMiniprogram.UserInfo; + }; + userInfoReadyCallback?: WechatMiniprogram.GetUserInfoSuccessCallback; +} diff --git a/typings/types/index.d.ts b/typings/types/index.d.ts new file mode 100644 index 0000000..a5e8a7c --- /dev/null +++ b/typings/types/index.d.ts @@ -0,0 +1 @@ +/// diff --git a/typings/types/wx/index.d.ts b/typings/types/wx/index.d.ts new file mode 100644 index 0000000..98399a4 --- /dev/null +++ b/typings/types/wx/index.d.ts @@ -0,0 +1,162 @@ +/*! ***************************************************************************** +Copyright (c) 2023 Tencent, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +***************************************************************************** */ + +/// +/// +/// +/// +/// +/// +/// +/// +/// + +declare namespace WechatMiniprogram { + type IAnyObject = Record; + type Optional = F extends (arg: infer P) => infer R ? (arg?: P) => R : F; + type OptionalInterface = { [K in keyof T]: Optional }; + interface AsyncMethodOptionLike { + success?: (...args: any[]) => void; + } + type PromisifySuccessResult = P extends { + success: any; + } + ? void + : P extends { fail: any } + ? void + : P extends { complete: any } + ? void + : Promise>[0]>; + + // TODO: Extract real definition from `lib.dom.d.ts` to replace this + type IIRFilterNode = any; + type WaveShaperNode = any; + type ConstantSourceNode = any; + type OscillatorNode = any; + type GainNode = any; + type BiquadFilterNode = any; + type PeriodicWaveNode = any; + type AudioNode = any; + type AudioParam = any; + type ChannelSplitterNode = any; + type ChannelMergerNode = any; + type DelayNode = any; + type DynamicsCompressorNode = any; + type ScriptProcessorNode = any; + type PannerNode = any; + type AnalyserNode = any; + type AudioListener = any; + type WebGLTexture = any; + type WebGLRenderingContext = any; + + // TODO: fill worklet type + type WorkletFunction = (...args: any) => any; + type AnimationObject = any; + type SharedValue = T; + type DerivedValue = T; +} + +declare let console: WechatMiniprogram.Console; + +declare let wx: WechatMiniprogram.Wx; +/** 引入模块。返回模块通过 `module.exports` 或 `exports` 暴露的接口。 */ +interface Require { + ( + /** 需要引入模块文件相对于当前文件的相对路径,或 npm 模块名,或 npm 模块路径。不支持绝对路径 */ + module: string, + /** 用于异步获取其他分包中的模块的引用结果,详见 [分包异步化]((subpackages/async)) */ + callback?: (moduleExport: any) => void, + /** 异步获取分包失败时的回调,详见 [分包异步化]((subpackages/async)) */ + errorCallback?: (err: any) => void + ): any; + /** 以 Promise 形式异步引入模块。返回模块通过 `module.exports` 或 `exports` 暴露的接口。 */ + async( + /** 需要引入模块文件相对于当前文件的相对路径,或 npm 模块名,或 npm 模块路径。不支持绝对路径 */ + module: string + ): Promise; +} +declare const require: Require; +/** 引入插件。返回插件通过 `main` 暴露的接口。 */ +interface RequirePlugin { + ( + /** 需要引入的插件的 alias */ + module: string, + /** 用于异步获取其他分包中的插件的引用结果,详见 [分包异步化]((subpackages/async)) */ + callback?: (pluginExport: any) => void + ): any; + /** 以 Promise 形式异步引入插件。返回插件通过 `main` 暴露的接口。 */ + async( + /** 需要引入的插件的 alias */ + module: string + ): Promise; +} +declare const requirePlugin: RequirePlugin; +/** 插件引入当前使用者小程序。返回使用者小程序通过 [插件配置中 `export` 暴露的接口](https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/using.html#%E5%AF%BC%E5%87%BA%E5%88%B0%E6%8F%92%E4%BB%B6)。 + * + * 该接口只在插件中存在 + * + * 最低基础库: `2.11.1` */ +declare function requireMiniProgram(): any; +/** 当前模块对象 */ +declare let module: { + /** 模块向外暴露的对象,使用 `require` 引用该模块时可以获取 */ + exports: any; +}; +/** `module.exports` 的引用 */ +declare let exports: any; + +/** [clearInterval(number intervalID)](https://developers.weixin.qq.com/miniprogram/dev/api/base/timer/clearInterval.html) + * + * 取消由 setInterval 设置的定时器。 */ +declare function clearInterval( + /** 要取消的定时器的 ID */ + intervalID: number +): void; +/** [clearTimeout(number timeoutID)](https://developers.weixin.qq.com/miniprogram/dev/api/base/timer/clearTimeout.html) + * + * 取消由 setTimeout 设置的定时器。 */ +declare function clearTimeout( + /** 要取消的定时器的 ID */ + timeoutID: number +): void; +/** [number setInterval(function callback, number delay, any rest)](https://developers.weixin.qq.com/miniprogram/dev/api/base/timer/setInterval.html) + * + * 设定一个定时器。按照指定的周期(以毫秒计)来执行注册的回调函数 */ +declare function setInterval( + /** 回调函数 */ + callback: (...args: any[]) => any, + /** 执行回调函数之间的时间间隔,单位 ms。 */ + delay?: number, + /** param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ + rest?: any +): number; +/** [number setTimeout(function callback, number delay, any rest)](https://developers.weixin.qq.com/miniprogram/dev/api/base/timer/setTimeout.html) + * + * 设定一个定时器。在定时到期以后执行注册的回调函数 */ +declare function setTimeout( + /** 回调函数 */ + callback: (...args: any[]) => any, + /** 延迟的时间,函数的调用会在该延迟之后发生,单位 ms。 */ + delay?: number, + /** param1, param2, ..., paramN 等附加参数,它们会作为参数传递给回调函数。 */ + rest?: any +): number; diff --git a/typings/types/wx/lib.wx.api.d.ts b/typings/types/wx/lib.wx.api.d.ts new file mode 100644 index 0000000..40183ab --- /dev/null +++ b/typings/types/wx/lib.wx.api.d.ts @@ -0,0 +1,31966 @@ +/*! ***************************************************************************** +Copyright (c) 2023 Tencent, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +***************************************************************************** */ + +/// + +declare namespace WechatMiniprogram { + interface AccessOption { + /** 要判断是否存在的文件/目录路径 (本地路径) */ + path: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AccessCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AccessFailCallback; + /** 接口调用成功的回调函数 */ + success?: AccessSuccessCallback; + } + /** 账号信息 */ + interface AccountInfo { + /** 小程序账号信息 */ + miniProgram: MiniProgram; + /** 插件账号信息(仅在插件中调用时包含这一项) */ + plugin: Plugin; + } + interface AddArcOption { + /** 终点 */ + end: MapPostion; + /** 圆弧 id */ + id: number; + /** 起始点 */ + start: MapPostion; + /** 夹角角度 */ + angle?: number; + /** 线的颜色 */ + color?: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddArcCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddArcFailCallback; + /** 途经点 */ + pass?: MapPostion; + /** 接口调用成功的回调函数 */ + success?: AddArcSuccessCallback; + /** 线宽 */ + width?: number; + } + interface AddCardOption { + /** 需要添加的卡券列表 */ + cardList: AddCardRequestInfo[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddCardCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddCardFailCallback; + /** 接口调用成功的回调函数 */ + success?: AddCardSuccessCallback; + } + /** 需要添加的卡券列表 */ + interface AddCardRequestInfo { + /** 卡券的扩展参数。需将 CardExt 对象 JSON 序列化为**字符串**传入 */ + cardExt: string; + /** 卡券 ID */ + cardId: string; + } + /** 卡券添加结果列表 */ + interface AddCardResponseInfo { + /** 卡券的扩展参数,结构请参考下文 */ + cardExt: string; + /** 用户领取到卡券的 ID */ + cardId: string; + /** 加密 code,为用户领取到卡券的code加密后的字符串,解密请参照:[code 解码接口](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1499332673_Unm7V) */ + code: string; + /** 是否成功 */ + isSuccess: boolean; + } + interface AddCardSuccessCallbackResult { + /** 卡券添加结果列表 */ + cardList: AddCardResponseInfo[]; + errMsg: string; + } + interface AddCustomLayerOption { + /** 个性化图层id */ + layerId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddCustomLayerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddCustomLayerFailCallback; + /** 接口调用成功的回调函数 */ + success?: AddCustomLayerSuccessCallback; + } + interface AddFileToFavoritesOption { + /** 要收藏的文件地址,必须为本地路径或临时路径 */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddFileToFavoritesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddFileToFavoritesFailCallback; + /** 自定义文件名,若留空则使用filePath中的文件名 */ + fileName?: string; + /** 接口调用成功的回调函数 */ + success?: AddFileToFavoritesSuccessCallback; + } + interface AddGroundOverlayOption { + /** 图片覆盖的经纬度范围 */ + bounds: MapBounds; + /** 图片图层 id */ + id: string; + /** 图片路径,支持网络图片、临时路径、代码包路径 */ + src: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddGroundOverlayCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddGroundOverlayFailCallback; + /** 图层透明度 */ + opacity?: number; + /** 接口调用成功的回调函数 */ + success?: AddGroundOverlaySuccessCallback; + /** 是否可见 */ + visible?: boolean; + /** 图层绘制顺序 */ + zIndex?: number; + } + interface AddMarkersOption { + /** 同传入 map 组件的 marker 属性 */ + markers: any[]; + /** 是否先清空地图上所有 marker */ + clear?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddMarkersCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddMarkersFailCallback; + /** 接口调用成功的回调函数 */ + success?: AddMarkersSuccessCallback; + } + interface AddPhoneCalendarOption { + /** 开始时间的 unix 时间戳 */ + startTime: number; + /** 日历事件标题 */ + title: string; + /** 是否提醒,默认 true */ + alarm?: boolean; + /** 提醒提前量,单位秒,默认 0 表示开始时提醒 */ + alarmOffset?: number; + /** 是否全天事件,默认 false */ + allDay?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddPhoneCalendarCompleteCallback; + /** 事件说明 */ + description?: string; + /** 结束时间的 unix 时间戳,默认与开始时间相同 */ + endTime?: string; + /** 接口调用失败的回调函数 */ + fail?: AddPhoneCalendarFailCallback; + /** 事件位置 */ + location?: string; + /** 接口调用成功的回调函数 */ + success?: AddPhoneCalendarSuccessCallback; + } + interface AddPhoneContactOption { + /** 名字 */ + firstName: string; + /** 联系地址城市 */ + addressCity?: string; + /** 联系地址国家 */ + addressCountry?: string; + /** 联系地址邮政编码 */ + addressPostalCode?: string; + /** 联系地址省份 */ + addressState?: string; + /** 联系地址街道 */ + addressStreet?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddPhoneContactCompleteCallback; + /** 电子邮件 */ + email?: string; + /** 接口调用失败的回调函数 */ + fail?: AddPhoneContactFailCallback; + /** 住宅地址城市 */ + homeAddressCity?: string; + /** 住宅地址国家 */ + homeAddressCountry?: string; + /** 住宅地址邮政编码 */ + homeAddressPostalCode?: string; + /** 住宅地址省份 */ + homeAddressState?: string; + /** 住宅地址街道 */ + homeAddressStreet?: string; + /** 住宅传真 */ + homeFaxNumber?: string; + /** 住宅电话 */ + homePhoneNumber?: string; + /** 公司电话 */ + hostNumber?: string; + /** 姓氏 */ + lastName?: string; + /** 中间名 */ + middleName?: string; + /** 手机号 */ + mobilePhoneNumber?: string; + /** 昵称 */ + nickName?: string; + /** 公司 */ + organization?: string; + /** 头像本地文件路径 */ + photoFilePath?: string; + /** 备注 */ + remark?: string; + /** 接口调用成功的回调函数 */ + success?: AddPhoneContactSuccessCallback; + /** 职位 */ + title?: string; + /** 网站 */ + url?: string; + /** 微信号 */ + weChatNumber?: string; + /** 工作地址城市 */ + workAddressCity?: string; + /** 工作地址国家 */ + workAddressCountry?: string; + /** 工作地址邮政编码 */ + workAddressPostalCode?: string; + /** 工作地址省份 */ + workAddressState?: string; + /** 工作地址街道 */ + workAddressStreet?: string; + /** 工作传真 */ + workFaxNumber?: string; + /** 工作电话 */ + workPhoneNumber?: string; + } + interface AddPhoneRepeatCalendarOption { + /** 开始时间的 unix 时间戳 (1970年1月1日开始所经过的秒数) */ + startTime: number; + /** 日历事件标题 */ + title: string; + /** 是否提醒,默认 true */ + alarm?: boolean; + /** 提醒提前量,单位秒,默认 0 表示开始时提醒 */ + alarmOffset?: number; + /** 是否全天事件,默认 false */ + allDay?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddPhoneRepeatCalendarCompleteCallback; + /** 事件说明 */ + description?: string; + /** 结束时间的 unix 时间戳,默认与开始时间相同 */ + endTime?: string; + /** 接口调用失败的回调函数 */ + fail?: AddPhoneRepeatCalendarFailCallback; + /** 事件位置 */ + location?: string; + /** 重复周期结束时间的 unix 时间戳,不填表示一直重复 */ + repeatEndTime?: number; + /** 重复周期,默认 month 每月重复 + * + * 可选值: + * - 'day': 每天重复; + * - 'week': 每周重复; + * - 'month': 每月重复。该模式日期不能大于 28 日; + * - 'year': 每年重复; */ + repeatInterval?: 'day' | 'week' | 'month' | 'year'; + /** 接口调用成功的回调函数 */ + success?: AddPhoneRepeatCalendarSuccessCallback; + } + interface AddServiceOption { + /** 描述service的Object */ + service: BLEPeripheralService; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddServiceCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddServiceFailCallback; + /** 接口调用成功的回调函数 */ + success?: AddServiceSuccessCallback; + } + interface AddVideoToFavoritesOption { + /** 要收藏的视频地址,必须为本地路径或临时路径 */ + videoPath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddVideoToFavoritesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddVideoToFavoritesFailCallback; + /** 接口调用成功的回调函数 */ + success?: AddVideoToFavoritesSuccessCallback; + /** 缩略图路径,若留空则使用视频首帧 */ + thumbPath?: string; + } + interface AddVisualLayerOption { + /** 可视化图层id([创建图层指引](https://lbs.qq.com/dev/console/layers/layerEdit)) */ + layerId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AddVisualLayerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AddVisualLayerFailCallback; + /** 刷新周期,单位秒 */ + interval?: number; + /** 图层透明度 */ + opacity?: number; + /** 接口调用成功的回调函数 */ + success?: AddVisualLayerSuccessCallback; + /** 图层绘制顺序 */ + zIndex?: number; + } + /** 广播自定义参数 */ + interface AdvertiseReqObj { + /** 需要基础库: `2.20.1` + * + * 以 beacon 设备形式广播的参数。 */ + beacon?: BeaconInfoObj; + /** 当前设备是否可连接 */ + connectable?: boolean; + /** 广播中 deviceName 字段,默认为空 */ + deviceName?: string; + /** 广播的制造商信息。仅安卓支持,iOS 因系统限制无法定制。 */ + manufacturerData?: ManufacturerData[]; + /** 要广播的服务 UUID 列表。使用 16/32 位 UUID 时请参考注意事项。 */ + serviceUuids?: string[]; + } + /** animationData */ + interface AnimationExportResult { + actions: IAnyObject[]; + } + /** 动画效果 */ + interface AnimationOption { + /** 动画变化时间,单位 ms */ + duration?: number; + /** 动画变化方式 + * + * 可选值: + * - 'linear': 动画从头到尾的速度是相同的; + * - 'easeIn': 动画以低速开始; + * - 'easeOut': 动画以低速结束; + * - 'easeInOut': 动画以低速开始和结束; */ + timingFunc?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut'; + } + interface AppAuthorizeSetting { + /** 允许微信使用相册的开关(仅 iOS 有效) */ + albumAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 允许微信使用蓝牙的开关(仅 iOS 有效) */ + bluetoothAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 允许微信使用摄像头的开关 */ + cameraAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 允许微信使用定位的开关 */ + locationAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 定位准确度。true 表示模糊定位,false 表示精确定位(仅 iOS 有效) */ + locationReducedAccuracy: boolean; + /** 允许微信使用麦克风的开关 */ + microphoneAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 允许微信通知带有提醒的开关(仅 iOS 有效) */ + notificationAlertAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 允许微信通知的开关 */ + notificationAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 允许微信通知带有标记的开关(仅 iOS 有效) */ + notificationBadgeAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 允许微信通知带有声音的开关(仅 iOS 有效) */ + notificationSoundAuthorized: 'authorized' | 'denied' | 'not determined'; + /** 允许微信读写日历的开关 */ + phoneCalendarAuthorized: 'authorized' | 'denied' | 'not determined'; + } + interface AppBaseInfo { + /** 客户端基础库版本 */ + SDKVersion: string; + /** 是否已打开调试。可通过右上角菜单或 [wx.setEnableDebug](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.setEnableDebug.html) 打开调试。 */ + enableDebug: boolean; + /** 当前小程序运行的宿主环境 */ + host: AppBaseInfoHost; + /** 微信设置的语言 */ + language: string; + /** 微信版本号 */ + version: string; + /** 系统当前主题,取值为`light`或`dark`,全局配置`"darkmode":true`时才能获取,否则为 undefined (不支持小游戏) + * + * 可选值: + * - 'dark': 深色主题; + * - 'light': 浅色主题; */ + theme?: 'dark' | 'light'; + } + /** 当前小程序运行的宿主环境 */ + interface AppBaseInfoHost { + /** 宿主 app(第三方App) 对应的 appId (当小程序运行在第三方App环境时才返回) */ + appId: string; + } + interface AppendFileOption { + /** 要追加的文本或二进制数据 */ + data: string | ArrayBuffer; + /** 要追加内容的文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AppendFileCompleteCallback; + /** 指定写入文件的字符编码 + * + * 可选值: + * - 'ascii': ; + * - 'base64': ; + * - 'binary': ; + * - 'hex': ; + * - 'ucs2': 以小端序读取; + * - 'ucs-2': 以小端序读取; + * - 'utf16le': 以小端序读取; + * - 'utf-16le': 以小端序读取; + * - 'utf-8': ; + * - 'utf8': ; + * - 'latin1': ; */ + encoding?: + | 'ascii' + | 'base64' + | 'binary' + | 'hex' + | 'ucs2' + | 'ucs-2' + | 'utf16le' + | 'utf-16le' + | 'utf-8' + | 'utf8' + | 'latin1'; + /** 接口调用失败的回调函数 */ + fail?: AppendFileFailCallback; + /** 接口调用成功的回调函数 */ + success?: AppendFileSuccessCallback; + } + interface ApplyBlusherStickMakeupOption { + /** 上色程度 0-1 */ + alpha: number; + blendMode: string; + /** 左腮红资源路径 */ + path: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ApplyBlusherStickMakeupCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ApplyBlusherStickMakeupFailCallback; + /** 接口调用成功的回调函数 */ + success?: ApplyBlusherStickMakeupSuccessCallback; + } + interface ApplyEyeBrowMakeupOption { + /** 上色程度 0-1 */ + alpha: number; + blendMode: string; + path: string; + shrinkRate: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ApplyEyeBrowMakeupCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ApplyEyeBrowMakeupFailCallback; + /** 接口调用成功的回调函数 */ + success?: ApplyEyeBrowMakeupSuccessCallback; + } + interface ApplyEyeShadowMakeupOption { + /** 上色程度 0-1 */ + alpha: number; + blendMode: string; + /** 眼影资源路径 */ + path: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ApplyEyeShadowMakeupCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ApplyEyeShadowMakeupFailCallback; + /** 细致效果图片资源路径 */ + shimmerPosition?: string; + /** 细致效果图片资源 md5 */ + shimmerPositionMD5?: string; + /** 接口调用成功的回调函数 */ + success?: ApplyEyeShadowMakeupSuccessCallback; + } + interface ApplyFaceContourMakeupOption { + alpha: number; + /** 高光资源路径 */ + path: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ApplyFaceContourMakeupCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ApplyFaceContourMakeupFailCallback; + /** 接口调用成功的回调函数 */ + success?: ApplyFaceContourMakeupSuccessCallback; + } + interface ApplyFilterOption { + /** 滤镜效果透明度,范围是 0-1 */ + alpha: number; + /** 滤镜资源路径 */ + path: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ApplyFilterCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ApplyFilterFailCallback; + /** 滤镜资源 md5 */ + md5?: string; + /** 接口调用成功的回调函数 */ + success?: ApplyFilterSuccessCallback; + } + interface ApplyLipStickMakeupOption { + /** 上色程度 0-1 */ + alpha: number; + blendMode: string; + faceModel: string; + path: string; + shimmerPath: string; + shimmerType: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ApplyLipStickMakeupCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ApplyLipStickMakeupFailCallback; + /** 接口调用成功的回调函数 */ + success?: ApplyLipStickMakeupSuccessCallback; + } + interface ApplyStickerOption { + /** 贴纸类型 */ + stickers: Sticker[]; + /** 贴纸类型 */ + type: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ApplyStickerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ApplyStickerFailCallback; + /** 接口调用成功的回调函数 */ + success?: ApplyStickerSuccessCallback; + templateTransSet?: IAnyObject; + } + interface Asset { + src: string; + /** 可选值: + * - 'font': 字体; + * - 'image': 图片; */ + type: 'font' | 'image'; + } + /** 需要基础库: `2.19.0` + * + * AudioBuffer接口表示存在内存里的一段短小的音频资源,利用[WebAudioContext.decodeAudioData](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.decodeAudioData.html)方法从一个音频文件构建,或者利用 [AudioContext.createBuffer](#)从原始数据构建。把音频放入AudioBuffer后,可以传入到一个 AudioBufferSourceNode进行播放。 */ + interface AudioBuffer { + /** 返回存储在缓存区的PCM数据的时长(单位为秒) */ + duration: number; + /** 返回存储在缓存区的PCM数据的采样帧率 */ + length: number; + /** 储存在缓存区的PCM数据的通道数 */ + numberOfChannels: number; + /** 存储在缓存区的PCM数据的采样率(单位为sample/s) */ + sampleRate: number; + /** [AudioBuffer.copyFromChannel()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.copyFromChannel.html) + * + * 在插件中使用:不支持 + * + * 从AudioBuffer的指定频道复制到数组终端。 */ + copyFromChannel(): void; + /** [AudioBuffer.copyToChannel(Float32Array source, number channelNumber, number startInChannel)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.copyToChannel.html) + * + * 在插件中使用:不支持 + * + * 从指定数组复制样本到audioBuffer的特定通道 + * + * **示例代码** + * + * 示例代码参考AudioBuffer.copyFromChannel */ + copyToChannel( + /** 需要复制的源数组 */ + source: Float32Array, + /** 需要复制到的目的通道号 */ + channelNumber: number, + /** 复制偏移数据量 */ + startInChannel: number + ): void; + /** [Float32Array AudioBuffer.getChannelData(number channel)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.getChannelData.html) + * + * 在插件中使用:不支持 + * + * 返回一个 Float32Array,包含了带有频道的PCM数据,由频道参数定义(有0代表第一个频道) */ + getChannelData( + /** 要获取特定通道数据的索引 */ + channel: number + ): Float32Array; + } + interface AuthPrivateMessageOption { + /** shareTicket。可以从 wx.onShow 中获取。详情 [shareTicket](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ + shareTicket: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AuthPrivateMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AuthPrivateMessageFailCallback; + /** 接口调用成功的回调函数 */ + success?: AuthPrivateMessageSuccessCallback; + } + interface AuthPrivateMessageSuccessCallbackResult { + /** 经过加密的activityId,解密后可得到原始的activityId。若解密后得到的activityId可以与开发者后台的活动id对应上则验证通过,否则表明valid字段不可靠(被篡改) 详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ + encryptedData: string; + /** 错误信息 */ + errMsg: string; + /** 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ + iv: string; + /** 验证是否通过 */ + 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; + /** 是否添加通讯录联系人,对应接口 [wx.addPhoneContact](https://developers.weixin.qq.com/miniprogram/dev/api/device/contact/wx.addPhoneContact.html) */ + 'scope.addPhoneContact'?: boolean; + /** 是否授权通讯地址,已取消此项授权,会默认返回true */ + '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; + /** 是否授权摄像头,对应[[camera](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html)](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html) 组件 */ + 'scope.camera'?: boolean; + /** 是否授权获取发票,已取消此项授权,会默认返回true */ + 'scope.invoice'?: boolean; + /** 是否授权发票抬头,已取消此项授权,会默认返回true */ + 'scope.invoiceTitle'?: boolean; + /** 是否授权录音功能,对应接口 [wx.startRecord](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.startRecord.html) */ + 'scope.record'?: boolean; + /** 是否授权用户信息,对应接口 [wx.getUserInfo](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html) */ + 'scope.userInfo'?: boolean; + /** 是否授权地理位置,对应接口 [wx.getLocation](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html), [wx.chooseLocation](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.chooseLocation.html) */ + 'scope.userLocation'?: boolean; + /** 是否授权微信运动步数,对应接口 [wx.getWeRunData](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/werun/wx.getWeRunData.html) */ + 'scope.werun'?: boolean; + /** 是否授权保存到相册 [wx.saveImageToPhotosAlbum](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.saveImageToPhotosAlbum.html), [wx.saveVideoToPhotosAlbum](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.saveVideoToPhotosAlbum.html) */ + 'scope.writePhotosAlbum'?: boolean; + } + interface AuthorizeForMiniProgramOption { + /** 需要获取权限的 scope,详见 [scope 列表](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html#scope-列表) + * + * 可选值: + * - 'scope.record': ; + * - 'scope.writePhotosAlbum': ; + * - 'scope.camera': ; */ + scope: 'scope.record' | 'scope.writePhotosAlbum' | 'scope.camera'; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AuthorizeForMiniProgramCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AuthorizeForMiniProgramFailCallback; + /** 接口调用成功的回调函数 */ + success?: AuthorizeForMiniProgramSuccessCallback; + } + interface AuthorizeOption { + /** 需要获取权限的 scope,详见 [scope 列表](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html#scope-列表) */ + scope: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: AuthorizeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: AuthorizeFailCallback; + /** 接口调用成功的回调函数 */ + success?: AuthorizeSuccessCallback; + } + /** 设备特征列表 */ + interface BLECharacteristic { + /** 该特征支持的操作类型 */ + properties: BLECharacteristicProperties; + /** 蓝牙设备特征的 UUID */ + uuid: string; + } + /** 该特征支持的操作类型 */ + interface BLECharacteristicProperties { + /** 该特征是否支持 indicate 操作 */ + indicate: boolean; + /** 该特征是否支持 notify 操作 */ + notify: boolean; + /** 该特征是否支持 read 操作 */ + read: boolean; + /** 该特征是否支持 write 操作 */ + write: boolean; + /** 该特征是否支持有回复写操作 */ + writeDefault: boolean; + /** 该特征是否支持无回复写操作 */ + writeNoResponse: boolean; + } + interface BLEPeripheralServerCloseOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SocketTaskCloseCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SocketTaskCloseFailCallback; + /** 接口调用成功的回调函数 */ + success?: SocketTaskCloseSuccessCallback; + } + /** 描述service的Object */ + interface BLEPeripheralService { + /** characteristics列表 */ + characteristics: Characteristic[]; + /** 蓝牙服务的 UUID */ + uuid: string; + } + /** 设备服务列表 */ + interface BLEService { + /** 该服务是否为主服务 */ + isPrimary: boolean; + /** 蓝牙设备服务的 UUID */ + uuid: string; + } + /** BackgroundAudioManager 实例,可通过 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 获取。 +* +* **示例代码** +* +* ```js +const backgroundAudioManager = wx.getBackgroundAudioManager() + +backgroundAudioManager.title = '此时此刻' +backgroundAudioManager.epname = '此时此刻' +backgroundAudioManager.singer = '许巍' +backgroundAudioManager.coverImgUrl = 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000' +// 设置了 src 之后会自动播放 +backgroundAudioManager.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E061FF02C31F716658E5C81F5594D561F2E88B854E81CAAB7806D5E4F103E55D33C16F3FAC506D1AB172DE8600B37E43FAD&fromtag=46' +``` */ + interface BackgroundAudioManager { + /** 音频已缓冲的时间,仅保证当前播放时间点到此时间点内容已缓冲。(只读) */ + buffered: number; + /** 封面图 URL,用于做原生音频播放器背景图。原生音频播放器中的分享功能,分享出去的卡片配图及背景也将使用该图。 */ + coverImgUrl: string; + /** 当前音频的播放位置(单位:s),只有在有合法 src 时返回。(只读) */ + currentTime: number; + /** 当前音频的长度(单位:s),只有在有合法 src 时返回。(只读) */ + duration: number; + /** 专辑名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ + epname: string; + /** 当前是否暂停或停止。(只读) */ + paused: boolean; + /** 需要基础库: `2.11.0` + * + * 播放速度。范围 0.5-2.0,默认为 1。(Android 需要 6 及以上版本) */ + playbackRate: number; + /** 需要基础库: `1.9.94` + * + * 音频协议。默认值为 'http',设置 'hls' 可以支持播放 HLS 协议的直播音频。 */ + protocol: string; + /** 需要基础库: `2.13.0` + * + * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ + referrerPolicy: string; + /** 歌手名,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ + singer: string; + /** 音频的数据源([2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 开始支持云文件ID)。默认为空字符串,**当设置了新的 src 时,会自动开始播放**,目前支持的格式有 m4a, aac, mp3, wav。 */ + src: string; + /** 音频开始播放的位置(单位:s)。 */ + startTime: number; + /** 音频标题,用于原生音频播放器音频标题(必填)。原生音频播放器中的分享功能,分享出去的卡片标题,也将使用该值。 */ + title: string; + /** 页面链接,原生音频播放器中的分享功能,分享出去的卡片简介,也将使用该值。 */ + webUrl: string; + /** [BackgroundAudioManager.onCanplay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onCanplay.html) + * + * 在插件中使用:支持 + * + * 监听背景音频进入可播放状态事件。 但不保证后面可以流畅播放 */ + onCanplay( + /** 背景音频进入可播放状态事件的监听函数 */ + listener: OnCanplayCallback + ): void; + /** [BackgroundAudioManager.onEnded(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onEnded.html) + * + * 在插件中使用:支持 + * + * 监听背景音频自然播放结束事件 */ + onEnded( + /** 背景音频自然播放结束事件的监听函数 */ + listener: OnEndedCallback + ): void; + /** [BackgroundAudioManager.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onError.html) + * + * 在插件中使用:支持 + * + * 监听背景音频播放错误事件 */ + onError( + /** 背景音频播放错误事件的监听函数 */ + listener: BackgroundAudioManagerOnErrorCallback + ): void; + /** [BackgroundAudioManager.onNext(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onNext.html) + * + * 在插件中使用:支持 + * + * 监听用户在系统音乐播放面板点击下一曲事件(仅iOS) */ + onNext( + /** 用户在系统音乐播放面板点击下一曲事件的监听函数 */ + listener: OnNextCallback + ): void; + /** [BackgroundAudioManager.onPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onPause.html) + * + * 在插件中使用:支持 + * + * 监听背景音频暂停事件 */ + onPause( + /** 背景音频暂停事件的监听函数 */ + listener: OnPauseCallback + ): void; + /** [BackgroundAudioManager.onPlay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onPlay.html) + * + * 在插件中使用:支持 + * + * 监听背景音频播放事件 */ + onPlay( + /** 背景音频播放事件的监听函数 */ + listener: OnPlayCallback + ): void; + /** [BackgroundAudioManager.onPrev(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onPrev.html) + * + * 在插件中使用:支持 + * + * 监听用户在系统音乐播放面板点击上一曲事件(仅iOS) */ + onPrev( + /** 用户在系统音乐播放面板点击上一曲事件的监听函数 */ + listener: OnPrevCallback + ): void; + /** [BackgroundAudioManager.onSeeked(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onSeeked.html) + * + * 在插件中使用:支持 + * + * 监听背景音频完成跳转操作事件 */ + onSeeked( + /** 背景音频完成跳转操作事件的监听函数 */ + listener: OnSeekedCallback + ): void; + /** [BackgroundAudioManager.onSeeking(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onSeeking.html) + * + * 在插件中使用:支持 + * + * 监听背景音频开始跳转操作事件 */ + onSeeking( + /** 背景音频开始跳转操作事件的监听函数 */ + listener: OnSeekingCallback + ): void; + /** [BackgroundAudioManager.onStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onStop.html) + * + * 在插件中使用:支持 + * + * 监听背景音频停止事件 */ + onStop( + /** 背景音频停止事件的监听函数 */ + listener: InnerAudioContextOnStopCallback + ): void; + /** [BackgroundAudioManager.onTimeUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onTimeUpdate.html) + * + * 在插件中使用:支持 + * + * 监听背景音频播放进度更新事件,只有小程序在前台时会回调。 */ + onTimeUpdate( + /** 背景音频播放进度更新事件的监听函数 */ + listener: OnTimeUpdateCallback + ): void; + /** [BackgroundAudioManager.onWaiting(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.onWaiting.html) + * + * 在插件中使用:支持 + * + * 监听音频加载中事件。当音频因为数据不足,需要停下来加载时会触发 */ + onWaiting( + /** 音频加载中事件的监听函数 */ + listener: OnWaitingCallback + ): void; + /** [BackgroundAudioManager.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.pause.html) + * + * 在插件中使用:支持 + * + * 暂停音乐 */ + pause(): void; + /** [BackgroundAudioManager.play()](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.play.html) + * + * 在插件中使用:支持 + * + * 播放音乐 */ + play(): void; + /** [BackgroundAudioManager.seek(number currentTime)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.seek.html) + * + * 在插件中使用:支持 + * + * 跳转到指定位置 */ + seek( + /** 跳转的位置,单位 s。精确到小数点后 3 位,即支持 ms 级别精确度 */ + currentTime: number + ): void; + /** [BackgroundAudioManager.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/BackgroundAudioManager.stop.html) + * + * 在插件中使用:支持 + * + * 停止音乐 */ + stop(): void; + } + interface BatchGetStorageOption { + /** 本地缓存中指定的 keyList */ + keyList: string[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: BatchGetStorageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: BatchGetStorageFailCallback; + /** 接口调用成功的回调函数 */ + success?: BatchGetStorageSuccessCallback; + } + interface BatchSetStorageOption { + /** [{ key, value }] */ + kvList: any[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: BatchSetStorageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: BatchSetStorageFailCallback; + /** 接口调用成功的回调函数 */ + success?: BatchSetStorageSuccessCallback; + } + /** Beacon 设备 */ + interface BeaconInfo { + /** Beacon 设备的距离,单位 m。iOS 上,proximity 为 0 时,accuracy 为 -1。 */ + accuracy: number; + /** Beacon 设备的主 ID */ + major: number; + /** Beacon 设备的次 ID */ + minor: number; + /** 表示设备距离的枚举值(仅iOS) + * + * 可选值: + * - 0: 信号太弱不足以计算距离,或非 iOS 设备; + * - 1: 十分近; + * - 2: 比较近; + * - 3: 远; */ + proximity: 0 | 1 | 2 | 3; + /** 表示设备的信号强度,单位 dBm */ + rssi: number; + /** Beacon 设备广播的 UUID */ + uuid: string; + } + /** 需要基础库: `2.20.1` + * + * 以 beacon 设备形式广播的参数。 */ + interface BeaconInfoObj { + /** Beacon 设备的主 ID */ + major: number; + /** Beacon 设备的次 ID */ + minor: number; + /** Beacon 设备广播的 UUID */ + uuid: string; + /** 用于判断距离设备 1 米时 RSSI 大小的参考值 */ + measuredPower?: number; + } + interface BindWifiOption { + /** 当前 wifi 网络的 BSSID ,可通过 wx.getConnectedWifi 获取 */ + BSSID: string; + } + interface BlueToothDevice { + /** 当前蓝牙设备的信号强度,单位 dBm */ + RSSI: number; + /** 当前蓝牙设备的广播数据段中的 ManufacturerData 数据段。 */ + advertisData: ArrayBuffer; + /** 当前蓝牙设备的广播数据段中的 ServiceUUIDs 数据段 */ + advertisServiceUUIDs: string[]; + /** 当前蓝牙设备是否可连接( Android 8.0 以下不支持返回该值 ) */ + connectable: boolean; + /** 蓝牙设备 id */ + deviceId: string; + /** 当前蓝牙设备的广播数据段中的 LocalName 数据段 */ + localName: string; + /** 蓝牙设备名称,某些设备可能没有 */ + name: string; + /** 当前蓝牙设备的广播数据段中的 ServiceData 数据段 */ + serviceData: IAnyObject; + } + /** 搜索到的设备列表 */ + interface BluetoothDeviceInfo { + /** 用于区分设备的 id */ + deviceId: string; + /** 蓝牙设备名称,某些设备可能没有 */ + name: string; + } + interface BlurOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: BlurCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: BlurFailCallback; + /** 接口调用成功的回调函数 */ + success?: BlurSuccessCallback; + } + /** 需要基础库: `2.28.0` + * + * 人体检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/body.html)。 */ + interface BodyTrack { + /** 需要基础库: `2.28.0` + * + * 人体检测模式 + * + * 可选值: + * - 1: 通过摄像头实时检测; + * - 2: 静态图片检测; */ + mode: 1 | 2; + } + interface BoundingClientRectCallbackResult { + /** 节点的下边界坐标 */ + bottom: number; + /** 节点的 dataset */ + dataset: IAnyObject; + /** 节点的高度 */ + height: number; + /** 节点的 ID */ + id: string; + /** 节点的左边界坐标 */ + left: number; + /** 节点的右边界坐标 */ + right: number; + /** 节点的上边界坐标 */ + top: number; + /** 节点的宽度 */ + width: number; + } + /** 目标边界 */ + interface BoundingClientRectResult { + /** 下边界 */ + bottom: number; + /** 高度 */ + height: number; + /** 左边界 */ + left: number; + /** 右边界 */ + right: number; + /** 上边界 */ + top: number; + /** 宽度 */ + width: number; + } + /** 音频源节点,通过 [WebAudioContext.createBufferSource](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createBufferSource.html)方法获得。 +* +* **示例代码** +* +* ```js +const source = audioCtx.createBufferSource() +source.buffer = AudioBuffer +source.connect(audioCtx.destination) +sourceCache.add(source) // Tips:缓存住 source,防止被GC掉,GC掉的话音频会中断 +source.onended = () => { + sourceCache.delete(source) // Tips:播放完之后,再清掉source缓存 +} +source.start() +``` */ + interface BufferSourceNode { + /** [AudioBuffer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.html) + * + * 是一个 AudioBuffer, 它定义了要播放的音频,当设置它的值为 0 时,它会定义一个静默的单通道。(可读可写) */ + buffer: AudioBuffer; + /** 定义音频是否循环播放(可读可写) */ + loop?: boolean; + /** 定义音频循环播放时,结束播放的位置。单位是秒,默认值是0(可读可写) */ + loopEnd?: number; + /** 定义音频循环播放时,开始播放的位置。单位是秒,默认值是0(可读可写) */ + loopStart?: number; + /** 定义音频播放结束事件回调函数(可读可写) + * + * ## 注意事项 + * - bug:从微信8.0.34开始,BufferSource在JS中如果不一直持有的话,会被客户端GC掉,GC掉之后,BufferSource如果正在播放的话会被中断。因此,建议开发者在 BufferSource.start() 开始播放之前缓存 BufferSource 并在 BufferSource.onended 的时候释放缓存。具体可参考下面示例代码中的缓存逻辑。 */ + onended?: (...args: any[]) => any; + /** 定义音频的播放倍速,数值越大速度越快,默认速度1.0,有效范围为 0 < playbackRate <= 2.0(可读可写) */ + playbackRate?: number; + /** [BufferSourceNode.connect(AudioNode|AudioParam destination)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.connect.html) + * + * 在插件中使用:不支持 + * + * 连接到一个指定目标。这个指定的目标可能是另一个 AudioNode(从而将音频数据引导到下一个指定节点)或一个AudioParam, 以便上一个节点的输出数据随着时间流逝能自动地对下一个参数值进行改变 */ + connect( + /** 要建立连接的目标节点 */ + destination: AudioNode | AudioParam + ): void; + /** [BufferSourceNode.disconnect()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.disconnect.html) + * + * 在插件中使用:不支持 + * + * 与已连接的目标节点断开连接 */ + disconnect(): void; + /** [BufferSourceNode.start(number when, number offset, number duration)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.start.html) + * + * 在插件中使用:不支持 + * + * 音频源开始播放 */ + start( + /** 延迟播放的时间,单位是秒。与 AudioContext 使用相同的时间坐标系统。如果 when 小于 AudioContext.currentTime, 或者是 0,声音立即被播放。 默认值是 0 */ + when?: number, + /** 音频开始播放的位置,单位是秒。默认值是 0 */ + offset?: number, + /** 音频播放的持续时间,单位是秒。如果这个参数没有被指定,声音播放到自然结束或者使用stop() 方法结束。使用这个参数的功能与调用 start(when, offset) 和调用 stop(when+duration)效果完全相同 */ + duration?: number + ): void; + /** [BufferSourceNode.stop(number when)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/BufferSourceNode.stop.html) + * + * 在插件中使用:不支持 + * + * 停止播放 */ + stop( + /** 延迟停止播放的时间,单位是秒。与 AudioContext 使用相同的时间坐标系统。省略此参数、指定值 0 或传递负值会使声音立即停止播放。 */ + when?: number + ): void; + } + /** 需要基础库: `2.24.0` + * + * 缓存管理器。全局只有唯一实例,一旦被创建出来即表示接入缓存管理器。其有以下几个能力: + * + * 1. 在网络通畅时,符合一定规则的用户网络请求(目前只包括普通 wx.request 请求)会被缓存。 + * 2. 在网络通畅时,某些 wx api 调用会被缓存。 + * 3. 进入弱网/离线状态时,会提供事件给用户,用户可以决定是否使用缓存返回。 + * 4. 提供进入和退出弱网/离线状态的事件。 + * + * > 1. 缓存管理器中涉及的网络请求如无特指,均指普通的 wx.request 异步请求,参数和返回值中均不考虑涉及 ArrayBuffer 或 TypedArray 的情形。 + * > 2. 缓存管理器中的缓存不会占用 storage 空间,但是有大小限制,请勿在非必要的请求上使用缓存。 */ + interface CacheManager { + /** 全局缓存有效时间 */ + maxAge: number; + /** 当前缓存模式 + * + * 可选值: + * - 'weakNetwork': 默认值,弱网/离线使用缓存返回; + * - 'always': 总是使用缓存返回; + * - 'none': 不开启,后续可手动开启/停止使用缓存返回; */ + mode: 'weakNetwork' | 'always' | 'none'; + /** 全局 origin */ + origin: string; + /** 当前缓存管理器状态 + * + * 可选值: + * - 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` + * + * 在插件中使用:不支持 + * + * 批量添加规则,规则写法可参考 [CacheManager.addRule](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.addRule.html)。 */ + addRules( + /** 规则列表 */ + rules: IAnyObject + ): string[]; + /** [CacheManager.clearCaches()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.clearCaches.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 清空所有缓存。 */ + clearCaches(): void; + /** [CacheManager.clearRules()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.clearRules.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 清空所有规则,同时会删除对应规则下所有缓存。 */ + clearRules(): void; + /** [CacheManager.deleteCache(string id)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.deleteCache.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 删除缓存。 */ + deleteCache( + /** 缓存 id */ + id: string + ): void; + /** [CacheManager.deleteCaches(Array.<string> ids)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.deleteCaches.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 批量删除缓存。 */ + deleteCaches( + /** 缓存 id 列表 */ + ids: string[] + ): void; + /** [CacheManager.deleteRule(string id)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.deleteRule.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 删除规则,同时会删除对应规则下所有缓存。 */ + deleteRule( + /** 规则 id */ + id: string + ): void; + /** [CacheManager.deleteRules(Array.<string> ids)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.deleteRules.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 批量删除规则,同时会删除对应规则下所有缓存。 */ + deleteRules( + /** 规则 id 列表 */ + 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` + * + * 在插件中使用:不支持 + * + * 取消事件监听。 */ + off( + /** 事件名 */ + eventName: string, + /** 事件句柄 */ + 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` +* +* 在插件中使用:不支持 +* +* 监听事件。 +* +* **** +* +* 这里 request 事件会提供 request 事件对象,用于做后续的处理;在 request 事件中需要返回一个 promise,用来生成 wx.request 请求的返回内容。 +* +* #### 示例代码 +* +* ```js +async function handler(evt) { + // evt.url - 请求 url + // evt.data - 请求参数 + // evt.method - 请求方法 + // evt.request - 原始 request 方法,返回一个 promise + + // if (evt.url === '/xxx') { + // // 如果有些请求仍然希望走到网络,则可以如下处理 + // const res = await evt.request() + // // res 即为网络请求返回 + // } + + return new Promsie((resolve, reject) => { + // do sth + if (data) { + // 这里 resolve 的 data 就会作为 wx.request 的 success 回调结果返回 + resolve(data) + } else { + // 这里 reject 的错误信息就会作为 wx.request 的 fail 回调结果返回 + reject('no data') + } + }) +} +cacheManager.on('request', handler) +``` */ + on( + /** 事件名 + * + * 参数 eventName 可选值: + * - 'request': 发生 wx.request 请求,只在缓存管理器开启阶段会触发; + * - 'enterWeakNetwork': 进入弱网/离线状态; + * - 'exitWeakNetwork': 离开弱网/离线状态; */ + eventName: 'request' | 'enterWeakNetwork' | 'exitWeakNetwork', + /** 事件句柄 */ + handler: (...args: any[]) => any + ): void; + /** [CacheManager.start()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.start.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 开启缓存,仅在 mode 为 none 时生效,调用后缓存管理器的 state 会置为 1。 */ + start(): void; + /** [CacheManager.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.stop.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 关闭缓存,仅在 mode 为 none 时生效,调用后缓存管理器的 state 会置为 0。 */ + stop(): void; + /** [Object CacheManager.match(Object evt)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.match.html) +* +* 需要基础库: `2.24.0` +* +* 在插件中使用:不支持 +* +* 匹配命中的缓存规则,一般需要和 request 事件搭配使用。 +* +* **示例代码** +* +* ```js +function handler(evt) { + const cache = cacheManager.match(evt) + // 若有重复监听,则取第一个 handler 返回的 promise + return new Promise((resolve, reject) => { + if (cache.data) { + resolve(cache.data) + } else { + reject('no cache') + } + }) +} +cacheManager.on('request', handler) +``` */ + match( + /** request 事件对象 */ + evt: IAnyObject + ): MatchCache; + /** [string CacheManager.addRule(Object rule)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/cachemanager/CacheManager.addRule.html) +* +* 需要基础库: `2.24.0` +* +* 在插件中使用:不支持 +* +* 添加规则。 +* +* **规则说明** +* +* 支持的规则写法有字符串、正则和对象三种: +* +* ### 字符串写法 +* +* 1. `addRule('/abc')`:纯 uri 串。 +* 2. `addRule('GET /abc'):带方法的 uri 串,除了匹配 uri 外,还会匹配请求方法。如例子中必须是 GET 方法请求才会被匹配。 +* 3. `addRule('/abc/:id'):带可变部分的 uri 串,id 可以是任意符合标准的字符串,表示这一段可以动态变化。比如 `/abc/123` 和 `/abc/321` 都会被匹配,而 `/abc/123/xxx` 因为多了一段,就不会被匹配。 +* 4. `addRule('/abc?aa'):带 query 参数的 uri 串,包含 aa 参数,值可以为任意值。比如 `/abc?aa=haha` 会被匹配,但是 `/abc` 就不会被匹配,因为缺少规则中声明的 aa 参数;不过如果请求是 `/abc?aa=haha&bb=123`,虽然多带了 bb 参数,但是因为包含了 aa 参数,所以也可以被匹配。 +* 5. `addRule('/abc?dd=haha'):带 query 参数的 uri 串,包含 dd 参数且值为 haha。比如 `/abc?dd=haha` 和 `/abc?dd=haha&bb=123` 会被匹配,而 `/abc?dd=123` 就不会被匹配,因为规则要求了 dd 参数的值。 +* +* > 以上写法中的 uri 串如果只有 path 部分,则会取全局 origin 进行补全。比如全局 origin 是 `https://weixin.qq.com`,而规则是 `/abc`,则会补全为 `https://weixin.qq.com/abc`。因此在前面例子中 `addRule('/abc')` 和 `addRule('https://weixin.qq.com/abc')` 的写法效果一致。所以一般情况下如果需要匹配的请求 origin 和全局 origin 一致,则规则中可忽略不写 orign。 +* +* ### 正则写法 +* +* 1. `addRule(/\/(abc|cba)$/ig)`:直接正则匹配请求的 uri,同时会比对请求 origin 和全局 origin 是否一致。 +* 2. `addRule(/^https:\/\/weixin.qq.com\/(abc|cba)$/ig)`:带有 orign 部分的正则表达式,则只匹配 uri,不再比对 origin。 +* +* ### 对象写法 +* +* 使用规则对象,可以更为详细的描述规则内容。(一般使用规则对象,是为了匹配请求参数) +* +* #### 规则对象: +* +* | 属性名 | 类型 | 默认值 | 备注 | +* |---|---|---|---| +* | id | string | | 规则 id,如果不填则会由基础库生成 | +* | method | string | | 请求方法,可选值 GET/POST/PATCH/PUT/DELETE,如果为空则表示前面提到的所有方法都能被匹配到 | +* | url | any | 必填 | uri 匹配规则,可参考规则字符串写法和正则写法 | +* | maxAge | number | 7 * 24 * 60 * 60 * 1000 | 缓存有效时间,单位为 ms,不填则默认取缓存管理器全局的缓存有效时间 | +* | dataSchema | Array\ | | 匹配请求参数 | +* +* 其中,dataSchema 用来匹配对象类型的请求参数(比如 wx.request 的 data),默认可以不填,即不做参数匹配。 +* +* dataSchema 的类型是一个 DataRule 对象数组,一个 DataRule 对象描述一个参数,比如一个 wx.request 请求的 data 是 `{a: 123, b: 'haha', c: true}`,你想要用一条规则来匹配其中的 a 和 b 参数,如果 a 是数字且 b 是字符串就能命中该规则,那么就需要在 dataSchema 中补充两个 DataRule 对象,即 `[{name: 'a', schema: {type: 'number'}}, {name: 'b', schema: {type: 'string'}}]`。 +* +* #### DataRule 对象: +* +* | 属性名 | 类型 | 默认值 | 备注 | +* |---|---|---|---| +* | name | string | | 需要匹配的参数名 | +* | schema | DataSchema/Array\ | 需要匹配的参数模式,支持数组,表示该参数值有多种模式 | +* +* name 表示要匹配的参数名,schema 为 DataSchema 对象,用来描述该参数的类型和值。 +* +* 一个 DataRule 对象也可以匹配可能拥有多种类型的参数,所以 schema 也支持为 DataSchema 对象数组。比如上述例子中,希望匹配的 a 参数必须是数值或者字符串,那么可以这么写:`{name: 'a', schema: [{type: 'number'}, {type: 'string'}]}`。 +* +* #### DataSchema 对象: +* +* | 属性名 | 类型 | 默认值 | 备注 | +* |---|---|---|---| +* | type | string | | 需要匹配的 data 对象的参数类型,string、number、boolean、null、object、any(表示任意类型),同时支持数组模式(数组模式则在类型后面加 [],如 string[] 表示字符串数组) | +* | value | string/regexp/function/Array\ | | 需要匹配的 data 对象的参数值,当 type 为基本类型时,可以用 string/regexp 来匹配固定的值,也可以通过 function 来确定值是否匹配,如果传入的 type 是 object,那么表示需要嵌套匹配值是否正确,可以传入 Array | +* +* type 参数表示要匹配的参数类型,value 表示要匹配的参数值。其中 value 支持多种写法,不同写法有如下匹配方式: +* +* 1. 字符串写法:直接判值的字符串形式是否和给定字符串一样,比如 value 值为 `123`,就要求参数值必须为 123 才能与之匹配。 +* 2. 正则写法:直接判值的字符串形式是否能被正则匹配,比如 value 值为 `/\d+/ig`,就要求参数值必须为数字,如果参数值为 `abc` 则不会被匹配。 +* 3. 函数写法:在匹配时会调用用户传入的函数,交由用户判断是否匹配。 +* 4. DataRule 数组写法:当参数类型为对象时,那么字符串写法和正则写法就无法使用,需要传入 DataRule 数组来进行匹配,即通过嵌套 DataRule 数组的方式来匹配嵌套的对象。 +* +* ### 示例代码 +* +* ```js +const ruleId = cacheManager.addRule({ + id: 'haha-rule', + method: 'GET', + url: '/haha', + maxAge: 123455, + dataSchema: [ + // data 字段的匹配,默认为空,表示不匹配 + // 类型可以是:string、number、boolean、null、object、any(表示任意类型均可),以及这些类型的数组表示方式 + {name: 'aaa', schema: {type: 'string'}}, // 类型为 string + {name: 'bbb', schema: [{type: 'number'}, {type: 'string'}]}, // 类型为 number, string + {name: 'ccc', schema: {type: 'string', value: 'abc'}}, // 值为 abc + {name: 'ddd', schema: {type: 'string', value: /(abc|cba)/ig}}, // 值符合该正则匹配,如果该值不是字符串类型,则会被尝试转成字符串后再进行比较 + {name: 'ddd', schema: {type: 'string', value: val => val === '123'}}, // 传入函数来校验值 + {name: 'eee', schema: {type: 'object', value: [{ // 类型为对象,则通过嵌套的方式来逐层校验 + name: 'aaa', schema: {type: 'string'}, + // ... + // 嵌套 dataSchema,同上面的方式一样来匹配嵌套的对象 + }]}}, + {name: 'fff', schema: {type: 'string[]'}}, // 类型为 string 数组 + {name: 'ggg', schema: {type: 'any'}}, // 类型为任意类型 + {name: 'hhh', schema: {type: 'any[]'}}, // 类型为任意类型的数组 + }], +}) +``` +* +* ### 补充说明 +* +* 用户可以添加多条规则,每条规则都会去解析网络请求,然后判断是否命中规则。假设有多条规则命中,则取第一条命中的规则。 +* +* ### 缓存覆盖 +* +* 不同的网络请求也可能命中同一条规则,所以每条规则可能对应多个缓存。每条规则会有一个规则 id,每个缓存会有一个缓存 id,一个规则 id 可能对应多个缓存 id,而缓存管理器的缓存存储是基于缓存 id 标识的,如果两个不同的请求生成了同样的缓存 id,那么后发生的请求结果缓存会覆盖前者。因此使用时需要思考缓存的覆盖情况,目前缓存 id 生成方式如下: +* +* 1. 规则使用字符串写法:那么按 method + url + 规则中声明的 query 参数来生成缓存 id。 +* +* > 需要注意的是这里不使用真实请求中的 query 参数来生成缓存 id,而是使用规则中匹配到的 query 来生成缓存 id。比如规则是 `/abc?aa=123`,请求是 GET 方法的 `/abc?aa=123&bb=123`,那么就会基于 `GET /abc?aa=123` 来生成缓存 id。而规则里没有声明 `bb=123`,所以 bb 参数不会被纳入缓存 id 的生成基准。 +* +* 2. 规则使用正则写法:那么只按 method + url 生成缓存 id,不考虑 query 参数。 +* 3. 规则使用对象写法:如果规则对象中的 url 是字符串写法,那么按 method + url + 规则中声明的 query 参数 + 规则中 dataSchema 声明的请求参数来生成缓存 id;如果规则对象中的 url 是正则写法,那么按 method + url + 规则中 dataSchema 声明的请求参数来生成缓存 id。 +* +* > 生成缓存 id 时没有使用请求中完整的 query 参数或者请求参数来作为基准,是考虑到很多请求可能会带上 token 或时间戳等参数。因为此参数存在不确定性,会导致每次请求生成的缓存 id 都不同,进而导致缓存命中率下降,故采取规则中声明的 query 参数和 dataSchema 声明的请求参数来作为生成缓存 id 的基准。 */ + addRule( + /** 规则 */ + rule: IAnyObject + ): string; + } + interface CameraContextSetZoomOption { + /** 缩放级别,范围[1, maxZoom]。zoom 可取小数,精确到小数后一位。maxZoom 可在 bindinitdone 返回值中获取。 */ + zoom: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetZoomCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetZoomFailCallback; + /** 接口调用成功的回调函数 */ + success?: CameraContextSetZoomSuccessCallback; + } + interface CameraContextStartRecordOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartRecordCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartRecordFailCallback; + /** 需要基础库: `2.22.0` + * + * 是否开启镜像 */ + selfieMirror?: boolean; + /** 接口调用成功的回调函数 */ + success?: CameraContextStartRecordSuccessCallback; + /** 需要基础库: `2.22.0` + * + * 录制时长上限,单位为秒,最长不能超过 5 分钟 */ + timeout?: number; + /** 超过录制时长上限时会结束录像并触发此回调,录像异常退出时也会触发此回调 */ + timeoutCallback?: StartRecordTimeoutCallback; + } + interface CameraContextStopRecordOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopRecordCompleteCallback; + /** 启动视频压缩,压缩效果同`chooseVideo` */ + compressed?: boolean; + /** 接口调用失败的回调函数 */ + fail?: StopRecordFailCallback; + /** 接口调用成功的回调函数 */ + success?: CameraContextStopRecordSuccessCallback; + } + interface CameraFrameListenerStartOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartFailCallback; + /** 接口调用成功的回调函数 */ + 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; + } + /** 需要基础库: `2.7.0` + * + * Canvas 实例,可通过 [SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) 获取。 + * + * **示例代码** + * + * 2D Canvas 示例 + * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/SHfgCmmq7UcM) + * + * WebGL 示例 + * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/qEGUOqmf7T8z) */ + interface Canvas { + /** 画布高度 */ + height: number; + /** 画布宽度 */ + width: number; + /** [Canvas.cancelAnimationFrame(number requestID)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.cancelAnimationFrame.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 取消由 requestAnimationFrame 添加到计划中的动画帧请求。支持在 2D Canvas 和 WebGL Canvas 下使用, 但不支持混用 2D 和 WebGL 的方法。 */ + 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` + * + * 在插件中使用:支持 + * + * 创建一个 ImageData 对象。仅支持在 2D Canvas 中使用。 */ + 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` + * + * 在插件中使用:支持 + * + * 创建一个图片对象。 支持在 2D Canvas 和 WebGL Canvas 下使用, 但不支持混用 2D 和 WebGL 的方法。 */ + 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` + * + * 在插件中使用:支持 + * + * 创建 Path2D 对象 */ + createPath2D( + /** [Path2D](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) */ + 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` + * + * 在插件中使用:支持 + * + * 该方法返回 Canvas 的绘图上下文 + * + * **** + * + * 支持获取 2D 和 WebGL 绘图上下文 */ + getContext( + /** 上下文类型 + * + * 参数 contextType 可选值: + * - '2d': 2d 绘图上下文; */ + 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` + * + * 在插件中使用:支持 + * + * 该方法返回 Canvas 的绘图上下文 + * + * **** + * + * 支持获取 2D 和 WebGL 绘图上下文 */ + getContext( + /** 上下文类型 + * + * 参数 contextType 可选值: + * - 'webgl': webgl 绘图上下文; */ + 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` + * + * 在插件中使用:支持 + * + * 该方法返回 Canvas 的绘图上下文 + * + * **** + * + * 支持获取 2D 和 WebGL 绘图上下文 */ + getContext( + /** 上下文类型 + * + * 参数 contextType 可选值: + * - 'webgl2': webgl2 绘图上下文; */ + contextType: 'webgl2' + ): CanvasRenderingContext.WebGL2RenderingContext; + /** [number Canvas.requestAnimationFrame(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.requestAnimationFrame.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 在下次进行重绘时执行。 支持在 2D Canvas 和 WebGL Canvas 下使用, 但不支持混用 2D 和 WebGL 的方法。 */ + requestAnimationFrame( + /** 执行的 callback */ + 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` + * + * 在插件中使用:支持 + * + * 返回一个包含图片展示的 data URI 。可以使用 type 参数其类型,默认为 PNG 格式。 */ + toDataURL( + /** 图片格式,默认为 image/png */ + type: string, + /** 在指定图片格式为 image/jpeg 或 image/webp的情况下,可以从 0 到 1 的区间内选择图片的质量。如果超出取值范围,将会使用默认值 0.92。其他参数会被忽略。 */ + 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) 替换 + * + * canvas 组件的绘图上下文。CanvasContext 是旧版的接口, 新版 Canvas 2D 接口与 Web 一致。 */ + interface CanvasContext { + /** 需要基础库: `1.9.90` + * + * 填充颜色。用法同 [CanvasContext.setFillStyle()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setFillStyle.html)。 */ + fillStyle: string | CanvasGradient; + /** 需要基础库: `1.9.90` + * + * 当前字体样式的属性。符合 [CSS font 语法](https://developer.mozilla.org/zh-CN/docs/Web/CSS/font) 的 DOMString 字符串,至少需要提供字体大小和字体族名。默认值为 10px sans-serif。 */ + font: string; + /** 全局画笔透明度。范围 0-1,0 表示完全透明,1 表示完全不透明。 */ + globalAlpha: number; + /** 需要基础库: `1.9.90` + * + * 在绘制新形状时应用的合成操作的类型。目前安卓版本只适用于 `fill` 填充块的合成,用于 `stroke` 线段的合成效果都是 `source-over`。 + * + * 目前支持的操作有 + * - 安卓:xor, source-over, source-atop, destination-out, lighter, overlay, darken, lighten, hard-light + * - iOS:xor, source-over, source-atop, destination-over, destination-out, lighter, multiply, overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion, saturation, luminosity */ + globalCompositeOperation: string; + /** 需要基础库: `1.9.90` + * + * 线条的端点样式。用法同 [CanvasContext.setLineCap()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineCap.html)。 */ + lineCap: string; + /** 需要基础库: `1.9.90` + * + * 虚线偏移量,初始值为0 */ + lineDashOffset: number; + /** 需要基础库: `1.9.90` + * + * 线条的交点样式。用法同 [CanvasContext.setLineJoin()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineJoin.html)。 + * + * 可选值: + * - '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; + /** 需要基础库: `1.9.90` + * + * 最大斜接长度。用法同 [CanvasContext.setMiterLimit()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setMiterLimit.html)。 */ + miterLimit: number; + /** 需要基础库: `1.9.90` + * + * 阴影的模糊级别 */ + shadowBlur: number; + /** 需要基础库: `1.9.90` + * + * 阴影的颜色 */ + shadowColor: number; + /** 需要基础库: `1.9.90` + * + * 阴影相对于形状在水平方向的偏移 */ + shadowOffsetX: number; + /** 需要基础库: `1.9.90` + * + * 阴影相对于形状在竖直方向的偏移 */ + shadowOffsetY: number; + /** 需要基础库: `1.9.90` + * + * 边框颜色。用法同 [CanvasContext.setStrokeStyle()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setStrokeStyle.html)。 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 创建一条弧线。 +* +* - 创建一个圆可以指定起始弧度为 0,终止弧度为 2 * Math.PI。 +* - 用 `stroke` 或者 `fill` 方法来在 `canvas` 中画弧线。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +// Draw coordinates +ctx.arc(100, 75, 50, 0, 2 * Math.PI) +ctx.setFillStyle('#EEEEEE') +ctx.fill() + +ctx.beginPath() +ctx.moveTo(40, 75) +ctx.lineTo(160, 75) +ctx.moveTo(100, 15) +ctx.lineTo(100, 135) +ctx.setStrokeStyle('#AAAAAA') +ctx.stroke() + +ctx.setFontSize(12) +ctx.setFillStyle('black') +ctx.fillText('0', 165, 78) +ctx.fillText('0.5*PI', 83, 145) +ctx.fillText('1*PI', 15, 78) +ctx.fillText('1.5*PI', 83, 10) + +// Draw points +ctx.beginPath() +ctx.arc(100, 75, 2, 0, 2 * Math.PI) +ctx.setFillStyle('lightgreen') +ctx.fill() + +ctx.beginPath() +ctx.arc(100, 25, 2, 0, 2 * Math.PI) +ctx.setFillStyle('blue') +ctx.fill() + +ctx.beginPath() +ctx.arc(150, 75, 2, 0, 2 * Math.PI) +ctx.setFillStyle('red') +ctx.fill() + +// Draw arc +ctx.beginPath() +ctx.arc(100, 75, 50, 0, 1.5 * Math.PI) +ctx.setStrokeStyle('#333333') +ctx.stroke() + +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/arc.png) +* +* 针对 arc(100, 75, 50, 0, 1.5 * Math.PI)的三个关键坐标如下: +* +* - 绿色: 圆心 (100, 75) +* - 红色: 起始弧度 (0) +* - 蓝色: 终止弧度 (1.5 * Math.PI) */ + arc( + /** 圆心的 x 坐标 */ + x: number, + /** 圆心的 y 坐标 */ + y: number, + /** 圆的半径 */ + r: number, + /** 起始弧度,单位弧度(在3点钟方向) */ + sAngle: number, + /** 终止弧度 */ + eAngle: number, + /** 弧度的方向是否是逆时针 */ + 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` + * + * 在插件中使用:支持 + * @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) 替换 + * + * @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** + * + * 根据控制点和半径绘制圆弧路径。 */ + arcTo( + /** 第一个控制点的 x 轴坐标 */ + x1: number, + /** 第一个控制点的 y 轴坐标 */ + y1: number, + /** 第二个控制点的 x 轴坐标 */ + x2: number, + /** 第二个控制点的 y 轴坐标 */ + y2: number, + /** 圆弧的半径 */ + radius: number + ): void; + /** [CanvasContext.beginPath()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.beginPath.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 开始创建一个路径。需要调用 `fill` 或者 `stroke` 才会使用路径进行填充或描边 +* +* - 在最开始的时候相当于调用了一次 `beginPath`。 +* - 同一个路径内的多次 `setFillStyle`、`setStrokeStyle`、`setLineWidth`等设置,以最后一次设置为准。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +// begin path +ctx.rect(10, 10, 100, 30) +ctx.setFillStyle('yellow') +ctx.fill() + +// begin another path +ctx.beginPath() +ctx.rect(10, 40, 100, 30) + +// only fill this rect, not in current path +ctx.setFillStyle('blue') +ctx.fillRect(10, 70, 100, 30) + +ctx.rect(10, 100, 100, 30) + +// it will fill current path +ctx.setFillStyle('red') +ctx.fill() +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/fill-path.png) */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 创建三次方贝塞尔曲线路径。曲线的起始点为路径中前一个点。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +// Draw points +ctx.beginPath() +ctx.arc(20, 20, 2, 0, 2 * Math.PI) +ctx.setFillStyle('red') +ctx.fill() + +ctx.beginPath() +ctx.arc(200, 20, 2, 0, 2 * Math.PI) +ctx.setFillStyle('lightgreen') +ctx.fill() + +ctx.beginPath() +ctx.arc(20, 100, 2, 0, 2 * Math.PI) +ctx.arc(200, 100, 2, 0, 2 * Math.PI) +ctx.setFillStyle('blue') +ctx.fill() + +ctx.setFillStyle('black') +ctx.setFontSize(12) + +// Draw guides +ctx.beginPath() +ctx.moveTo(20, 20) +ctx.lineTo(20, 100) +ctx.lineTo(150, 75) + +ctx.moveTo(200, 20) +ctx.lineTo(200, 100) +ctx.lineTo(70, 75) +ctx.setStrokeStyle('#AAAAAA') +ctx.stroke() + +// Draw quadratic curve +ctx.beginPath() +ctx.moveTo(20, 20) +ctx.bezierCurveTo(20, 100, 200, 100, 200, 20) +ctx.setStrokeStyle('black') +ctx.stroke() + +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/bezier-curve.png) +* +* 针对 moveTo(20, 20) bezierCurveTo(20, 100, 200, 100, 200, 20) 的三个关键坐标如下: +* +* - 红色:起始点(20, 20) +* - 蓝色:两个控制点(20, 100) (200, 100) +* - 绿色:终止点(200, 20) */ + bezierCurveTo( + /** 第一个贝塞尔控制点的 x 坐标 */ + cp1x: number, + /** 第一个贝塞尔控制点的 y 坐标 */ + cp1y: number, + /** 第二个贝塞尔控制点的 x 坐标 */ + cp2x: number, + /** 第二个贝塞尔控制点的 y 坐标 */ + cp2y: number, + /** 结束点的 x 坐标 */ + x: number, + /** 结束点的 y 坐标 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 清除画布上在该矩形区域内的内容 +* +* **示例代码** +* +* clearRect 并非画一个白色的矩形在地址区域,而是清空,为了有直观感受,对 canvas 加了一层背景色。 +* ```html +* +* ``` +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.setFillStyle('red') +ctx.fillRect(0, 0, 150, 200) +ctx.setFillStyle('blue') +ctx.fillRect(150, 0, 150, 200) +ctx.clearRect(10, 10, 150, 75) +ctx.draw() +``` +* ![](@program/dev/image/canvas/clear-rect.png) */ + clearRect( + /** 矩形路径左上角的横坐标 */ + x: number, + /** 矩形路径左上角的纵坐标 */ + y: number, + /** 矩形路径的宽度 */ + width: number, + /** 矩形路径的高度 */ + height: number + ): void; + /** [CanvasContext.clip()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.clip.html) +* +* 需要基础库: `1.6.0` +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 从原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内(不能访问画布上的其他区域)。可以在使用 `clip` 方法前通过使用 `save` 方法对当前画布区域进行保存,并在以后的任意时间通过`restore`方法对其进行恢复。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +wx.downloadFile({ + url: 'http://is5.mzstatic.com/image/thumb/Purple128/v4/75/3b/90/753b907c-b7fb-5877-215a-759bd73691a4/source/50x50bb.jpg', + success: function(res) { + ctx.save() + ctx.beginPath() + ctx.arc(50, 50, 25, 0, 2*Math.PI) + ctx.clip() + ctx.drawImage(res.tempFilePath, 25, 25) + ctx.restore() + ctx.draw() + } +}) +``` +* ![](@program/dev/image/canvas/clip.png) */ + clip(): void; + /** [CanvasContext.closePath()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.closePath.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 关闭一个路径。会连接起点和终点。如果关闭路径后没有调用 `fill` 或者 `stroke` 并开启了新的路径,那之前的路径将不会被渲染。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.moveTo(10, 10) +ctx.lineTo(100, 10) +ctx.lineTo(100, 100) +ctx.closePath() +ctx.stroke() +ctx.draw() +``` +* ![](@program/dev/image/canvas/close-line.png) +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +// begin path +ctx.rect(10, 10, 100, 30) +ctx.closePath() + +// begin another path +ctx.beginPath() +ctx.rect(10, 40, 100, 30) + +// only fill this rect, not in current path +ctx.setFillStyle('blue') +ctx.fillRect(10, 70, 100, 30) + +ctx.rect(10, 100, 100, 30) + +// it will fill current path +ctx.setFillStyle('red') +ctx.fill() +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/close-path.png) */ + closePath(): void; + /** [CanvasContext.createPattern(string image, string repetition)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.createPattern.html) + * + * 需要基础库: `1.9.90` + * + * 在插件中使用:支持 + * @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) 替换 + * + * @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** + * + * 对指定的图像创建模式的方法,可在指定的方向上重复元图像 */ + createPattern( + /** 重复的图像源,支持代码包路径和本地临时路径 (本地路径) */ + image: string, + /** 如何重复图像 + * + * 参数 repetition 可选值: + * - 'repeat': 水平竖直方向都重复; + * - 'repeat-x': 水平方向重复; + * - 'repeat-y': 竖直方向重复; + * - 'no-repeat': 不重复; */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 将之前在绘图上下文中的描述(路径、变形、样式)画到 canvas 中。 +* +* **示例代码** +* +* 第二次 draw() reserve 为 true。所以保留了上一次的绘制结果,在上下文设置的 fillStyle 'red' 也变成了默认的 'black'。 +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.setFillStyle('red') +ctx.fillRect(10, 10, 150, 100) +ctx.draw() +ctx.fillRect(50, 50, 150, 100) +ctx.draw(true) +``` +* ![](@program/dev/image/canvas/reserve.png) +* +* **示例代码** +* +* 第二次 draw() reserve 为 false。所以没有保留了上一次的绘制结果和在上下文设置的 fillStyle 'red'。 +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.setFillStyle('red') +ctx.fillRect(10, 10, 150, 100) +ctx.draw() +ctx.fillRect(50, 50, 150, 100) +ctx.draw() +``` +* ![](@program/dev/image/canvas/un-reserve.png) */ + draw( + /** 本次绘制是否接着上一次绘制。即 reserve 参数为 false,则在本次调用绘制之前 native 层会先清空画布再继续绘制;若 reserve 参数为 true,则保留当前画布上的内容,本次调用 drawCanvas 绘制的内容覆盖在上面,默认 false。 */ + reserve?: boolean, + /** 绘制完成后执行的回调函数 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 绘制图像到画布 +* +* **示例代码** +* +* 有三个版本的写法: +* +* - drawImage(imageResource, dx, dy) +* - drawImage(imageResource, dx, dy, dWidth, dHeight) +* - drawImage(imageResource, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) 从 1.9.0 起支持 +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +wx.chooseImage({ + success: function(res){ + ctx.drawImage(res.tempFilePaths[0], 0, 0, 150, 100) + ctx.draw() + } +}) + +``` +* ![](@program/dev/image/canvas/draw-image.png) */ + drawImage( + /** 所要绘制的图片资源(网络图片要通过 getImageInfo / downloadFile 先下载) */ + imageResource: string, + /** imageResource的左上角在目标 canvas 上 x 轴的位置 */ + dx: number, + /** imageResource的左上角在目标 canvas 上 y 轴的位置 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 绘制图像到画布 +* +* **示例代码** +* +* 有三个版本的写法: +* +* - drawImage(imageResource, dx, dy) +* - drawImage(imageResource, dx, dy, dWidth, dHeight) +* - drawImage(imageResource, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) 从 1.9.0 起支持 +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +wx.chooseImage({ + success: function(res){ + ctx.drawImage(res.tempFilePaths[0], 0, 0, 150, 100) + ctx.draw() + } +}) + +``` +* ![](@program/dev/image/canvas/draw-image.png) */ + drawImage( + /** 所要绘制的图片资源(网络图片要通过 getImageInfo / downloadFile 先下载) */ + imageResource: string, + /** imageResource的左上角在目标 canvas 上 x 轴的位置 */ + dx: number, + /** imageResource的左上角在目标 canvas 上 y 轴的位置 */ + dy: number, + /** 在目标画布上绘制imageResource的宽度,允许对绘制的imageResource进行缩放 */ + dWidth: number, + /** 在目标画布上绘制imageResource的高度,允许对绘制的imageResource进行缩放 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 绘制图像到画布 +* +* **示例代码** +* +* 有三个版本的写法: +* +* - drawImage(imageResource, dx, dy) +* - drawImage(imageResource, dx, dy, dWidth, dHeight) +* - drawImage(imageResource, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) 从 1.9.0 起支持 +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +wx.chooseImage({ + success: function(res){ + ctx.drawImage(res.tempFilePaths[0], 0, 0, 150, 100) + ctx.draw() + } +}) + +``` +* ![](@program/dev/image/canvas/draw-image.png) */ + drawImage( + /** 所要绘制的图片资源(网络图片要通过 getImageInfo / downloadFile 先下载) */ + imageResource: string, + /** 需要绘制到画布中的,imageResource的矩形(裁剪)选择框的左上角 x 坐标 */ + sx: number, + /** 需要绘制到画布中的,imageResource的矩形(裁剪)选择框的左上角 y 坐标 */ + sy: number, + /** 需要绘制到画布中的,imageResource的矩形(裁剪)选择框的宽度 */ + sWidth: number, + /** 需要绘制到画布中的,imageResource的矩形(裁剪)选择框的高度 */ + sHeight: number, + /** imageResource的左上角在目标 canvas 上 x 轴的位置 */ + dx: number, + /** imageResource的左上角在目标 canvas 上 y 轴的位置 */ + dy: number, + /** 在目标画布上绘制imageResource的宽度,允许对绘制的imageResource进行缩放 */ + dWidth: number, + /** 在目标画布上绘制imageResource的高度,允许对绘制的imageResource进行缩放 */ + dHeight: number + ): void; + /** [CanvasContext.fill()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.fill.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 对当前路径中的内容进行填充。默认的填充色为黑色。 +* +* **示例代码** +* +* 如果当前路径没有闭合,fill() 方法会将起点和终点进行连接,然后填充。 +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.moveTo(10, 10) +ctx.lineTo(100, 10) +ctx.lineTo(100, 100) +ctx.fill() +ctx.draw() +``` +* +* fill() 填充的的路径是从 beginPath() 开始计算,但是不会将 fillRect() 包含进去。 +* +* ![](@program/dev/image/canvas/fill-line.png) +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +// begin path +ctx.rect(10, 10, 100, 30) +ctx.setFillStyle('yellow') +ctx.fill() + +// begin another path +ctx.beginPath() +ctx.rect(10, 40, 100, 30) + +// only fill this rect, not in current path +ctx.setFillStyle('blue') +ctx.fillRect(10, 70, 100, 30) + +ctx.rect(10, 100, 100, 30) + +// it will fill current path +ctx.setFillStyle('red') +ctx.fill() +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/fill-path.png) */ + fill(): void; + /** [CanvasContext.fillRect(number x, number y, number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.fillRect.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 填充一个矩形。用 [`setFillStyle`](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setFillStyle.html) 设置矩形的填充色,如果没设置默认是黑色。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.setFillStyle('red') +ctx.fillRect(10, 10, 150, 75) +ctx.draw() +``` +* ![](@program/dev/image/canvas/fill-rect.png) */ + fillRect( + /** 矩形路径左上角的横坐标 */ + x: number, + /** 矩形路径左上角的纵坐标 */ + y: number, + /** 矩形路径的宽度 */ + width: number, + /** 矩形路径的高度 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 在画布上绘制被填充的文本 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.setFontSize(20) +ctx.fillText('Hello', 20, 20) +ctx.fillText('MINA', 100, 100) + +ctx.draw() +``` +* ![](@program/dev/image/canvas/text.png) */ + fillText( + /** 在画布上输出的文本 */ + text: string, + /** 绘制文本的左上角 x 坐标位置 */ + x: number, + /** 绘制文本的左上角 y 坐标位置 */ + y: number, + /** 需要绘制的最大宽度,可选 */ + maxWidth?: number + ): void; + /** [CanvasContext.lineTo(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.lineTo.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 增加一个新点,然后创建一条从上次指定点到目标点的线。用 `stroke` 方法来画线条 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.moveTo(10, 10) +ctx.rect(10, 10, 100, 50) +ctx.lineTo(110, 60) +ctx.stroke() +ctx.draw() +``` +* ![](@program/dev/image/canvas/line-to.png) */ + lineTo( + /** 目标位置的 x 坐标 */ + x: number, + /** 目标位置的 y 坐标 */ + y: number + ): void; + /** [CanvasContext.moveTo(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.moveTo.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 把路径移动到画布中的指定点,不创建线条。用 `stroke` 方法来画线条 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.moveTo(10, 10) +ctx.lineTo(100, 10) + +ctx.moveTo(10, 50) +ctx.lineTo(100, 50) +ctx.stroke() +ctx.draw() +``` +* ![](@program/dev/image/canvas/move-to.png) */ + moveTo( + /** 目标位置的 x 坐标 */ + x: number, + /** 目标位置的 y 坐标 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 创建二次贝塞尔曲线路径。曲线的起始点为路径中前一个点。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +// Draw points +ctx.beginPath() +ctx.arc(20, 20, 2, 0, 2 * Math.PI) +ctx.setFillStyle('red') +ctx.fill() + +ctx.beginPath() +ctx.arc(200, 20, 2, 0, 2 * Math.PI) +ctx.setFillStyle('lightgreen') +ctx.fill() + +ctx.beginPath() +ctx.arc(20, 100, 2, 0, 2 * Math.PI) +ctx.setFillStyle('blue') +ctx.fill() + +ctx.setFillStyle('black') +ctx.setFontSize(12) + +// Draw guides +ctx.beginPath() +ctx.moveTo(20, 20) +ctx.lineTo(20, 100) +ctx.lineTo(200, 20) +ctx.setStrokeStyle('#AAAAAA') +ctx.stroke() + +// Draw quadratic curve +ctx.beginPath() +ctx.moveTo(20, 20) +ctx.quadraticCurveTo(20, 100, 200, 20) +ctx.setStrokeStyle('black') +ctx.stroke() + +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/quadratic-curve-to.png) +* +* 针对 moveTo(20, 20) quadraticCurveTo(20, 100, 200, 20) 的三个关键坐标如下: +* +* - 红色:起始点(20, 20) +* - 蓝色:控制点(20, 100) +* - 绿色:终止点(200, 20) */ + quadraticCurveTo( + /** 贝塞尔控制点的 x 坐标 */ + cpx: number, + /** 贝塞尔控制点的 y 坐标 */ + cpy: number, + /** 结束点的 x 坐标 */ + x: number, + /** 结束点的 y 坐标 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 创建一个矩形路径。需要用 [`fill`](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.fill.html) 或者 [`stroke`](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.stroke.html) 方法将矩形真正的画到 `canvas` 中 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.rect(10, 10, 150, 75) +ctx.setFillStyle('red') +ctx.fill() +ctx.draw() +``` +* ![](@program/dev/image/canvas/fill-rect.png) */ + rect( + /** 矩形路径左上角的横坐标 */ + x: number, + /** 矩形路径左上角的纵坐标 */ + y: number, + /** 矩形路径的宽度 */ + width: number, + /** 矩形路径的高度 */ + height: number + ): void; + /** [CanvasContext.restore()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.restore.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 恢复之前保存的绘图上下文。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +// save the default fill style +ctx.save() +ctx.setFillStyle('red') +ctx.fillRect(10, 10, 150, 100) + +// restore to the previous saved state +ctx.restore() +ctx.fillRect(50, 50, 150, 100) + +ctx.draw() +``` +* ![](@program/dev/image/canvas/save-restore.png) */ + restore(): void; + /** [CanvasContext.rotate(number rotate)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.rotate.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 以原点为中心顺时针旋转当前坐标轴。多次调用旋转的角度会叠加。原点可以用 `translate` 方法修改。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.strokeRect(100, 10, 150, 100) +ctx.rotate(20 * Math.PI / 180) +ctx.strokeRect(100, 10, 150, 100) +ctx.rotate(20 * Math.PI / 180) +ctx.strokeRect(100, 10, 150, 100) + +ctx.draw() +``` +* ![](@program/dev/image/canvas/rotate.png) */ + rotate( + /** 旋转角度,以弧度计 degrees * Math.PI/180;degrees 范围为 0-360 */ + rotate: number + ): void; + /** [CanvasContext.save()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.save.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 保存绘图上下文。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +// save the default fill style +ctx.save() +ctx.setFillStyle('red') +ctx.fillRect(10, 10, 150, 100) + +// restore to the previous saved state +ctx.restore() +ctx.fillRect(50, 50, 150, 100) + +ctx.draw() +``` +* ![](@program/dev/image/canvas/save-restore.png) */ + save(): void; + /** [CanvasContext.scale(number scaleWidth, number scaleHeight)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.scale.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 在调用后,之后创建的路径其横纵坐标会被缩放。多次调用倍数会相乘。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.strokeRect(10, 10, 25, 15) +ctx.scale(2, 2) +ctx.strokeRect(10, 10, 25, 15) +ctx.scale(2, 2) +ctx.strokeRect(10, 10, 25, 15) + +ctx.draw() +``` +* ![](@program/dev/image/canvas/scale.png) */ + scale( + /** 横坐标缩放的倍数 (1 = 100%,0.5 = 50%,2 = 200%) */ + scaleWidth: number, + /** 纵坐标轴缩放的倍数 (1 = 100%,0.5 = 50%,2 = 200%) */ + 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) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.fillStyle](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置填充色。 +* +* **代码示例** +* +* ```js +const ctx = wx.createCanvasContext('myCanvas') +ctx.setFillStyle('red') +ctx.fillRect(10, 10, 150, 75) +ctx.draw() +``` +* ![](@program/dev/image/canvas/fill-rect.png) */ + setFillStyle( + /** 填充的颜色,默认颜色为 black。 */ + color: string | CanvasGradient + ): void; + /** [CanvasContext.setFontSize(number fontSize)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setFontSize.html) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.font](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置字体的字号 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.setFontSize(20) +ctx.fillText('20', 20, 20) +ctx.setFontSize(30) +ctx.fillText('30', 40, 40) +ctx.setFontSize(40) +ctx.fillText('40', 60, 60) +ctx.setFontSize(50) +ctx.fillText('50', 90, 90) + +ctx.draw() +``` +* ![](@program/dev/image/canvas/font-size.png) */ + setFontSize( + /** 字体的字号 */ + fontSize: number + ): void; + /** [CanvasContext.setGlobalAlpha(number alpha)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setGlobalAlpha.html) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.globalAlpha](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置全局画笔透明度。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.setFillStyle('red') +ctx.fillRect(10, 10, 150, 100) +ctx.setGlobalAlpha(0.2) +ctx.setFillStyle('blue') +ctx.fillRect(50, 50, 150, 100) +ctx.setFillStyle('yellow') +ctx.fillRect(100, 100, 150, 100) + +ctx.draw() +``` +* ![](@program/dev/image/canvas/global-alpha.png) */ + setGlobalAlpha( + /** 透明度。范围 0-1,0 表示完全透明,1 表示完全不透明。 */ + alpha: number + ): void; + /** [CanvasContext.setLineCap(string lineCap)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineCap.html) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.lineCap](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置线条的端点样式 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.beginPath() +ctx.moveTo(10, 10) +ctx.lineTo(150, 10) +ctx.stroke() + +ctx.beginPath() +ctx.setLineCap('butt') +ctx.setLineWidth(10) +ctx.moveTo(10, 30) +ctx.lineTo(150, 30) +ctx.stroke() + +ctx.beginPath() +ctx.setLineCap('round') +ctx.setLineWidth(10) +ctx.moveTo(10, 50) +ctx.lineTo(150, 50) +ctx.stroke() + +ctx.beginPath() +ctx.setLineCap('square') +ctx.setLineWidth(10) +ctx.moveTo(10, 70) +ctx.lineTo(150, 70) +ctx.stroke() + +ctx.draw() +``` +* ![](@program/dev/image/canvas/line-cap.png) */ + setLineCap( + /** 线条的结束端点样式 + * + * 参数 lineCap 可选值: + * - 'butt': 向线条的每个末端添加平直的边缘。; + * - 'round': 向线条的每个末端添加圆形线帽。; + * - 'square': 向线条的每个末端添加正方形线帽。; */ + 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` +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.lineDashOffset](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置虚线样式。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.setLineDash([10, 20], 5); + +ctx.beginPath(); +ctx.moveTo(0,100); +ctx.lineTo(400, 100); +ctx.stroke(); + +ctx.draw() +``` +* ![](@program/dev/image/canvas/set-line-dash.png) */ + setLineDash( + /** 一组描述交替绘制线段和间距(坐标空间单位)长度的数字 */ + pattern: number[], + /** 虚线偏移量 */ + offset: number + ): void; + /** [CanvasContext.setLineJoin(string lineJoin)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineJoin.html) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.lineJoin](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置线条的交点样式 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.beginPath() +ctx.moveTo(10, 10) +ctx.lineTo(100, 50) +ctx.lineTo(10, 90) +ctx.stroke() + +ctx.beginPath() +ctx.setLineJoin('bevel') +ctx.setLineWidth(10) +ctx.moveTo(50, 10) +ctx.lineTo(140, 50) +ctx.lineTo(50, 90) +ctx.stroke() + +ctx.beginPath() +ctx.setLineJoin('round') +ctx.setLineWidth(10) +ctx.moveTo(90, 10) +ctx.lineTo(180, 50) +ctx.lineTo(90, 90) +ctx.stroke() + +ctx.beginPath() +ctx.setLineJoin('miter') +ctx.setLineWidth(10) +ctx.moveTo(130, 10) +ctx.lineTo(220, 50) +ctx.lineTo(130, 90) +ctx.stroke() + +ctx.draw() +``` +* ![](@program/dev/image/canvas/line-join.png) */ + setLineJoin( + /** 线条的结束交点样式 + * + * 参数 lineJoin 可选值: + * - 'bevel': 斜角; + * - 'round': 圆角; + * - 'miter': 尖角; */ + lineJoin: 'bevel' | 'round' | 'miter' + ): void; + /** [CanvasContext.setLineWidth(number lineWidth)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineWidth.html) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.lineWidth](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置线条的宽度 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.beginPath() +ctx.moveTo(10, 10) +ctx.lineTo(150, 10) +ctx.stroke() + +ctx.beginPath() +ctx.setLineWidth(5) +ctx.moveTo(10, 30) +ctx.lineTo(150, 30) +ctx.stroke() + +ctx.beginPath() +ctx.setLineWidth(10) +ctx.moveTo(10, 50) +ctx.lineTo(150, 50) +ctx.stroke() + +ctx.beginPath() +ctx.setLineWidth(15) +ctx.moveTo(10, 70) +ctx.lineTo(150, 70) +ctx.stroke() + +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/line-width.png) */ + setLineWidth( + /** 线条的宽度,单位px */ + lineWidth: number + ): void; + /** [CanvasContext.setMiterLimit(number miterLimit)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setMiterLimit.html) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.miterLimit](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置最大斜接长度。斜接长度指的是在两条线交汇处内角和外角之间的距离。当 [CanvasContext.setLineJoin()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setLineJoin.html) 为 miter 时才有效。超过最大倾斜长度的,连接处将以 lineJoin 为 bevel 来显示。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.beginPath() +ctx.setLineWidth(10) +ctx.setLineJoin('miter') +ctx.setMiterLimit(1) +ctx.moveTo(10, 10) +ctx.lineTo(100, 50) +ctx.lineTo(10, 90) +ctx.stroke() + +ctx.beginPath() +ctx.setLineWidth(10) +ctx.setLineJoin('miter') +ctx.setMiterLimit(2) +ctx.moveTo(50, 10) +ctx.lineTo(140, 50) +ctx.lineTo(50, 90) +ctx.stroke() + +ctx.beginPath() +ctx.setLineWidth(10) +ctx.setLineJoin('miter') +ctx.setMiterLimit(3) +ctx.moveTo(90, 10) +ctx.lineTo(180, 50) +ctx.lineTo(90, 90) +ctx.stroke() + +ctx.beginPath() +ctx.setLineWidth(10) +ctx.setLineJoin('miter') +ctx.setMiterLimit(4) +ctx.moveTo(130, 10) +ctx.lineTo(220, 50) +ctx.lineTo(130, 90) +ctx.stroke() + +ctx.draw() +``` +* ![](@program/dev/image/canvas/miter-limit.png) */ + setMiterLimit( + /** 最大斜接长度 */ + 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) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.shadowOffsetX|CanvasContext.shadowOffsetY|CanvasContext.shadowColor|CanvasContext.shadowBlur](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设定阴影样式。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.setFillStyle('red') +ctx.setShadow(10, 50, 50, 'blue') +ctx.fillRect(10, 10, 150, 75) +ctx.draw() +``` +* ![](@program/dev/image/canvas/shadow.png) */ + setShadow( + /** 阴影相对于形状在水平方向的偏移,默认值为 0。 */ + offsetX: number, + /** 阴影相对于形状在竖直方向的偏移,默认值为 0。 */ + offsetY: number, + /** 阴影的模糊级别,数值越大越模糊。范围 0- 100。,默认值为 0。 */ + blur: number, + /** 阴影的颜色。默认值为 black。 */ + 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) +* +* 在插件中使用:支持 +* @deprecated 基础库版本 [1.9.90](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [CanvasContext.strokeStyle](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置描边颜色。 +* +* **代码示例** +* +* ```js +const ctx = wx.createCanvasContext('myCanvas') +ctx.setStrokeStyle('red') +ctx.strokeRect(10, 10, 150, 75) +ctx.draw() +``` +* ![](@program/dev/image/canvas/stroke-rect.png) */ + setStrokeStyle( + /** 描边的颜色,默认颜色为 black。 */ + color: string | CanvasGradient + ): void; + /** [CanvasContext.setTextAlign(string align)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setTextAlign.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置文字的对齐 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.setStrokeStyle('red') +ctx.moveTo(150, 20) +ctx.lineTo(150, 170) +ctx.stroke() + +ctx.setFontSize(15) +ctx.setTextAlign('left') +ctx.fillText('textAlign=left', 150, 60) + +ctx.setTextAlign('center') +ctx.fillText('textAlign=center', 150, 80) + +ctx.setTextAlign('right') +ctx.fillText('textAlign=right', 150, 100) + +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/set-text-align.png) */ + setTextAlign( + /** 文字的对齐方式 + * + * 参数 align 可选值: + * - 'left': 左对齐; + * - 'center': 居中对齐; + * - 'right': 右对齐; */ + align: 'left' | 'center' | 'right' + ): void; + /** [CanvasContext.setTextBaseline(string textBaseline)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setTextBaseline.html) +* +* 需要基础库: `1.4.0` +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 设置文字的竖直对齐 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.setStrokeStyle('red') +ctx.moveTo(5, 75) +ctx.lineTo(295, 75) +ctx.stroke() + +ctx.setFontSize(20) + +ctx.setTextBaseline('top') +ctx.fillText('top', 5, 75) + +ctx.setTextBaseline('middle') +ctx.fillText('middle', 50, 75) + +ctx.setTextBaseline('bottom') +ctx.fillText('bottom', 120, 75) + +ctx.setTextBaseline('normal') +ctx.fillText('normal', 200, 75) + +ctx.draw() +``` +* ![](@program/dev/image/canvas/set-text-baseline.png) */ + setTextBaseline( + /** 文字的竖直对齐方式 + * + * 参数 textBaseline 可选值: + * - 'top': 顶部对齐; + * - 'bottom': 底部对齐; + * - 'middle': 居中对齐; + * - 'normal': ; */ + 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` + * + * 在插件中使用:支持 + * @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) 替换 + * + * @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** + * + * 使用矩阵重新设置(覆盖)当前变换的方法 */ + setTransform( + /** 水平缩放 */ + scaleX: number, + /** 水平倾斜 */ + skewX: number, + /** 垂直倾斜 */ + skewY: number, + /** 垂直缩放 */ + scaleY: number, + /** 水平移动 */ + translateX: number, + /** 垂直移动 */ + translateY: number + ): void; + /** [CanvasContext.stroke()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.stroke.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 画出当前路径的边框。默认颜色色为黑色。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.moveTo(10, 10) +ctx.lineTo(100, 10) +ctx.lineTo(100, 100) +ctx.stroke() +ctx.draw() +``` +* ![](@program/dev/image/canvas/stroke-line.png) +* +* stroke() 描绘的的路径是从 beginPath() 开始计算,但是不会将 strokeRect() 包含进去。 +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +// begin path +ctx.rect(10, 10, 100, 30) +ctx.setStrokeStyle('yellow') +ctx.stroke() + +// begin another path +ctx.beginPath() +ctx.rect(10, 40, 100, 30) + +// only stoke this rect, not in current path +ctx.setStrokeStyle('blue') +ctx.strokeRect(10, 70, 100, 30) + +ctx.rect(10, 100, 100, 30) + +// it will stroke current path +ctx.setStrokeStyle('red') +ctx.stroke() +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/stroke-path.png) */ + stroke(): void; + /** [CanvasContext.strokeRect(number x, number y, number width, number height)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.strokeRect.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 画一个矩形(非填充)。 用 [`setStrokeStyle`](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.setStrokeStyle.html) 设置矩形线条的颜色,如果没设置默认是黑色。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') +ctx.setStrokeStyle('red') +ctx.strokeRect(10, 10, 150, 75) +ctx.draw() +``` +* ![](@program/dev/image/canvas/stroke-rect.png) */ + strokeRect( + /** 矩形路径左上角的横坐标 */ + x: number, + /** 矩形路径左上角的纵坐标 */ + y: number, + /** 矩形路径的宽度 */ + width: number, + /** 矩形路径的高度 */ + 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` + * + * 在插件中使用:支持 + * @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) 替换 + * + * @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** + * + * 给定的 (x, y) 位置绘制文本描边的方法 */ + strokeText( + /** 要绘制的文本 */ + text: string, + /** 文本起始点的 x 轴坐标 */ + x: number, + /** 文本起始点的 y 轴坐标 */ + y: number, + /** 需要绘制的最大宽度,可选 */ + 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` + * + * 在插件中使用:支持 + * @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) 替换 + * + * @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** + * + * 使用矩阵多次叠加当前变换的方法 */ + transform( + /** 水平缩放 */ + scaleX: number, + /** 水平倾斜 */ + skewX: number, + /** 垂直倾斜 */ + skewY: number, + /** 垂直缩放 */ + scaleY: number, + /** 水平移动 */ + translateX: number, + /** 垂直移动 */ + translateY: number + ): void; + /** [CanvasContext.translate(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.translate.html) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 对当前坐标系的原点 (0, 0) 进行变换。默认的坐标系原点为页面左上角。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +ctx.strokeRect(10, 10, 150, 100) +ctx.translate(20, 20) +ctx.strokeRect(10, 10, 150, 100) +ctx.translate(20, 20) +ctx.strokeRect(10, 10, 150, 100) + +ctx.draw() +``` +* +* ![](@program/dev/image/canvas/translate.png) */ + translate( + /** 水平坐标平移量 */ + x: number, + /** 竖直坐标平移量 */ + y: number + ): void; + /** [Object CanvasContext.measureText(string text)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.measureText.html) + * + * 需要基础库: `1.9.90` + * + * 在插件中使用:支持 + * @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) 替换 + * + * @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** + * + * 测量文本尺寸信息。目前仅返回文本宽度。同步接口。 */ + measureText( + /** 要测量的文本 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 创建一个圆形的渐变颜色。起点在圆心,终点在圆环。返回的`CanvasGradient`对象需要使用 [CanvasGradient.addColorStop()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasGradient.addColorStop.html) 来指定渐变点,至少要两个。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +// Create circular gradient +const grd = ctx.createCircularGradient(75, 50, 50) +grd.addColorStop(0, 'red') +grd.addColorStop(1, 'white') + +// Fill with gradient +ctx.setFillStyle(grd) +ctx.fillRect(10, 10, 150, 80) +ctx.draw() +``` +* ![](@program/dev/image/canvas/circular-gradient.png) */ + createCircularGradient( + /** 圆心的 x 坐标 */ + x: number, + /** 圆心的 y 坐标 */ + y: number, + /** 圆的半径 */ + 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) +* +* 在插件中使用:支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 创建一个线性的渐变颜色。返回的`CanvasGradient`对象需要使用 [CanvasGradient.addColorStop()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasGradient.addColorStop.html) 来指定渐变点,至少要两个。 +* +* **示例代码** +* +* ```javascript +const ctx = wx.createCanvasContext('myCanvas') + +// Create linear gradient +const grd = ctx.createLinearGradient(0, 0, 200, 0) +grd.addColorStop(0, 'red') +grd.addColorStop(1, 'white') + +// Fill with gradient +ctx.setFillStyle(grd) +ctx.fillRect(10, 10, 150, 80) +ctx.draw() +``` +* ![](@program/dev/image/canvas/linear-gradient.png) */ + createLinearGradient( + /** 起点的 x 坐标 */ + x0: number, + /** 起点的 y 坐标 */ + y0: number, + /** 终点的 x 坐标 */ + x1: number, + /** 终点的 y 坐标 */ + y1: number + ): CanvasGradient; + } + interface CanvasGetImageDataOption { + /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 `canvas-id` 属性。 */ + canvasId: string; + /** 将要被提取的图像数据矩形区域的高度 */ + height: number; + /** 将要被提取的图像数据矩形区域的宽度 */ + width: number; + /** 将要被提取的图像数据矩形区域的左上角横坐标 */ + x: number; + /** 将要被提取的图像数据矩形区域的左上角纵坐标 */ + y: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CanvasGetImageDataCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CanvasGetImageDataFailCallback; + /** 接口调用成功的回调函数 */ + success?: CanvasGetImageDataSuccessCallback; + } + interface CanvasGetImageDataSuccessCallbackResult { + /** 图像像素点数据,一维数组,每四项表示一个像素点的 rgba */ + data: Uint8ClampedArray; + /** 图像数据矩形的高度 */ + height: number; + /** 图像数据矩形的宽度 */ + width: number; + errMsg: string; + } + interface CanvasPutImageDataOption { + /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 canvas-id 属性。 */ + canvasId: string; + /** 图像像素点数据,一维数组,每四项表示一个像素点的 rgba */ + data: Uint8ClampedArray; + /** 源图像数据矩形区域的高度 */ + height: number; + /** 源图像数据矩形区域的宽度 */ + width: number; + /** 源图像数据在目标画布中的位置偏移量(x 轴方向的偏移量) */ + x: number; + /** 源图像数据在目标画布中的位置偏移量(y 轴方向的偏移量) */ + y: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CanvasPutImageDataCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CanvasPutImageDataFailCallback; + /** 接口调用成功的回调函数 */ + success?: CanvasPutImageDataSuccessCallback; + } + interface CanvasToTempFilePathOption { + /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件实例 (canvas type="2d" 时使用该属性)。 */ + canvas?: IAnyObject; + /** 画布标识,传入 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件的 canvas-id */ + canvasId?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CanvasToTempFilePathCompleteCallback; + /** 需要基础库: `1.2.0` + * + * 输出的图片的高度 */ + destHeight?: number; + /** 需要基础库: `1.2.0` + * + * 输出的图片的宽度 */ + destWidth?: number; + /** 接口调用失败的回调函数 */ + fail?: CanvasToTempFilePathFailCallback; + /** 需要基础库: `1.7.0` + * + * 目标文件的类型 + * + * 可选值: + * - 'jpg': jpg 图片; + * - 'png': png 图片; */ + fileType?: 'jpg' | 'png'; + /** 需要基础库: `1.2.0` + * + * 指定的画布区域的高度 */ + height?: number; + /** 需要基础库: `1.7.0` + * + * 图片的质量,目前仅对 jpg 有效。取值范围为 (0, 1],不在范围内时当作 1.0 处理。 */ + quality?: number; + /** 接口调用成功的回调函数 */ + success?: CanvasToTempFilePathSuccessCallback; + /** 需要基础库: `1.2.0` + * + * 指定的画布区域的宽度 */ + width?: number; + /** 需要基础库: `1.2.0` + * + * 指定的画布区域的左上角横坐标 */ + x?: number; + /** 需要基础库: `1.2.0` + * + * 指定的画布区域的左上角纵坐标 */ + y?: number; + } + interface CanvasToTempFilePathSuccessCallbackResult { + /** 生成文件的临时路径 (本地路径) */ + tempFilePath: string; + errMsg: string; + } + /** characteristics列表 */ + interface Characteristic { + /** characteristic 的 UUID */ + uuid: string; + /** 描述符数据 */ + descriptors?: CharacteristicDescriptor[]; + /** 特征权限 */ + permission?: CharacteristicPermission; + /** 特征支持的操作 */ + properties?: CharacteristicProperties; + /** 特征对应的二进制值 */ + value?: ArrayBuffer; + } + /** 描述符数据 */ + interface CharacteristicDescriptor { + /** Descriptor 的 UUID */ + uuid: string; + /** 描述符的权限 */ + permission?: DescriptorPermission; + /** 描述符数据 */ + value?: ArrayBuffer; + } + /** 特征权限 */ + interface CharacteristicPermission { + /** 加密读请求 */ + readEncryptionRequired?: boolean; + /** 可读 */ + readable?: boolean; + /** 加密写请求 */ + writeEncryptionRequired?: boolean; + /** 可写 */ + writeable?: boolean; + } + /** 特征支持的操作 */ + interface CharacteristicProperties { + /** 回包 */ + indicate?: boolean; + /** 订阅 */ + notify?: boolean; + /** 读 */ + read?: boolean; + /** 写 */ + write?: boolean; + /** 无回复写 */ + writeNoResponse?: boolean; + } + interface CheckIsAddedToMyMiniProgramOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CheckIsAddedToMyMiniProgramCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CheckIsAddedToMyMiniProgramFailCallback; + /** 接口调用成功的回调函数 */ + success?: CheckIsAddedToMyMiniProgramSuccessCallback; + } + interface CheckIsAddedToMyMiniProgramSuccessCallbackResult { + /** 是否被添加至 「我的小程序」 */ + added: boolean; + errMsg: string; + } + interface CheckIsOpenAccessibilityOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CheckIsOpenAccessibilityCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CheckIsOpenAccessibilityFailCallback; + /** 接口调用成功的回调函数 */ + success?: CheckIsOpenAccessibilitySuccessCallback; + } + interface CheckIsOpenAccessibilitySuccessCallbackOption { + /** iOS 上开启辅助功能旁白,安卓开启 talkback 时返回 true */ + open: boolean; + errMsg: string; + } + interface CheckIsSoterEnrolledInDeviceOption { + /** 认证方式 + * + * 可选值: + * - 'fingerPrint': 指纹识别; + * - 'facial': 人脸识别; + * - 'speech': 声纹识别(暂未支持); */ + checkAuthMode: 'fingerPrint' | 'facial' | 'speech'; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CheckIsSoterEnrolledInDeviceCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CheckIsSoterEnrolledInDeviceFailCallback; + /** 接口调用成功的回调函数 */ + success?: CheckIsSoterEnrolledInDeviceSuccessCallback; + } + interface CheckIsSoterEnrolledInDeviceSuccessCallbackResult { + /** 错误信息 */ + errMsg: string; + /** 是否已录入信息 */ + isEnrolled: boolean; + } + interface CheckIsSupportSoterAuthenticationOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CheckIsSupportSoterAuthenticationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CheckIsSupportSoterAuthenticationFailCallback; + /** 接口调用成功的回调函数 */ + success?: CheckIsSupportSoterAuthenticationSuccessCallback; + } + interface CheckIsSupportSoterAuthenticationSuccessCallbackResult { + /** 该设备支持的可被SOTER识别的生物识别方式 + * + * 可选值: + * - 'fingerPrint': 指纹识别; + * - 'facial': 人脸识别; + * - 'speech': 声纹识别(暂未支持); */ + supportMode: Array<'fingerPrint' | 'facial' | 'speech'>; + errMsg: string; + } + interface CheckSessionOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CheckSessionCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CheckSessionFailCallback; + /** 接口调用成功的回调函数 */ + success?: CheckSessionSuccessCallback; + } + interface ChooseAddressOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseAddressCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ChooseAddressFailCallback; + /** 接口调用成功的回调函数 */ + success?: ChooseAddressSuccessCallback; + } + interface ChooseAddressSuccessCallbackResult { + /** 国标收货地址第二级地址 */ + cityName: string; + /** 国标收货地址第三级地址 */ + countyName: string; + /** 详细收货地址信息(包括街道地址) */ + detailInfo: string; + /** 新选择器详细收货地址信息 */ + detailInfoNew: string; + /** 错误信息 */ + errMsg: string; + /** 收货地址国家码 */ + nationalCode: string; + /** 邮编 */ + postalCode: string; + /** 国标收货地址第一级地址 */ + provinceName: string; + /** 国标收货地址第四级地址 */ + streetName: string; + /** 收货人手机号码 */ + telNumber: string; + /** 收货人姓名 */ + userName: string; + } + interface ChooseContactOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseContactCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ChooseContactFailCallback; + /** 接口调用成功的回调函数 */ + success?: ChooseContactSuccessCallback; + } + interface ChooseContactSuccessCallbackOption { + /** 联系人姓名 */ + displayName: string; + /** 手机号 */ + phoneNumber: string; + /** 选定联系人的所有手机号(部分 Android 系统只能选联系人而不能选特定手机号) */ + phoneNumberList: string; + errMsg: string; + } + /** 返回选择的文件的本地临时文件对象数组 */ + interface ChooseFile { + /** 选择的文件名称 */ + name: string; + /** 本地临时文件路径 (本地路径) */ + path: string; + /** 本地临时文件大小,单位 B */ + size: number; + /** 选择的文件的会话发送时间,Unix时间戳,工具暂不支持此属性 */ + time: number; + /** 选择的文件类型 + * + * 可选值: + * - 'video': 选择了视频文件; + * - 'image': 选择了图片文件; + * - 'file': 选择了除图片和视频的文件; */ + type: 'video' | 'image' | 'file'; + } + interface ChooseImageOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseImageCompleteCallback; + /** 最多可以选择的图片张数 */ + count?: number; + /** 接口调用失败的回调函数 */ + fail?: ChooseImageFailCallback; + /** 所选的图片的尺寸 + * + * 可选值: + * - 'original': 原图; + * - 'compressed': 压缩图; */ + sizeType?: Array<'original' | 'compressed'>; + /** 选择图片的来源 + * + * 可选值: + * - 'album': 从相册选图; + * - 'camera': 使用相机; */ + sourceType?: Array<'album' | 'camera'>; + /** 接口调用成功的回调函数 */ + success?: ChooseImageSuccessCallback; + } + interface ChooseImageSuccessCallbackResult { + /** 图片的本地临时文件路径列表 (本地路径) */ + tempFilePaths: string[]; + /** 需要基础库: `1.2.0` + * + * 图片的本地临时文件列表 */ + tempFiles: ImageFile[]; + errMsg: string; + } + interface ChooseInvoiceOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseInvoiceCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ChooseInvoiceFailCallback; + /** 接口调用成功的回调函数 */ + success?: ChooseInvoiceSuccessCallback; + } + interface ChooseInvoiceSuccessCallbackResult { + /** 用户选中的发票信息,格式为一个 JSON 字符串,包含三个字段: card_id:所选发票卡券的 cardId,encrypt_code:所选发票卡券的加密 code,报销方可以通过 cardId 和 encryptCode 获得报销发票的信息,app_id: 发票方的 appId。 */ + invoiceInfo: string; + errMsg: string; + } + interface ChooseInvoiceTitleOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseInvoiceTitleCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ChooseInvoiceTitleFailCallback; + /** 接口调用成功的回调函数 */ + success?: ChooseInvoiceTitleSuccessCallback; + } + interface ChooseInvoiceTitleSuccessCallbackResult { + /** 银行账号 */ + bankAccount: string; + /** 银行名称 */ + bankName: string; + /** 单位地址 */ + companyAddress: string; + /** 错误信息 */ + errMsg: string; + /** 抬头税号 */ + taxNumber: string; + /** 手机号码 */ + telephone: string; + /** 抬头名称 */ + title: string; + /** 抬头类型 + * + * 可选值: + * - 0: 单位; + * - 1: 个人; */ + type: 0 | 1; + } + interface ChooseLicensePlateOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseLicensePlateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ChooseLicensePlateFailCallback; + /** 接口调用成功的回调函数 */ + success?: ChooseLicensePlateSuccessCallback; + } + interface ChooseLicensePlateSuccessCallbackResult { + /** 用户选择的车牌号 */ + plateNumber: string; + errMsg: string; + } + interface ChooseLocationOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseLocationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ChooseLocationFailCallback; + /** 需要基础库: `2.9.0` + * + * 目标地纬度 */ + latitude?: number; + /** 需要基础库: `2.9.0` + * + * 目标地经度 */ + longitude?: number; + /** 接口调用成功的回调函数 */ + success?: ChooseLocationSuccessCallback; + } + interface ChooseLocationSuccessCallbackResult { + /** 详细地址 */ + address: string; + /** 纬度,浮点数,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系 */ + latitude: number; + /** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */ + longitude: number; + /** 位置名称 */ + name: string; + errMsg: string; + } + interface ChooseMediaOption { + /** 仅在 sourceType 为 camera 时生效,使用前置或后置摄像头 + * + * 可选值: + * - 'back': 使用后置摄像头; + * - 'front': 使用前置摄像头; */ + camera?: 'back' | 'front'; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseMediaCompleteCallback; + /** 最多可以选择的文件个数,基础库2.25.0前,最多可支持9个文件,2.25.0及以后最多可支持20个文件 */ + count?: number; + /** 接口调用失败的回调函数 */ + fail?: ChooseMediaFailCallback; + /** 拍摄视频最长拍摄时间,单位秒。时间范围为 3s 至 60s 之间。不限制相册。 */ + maxDuration?: number; + /** 文件类型 + * + * 可选值: + * - 'image': 只能拍摄图片或从相册选择图片; + * - 'video': 只能拍摄视频或从相册选择视频; + * - 'mix': 可同时选择图片和视频; */ + mediaType?: Array<'image' | 'video' | 'mix'>; + /** 是否压缩所选文件,基础库2.25.0前仅对 mediaType 为 image 时有效,2.25.0及以后对全量 mediaType 有效 */ + sizeType?: string[]; + /** 图片和视频选择的来源 + * + * 可选值: + * - 'album': 从相册选择; + * - 'camera': 使用相机拍摄; */ + sourceType?: Array<'album' | 'camera'>; + /** 接口调用成功的回调函数 */ + success?: ChooseMediaSuccessCallback; + } + interface ChooseMediaSuccessCallbackResult { + /** 本地临时文件列表 */ + tempFiles: MediaFile[]; + /** 文件类型,有效值有 image 、video、mix */ + type: string; + errMsg: string; + } + interface ChooseMessageFileOption { + /** 最多可以选择的文件个数,可以 0~100 */ + count: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseMessageFileCompleteCallback; + /** 需要基础库: `2.6.0` + * + * 根据文件拓展名过滤,仅 type==file 时有效。每一项都不能是空字符串。默认不过滤。 */ + extension?: string[]; + /** 接口调用失败的回调函数 */ + fail?: ChooseMessageFileFailCallback; + /** 接口调用成功的回调函数 */ + success?: ChooseMessageFileSuccessCallback; + /** 所选的文件的类型 + * + * 可选值: + * - 'all': 从所有文件选择; + * - 'video': 只能选择视频文件; + * - 'image': 只能选择图片文件; + * - 'file': 可以选择除了图片和视频之外的其它的文件; */ + type?: 'all' | 'video' | 'image' | 'file'; + } + interface ChooseMessageFileSuccessCallbackResult { + /** 返回选择的文件的本地临时文件对象数组 */ + tempFiles: ChooseFile[]; + errMsg: string; + } + interface ChoosePoiOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChoosePoiCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ChoosePoiFailCallback; + /** 接口调用成功的回调函数 */ + success?: ChoosePoiSuccessCallback; + } + interface ChoosePoiSuccessCallbackResult { + /** 详细地址 */ + address: string; + /** 城市名称 */ + city: number; + /** 纬度,浮点数,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系(即将废弃) */ + latitude: number; + /** 经度,浮点数,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系(即将废弃) */ + longitude: number; + /** 位置名称 */ + name: string; + /** 选择城市时,值为 1,选择精确位置时,值为 2 */ + type: number; + errMsg: string; + } + interface ChooseVideoOption { + /** 默认拉起的是前置或者后置摄像头。部分 Android 手机下由于系统 ROM 不支持无法生效 + * + * 可选值: + * - 'back': 默认拉起后置摄像头; + * - 'front': 默认拉起前置摄像头; */ + camera?: 'back' | 'front'; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ChooseVideoCompleteCallback; + /** 需要基础库: `1.6.0` + * + * 是否压缩所选择的视频文件 */ + compressed?: boolean; + /** 接口调用失败的回调函数 */ + fail?: ChooseVideoFailCallback; + /** 拍摄视频最长拍摄时间,单位秒 */ + maxDuration?: number; + /** 视频选择的来源 + * + * 可选值: + * - 'album': 从相册选择视频; + * - 'camera': 使用相机拍摄视频; */ + sourceType?: Array<'album' | 'camera'>; + /** 接口调用成功的回调函数 */ + success?: ChooseVideoSuccessCallback; + } + interface ChooseVideoSuccessCallbackResult { + /** 选定视频的时间长度 */ + duration: number; + /** 返回选定视频的高度 */ + height: number; + /** 选定视频的数据量大小 */ + size: number; + /** 选定视频的临时文件路径 (本地路径) */ + tempFilePath: string; + /** 返回选定视频的宽度 */ + width: number; + errMsg: string; + } + interface ClearFiltersOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ClearFiltersCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ClearFiltersFailCallback; + /** 接口调用成功的回调函数 */ + success?: ClearFiltersSuccessCallback; + } + interface ClearMakeupsOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ClearMakeupsCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ClearMakeupsFailCallback; + /** 接口调用成功的回调函数 */ + success?: ClearMakeupsSuccessCallback; + } + interface ClearOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ClearCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ClearFailCallback; + /** 接口调用成功的回调函数 */ + success?: ClearSuccessCallback; + } + interface ClearStickersOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ClearStickersCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ClearStickersFailCallback; + /** 接口调用成功的回调函数 */ + success?: ClearStickersSuccessCallback; + } + interface ClearStorageOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ClearStorageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ClearStorageFailCallback; + /** 接口调用成功的回调函数 */ + success?: ClearStorageSuccessCallback; + } + /** 菜单按钮的布局位置信息 */ + interface ClientRect { + /** 下边界坐标,单位:px */ + bottom: number; + /** 高度,单位:px */ + height: number; + /** 左边界坐标,单位:px */ + left: number; + /** 右边界坐标,单位:px */ + right: number; + /** 上边界坐标,单位:px */ + top: number; + /** 宽度,单位:px */ + width: number; + } + interface CloseBLEConnectionOption { + /** 蓝牙设备 id */ + deviceId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CloseBLEConnectionCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CloseBLEConnectionFailCallback; + /** 接口调用成功的回调函数 */ + success?: CloseBLEConnectionSuccessCallback; + } + interface CloseBluetoothAdapterOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CloseBluetoothAdapterCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CloseBluetoothAdapterFailCallback; + /** 接口调用成功的回调函数 */ + success?: CloseBluetoothAdapterSuccessCallback; + } + interface CloseSocketOption { + /** 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 */ + code?: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CloseSocketCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CloseSocketFailCallback; + /** 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。 */ + reason?: string; + /** 接口调用成功的回调函数 */ + 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; + } + /** 颜色。可以用以下几种方式来表示 canvas 中使用的颜色: + * + * - RGB 颜色: 如 `'rgb(255, 0, 0)'` + * - RGBA 颜色:如 `'rgba(255, 0, 0, 0.3)'` + * - 16 进制颜色: 如 `'#FF0000'` + * - 预定义的颜色: 如 `'red'` + * + * 其中预定义颜色有以下148个: + * *注意**: Color Name 大小写不敏感 + * + * | Color Name | HEX | + * | -------------------- | ------- | + * | AliceBlue | #F0F8FF | + * | AntiqueWhite | #FAEBD7 | + * | Aqua | #00FFFF | + * | Aquamarine | #7FFFD4 | + * | Azure | #F0FFFF | + * | Beige | #F5F5DC | + * | Bisque | #FFE4C4 | + * | Black | #000000 | + * | BlanchedAlmond | #FFEBCD | + * | Blue | #0000FF | + * | BlueViolet | #8A2BE2 | + * | Brown | #A52A2A | + * | BurlyWood | #DEB887 | + * | CadetBlue | #5F9EA0 | + * | Chartreuse | #7FFF00 | + * | Chocolate | #D2691E | + * | Coral | #FF7F50 | + * | CornflowerBlue | #6495ED | + * | Cornsilk | #FFF8DC | + * | Crimson | #DC143C | + * | Cyan | #00FFFF | + * | DarkBlue | #00008B | + * | DarkCyan | #008B8B | + * | DarkGoldenRod | #B8860B | + * | DarkGray | #A9A9A9 | + * | DarkGrey | #A9A9A9 | + * | DarkGreen | #006400 | + * | DarkKhaki | #BDB76B | + * | DarkMagenta | #8B008B | + * | DarkOliveGreen | #556B2F | + * | DarkOrange | #FF8C00 | + * | DarkOrchid | #9932CC | + * | DarkRed | #8B0000 | + * | DarkSalmon | #E9967A | + * | DarkSeaGreen | #8FBC8F | + * | DarkSlateBlue | #483D8B | + * | DarkSlateGray | #2F4F4F | + * | DarkSlateGrey | #2F4F4F | + * | DarkTurquoise | #00CED1 | + * | DarkViolet | #9400D3 | + * | DeepPink | #FF1493 | + * | DeepSkyBlue | #00BFFF | + * | DimGray | #696969 | + * | DimGrey | #696969 | + * | DodgerBlue | #1E90FF | + * | FireBrick | #B22222 | + * | FloralWhite | #FFFAF0 | + * | ForestGreen | #228B22 | + * | Fuchsia | #FF00FF | + * | Gainsboro | #DCDCDC | + * | GhostWhite | #F8F8FF | + * | Gold | #FFD700 | + * | GoldenRod | #DAA520 | + * | Gray | #808080 | + * | Grey | #808080 | + * | Green | #008000 | + * | GreenYellow | #ADFF2F | + * | HoneyDew | #F0FFF0 | + * | HotPink | #FF69B4 | + * | IndianRed | #CD5C5C | + * | Indigo | #4B0082 | + * | Ivory | #FFFFF0 | + * | Khaki | #F0E68C | + * | Lavender | #E6E6FA | + * | LavenderBlush | #FFF0F5 | + * | LawnGreen | #7CFC00 | + * | LemonChiffon | #FFFACD | + * | LightBlue | #ADD8E6 | + * | LightCoral | #F08080 | + * | LightCyan | #E0FFFF | + * | LightGoldenRodYellow | #FAFAD2 | + * | LightGray | #D3D3D3 | + * | LightGrey | #D3D3D3 | + * | LightGreen | #90EE90 | + * | LightPink | #FFB6C1 | + * | LightSalmon | #FFA07A | + * | LightSeaGreen | #20B2AA | + * | LightSkyBlue | #87CEFA | + * | LightSlateGray | #778899 | + * | LightSlateGrey | #778899 | + * | LightSteelBlue | #B0C4DE | + * | LightYellow | #FFFFE0 | + * | Lime | #00FF00 | + * | LimeGreen | #32CD32 | + * | Linen | #FAF0E6 | + * | Magenta | #FF00FF | + * | Maroon | #800000 | + * | MediumAquaMarine | #66CDAA | + * | MediumBlue | #0000CD | + * | MediumOrchid | #BA55D3 | + * | MediumPurple | #9370DB | + * | MediumSeaGreen | #3CB371 | + * | MediumSlateBlue | #7B68EE | + * | MediumSpringGreen | #00FA9A | + * | MediumTurquoise | #48D1CC | + * | MediumVioletRed | #C71585 | + * | MidnightBlue | #191970 | + * | MintCream | #F5FFFA | + * | MistyRose | #FFE4E1 | + * | Moccasin | #FFE4B5 | + * | NavajoWhite | #FFDEAD | + * | Navy | #000080 | + * | OldLace | #FDF5E6 | + * | Olive | #808000 | + * | OliveDrab | #6B8E23 | + * | Orange | #FFA500 | + * | OrangeRed | #FF4500 | + * | Orchid | #DA70D6 | + * | PaleGoldenRod | #EEE8AA | + * | PaleGreen | #98FB98 | + * | PaleTurquoise | #AFEEEE | + * | PaleVioletRed | #DB7093 | + * | PapayaWhip | #FFEFD5 | + * | PeachPuff | #FFDAB9 | + * | Peru | #CD853F | + * | Pink | #FFC0CB | + * | Plum | #DDA0DD | + * | PowderBlue | #B0E0E6 | + * | Purple | #800080 | + * | RebeccaPurple | #663399 | + * | Red | #FF0000 | + * | RosyBrown | #BC8F8F | + * | RoyalBlue | #4169E1 | + * | SaddleBrown | #8B4513 | + * | Salmon | #FA8072 | + * | SandyBrown | #F4A460 | + * | SeaGreen | #2E8B57 | + * | SeaShell | #FFF5EE | + * | Sienna | #A0522D | + * | Silver | #C0C0C0 | + * | SkyBlue | #87CEEB | + * | SlateBlue | #6A5ACD | + * | SlateGray | #708090 | + * | SlateGrey | #708090 | + * | Snow | #FFFAFA | + * | SpringGreen | #00FF7F | + * | SteelBlue | #4682B4 | + * | Tan | #D2B48C | + * | Teal | #008080 | + * | Thistle | #D8BFD8 | + * | Tomato | #FF6347 | + * | Turquoise | #40E0D0 | + * | Violet | #EE82EE | + * | Wheat | #F5DEB3 | + * | White | #FFFFFF | + * | WhiteSmoke | #F5F5F5 | + * | Yellow | #FFFF00 | + * | YellowGreen | #9ACD32 | */ + interface Color {} + interface CompressImageOption { + /** 图片路径,图片的路径,支持本地路径、代码包路径 */ + src: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CompressImageCompleteCallback; + /** 需要基础库: `2.26.0` + * + * 压缩后图片的高度,单位为px,若不填写则默认以compressedWidth为准等比缩放 */ + compressedHeight?: number; + /** 需要基础库: `2.26.0` + * + * 压缩后图片的宽度,单位为px,若不填写则默认以compressedHeight为准等比缩放。 */ + compressedWidth?: number; + /** 接口调用失败的回调函数 */ + fail?: CompressImageFailCallback; + /** 压缩质量,范围0~100,数值越小,质量越低,压缩率越高(仅对jpg有效)。 */ + quality?: number; + /** 接口调用成功的回调函数 */ + success?: CompressImageSuccessCallback; + } + interface CompressImageSuccessCallbackResult { + /** 压缩后图片的临时文件路径 (本地路径) */ + tempFilePath: string; + errMsg: string; + } + interface CompressVideoOption { + /** 码率,单位 kbps */ + bitrate: number; + /** 帧率 */ + fps: number; + /** 压缩质量 + * + * 可选值: + * - 'low': 低; + * - 'medium': 中; + * - 'high': 高; */ + quality: 'low' | 'medium' | 'high'; + /** 相对于原视频的分辨率比例,取值范围(0, 1] */ + resolution: number; + /** 视频文件路径,可以是临时文件路径也可以是永久文件路径 */ + src: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CompressVideoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CompressVideoFailCallback; + /** 接口调用成功的回调函数 */ + success?: CompressVideoSuccessCallback; + } + interface CompressVideoSuccessCallbackResult { + /** 压缩后的大小,单位 kB */ + size: string; + /** 压缩后的临时文件地址 */ + tempFilePath: string; + errMsg: string; + } + interface ConnectSocketOption { + /** 开发者服务器 wss 接口地址 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ConnectSocketCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ConnectSocketFailCallback; + /** 需要基础库: `2.29.0` + * + * 强制使用蜂窝网络发送请求 */ + forceCellularNetwork?: boolean; + /** HTTP Header,Header 中不能设置 Referer */ + header?: IAnyObject; + /** 需要基础库: `2.8.0` + * + * 是否开启压缩扩展 */ + perMessageDeflate?: boolean; + /** 需要基础库: `1.4.0` + * + * 子协议数组 */ + protocols?: string[]; + /** 接口调用成功的回调函数 */ + success?: ConnectSocketSuccessCallback; + /** 需要基础库: `2.4.0` + * + * 建立 TCP 连接的时候的 TCP_NODELAY 设置 */ + tcpNoDelay?: boolean; + /** 需要基础库: `2.10.0` + * + * 超时时间,单位为毫秒 */ + timeout?: number; + } + interface ConnectWifiOption { + /** Wi-Fi 设备 SSID */ + SSID: string; + /** Wi-Fi 设备密码 */ + password: string; + /** Wi-Fi 设备 BSSID */ + BSSID?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ConnectWifiCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ConnectWifiFailCallback; + /** 需要基础库: `2.12.0` + * + * 跳转到系统设置页进行连接 */ + maunal?: boolean; + /** 需要基础库: `2.22.0` + * + * 是否需要返回部分 Wi-Fi 信息,仅安卓生效 */ + partialInfo?: boolean; + /** 接口调用成功的回调函数 */ + success?: ConnectWifiSuccessCallback; + } + /** 一个字典对象,它指定是否应该禁用规范化(默认启用规范化) */ + interface Constraints { + /** 如果指定为true则禁用标准化,默认为false */ + disableNormalization?: boolean; + } + interface ContextCallbackResult { + /** 节点对应的 Context 对象 */ + context: IAnyObject; + } + interface CopyFileOption { + /** 目标文件路径,支持本地路径 */ + destPath: string; + /** 源文件路径,支持本地路径 */ + srcPath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CopyFileCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CopyFileFailCallback; + /** 接口调用成功的回调函数 */ + success?: CopyFileSuccessCallback; + } + interface CreateBLEConnectionOption { + /** 蓝牙设备 id */ + deviceId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CreateBLEConnectionCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CreateBLEConnectionFailCallback; + /** 接口调用成功的回调函数 */ + success?: CreateBLEConnectionSuccessCallback; + /** 超时时间,单位 ms,不填表示不会超时 */ + timeout?: number; + } + interface CreateBLEPeripheralServerOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CreateBLEPeripheralServerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CreateBLEPeripheralServerFailCallback; + /** 接口调用成功的回调函数 */ + success?: CreateBLEPeripheralServerSuccessCallback; + } + interface CreateBLEPeripheralServerSuccessCallbackResult { + /** [BLEPeripheralServer](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.html) + * + * 外围设备的服务端。 */ + server: BLEPeripheralServer; + errMsg: string; + } + interface CreateCacheManagerOption { + /** 额外的缓存处理 */ + extra?: ExtraOption; + /** 全局缓存有效时间,单位为毫秒,默认为 7 天,最长不超过 30 天 */ + maxAge?: number; + /** 缓存模式 + * + * 可选值: + * - 'weakNetwork': 弱网/离线使用缓存返回; + * - 'always': 总是使用缓存返回; + * - 'none': 不开启,后续可手动开启/停止使用缓存返回; */ + mode?: 'weakNetwork' | 'always' | 'none'; + /** 全局 origin */ + origin?: string; + } + interface CreateInferenceSessionOption { + /** 模型文件路径,目前只执行后缀为.onnx格式(支持代码包路径,和本地文件系统路径) */ + model: string; + /** 是否使用NPU推理,仅对IOS有效 */ + allowNPU?: boolean; + /** 是否生成量化模型推理 */ + allowQuantize?: boolean; + /** 推理精度,有效值为 0 - 4。一般来说,使用的precesionLevel等级越低,推理速度越快,但可能会损失精度。推荐开发者在开发时,在效果满足需求时优先使用更低精度以提高推理速度,节约能耗。 + * + * 可选值: + * - 0: 使用fp16 存储浮点,fp16计算,Winograd 算法也采取fp16 计算,开启近似math计算; + * - 1: 使用fp16 存储浮点,fp16计算,禁用 Winograd 算法,开启近似math计算; + * - 2: 使用fp16 存储浮点,fp32计算,开启 Winograd,开启近似math计算; + * - 3: 使用fp32 存储浮点,fp32计算,开启 Winograd,开启近似math计算; + * - 4: 使用fp32 存储浮点,fp32计算,开启 Winograd,关闭近似math计算; */ + precesionLevel?: 0 | 1 | 2 | 3 | 4; + /** 输入典型分辨率 */ + typicalShape?: IAnyObject; + } + interface CreateInnerAudioContextOption { + /** 需要基础库: `2.19.0` + * + * 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项。 */ + useWebAudioImplement?: boolean; + } + /** 选项 */ + interface CreateIntersectionObserverOption { + /** 初始的相交比例,如果调用时检测到的相交比例与这个值不相等且达到阈值,则会触发一次监听器的回调函数。 */ + initialRatio?: number; + /** 需要基础库: `2.0.0` + * + * 是否同时观测多个目标节点(而非一个),如果设为 true ,observe 的 targetSelector 将选中多个节点(注意:同时选中过多节点将影响渲染性能) */ + observeAll?: boolean; + /** 一个数值数组,包含所有阈值。 */ + thresholds?: number[]; + } + interface CreateInterstitialAdOption { + /** 广告单元 id */ + adUnitId: string; + } + interface CreateMediaRecorderOption { + /** 指定录制的时长(s),到达自动停止。最大 7200,最小 5 */ + duration?: number; + /** 视频 fps */ + fps?: number; + /** 视频关键帧间隔 */ + gop?: number; + /** 视频比特率(kbps),最小值 600,最大值 3000 */ + videoBitsPerSecond?: number; + } + interface CreateOffscreenCanvasOption { + /** 在自定义组件下,当前组件实例的 this */ + compInst?: Component.TrivialInstance | Page.TrivialInstance; + /** 画布高度 */ + height?: number; + /** 创建的离屏 canvas 类型 + * + * 可选值: + * - 'webgl': webgl类型上下文; + * - '2d': 2d类型上下文; */ + type?: 'webgl' | '2d'; + /** 画布宽度 */ + width?: number; + } + interface CreateRewardedVideoAdOption { + /** 广告单元 id */ + adUnitId: string; + /** 需要基础库: `2.8.0` + * + * 是否启用多例模式,默认为false */ + multiton?: boolean; + } + /** 可选参数 */ + interface CreateWorkerOption { + /** 需要基础库: `2.13.0` + * + * 是否使用实验worker。在iOS下,实验worker的JS运行效率比非实验worker提升数倍,如需在worker内进行重度计算的建议开启此选项。同时,实验worker存在极小概率会在系统资源紧张时被系统回收,因此建议配合 worker.onProcessKilled 事件使用,在worker被回收后可重新创建一个。 */ + useExperimentalWorker?: boolean; + } + interface CropImageOption { + /** 裁剪比例 + * + * 可选值: + * - '16:9': 宽高比为16比9; + * - '9:16': 宽高比为9比16; + * - '4:3': 宽高比为4比3; + * - '3:4': 宽高比为3比4; + * - '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'; + /** 图片路径,图片的路径,支持本地路径、代码包路径 */ + src: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: CropImageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: CropImageFailCallback; + /** 接口调用成功的回调函数 */ + success?: CropImageSuccessCallback; + } + interface CropImageSuccessCallbackResult { + /** 编辑后图片的临时文件路径 (本地路径) */ + tempFilePath: string; + errMsg: string; + } + interface CurrentState { + /** 当前缓存中的日志条数 */ + logCount: number; + /** 当前缓存中最大可存日志条数 */ + maxLogCount: number; + /** 当前缓存最大可用空间,以字节为单位 */ + maxSize: number; + /** 当前缓存中已使用空间,以字节为单位 */ + size: number; + } + /** 自定义路由动画配置 */ + interface CustomRouteConfig { + /** 遮罩层背景色,支持 `rgba()` 和 `#RRGGBBAA` 写法 */ + barrierColor: string; + /** 点击遮罩层返回上一页 */ + barrierDismissible: boolean; + /** 无障碍语义 */ + barrierLabel: string; + /** 是否与前一个页面联动,决定前一个页 `secondaryAnimation` 是否生效 */ + canTransitionFrom: boolean; + /** 是否与下一个页面联动,决定当前页 `secondaryAnimation` 是否生效 */ + canTransitionTo: boolean; + /** 是否保持前一个页面状态 */ + maintainState: boolean; + /** 下一个页面推入后,不显示前一个页面 */ + opaque: boolean; + /** 页面推出动画时长,单位 ms */ + reverseTransitionDuration: number; + /** 页面推入动画时长,单位 ms */ + transitionDuration: number; + } + /** 自定义路由上下文对象 */ + interface CustomRouteContext { + /** 返回上一级,效果同 `wx.navigateBack`,仅可用于 `worklet` 函数内 */ + didPop: (...args: any[]) => any; + /** 动画控制器,影响推入页面的进入和退出过渡效果 */ + primaryAnimation: SharedValue; + /** 动画控制器状态 */ + primaryAnimationStatus: SharedValue; + /** 动画控制器,影响栈顶页面的推出过渡效果 */ + secondaryAnimation: SharedValue; + /** 动画控制器状态 */ + secondaryAnimationStatus: SharedValue; + /** 手势开始控制路由,与共享元素动画有关 */ + startUserGesture: (...args: any[]) => any; + /** 手势不再控制路由,与 `startUserGesture` 成对调用 */ + stopUserGesture: (...args: any[]) => any; + /** 当前路由进度由手势控制 */ + userGestureInProgress: SharedValue; + } + /** 弹幕内容 */ + interface Danmu { + /** 弹幕文字 */ + text: string; + /** 弹幕颜色 */ + color?: string; + } + /** 动画配置 */ + interface DecayOption { + /** 边界值,长度为 2 的数组 */ + clamp?: any[]; + /** 衰减速率 */ + deceleration?: number; + /** 初速度 */ + velocity?: number; + } + /** 需要基础库: `3.0.0` + * + * 深度识别配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/depth.html)。 */ + interface DepthTrack { + /** 需要基础库: `3.0.0` + * + * 深度识别模式 + * + * 可选值: + * - 1: 通过摄像头实时检测; + * - 2: 静态图片检测; */ + mode: 1 | 2; + } + /** 可选的字体描述符 */ + interface DescOption { + /** 字体样式,可选值为 normal / italic / oblique */ + style?: string; + /** 设置小型大写字母的字体显示文本,可选值为 normal / small-caps / inherit */ + variant?: string; + /** 字体粗细,可选值为 normal / bold / 100 / 200../ 900 */ + weight?: string; + } + /** 描述符的权限 */ + interface DescriptorPermission { + /** 读 */ + read?: boolean; + /** 写 */ + write?: boolean; + } + /** 指定 marker 移动到的目标点 */ + interface DestinationOption { + /** 纬度 */ + latitude: number; + /** 经度 */ + longitude: number; + } + interface DetectBodyOption { + /** 人脸图像像素点数据,每四项表示一个像素点的 RGBA */ + frameBuffer: ArrayBuffer; + /** 图像高度 */ + height: number; + /** 图像宽度 */ + width: number; + /** 评分阈值。正常情况传入 0.8 即可。 */ + scoreThreshold?: number; + /** 图像源类型。正常情况传入 1 即可。当输入的图片是来自一个连续视频的每一帧图像时,sourceType 传入 0 会得到更优的效果 + * + * 可选值: + * - 1: 表示输入的图片是随机的图片; + * - 0: 表示输入的图片是来自一个连续视频的每一帧图像; */ + sourceType?: 1 | 0; + } + interface DetectDepthOption { + /** 需要识别深度的图像像素点数据,每四项表示一个像素点的 RGBA */ + frameBuffer: ArrayBuffer; + /** 图像高度 */ + height: number; + /** 图像宽度 */ + width: number; + } + interface DetectFaceOption { + /** 人脸图像像素点数据,每四项表示一个像素点的 RGBA */ + frameBuffer: ArrayBuffer; + /** 图像高度 */ + height: number; + /** 图像宽度 */ + width: number; + /** 算法模型类型。正常情况传入 1 即可。0、1、2 分别表示小、中、大模型,模型越大识别准确率越高,但资源占用也越高。建议根据用户设备性能进行选择。 + * + * 可选值: + * - 0: 小模型; + * - 1: 中模型; + * - 2: 大模型; */ + modelModel?: 0 | 1 | 2; + /** 评分阈值。正常情况传入 0.8 即可。 */ + scoreThreshold?: number; + /** 图像源类型。正常情况传入 1 即可。当输入的图片是来自一个连续视频的每一帧图像时,sourceType 传入 0 会得到更优的效果 + * + * 可选值: + * - 1: 表示输入的图片是随机的图片; + * - 0: 表示输入的图片是来自一个连续视频的每一帧图像; */ + sourceType?: 1 | 0; + } + interface DetectHandOption { + /** 人脸图像像素点数据,每四项表示一个像素点的 RGBA */ + frameBuffer: ArrayBuffer; + /** 图像高度 */ + height: number; + /** 图像宽度 */ + width: number; + /** 算法检测模式 + * + * 可选值: + * - 0: 检测模式,输出框和点; + * - 1: 手势模式,输出框和手势分类; + * - 2: 结合0和1模式,输出框、点、手势分类; */ + algoMode?: 0 | 1 | 2; + /** 评分阈值。正常情况传入 0.8 即可。 */ + scoreThreshold?: number; + } + interface DeviceInfo { + /** 应用(微信APP)二进制接口类型(仅 Android 支持) */ + abi: string; + /** 设备性能等级(仅 Android 支持)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */ + benchmarkLevel: number; + /** 设备品牌 */ + brand: string; + /** 需要基础库: `2.29.0` + * + * 设备 CPU 型号(仅 Android 支持)(Tips: GPU 型号可通过 WebGLRenderingContext.getExtension('WEBGL_debug_renderer_info') 来获取) */ + cpuType: string; + /** 需要基础库: `2.25.1` + * + * 设备二进制接口类型(仅 Android 支持) */ + deviceAbi: string; + /** 需要基础库: `2.30.0` + * + * 设备内存大小,单位为 MB */ + memorySize: string; + /** 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。 */ + model: string; + /** 客户端平台 */ + platform: string; + /** 操作系统及版本 */ + system: string; + } + interface DeviceVoIPInfo { + /** 需要基础库: `2.30.4` + * + * 设备组的唯一标识 id(仅设备组时) */ + group_id: string; + /** 设备型号 id。通过微信公众平台注册设备获得。(仅单台设备时) */ + model_id: string; + /** 设备唯一序列号。(仅单台设备时) */ + sn: string; + /** 设备(组)授权状态。0:未授权;1:已授权 */ + status: number; + } + interface DisableAlertBeforeUnloadOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: DisableAlertBeforeUnloadCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: DisableAlertBeforeUnloadFailCallback; + /** 接口调用成功的回调函数 */ + success?: DisableAlertBeforeUnloadSuccessCallback; + } + interface DownloadFileOption { + /** 下载资源的 url */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: DownloadFileCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: DownloadFileFailCallback; + /** 需要基础库: `1.8.0` + * + * 指定文件下载后存储的路径 (本地路径) */ + filePath?: string; + /** HTTP 请求的 Header,Header 中不能设置 Referer */ + header?: IAnyObject; + /** 接口调用成功的回调函数 */ + success?: DownloadFileSuccessCallback; + /** 需要基础库: `2.10.0` + * + * 超时时间,单位为毫秒,默认值为 60000 即一分钟。 */ + timeout?: number; + } + interface DownloadFileSuccessCallbackResult { + /** 用户文件路径 (本地路径)。传入 filePath 时会返回,跟传入的 filePath 一致 */ + filePath: string; + /** 需要基础库: `2.10.4` + * + * 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) */ + profile: RequestProfile; + /** 开发者服务器返回的 HTTP 状态码 */ + statusCode: number; + /** 临时文件路径 (本地路径)。没传入 filePath 指定文件存储路径时会返回,下载后的文件会存储到一个临时文件 */ + tempFilePath: string; + errMsg: string; + } + interface DownloadTaskOnProgressUpdateListenerResult { + /** 下载进度百分比 */ + progress: number; + /** 预期需要下载的数据总长度,单位 Bytes */ + totalBytesExpectedToWrite: number; + /** 已经下载的数据长度,单位 Bytes */ + totalBytesWritten: number; + } + interface EditImageOption { + /** 图片路径,图片的路径,支持本地路径、代码包路径 */ + src: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: EditImageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: EditImageFailCallback; + /** 接口调用成功的回调函数 */ + success?: EditImageSuccessCallback; + } + interface EnableAlertBeforeUnloadOption { + /** 询问对话框内容 */ + message: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: EnableAlertBeforeUnloadCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: EnableAlertBeforeUnloadFailCallback; + /** 接口调用成功的回调函数 */ + success?: EnableAlertBeforeUnloadSuccessCallback; + } + /** 文件读取结果。res.entries 是一个对象,key是文件路径,value是一个对象 FileItem ,表示该文件的读取结果。每个 FileItem 包含 data (文件内容) 和 errMsg (错误信息) 属性。 */ + interface EntriesResult { + /** 文件路径 */ + [path: string]: ZipFileItem; + } + /** 要读取的压缩包内的文件列表(当传入"all" 时表示读取压缩包内所有文件) */ + interface EntryItem { + /** 压缩包内文件路径 */ + path: string; + /** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 + * + * 可选值: + * - '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; + /** 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */ + position?: number; + } + /** 要擦除的线段数组。详见 [polyline 属性](https://developers.weixin.qq.com/miniprogram/dev/component/map.html#polyline)。 */ + interface EraseLineOptions { + /** 线段的 id。 */ + id: number; + /** 指定线段的某一段,线段起点 index 为 0 */ + index: number; + /** 指定线段某一段中的点 */ + point: MapPostion; + /** 为 true 时擦除,false 时置灰 */ + clear?: boolean; + } + interface EraseLinesOption { + /** 要擦除的线段数组。详见 [polyline 属性](https://developers.weixin.qq.com/miniprogram/dev/component/map.html#polyline)。 */ + lines: EraseLineOptions[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: EraseLinesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: EraseLinesFailCallback; + /** 接口调用成功的回调函数 */ + success?: EraseLinesSuccessCallback; + } + /** 本次请求底层失败信息,所有失败信息均符合Errno错误码 */ + interface ExceptionReason { + /** 错误原因 */ + errMsg: string; + /** 错误码 */ + errno: string; + } + interface ExecuteVisualLayerCommandOption { + /** 图层指令 */ + command: string; + /** 可视化图层id */ + layerId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ExecuteVisualLayerCommandCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ExecuteVisualLayerCommandFailCallback; + /** 接口调用成功的回调函数 */ + success?: ExecuteVisualLayerCommandSuccessCallback; + } + interface ExecuteVisualLayerCommandSuccessCallbackResult { + /** SDK 返回的 JSON 数据 */ + data: string; + /** 调用结果 */ + errMsg: string; + } + interface ExitCastingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ExitCastingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ExitCastingFailCallback; + /** 接口调用成功的回调函数 */ + success?: ExitCastingSuccessCallback; + } + interface ExitFullScreenOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ExitFullScreenCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ExitFullScreenFailCallback; + /** 接口调用成功的回调函数 */ + success?: ExitFullScreenSuccessCallback; + } + interface ExitMiniProgramOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ExitMiniProgramCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ExitMiniProgramFailCallback; + /** 接口调用成功的回调函数 */ + success?: ExitMiniProgramSuccessCallback; + } + interface ExitPictureInPictureOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ExitPictureInPictureCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ExitPictureInPictureFailCallback; + /** 接口调用成功的回调函数 */ + success?: ExitPictureInPictureSuccessCallback; + } + interface ExitVoIPChatOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ExitVoIPChatCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ExitVoIPChatFailCallback; + /** 接口调用成功的回调函数 */ + success?: ExitVoIPChatSuccessCallback; + } + /** 客服信息 */ + interface ExtInfoOption { + /** 客服链接 */ + url: string; + } + /** 额外的缓存处理 */ + interface ExtraOption { + /** 需要缓存的 wx api 接口,不传则表示支持缓存的接口全都做缓存处理。返回的如果是缓存数据,开发者可通过 fromCache 标记区分 + * + * 可选值: + * - 'wx.login': ; + * - 'wx.checkSession': ; + * - 'wx.getSetting': ; */ + apiList?: Array<'wx.login' | 'wx.checkSession' | 'wx.getSetting'>; + } + interface ExtractDataSourceOption { + /** 视频源地址,只支持本地文件 */ + source: string; + } + /** 人脸角度信息,取值范围 [-1, 1],数值越接近 0 表示越正对摄像头 */ + interface FaceAngel { + /** 仰俯角(点头) */ + pitch: number; + /** 翻滚角(左右倾) */ + roll: number; + /** 偏航角(摇头) */ + yaw: number; + } + /** 人脸置信度,取值范围 [0, 1],数值越大置信度越高(遮挡越少) */ + interface FaceConf { + /** 整体可信度 */ + global: number; + /** 左眼可信度 */ + leftEye: number; + /** 嘴巴可信度 */ + mouth: number; + /** 鼻子可信度 */ + nose: number; + /** 右眼可信度 */ + rightEye: number; + } + interface FaceDetectOption { + /** 图像像素点数据,每四项表示一个像素点的 RGBA */ + frameBuffer: ArrayBuffer; + /** 图像高度 */ + height: number; + /** 图像宽度 */ + width: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: FaceDetectCompleteCallback; + /** 是否返回当前图像的人脸角度信息 */ + enableAngle?: boolean; + /** 是否返回当前图像的人脸的置信度(可表示器官遮挡情况) */ + enableConf?: boolean; + /** 是否返回多张人脸的信息 */ + enableMultiFace?: boolean; + /** 是否返回当前图像的人脸(106 个点) */ + enablePoint?: boolean; + /** 接口调用失败的回调函数 */ + fail?: FaceDetectFailCallback; + /** 接口调用成功的回调函数 */ + success?: FaceDetectSuccessCallback; + } + interface FaceDetectSuccessCallbackResult { + /** 人脸角度信息,取值范围 [-1, 1],数值越接近 0 表示越正对摄像头 */ + angleArray: FaceAngel; + /** 人脸置信度,取值范围 [0, 1],数值越大置信度越高(遮挡越少) */ + confArray: FaceConf; + /** 脸部方框数值,对象包含 height, width, originX, originY 四个属性 (origin 为方框左上角坐标) */ + detectRect: IAnyObject; + /** 多人模式(enableMultiFace)下的人脸信息,每个对象包含上述其它属性 */ + faceInfo: IAnyObject[]; + /** 标记人脸轮廓的 106 个点位置数组,数组每个对象包含 x 和 y */ + pointArray: IAnyObject[]; + /** 脸部中心点横坐标,检测不到人脸则为 -1 */ + x: number; + /** 脸部中心点纵坐标,检测不到人脸则为 -1 */ + y: number; + errMsg: string; + } + /** 需要基础库: `2.25.0` + * + * 人脸检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/face.html)。安卓微信8.0.25开始支持,iOS微信8.0.24开始支持。 */ + interface FaceTrack { + /** 需要基础库: `2.25.0` + * + * 人脸检测模式 + * + * 可选值: + * - 1: 通过摄像头实时检测; + * - 2: 静态图片检测; */ + mode: 1 | 2; + } + interface Fields { + /** 需要基础库: `2.1.0` + * + * 指定样式名列表,返回节点对应样式名的当前值 */ + computedStyle?: string[]; + /** 需要基础库: `2.4.2` + * + * 是否返回节点对应的 Context 对象 */ + context?: boolean; + /** 是否返回节点 dataset */ + dataset?: boolean; + /** 是否返回节点 id */ + id?: boolean; + /** 是否返回节点 mark */ + mark?: boolean; + /** 需要基础库: `2.7.0` + * + * 是否返回节点对应的 Node 实例 */ + node?: boolean; + /** 指定属性名列表,返回节点对应属性名的当前属性值(只能获得组件文档中标注的常规属性值,id class style 和事件绑定的属性值不可获取) */ + properties?: string[]; + /** 是否返回节点布局位置(`left` `right` `top` `bottom`) */ + rect?: boolean; + /** 否 是否返回节点的 `scrollLeft` `scrollTop`,节点必须是 `scroll-view` 或者 `viewport` */ + scrollOffset?: boolean; + /** 是否返回节点尺寸(`width` `height`) */ + size?: boolean; + } + /** 文件数组 */ + interface FileItem { + /** 文件保存时的时间戳,从1970/01/01 08:00:00 到当前时间的秒数 */ + createTime: number; + /** 文件路径 (本地路径) */ + filePath: string; + /** 本地文件大小,以字节为单位 */ + size: number; + } + /** 每个 FileStats 对象包含 path 和 Stats */ + interface FileStats { + /** 文件/目录路径 */ + path: string; + /** [Stats](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.html) + * + * 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; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: FileSystemManagerCloseCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: FileSystemManagerCloseFailCallback; + /** 接口调用成功的回调函数 */ + success?: FileSystemManagerCloseSuccessCallback; + } + /** 打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数 */ + interface ForwardMaterials { + /** 文件名 */ + name: string; + /** 文件路径(如果是webview则是url) */ + path: string; + /** 文件大小 */ + size: number; + /** 文件的mimetype类型 */ + type: string; + } + /** 视频帧数据,若取不到则返回 null。当缓冲区为空的时候可能暂停取不到数据。 */ + interface FrameDataOptions { + /** 帧数据 */ + data: ArrayBuffer; + /** 帧数据高度 */ + height: number; + /** 帧原始 dts */ + pkDts: number; + /** 帧原始 pts */ + pkPts: number; + /** 帧数据宽度 */ + width: number; + } + interface FromScreenLocationOption { + /** x 坐标值 */ + x: number; + /** y 坐标值 */ + y: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: FromScreenLocationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: FromScreenLocationFailCallback; + /** 接口调用成功的回调函数 */ + 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; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: FstatCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: FstatFailCallback; + /** 接口调用成功的回调函数 */ + success?: FstatSuccessCallback; + } + interface FstatSuccessCallbackResult { + /** [Stats](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.html) + * + * Stats 对象,包含了文件的状态信息 */ + 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; + } + 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; + /** 截断位置,默认0。如果 length 小于文件长度(单位:字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') */ + length: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: FtruncateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: FtruncateFailCallback; + /** 接口调用成功的回调函数 */ + 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; + /** 截断位置,默认0。如果 length 小于文件长度(单位:字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') */ + length: number; + } + interface GeneralCallbackResult { + /** 错误信息 */ + errMsg: string; + } + interface GetAtqaOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetAtqaCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetAtqaFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetAtqaSuccessCallback; + } + interface GetAtqaSuccessCallbackResult { + /** 返回 ATQA/SENS_RES 数据 */ + atqa: ArrayBuffer; + errMsg: string; + } + interface GetAvailableAudioSourcesOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetAvailableAudioSourcesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetAvailableAudioSourcesFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetAvailableAudioSourcesSuccessCallback; + } + interface GetAvailableAudioSourcesSuccessCallbackResult { + /** 支持的音频输入源列表,可在 [RecorderManager.start()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.start.html) 接口中使用。返回值定义参考 https://developer.android.com/reference/kotlin/android/media/MediaRecorder.AudioSource + * + * 可选值: + * - 'auto': 自动设置,默认使用手机麦克风,插上耳麦后自动切换使用耳机麦克风,所有平台适用; + * - 'buildInMic': 手机麦克风,仅限 iOS; + * - 'headsetMic': 耳机麦克风,仅限 iOS; + * - 'mic': 麦克风(没插耳麦时是手机麦克风,插耳麦时是耳机麦克风),仅限 Android; + * - 'camcorder': 同 mic,适用于录制音视频内容,仅限 Android; + * - 'voice_communication': 同 mic,适用于实时沟通,仅限 Android; + * - 'voice_recognition': 同 mic,适用于语音识别,仅限 Android; */ + audioSources: Array< + | 'auto' + | 'buildInMic' + | 'headsetMic' + | 'mic' + | 'camcorder' + | 'voice_communication' + | 'voice_recognition' + >; + errMsg: string; + } + interface GetBLEDeviceCharacteristicsOption { + /** 蓝牙设备 id。需要已经通过 [wx.createBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 建立连接 */ + deviceId: string; + /** 蓝牙服务 UUID。需要先调用 [wx.getBLEDeviceServices](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEDeviceServices.html) 获取 */ + serviceId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBLEDeviceCharacteristicsCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBLEDeviceCharacteristicsFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBLEDeviceCharacteristicsSuccessCallback; + } + interface GetBLEDeviceCharacteristicsSuccessCallbackResult { + /** 设备特征列表 */ + characteristics: BLECharacteristic[]; + errMsg: string; + } + interface GetBLEDeviceRSSIOption { + /** 蓝牙设备 id */ + deviceId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBLEDeviceRSSICompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBLEDeviceRSSIFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBLEDeviceRSSISuccessCallback; + } + interface GetBLEDeviceRSSISuccessCallbackResult { + /** 信号强度,单位 dBm */ + 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; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBLEDeviceServicesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBLEDeviceServicesFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBLEDeviceServicesSuccessCallback; + } + interface GetBLEDeviceServicesSuccessCallbackResult { + /** 设备服务列表 */ + services: BLEService[]; + errMsg: string; + } + interface GetBLEMTUOption { + /** 蓝牙设备 id */ + deviceId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBLEMTUCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBLEMTUFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBLEMTUSuccessCallback; + /** 写模式 (iOS 特有参数) + * + * 可选值: + * - 'write': 有回复写; + * - 'writeNoResponse': 无回复写; */ + writeType?: 'write' | 'writeNoResponse'; + } + interface GetBLEMTUSuccessCallbackResult { + /** 最大传输单元 */ + mtu: number; + errMsg: string; + } + interface GetBackgroundAudioPlayerStateOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBackgroundAudioPlayerStateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBackgroundAudioPlayerStateFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBackgroundAudioPlayerStateSuccessCallback; + } + interface GetBackgroundAudioPlayerStateSuccessCallbackResult { + /** 选定音频的播放位置(单位:s),只有在音乐播放中时返回 */ + currentPosition: number; + /** 歌曲数据链接,只有在音乐播放中时返回 */ + dataUrl: string; + /** 音频的下载进度百分比,只有在音乐播放中时返回 */ + downloadPercent: number; + /** 选定音频的长度(单位:s),只有在音乐播放中时返回 */ + duration: number; + /** 播放状态 + * + * 可选值: + * - 0: 暂停中; + * - 1: 播放中; + * - 2: 没有音乐播放; */ + status: 0 | 1 | 2; + errMsg: string; + } + interface GetBackgroundFetchDataOption { + /** 缓存数据类别,取值为 periodic 或 pre */ + fetchType: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBackgroundFetchDataCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBackgroundFetchDataFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBackgroundFetchDataSuccessCallback; + } + interface GetBackgroundFetchDataSuccessCallbackResult { + /** 缓存数据 */ + fetchedData: string; + /** 小程序页面路径 */ + path: string; + /** 传给页面的 query 参数 */ + query: string; + /** 进入小程序的场景值 */ + scene: number; + /** 客户端拿到缓存数据的时间戳 ms。(iOS 时间戳存在异常,8.0.27 修复) */ + timeStamp: number; + errMsg: string; + } + interface GetBackgroundFetchTokenOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBackgroundFetchTokenCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBackgroundFetchTokenFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBackgroundFetchTokenSuccessCallback; + } + interface GetBackgroundFetchTokenSuccessCallbackResult { + /** 接口调用结果 */ + errMsg: string; + /** 自定义的登录态 */ + token: string; + } + interface GetBatteryInfoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBatteryInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBatteryInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBatteryInfoSuccessCallback; + } + interface GetBatteryInfoSuccessCallbackResult { + /** 是否正在充电中 */ + isCharging: boolean; + /** 设备电量,范围 1 - 100 */ + level: number; + errMsg: string; + } + interface GetBatteryInfoSyncResult { + /** 是否正在充电中 */ + isCharging: boolean; + /** 设备电量,范围 1 - 100 */ + level: number; + } + interface GetBeaconsOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBeaconsCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBeaconsFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBeaconsSuccessCallback; + } + interface GetBeaconsSuccessCallbackResult { + /** Beacon 设备列表 */ + beacons: BeaconInfo[]; + errMsg: string; + } + interface GetBluetoothAdapterStateOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBluetoothAdapterStateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBluetoothAdapterStateFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBluetoothAdapterStateSuccessCallback; + } + interface GetBluetoothAdapterStateSuccessCallbackResult { + /** 蓝牙适配器是否可用 */ + available: boolean; + /** 是否正在搜索设备 */ + discovering: boolean; + errMsg: string; + } + interface GetBluetoothDevicesOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetBluetoothDevicesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetBluetoothDevicesFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetBluetoothDevicesSuccessCallback; + } + interface GetBluetoothDevicesSuccessCallbackResult { + /** UUID 对应的已连接设备列表 */ + devices: BlueToothDevice[]; + errMsg: string; + } + interface GetCenterLocationOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetCenterLocationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetCenterLocationFailCallback; + /** 图标路径,支持网络路径、本地路径、代码包路径 */ + iconPath?: string; + /** 接口调用成功的回调函数 */ + success?: GetCenterLocationSuccessCallback; + } + interface GetCenterLocationSuccessCallbackResult { + /** 纬度 */ + latitude: number; + /** 经度 */ + longitude: number; + errMsg: string; + } + interface GetChannelsLiveInfoOption { + /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ + finderUserName: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetChannelsLiveInfoCompleteCallback; + /** 需要基础库: `2.29.0` + * + * 结束时间,筛选指定时间段的直播。若上传了startTime,未上传endTime,则endTime默认取当前时间 */ + endTime?: number; + /** 接口调用失败的回调函数 */ + fail?: GetChannelsLiveInfoFailCallback; + /** 需要基础库: `2.29.0` + * + * 起始时间,筛选指定时间段的直播。若上传了endTime,未上传startTime,则startTime默认为0 */ + startTime?: number; + /** 接口调用成功的回调函数 */ + success?: GetChannelsLiveInfoSuccessCallback; + } + interface GetChannelsLiveInfoSuccessCallbackResult { + /** 直播主题 */ + description: string; + /** 直播 feedId */ + feedId: string; + /** 视频号头像 */ + headUrl: string; + /** 视频号昵称 */ + nickname: string; + /** 直播 nonceId */ + nonceId: string; + /** 需要基础库: `2.29.0` + * + * 除最近的一条直播外,其他的直播列表(注意:每次最多返回按时间戳增序排列的15个直播信息,其中时间最近的那个直播会在接口其他的返回参数中展示,其余的直播会在该字段中展示)。 */ + otherInfos: any[]; + /** 需要基础库: `2.29.0` + * + * 直播回放状态 + * + * 可选值: + * - 0: 未生成; + * - 1: 已生成; + * - 3: 生成中; + * - 6: 已过期; */ + replayStatus: 0 | 1 | 3 | 6; + /** 直播状态 + * + * 可选值: + * - 2: 直播中; + * - 3: 直播结束; */ + status: 2 | 3; + errMsg: string; + } + interface GetChannelsLiveNoticeInfoOption { + /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ + finderUserName: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetChannelsLiveNoticeInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetChannelsLiveNoticeInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetChannelsLiveNoticeInfoSuccessCallback; + } + interface GetChannelsLiveNoticeInfoSuccessCallbackResult { + /** 直播封面 */ + headUrl: string; + /** 视频号昵称 */ + nickname: string; + /** 预告 id */ + noticeId: string; + /** 需要基础库: `2.24.6` + * + * 除最近的一条预告信息外,其他的预告信息列表(注意:每次最多返回按时间戳增序排列的15个预告信息,其中时间最近的那个预告信息会在接口其他的返回参数中展示,其余的预告信息会在该字段中展示)。 */ + otherInfos: any[]; + /** 是否可预约 */ + reservable: boolean; + /** 开始时间 */ + startTime: string; + /** 预告状态:0可用 1取消 2已用 */ + status: number; + errMsg: string; + } + interface GetChannelsShareKeyOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetChannelsShareKeyCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetChannelsShareKeyFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetChannelsShareKeySuccessCallback; + } + interface GetChannelsShareKeySuccessCallbackResult { + /** 推广员 */ + promoter: PromoterResult; + /** 分享者 openid */ + sharerOpenId: string; + errMsg: string; + } + interface GetClipboardDataOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetClipboardDataCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetClipboardDataFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetClipboardDataSuccessCallback; + } + interface GetClipboardDataSuccessCallbackOption { + /** 剪贴板的内容 */ + 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; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetCommonConfigCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetCommonConfigFailCallback; + /** 需要获取的数据指标的对象数组,每个string的格式约定:配置类型_分表key */ + keys?: string[]; + /** 接口调用成功的回调函数 */ + success?: GetCommonConfigSuccessCallback; + } + interface GetCommonConfigSuccessCallbackResult { + /** 根据conf_type来确定conf内容,conf_type为1时conf是一个json数组, 类似"[{xxx},{xxx}]", 每一项对应表类型每一行配置内容, 其中conf_type为2时conf是一个json对象,类似"{xxxx}" */ + conf: string; + /** 配置类型, 1-表类型 2-kv类型 */ + conf_type: number; + /** 错误码 */ + errcode: number; + /** 错误信息 */ + errmsg: string; + /** 过期时间,单位秒. 0表示当次有效 */ + expire_sec: number; + errMsg: string; + } + interface GetConnectedBluetoothDevicesOption { + /** 蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID) */ + services: string[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetConnectedBluetoothDevicesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetConnectedBluetoothDevicesFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetConnectedBluetoothDevicesSuccessCallback; + } + interface GetConnectedBluetoothDevicesSuccessCallbackResult { + /** 搜索到的设备列表 */ + devices: BluetoothDeviceInfo[]; + errMsg: string; + } + interface GetConnectedWifiOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetConnectedWifiCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetConnectedWifiFailCallback; + /** 需要基础库: `2.22.0` + * + * 是否需要返回部分 Wi-Fi 信息 */ + partialInfo?: boolean; + /** 接口调用成功的回调函数 */ + success?: GetConnectedWifiSuccessCallback; + } + interface GetConnectedWifiSuccessCallbackResult { + /** [WifiInfo](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/WifiInfo.html) + * + * Wi-Fi 信息 */ + wifi: WifiInfo; + errMsg: string; + } + interface GetContentsOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetContentsCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetContentsFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetContentsSuccessCallback; + } + interface GetContentsSuccessCallbackResult { + /** 表示内容的delta对象 */ + delta: IAnyObject; + /** 带标签的HTML内容 */ + html: string; + /** 纯文本内容 */ + text: string; + errMsg: string; + } + interface GetDeviceVoIPListOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetDeviceVoIPListCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetDeviceVoIPListFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetDeviceVoIPListSuccessCallback; + } + interface GetDeviceVoIPListSuccessCallbackResult { + list: DeviceVoIPInfo[]; + errMsg: string; + } + interface GetExtConfigOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetExtConfigCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetExtConfigFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetExtConfigSuccessCallback; + } + interface GetExtConfigSuccessCallbackResult { + /** 第三方平台自定义的数据 */ + extConfig: IAnyObject; + errMsg: string; + } + interface GetFileInfoOption { + /** 要读取的文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetFileInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetFileInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetFileInfoSuccessCallback; + } + interface GetFileInfoSuccessCallbackResult { + /** 文件大小,以字节为单位 */ + size: number; + errMsg: string; + } + interface GetFuzzyLocationOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetFuzzyLocationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetFuzzyLocationFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetFuzzyLocationSuccessCallback; + /** wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 */ + type?: string; + } + interface GetFuzzyLocationSuccessCallbackResult { + /** 纬度,范围为 -90~90,负数表示南纬 */ + latitude: number; + /** 经度,范围为 -180~180,负数表示西经 */ + longitude: number; + errMsg: string; + } + interface GetGroupEnterInfoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetGroupEnterInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetGroupEnterInfoFailCallback; + /** 接口调用成功的回调函数 */ + 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; + /** 包括敏感数据在内的完整转发信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ + encryptedData: string; + /** 错误信息 */ + errMsg: string; + /** 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ + iv: string; + } + interface GetHCEStateOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetHCEStateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetHCEStateFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetHCEStateSuccessCallback; + } + interface GetHistoricalBytesOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetHistoricalBytesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetHistoricalBytesFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetHistoricalBytesSuccessCallback; + } + interface GetHistoricalBytesSuccessCallbackResult { + /** 返回历史二进制数据 */ + histBytes: ArrayBuffer; + errMsg: string; + } + interface GetImageInfoOption { + /** 图片的路径,支持网络路径、本地路径、代码包路径 */ + src: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetImageInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetImageInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetImageInfoSuccessCallback; + } + interface GetImageInfoSuccessCallbackResult { + /** 图片原始高度,单位px。不考虑旋转。 */ + height: number; + /** 需要基础库: `1.9.90` + * + * [拍照时设备方向](http://sylvana.net/jpegcrop/exif_orientation.html) + * + * 可选值: + * - 'up': 默认方向(手机横持拍照),对应 Exif 中的 1。或无 orientation 信息。; + * - 'up-mirrored': 同 up,但镜像翻转,对应 Exif 中的 2; + * - 'down': 旋转180度,对应 Exif 中的 3; + * - 'down-mirrored': 同 down,但镜像翻转,对应 Exif 中的 4; + * - 'left-mirrored': 同 left,但镜像翻转,对应 Exif 中的 5; + * - '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'; + /** 图片的本地路径 */ + path: string; + /** 需要基础库: `1.9.90` + * + * 图片格式 + * + * 可选值: + * - 'unknown': 未知格式; + * - 'jpeg': jpeg压缩格式; + * - 'png': png压缩格式; + * - 'gif': gif压缩格式; + * - 'tiff': tiff压缩格式; */ + type: 'unknown' | 'jpeg' | 'png' | 'gif' | 'tiff'; + /** 图片原始宽度,单位px。不考虑旋转。 */ + width: number; + errMsg: string; + } + interface GetInferenceEnvInfoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetInferenceEnvInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetInferenceEnvInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetInferenceEnvInfoSuccessCallback; + } + interface GetInferenceEnvInfoSuccessCallbackResult { + /** AI推理引擎版本 */ + ver: string; + errMsg: string; + } + interface GetLatestUserKeyOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetLatestUserKeyCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetLatestUserKeyFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetLatestUserKeySuccessCallback; + } + interface GetLatestUserKeySuccessCallbackResult { + /** 用户加密密钥 */ + encryptKey: string; + /** 密钥过期时间 */ + expireTime: number; + /** 密钥初始向量 */ + iv: string; + /** 密钥版本 */ + version: number; + errMsg: string; + } + interface GetLocalIPAddressOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetLocalIPAddressCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetLocalIPAddressFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetLocalIPAddressSuccessCallback; + } + interface GetLocalIPAddressSuccessCallbackResult { + /** 错误信息 */ + errMsg: string; + /** 本机局域网IP地址 */ + localip: string; + /** 本机局域网子网掩码,基础库 2.24.0 开始支持 */ + netmask: string; + } + interface GetLocationOption { + /** 需要基础库: `1.6.0` + * + * 传入 true 会返回高度信息,由于获取高度需要较高精确度,会减慢接口返回速度 */ + altitude?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetLocationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetLocationFailCallback; + /** 需要基础库: `2.9.0` + * + * 高精度定位超时时间(ms),指定时间内返回最高精度,该值3000ms以上高精度定位才有效果 */ + highAccuracyExpireTime?: number; + /** 需要基础库: `2.9.0` + * + * 开启高精度定位 */ + isHighAccuracy?: boolean; + /** 接口调用成功的回调函数 */ + success?: GetLocationSuccessCallback; + /** wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 */ + type?: string; + } + interface GetLocationSuccessCallbackResult { + /** 位置的精确度,反应与真实位置之间的接近程度,可以理解成10即与真实位置相差10m,越小越精确 */ + accuracy: number; + /** 需要基础库: `1.2.0` + * + * 高度,单位 m */ + altitude: number; + /** 需要基础库: `1.2.0` + * + * 水平精度,单位 m */ + horizontalAccuracy: number; + /** 纬度,范围为 -90~90,负数表示南纬 */ + latitude: number; + /** 经度,范围为 -180~180,负数表示西经 */ + longitude: number; + /** 速度,单位 m/s */ + speed: number; + /** 需要基础库: `1.2.0` + * + * 垂直精度,单位 m(Android 无法获取,返回 0) */ + verticalAccuracy: number; + errMsg: string; + } + interface GetLogManagerOption { + /** 需要基础库: `2.3.2` + * + * 取值为0/1,取值为0表示会把 `App`、`Page` 的生命周期函数和 `wx` 命名空间下的函数调用写入日志,取值为1则不会。默认值是 0 */ + level?: number; + } + interface GetMaxTransceiveLengthOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetMaxTransceiveLengthCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetMaxTransceiveLengthFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetMaxTransceiveLengthSuccessCallback; + } + interface GetMaxTransceiveLengthSuccessCallbackResult { + /** 最大传输长度 */ + length: number; + errMsg: string; + } + interface GetMaxZoomOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetMaxZoomCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetMaxZoomFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetMaxZoomSuccessCallback; + } + interface GetMaxZoomSuccessCallbackResult { + /** 最大放缩级别 */ + maxZoom: string; + errMsg: string; + } + interface GetNetworkTypeOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetNetworkTypeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetNetworkTypeFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetNetworkTypeSuccessCallback; + } + interface GetNetworkTypeSuccessCallbackResult { + /** 需要基础库: `2.22.1` + * + * 设备是否使用了网络代理 */ + hasSystemProxy: boolean; + /** 网络类型 + * + * 可选值: + * - 'wifi': wifi 网络; + * - '2g': 2g 网络; + * - '3g': 3g 网络; + * - '4g': 4g 网络; + * - '5g': 5g 网络; + * - 'unknown': Android 下不常见的网络类型; + * - 'none': 无网络; */ + networkType: 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none'; + /** 信号强弱,单位 dbm */ + signalStrength: number; + errMsg: string; + } + interface GetPrivacySettingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetPrivacySettingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetPrivacySettingFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetPrivacySettingSuccessCallback; + } + interface GetPrivacySettingSuccessCallbackResult { + /** 是否需要用户授权隐私协议(如果开发者没有在[mp后台-设置-服务内容声明-用户隐私保护指引]中声明隐私收集类型则会返回false;如果开发者声明了隐私收集,且用户之前同意过隐私协议则会返回false;如果开发者声明了隐私收集,且用户还没同意过则返回true;如果用户之前同意过、但后来小程序又新增了隐私收集类型也会返回true) */ + needAuthorization: boolean; + /** 隐私授权协议的名称 */ + privacyContractName: string; + errMsg: string; + } + interface GetRandomValuesOption { + /** 整数,生成随机数的字节数,最大 1048576 */ + length: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetRandomValuesCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetRandomValuesFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetRandomValuesSuccessCallback; + } + interface GetRandomValuesSuccessCallbackResult { + /** 随机数内容,长度为传入的字节数 */ + randomValues: ArrayBuffer; + errMsg: string; + } + interface GetRegionOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetRegionCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetRegionFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetRegionSuccessCallback; + } + interface GetRegionSuccessCallbackResult { + /** 东北角经纬度 */ + northeast: MapPostion; + /** 西南角经纬度 */ + southwest: MapPostion; + errMsg: string; + } + interface GetRendererUserAgentOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetRendererUserAgentCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetRendererUserAgentFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetRendererUserAgentSuccessCallback; + } + interface GetRotateOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetRotateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetRotateFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetRotateSuccessCallback; + } + interface GetRotateSuccessCallbackResult { + /** 旋转角 */ + rotate: number; + errMsg: string; + } + interface GetSakOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSakCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSakFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSakSuccessCallback; + } + interface GetSakSuccessCallbackResult { + /** 返回 SAK/SEL_RES 数据 */ + sak: number; + errMsg: string; + } + interface GetSavedFileListOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSavedFileListCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSavedFileListFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSavedFileListSuccessCallback; + } + interface GetSavedFileListSuccessCallbackResult { + /** 文件数组 */ + fileList: FileItem[]; + errMsg: string; + } + interface GetScaleOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetScaleCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetScaleFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetScaleSuccessCallback; + } + interface GetScaleSuccessCallbackResult { + /** 缩放值 */ + scale: number; + errMsg: string; + } + interface GetScreenBrightnessOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetScreenBrightnessCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetScreenBrightnessFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetScreenBrightnessSuccessCallback; + } + interface GetScreenBrightnessSuccessCallbackOption { + /** 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮 */ + value: number; + errMsg: string; + } + interface GetScreenRecordingStateOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetScreenRecordingStateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetScreenRecordingStateFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetScreenRecordingStateSuccessCallback; + } + interface GetScreenRecordingStateSuccessCallbackResult { + /** 录屏状态 + * + * 可选值: + * - 'on': 开启; + * - 'off': 关闭; */ + state: 'on' | 'off'; + errMsg: string; + } + interface GetSelectedTextRangeOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSelectedTextRangeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSelectedTextRangeFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSelectedTextRangeSuccessCallback; + } + interface GetSelectedTextRangeSuccessCallbackResult { + /** 输入框光标结束位置 */ + end: number; + /** 输入框光标起始位置 */ + start: number; + errMsg: string; + } + interface GetSelectionTextOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSelectionTextCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSelectionTextFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSelectionTextSuccessCallback; + } + interface GetSelectionTextSuccessCallbackResult { + /** 纯文本内容 */ + text: string; + errMsg: string; + } + interface GetSettingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSettingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSettingFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSettingSuccessCallback; + /** 需要基础库: `2.10.1` + * + * 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 */ + withSubscriptions?: boolean; + } + interface GetSettingSuccessCallbackResult { + /** [AuthSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/AuthSetting.html) + * + * 用户授权结果 */ + authSetting: AuthSetting; + /** [SubscriptionsSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/SubscriptionsSetting.html) + * + * 需要基础库: `2.10.1` + * + * 用户订阅消息设置,接口参数`withSubscriptions`值为`true`时才会返回。 */ + subscriptionsSetting: SubscriptionsSetting; + /** [AuthSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/AuthSetting.html) + * + * 在插件中调用时,当前宿主小程序的用户授权结果 */ + miniprogramAuthSetting?: AuthSetting; + errMsg: string; + } + interface GetShareInfoOption { + /** shareTicket */ + shareTicket: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetShareInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetShareInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetShareInfoSuccessCallback; + /** 需要基础库: `1.9.90` + * + * 超时时间,单位 ms */ + timeout?: number; + } + interface GetSkewOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSkewCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSkewFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSkewSuccessCallback; + } + interface GetSkewSuccessCallbackResult { + /** 倾斜角 */ + skew: number; + errMsg: string; + } + interface GetSkylineInfoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSkylineInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSkylineInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSkylineInfoSuccessCallback; + } + interface GetStorageInfoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetStorageInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetStorageInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetStorageInfoSuccessCallback; + } + interface GetStorageInfoSuccessCallbackOption { + /** 当前占用的空间大小, 单位 KB */ + currentSize: number; + /** 当前 storage 中所有的 key */ + keys: string[]; + /** 限制的空间大小,单位 KB */ + limitSize: number; + errMsg: string; + } + interface GetStorageInfoSyncOption { + /** 当前占用的空间大小, 单位 KB */ + currentSize: number; + /** 当前 storage 中所有的 key */ + keys: string[]; + /** 限制的空间大小,单位 KB */ + limitSize: number; + } + interface GetStorageOption { + /** 本地缓存中指定的 key */ + key: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetStorageCompleteCallback; + /** 需要基础库: `2.21.3` + * + * 是否开启加密存储。只有异步的 getStorage 接口支持开启加密存储。开启后,将会对 data 使用 AES128 解密,接口回调耗时将会增加。若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true */ + encrypt?: boolean; + /** 接口调用失败的回调函数 */ + fail?: GetStorageFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetStorageSuccessCallback; + } + interface GetStorageSuccessCallbackResult { + /** key对应的内容 */ + data: T; + errMsg: string; + } + interface GetSystemInfoAsyncOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSystemInfoAsyncCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSystemInfoAsyncFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSystemInfoAsyncSuccessCallback; + } + interface GetSystemInfoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetSystemInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetSystemInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetSystemInfoSuccessCallback; + } + interface GetUserInfoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetUserInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetUserInfoFailCallback; + /** 显示用户信息的语言 + * + * 可选值: + * - 'en': 英文; + * - 'zh_CN': 简体中文; + * - 'zh_TW': 繁体中文; */ + lang?: 'en' | 'zh_CN' | 'zh_TW'; + /** 接口调用成功的回调函数 */ + success?: GetUserInfoSuccessCallback; + /** 是否带上登录态信息。当 withCredentials 为 true 时,要求此前有调用过 wx.login 且登录态尚未过期,此时返回的数据会包含 encryptedData, iv 等敏感信息;当 withCredentials 为 false 时,不要求有登录态,返回的数据不包含 encryptedData, iv 等敏感信息。 */ + 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; + /** 包括敏感数据在内的完整用户信息的加密数据,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) */ + encryptedData: string; + /** 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) */ + iv: string; + /** 不包括敏感信息的原始数据字符串,用于计算签名 */ + rawData: string; + /** 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ + signature: string; + /** [UserInfo](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/UserInfo.html) + * + * 用户信息对象,不包含 openid 等敏感信息 */ + userInfo: UserInfo; + errMsg: string; + } + interface GetUserProfileOption { + /** 声明获取用户个人信息后的用途,不超过30个字符 */ + desc: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetUserProfileCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetUserProfileFailCallback; + /** 显示用户信息的语言 + * + * 可选值: + * - 'en': 英文; + * - 'zh_CN': 简体中文; + * - 'zh_TW': 繁体中文; */ + lang?: 'en' | 'zh_CN' | 'zh_TW'; + /** 接口调用成功的回调函数 */ + 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; + /** 需要基础库: `2.10.4` + * + * 包括敏感数据在内的完整用户信息的加密数据,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) */ + encryptedData: string; + /** 需要基础库: `2.10.4` + * + * 加密算法的初始向量,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) */ + iv: string; + /** 需要基础库: `2.10.4` + * + * 不包括敏感信息的原始数据字符串,用于计算签名 */ + rawData: string; + /** 需要基础库: `2.10.4` + * + * 使用 sha1( rawData + sessionkey ) 得到字符串,用于校验用户信息,详见 [用户数据的签名验证和加解密](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ + signature: string; + /** [UserInfo](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/UserInfo.html) + * + * 需要基础库: `2.10.4` + * + * 用户信息对象 */ + userInfo: UserInfo; + errMsg: string; + } + interface GetVideoInfoOption { + /** 视频文件路径,可以是临时文件路径也可以是永久文件路径 */ + src: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetVideoInfoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetVideoInfoFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetVideoInfoSuccessCallback; + } + interface GetVideoInfoSuccessCallbackResult { + /** 视频码率,单位 kbps */ + bitrate: number; + /** 视频长度 */ + duration: number; + /** 视频帧率 */ + fps: number; + /** 视频的长,单位 px */ + height: number; + /** 画面方向 + * + * 可选值: + * - 'up': 默认; + * - 'down': 180度旋转; + * - 'left': 逆时针旋转90度; + * - 'right': 顺时针旋转90度; + * - 'up-mirrored': 同up,但水平翻转; + * - 'down-mirrored': 同down,但水平翻转; + * - 'left-mirrored': 同left,但垂直翻转; + * - 'right-mirrored': 同right,但垂直翻转; */ + orientation: + | 'up' + | 'down' + | 'left' + | 'right' + | 'up-mirrored' + | 'down-mirrored' + | 'left-mirrored' + | 'right-mirrored'; + /** 视频大小,单位 kB */ + size: number; + /** 视频格式 */ + type: string; + /** 视频的宽,单位 px */ + width: number; + errMsg: string; + } + interface GetWeRunDataOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetWeRunDataCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetWeRunDataFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetWeRunDataSuccessCallback; + } + interface GetWeRunDataSuccessCallbackResult { + /** 需要基础库: `2.7.0` + * + * 敏感数据对应的云 ID,开通云开发的小程序才会返回,可通过云调用直接获取开放数据,详细见[云调用直接获取开放数据](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#method-cloud) */ + cloudID: string; + /** 包括敏感数据在内的完整用户信息的加密数据,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html)。解密后得到的数据结构见后文 */ + encryptedData: string; + /** 加密算法的初始向量,详细见[加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html) */ + iv: string; + errMsg: string; + } + interface GetWifiListOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: GetWifiListCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: GetWifiListFailCallback; + /** 接口调用成功的回调函数 */ + success?: GetWifiListSuccessCallback; + } + /** 需要基础库: `2.28.0` + * + * 手势检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/hand.html)。 */ + interface HandTrack { + /** 需要基础库: `2.28.0` + * + * 手势检测模式 + * + * 可选值: + * - 1: 通过摄像头实时检测; + * - 2: 静态图片检测; */ + mode: 1 | 2; + } + interface HideHomeButtonOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: HideHomeButtonCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: HideHomeButtonFailCallback; + /** 接口调用成功的回调函数 */ + success?: HideHomeButtonSuccessCallback; + } + interface HideKeyboardOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: HideKeyboardCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: HideKeyboardFailCallback; + /** 接口调用成功的回调函数 */ + success?: HideKeyboardSuccessCallback; + } + interface HideLoadingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: HideLoadingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: HideLoadingFailCallback; + /** 需要基础库: `2.22.1` + * + * 目前 toast 和 loading 相关接口可以相互混用,此参数可用于取消混用特性 */ + noConflict?: boolean; + /** 接口调用成功的回调函数 */ + success?: HideLoadingSuccessCallback; + } + interface HideNavigationBarLoadingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: HideNavigationBarLoadingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: HideNavigationBarLoadingFailCallback; + /** 接口调用成功的回调函数 */ + success?: HideNavigationBarLoadingSuccessCallback; + } + interface HideShareMenuOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: HideShareMenuCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: HideShareMenuFailCallback; + /** 需要基础库: `2.11.3` + * + * 本接口为 Beta 版本,暂只在 Android 平台支持。需要隐藏的转发按钮名称列表,默认['shareAppMessage', 'shareTimeline']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 */ + menus?: string[]; + /** 接口调用成功的回调函数 */ + success?: HideShareMenuSuccessCallback; + } + interface HideTabBarOption { + /** 是否需要动画效果 */ + animation?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: HideTabBarCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: HideTabBarFailCallback; + /** 接口调用成功的回调函数 */ + success?: HideTabBarSuccessCallback; + } + interface HideTabBarRedDotOption { + /** tabBar 的哪一项,从左边算起 */ + index: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: HideTabBarRedDotCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: HideTabBarRedDotFailCallback; + /** 接口调用成功的回调函数 */ + success?: HideTabBarRedDotSuccessCallback; + } + interface HideToastOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: HideToastCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: HideToastFailCallback; + /** 需要基础库: `2.22.1` + * + * 目前 toast 和 loading 相关接口可以相互混用,此参数可用于取消混用特性 */ + noConflict?: boolean; + /** 接口调用成功的回调函数 */ + success?: HideToastSuccessCallback; + } + /** 检测结果 */ + interface HitTestRes { + /** 包含位置、旋转、放缩信息的矩阵,以列为主序 */ + transform: Float32Array; + } + /** 需要基础库: `2.7.0` + * + * 图片对象 */ + interface Image { + /** 图片的真实高度 */ + height: number; + /** 图片加载发生错误后触发的回调函数 */ + onerror: (...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; + /** 图片的 URL。v2.11.0 起支持传递 base64 Data URI */ + src: string; + /** 图片的真实宽度 */ + width: number; + } + /** 需要基础库: `2.9.0` + * + * ImageData 对象 */ + interface ImageData { + /** 一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示 */ + data: Uint8ClampedArray; + /** 使用像素描述 ImageData 的实际高度 */ + height: number; + /** 使用像素描述 ImageData 的实际宽度 */ + width: number; + } + /** 需要基础库: `1.2.0` + * + * 图片的本地临时文件列表 */ + interface ImageFile { + /** 本地临时文件路径 (本地路径) */ + path: string; + /** 本地临时文件大小,单位 B */ + size: number; + } + interface IncludePointsOption { + /** 要显示在可视区域内的坐标点列表 */ + points: MapPostion[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: IncludePointsCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: IncludePointsFailCallback; + /** 坐标点形成的矩形边缘到地图边缘的距离,单位像素。格式为[上,右,下,左]。开发者工具暂不支持padding参数。 */ + padding?: number[]; + /** 接口调用成功的回调函数 */ + success?: IncludePointsSuccessCallback; + } + interface InitFaceDetectOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: InitFaceDetectCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: InitFaceDetectFailCallback; + /** 接口调用成功的回调函数 */ + success?: InitFaceDetectSuccessCallback; + } + interface InitMarkerClusterOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: InitMarkerClusterCompleteCallback; + /** 启用默认的聚合样式 */ + enableDefaultStyle?: boolean; + /** 接口调用失败的回调函数 */ + fail?: InitMarkerClusterFailCallback; + /** 聚合算法的可聚合距离,即距离小于该值的点会聚合至一起,以像素为单位 */ + gridSize?: number; + /** 接口调用成功的回调函数 */ + success?: InitMarkerClusterSuccessCallback; + /** 点击已经聚合的标记点时是否实现聚合分离 */ + 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)事件来处理这种情况。 +* +* **支持格式** +* +* | 格式 | iOS | Android | +* | ---- | ---- | ------- | +* | flac | x | √ | +* | m4a | √ | √ | +* | ogg | x | √ | +* | ape | x | √ | +* | amr | x | √ | +* | wma | x | √ | +* | wav | √ | √ | +* | mp3 | √ | √ | +* | mp4 | x | √ | +* | aac | √ | √ | +* | aiff | √ | x | +* | caf | √ | x | +* +* **示例代码** +* +* ```js +const innerAudioContext = wx.createInnerAudioContext() +innerAudioContext.autoplay = true +innerAudioContext.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E061FF02C31F716658E5C81F5594D561F2E88B854E81CAAB7806D5E4F103E55D33C16F3FAC506D1AB172DE8600B37E43FAD&fromtag=46' +innerAudioContext.onPlay(() => { + console.log('开始播放') +}) +innerAudioContext.onError((res) => { + console.log(res.errMsg) + console.log(res.errCode) +}) +``` */ + interface InnerAudioContext { + /** 是否自动开始播放,默认为 `false` */ + autoplay: boolean; + /** 音频缓冲的时间点,仅保证当前播放时间点到此时间点内容已缓冲(只读) */ + buffered: number; + /** 当前音频的播放位置(单位 s)。只有在当前有合法的 src 时返回,时间保留小数点后 6 位(currentTime 属性在基础库 2.26.2 之前只读,基础库 2.26.2 开始可读可写,改变 currentTime 值等同于调用 seek) */ + currentTime: number; + /** 当前音频的长度(单位 s)。只有在当前有合法的 src 时返回(只读) */ + duration: number; + /** 是否循环播放,默认为 `false` */ + loop: boolean; + /** 是否遵循系统静音开关,默认为 `true`。当此参数为 `false` 时,即使用户打开了静音开关,也能继续发出声音。从 2.3.0 版本开始此参数不生效,使用 [wx.setInnerAudioOption](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.setInnerAudioOption.html) 接口统一设置。 */ + obeyMuteSwitch: boolean; + /** 当前是是否暂停或停止状态(只读) */ + paused: boolean; + /** 需要基础库: `2.11.0` + * + * 播放速度。范围 0.5-2.0,默认为 1。(Android 需要 6 及以上版本) */ + playbackRate: number; + /** 需要基础库: `2.13.0` + * + * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ + referrerPolicy: string; + /** 音频资源的地址,用于直接播放。[2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 开始支持云文件ID */ + src: string; + /** 开始播放的位置(单位:s),默认为 0 */ + startTime: number; + /** 需要基础库: `1.9.90` + * + * 音量。范围 0~1。默认为 1 */ + volume: number; + /** [InnerAudioContext.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.destroy.html) + * + * 在插件中使用:支持 + * + * 销毁当前实例 */ + destroy(): void; + /** [InnerAudioContext.offCanplay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offCanplay.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频进入可以播放状态的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onCanplay(listener) +InnerAudioContext.offCanplay(listener) // 需传入与监听时同一个的函数对象 +``` */ + offCanplay( + /** onCanplay 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffCanplayCallback + ): void; + /** [InnerAudioContext.offEnded(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offEnded.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频自然播放至结束的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onEnded(listener) +InnerAudioContext.offEnded(listener) // 需传入与监听时同一个的函数对象 +``` */ + offEnded( + /** onEnded 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffEndedCallback + ): void; + /** [InnerAudioContext.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offError.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频播放错误事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onError(listener) +InnerAudioContext.offError(listener) // 需传入与监听时同一个的函数对象 +``` */ + offError( + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: InnerAudioContextOffErrorCallback + ): void; + /** [InnerAudioContext.offPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offPause.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频暂停事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onPause(listener) +InnerAudioContext.offPause(listener) // 需传入与监听时同一个的函数对象 +``` */ + offPause( + /** onPause 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffPauseCallback + ): void; + /** [InnerAudioContext.offPlay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offPlay.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频播放事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onPlay(listener) +InnerAudioContext.offPlay(listener) // 需传入与监听时同一个的函数对象 +``` */ + offPlay( + /** onPlay 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffPlayCallback + ): void; + /** [InnerAudioContext.offSeeked(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offSeeked.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频完成跳转操作的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onSeeked(listener) +InnerAudioContext.offSeeked(listener) // 需传入与监听时同一个的函数对象 +``` */ + offSeeked( + /** onSeeked 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffSeekedCallback + ): void; + /** [InnerAudioContext.offSeeking(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offSeeking.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频进行跳转操作的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onSeeking(listener) +InnerAudioContext.offSeeking(listener) // 需传入与监听时同一个的函数对象 +``` */ + offSeeking( + /** onSeeking 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffSeekingCallback + ): void; + /** [InnerAudioContext.offStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offStop.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频停止事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onStop(listener) +InnerAudioContext.offStop(listener) // 需传入与监听时同一个的函数对象 +``` */ + offStop( + /** onStop 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffStopCallback + ): void; + /** [InnerAudioContext.offTimeUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offTimeUpdate.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频播放进度更新事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onTimeUpdate(listener) +InnerAudioContext.offTimeUpdate(listener) // 需传入与监听时同一个的函数对象 +``` */ + offTimeUpdate( + /** onTimeUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffTimeUpdateCallback + ): void; + /** [InnerAudioContext.offWaiting(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.offWaiting.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:支持 +* +* 移除音频加载中事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InnerAudioContext.onWaiting(listener) +InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函数对象 +``` */ + offWaiting( + /** onWaiting 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffWaitingCallback + ): void; + /** [InnerAudioContext.onCanplay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onCanplay.html) + * + * 在插件中使用:支持 + * + * 监听音频进入可以播放状态的事件。但不保证后面可以流畅播放 */ + onCanplay( + /** 音频进入可以播放状态的事件的监听函数 */ + listener: OnCanplayCallback + ): void; + /** [InnerAudioContext.onEnded(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onEnded.html) + * + * 在插件中使用:支持 + * + * 监听音频自然播放至结束的事件 */ + onEnded( + /** 音频自然播放至结束的事件的监听函数 */ + listener: OnEndedCallback + ): void; + /** [InnerAudioContext.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onError.html) + * + * 在插件中使用:支持 + * + * 监听音频播放错误事件 + * + * **Tips** + * + * 1. errCode=100001 时,如若 errMsg 中有 INNERCODE -11828 ,请先检查 response header 是否缺少 Content-Length + * 2. errCode=100001 时,如若 errMsg 中有 systemErrCode:200333420,请检查文件编码格式和 fileExtension 是否一致 */ + onError( + /** 音频播放错误事件的监听函数 */ + listener: InnerAudioContextOnErrorCallback + ): void; + /** [InnerAudioContext.onPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onPause.html) + * + * 在插件中使用:支持 + * + * 监听音频暂停事件 */ + onPause( + /** 音频暂停事件的监听函数 */ + listener: OnPauseCallback + ): void; + /** [InnerAudioContext.onPlay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onPlay.html) + * + * 在插件中使用:支持 + * + * 监听音频播放事件 */ + onPlay( + /** 音频播放事件的监听函数 */ + listener: OnPlayCallback + ): void; + /** [InnerAudioContext.onSeeked(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onSeeked.html) + * + * 在插件中使用:支持 + * + * 监听音频完成跳转操作的事件 */ + onSeeked( + /** 音频完成跳转操作的事件的监听函数 */ + listener: OnSeekedCallback + ): void; + /** [InnerAudioContext.onSeeking(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onSeeking.html) + * + * 在插件中使用:支持 + * + * 监听音频进行跳转操作的事件 */ + onSeeking( + /** 音频进行跳转操作的事件的监听函数 */ + listener: OnSeekingCallback + ): void; + /** [InnerAudioContext.onStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onStop.html) + * + * 在插件中使用:支持 + * + * 监听音频停止事件 */ + onStop( + /** 音频停止事件的监听函数 */ + listener: InnerAudioContextOnStopCallback + ): void; + /** [InnerAudioContext.onTimeUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onTimeUpdate.html) + * + * 在插件中使用:支持 + * + * 监听音频播放进度更新事件 */ + onTimeUpdate( + /** 音频播放进度更新事件的监听函数 */ + listener: OnTimeUpdateCallback + ): void; + /** [InnerAudioContext.onWaiting(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.onWaiting.html) + * + * 在插件中使用:支持 + * + * 监听音频加载中事件。当音频因为数据不足,需要停下来加载时会触发 */ + onWaiting( + /** 音频加载中事件的监听函数 */ + listener: OnWaitingCallback + ): void; + /** [InnerAudioContext.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.pause.html) + * + * 在插件中使用:支持 + * + * 暂停。暂停后的音频再播放会从暂停处开始播放 */ + pause(): void; + /** [InnerAudioContext.play()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.play.html) + * + * 在插件中使用:支持 + * + * 播放 */ + play(): void; + /** [InnerAudioContext.seek(number position)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.seek.html) + * + * 在插件中使用:支持 + * + * 跳转到指定位置 */ + seek( + /** 跳转的时间,单位 s。精确到小数点后 3 位,即支持 ms 级别精确度 */ + position: number + ): void; + /** [InnerAudioContext.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.stop.html) + * + * 在插件中使用:支持 + * + * 停止。停止后的音频再播放会从头开始播放。 */ + stop(): void; + } + interface InnerAudioContextOnErrorListenerResult { + /** 可选值: + * - 10001: 系统错误; + * - 10002: 网络错误; + * - 10003: 文件错误; + * - 10004: 格式错误; + * - -1: 未知错误; */ + errCode: 10001 | 10002 | 10003 | 10004 | -1; + errMsg: string; + } + interface InsertDividerOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: InsertDividerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: InsertDividerFailCallback; + /** 接口调用成功的回调函数 */ + success?: InsertDividerSuccessCallback; + } + interface InsertImageOption { + /** 图片地址,仅支持 http(s)、base64、云图片(2.8.0)、临时文件(2.8.3)。 */ + src: string; + /** 图像无法显示时的替代文本 */ + alt?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: InsertImageCompleteCallback; + /** data 被序列化为 name=value;name1=value2 的格式挂在属性 data-custom 上 */ + data?: IAnyObject; + /** 添加到图片 img 标签上的类名 */ + extClass?: string; + /** 接口调用失败的回调函数 */ + fail?: InsertImageFailCallback; + /** 图片高度 (pixels/百分比) */ + height?: string; + /** 插入图片后是否自动换行,默认换行 */ + nowrap?: boolean; + /** 接口调用成功的回调函数 */ + success?: InsertImageSuccessCallback; + /** 图片宽度(pixels/百分比) */ + width?: string; + } + interface InsertTextOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: InsertTextCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: InsertTextFailCallback; + /** 接口调用成功的回调函数 */ + success?: InsertTextSuccessCallback; + /** 文本内容 */ + text?: string; + } + interface IntersectionObserverObserveCallbackResult { + /** 目标边界 */ + boundingClientRect: BoundingClientRectResult; + /** 节点自定义数据属性 */ + dataset: Record; + /** 节点 ID */ + id: string; + /** 相交比例 */ + intersectionRatio: number; + /** 相交区域的边界 */ + intersectionRect: IntersectionRectResult; + /** 参照区域的边界 */ + relativeRect: RelativeRectResult; + /** 相交检测时的时间戳 */ + time: number; + } + /** 相交区域的边界 */ + interface IntersectionRectResult { + /** 下边界 */ + bottom: number; + /** 高度 */ + height: number; + /** 左边界 */ + left: number; + /** 右边界 */ + right: number; + /** 上边界 */ + top: number; + /** 宽度 */ + width: number; + } + interface InterstitialAdOnErrorListenerResult { + /** 错误码 + * + * 可选值: + * - 1000: 后端接口调用失败; + * - 1001: 参数错误; + * - 1002: 广告单元无效; + * - 1003: 内部错误; + * - 1004: 无合适的广告; + * - 1005: 广告组件审核中; + * - 1006: 广告组件被驳回; + * - 1007: 广告组件被封禁; + * - 1008: 广告单元已关闭; */ + errCode: 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008; + /** 错误信息 */ + errMsg: string; + } + interface IsBluetoothDevicePairedOption { + /** 蓝牙设备 id */ + deviceId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: IsBluetoothDevicePairedCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: IsBluetoothDevicePairedFailCallback; + /** 接口调用成功的回调函数 */ + success?: IsBluetoothDevicePairedSuccessCallback; + } + interface IsConnectedOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: IsConnectedCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: IsConnectedFailCallback; + /** 接口调用成功的回调函数 */ + success?: IsConnectedSuccessCallback; + } + interface Join1v1ChatOption { + /** 呼叫方信息 */ + caller: VoIP1v1ChatUser; + /** 接听方信息 */ + listener: VoIP1v1ChatUser; + /** 窗口背景色(音频通话背景以及小窗模式背景) + * + * 可选值: + * - 0: #262930; + * - 1: #FA5151; + * - 2: #FA9D3B; + * - 3: #3D7257; + * - 4: #1485EE; + * - 5: #6467F0; */ + backgroundType?: 0 | 1 | 2 | 3 | 4 | 5; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: Join1v1ChatCompleteCallback; + /** 不允许切换到语音通话 */ + disableSwitchVoice?: boolean; + /** 接口调用失败的回调函数 */ + fail?: Join1v1ChatFailCallback; + /** 小窗样式 */ + minWindowType?: number; + /** 通话类型 + * + * 可选值: + * - 'voice': 语音通话; + * - 'video': 视频通话; */ + roomType?: 'voice' | 'video'; + /** 接口调用成功的回调函数 */ + success?: Join1v1ChatSuccessCallback; + } + interface JoinVoIPChatOption { + /** 小游戏内此房间/群聊的 ID。同一时刻传入相同 groupId 的用户会进入到同个实时语音房间。 */ + groupId: string; + /** 验证所需的随机字符串 */ + nonceStr: string; + /** 签名,用于验证小游戏的身份 */ + signature: string; + /** 验证所需的时间戳 */ + timeStamp: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: JoinVoIPChatCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: JoinVoIPChatFailCallback; + /** 需要基础库: `2.29.0` + * + * 开启后,joinVoIPChat 会同时走 Wi-Fi 和蜂窝网络2种网络模式,保证实时通话体验。 */ + forceCellularNetwork?: boolean; + /** 静音设置 */ + muteConfig?: MuteConfig; + /** 房间类型 + * + * 可选值: + * - 'voice': 音频房间,用于语音通话; + * - 'video': 视频房间,结合 [voip-room](https://developers.weixin.qq.com/miniprogram/dev/component/voip-room.html) 组件可显示成员画面; */ + roomType?: 'voice' | 'video'; + /** 接口调用成功的回调函数 */ + success?: JoinVoIPChatSuccessCallback; + } + interface JoinVoIPChatSuccessCallbackResult { + /** 错误码 */ + errCode: number; + /** 调用结果 */ + errMsg: string; + /** 在此通话中的成员 openId 名单 */ + openIdList: string[]; + } + interface KvList { + /** key 本地缓存中指定的 key */ + key: string; + /** data 需要存储的内容。只支持原生类型、Date、及能够通过`JSON.stringify`序列化的对象。 */ + value: any; + } + /** 启动参数 */ + interface LaunchOptionsApp { + /** 需要基础库: `2.20.0` + * + * API 类别 + * + * 可选值: + * - 'default': 默认类别; + * - 'nativeFunctionalized': 原生功能化,视频号直播商品、商品橱窗等场景打开的小程序; + * - 'browseOnly': 仅浏览,朋友圈快照页等场景打开的小程序; + * - 'embedded': 内嵌,通过打开半屏小程序能力打开的小程序; */ + apiCategory: 'default' | 'nativeFunctionalized' | 'browseOnly' | 'embedded'; + /** 打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数 */ + forwardMaterials: ForwardMaterials[]; + /** 启动小程序的路径 (代码包路径) */ + path: string; + /** 启动小程序的 query 参数 */ + query: Record; + /** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */ + referrerInfo: ReferrerInfo; + /** 启动小程序的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */ + scene: number; + /** 从微信群聊/单聊打开小程序时,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; + } + interface LivePlayerContextRequestFullScreenOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestFullScreenCompleteCallback; + /** 设置全屏时的方向 + * + * 可选值: + * - 0: 正常竖向; + * - 90: 屏幕逆时针90度; + * - -90: 屏幕顺时针90度; */ + direction?: 0 | 90 | -90; + /** 接口调用失败的回调函数 */ + fail?: RequestFullScreenFailCallback; + /** 接口调用成功的回调函数 */ + success?: RequestFullScreenSuccessCallback; + } + interface LivePlayerContextSnapshotOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SnapshotCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SnapshotFailCallback; + /** 需要基础库: `2.10.0` + * + * 图片的质量 + * + * 可选值: + * - 'raw': 原图; + * - 'compressed': 压缩图; */ + quality?: 'raw' | 'compressed'; + /** 需要基础库: `2.25.0` + * + * 截取的源类型 + * + * 可选值: + * - 'stream': 截取视频源; + * - 'view': 截取渲染后的画面; */ + sourceType?: 'stream' | 'view'; + /** 接口调用成功的回调函数 */ + success?: LivePlayerContextSnapshotSuccessCallback; + } + interface LivePlayerContextSnapshotSuccessCallbackResult { + /** 图片的高度 */ + height: string; + /** 图片文件的临时路径 (本地路径) */ + tempImagePath: string; + /** 图片的宽度 */ + width: string; + errMsg: string; + } + interface LivePusherContextSetZoomOption { + /** 缩放级别,范围[1, maxZoom]。zoom 可取小数,精确到小数后一位。 */ + zoom: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetZoomCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetZoomFailCallback; + /** 接口调用成功的回调函数 */ + success?: LivePusherContextSetZoomSuccessCallback; + } + interface LivePusherContextSnapshotOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SnapshotCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SnapshotFailCallback; + /** 需要基础库: `2.10.0` + * + * 图片的质量 + * + * 可选值: + * - 'raw': 原图; + * - 'compressed': 压缩图; */ + quality?: 'raw' | 'compressed'; + /** 需要基础库: `2.25.0` + * + * 截取的源类型 + * + * 可选值: + * - 'stream': 截取视频源; + * - 'view': 截取渲染后的画面; */ + sourceType?: 'stream' | 'view'; + /** 接口调用成功的回调函数 */ + success?: LivePusherContextSnapshotSuccessCallback; + } + interface LivePusherContextSnapshotSuccessCallbackResult { + /** 图片的高度 */ + height: string; + /** 图片文件的临时路径 */ + tempImagePath: string; + /** 图片的宽度 */ + width: string; + errMsg: string; + } + interface LivePusherContextStartOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartSuccessCallback; + } + interface LoadFontFaceCompleteCallbackResult { + /** 加载字体结果 */ + status: string; + } + interface LoadFontFaceOption { + /** 定义的字体名称 */ + family: string; + /** 字体资源的地址。建议格式为 TTF 和 WOFF,WOFF2 在低版本的iOS上会不兼容。 */ + source: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: LoadFontFaceCompleteCallback; + /** 可选的字体描述符 */ + desc?: DescOption; + /** 接口调用失败的回调函数 */ + fail?: LoadFontFaceFailCallback; + /** 需要基础库: `2.10.0` + * + * 是否全局生效 */ + global?: boolean; + /** 字体作用范围,可选值为 webview / native,默认 webview,设置 native 可在 Canvas 2D 下使用 */ + scopes?: any[]; + /** 接口调用成功的回调函数 */ + success?: LoadFontFaceSuccessCallback; + } + interface LocalInfo { + /** 接收消息的 socket 的地址 */ + address: string; + /** 使用的协议族,为 IPv4 或者 IPv6 */ + family: string; + /** 端口号 */ + port: number; + } + interface LoginOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: LoginCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: LoginFailCallback; + /** 接口调用成功的回调函数 */ + success?: LoginSuccessCallback; + /** 需要基础库: `1.9.90` + * + * 超时时间,单位ms */ + 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; + } + interface MakeBluetoothPairOption { + /** 蓝牙设备 id */ + deviceId: string; + /** pin 码,Base64 格式。 */ + pin: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: MakeBluetoothPairCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: MakeBluetoothPairFailCallback; + /** 接口调用成功的回调函数 */ + success?: MakeBluetoothPairSuccessCallback; + /** 超时时间,单位 ms */ + timeout?: number; + } + interface MakePhoneCallOption { + /** 需要拨打的电话号码 */ + phoneNumber: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: MakePhoneCallCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: MakePhoneCallFailCallback; + /** 接口调用成功的回调函数 */ + success?: MakePhoneCallSuccessCallback; + } + /** 广播的制造商信息。仅安卓支持,iOS 因系统限制无法定制。 */ + interface ManufacturerData { + /** 制造商ID,0x 开头的十六进制 */ + manufacturerId: string; + /** 制造商信息 */ + manufacturerSpecificData?: ArrayBuffer; + } + /** 图片覆盖的经纬度范围 */ + interface MapBounds { + /** 东北角经纬度 */ + northeast: MapPostion; + /** 西南角经纬度 */ + southwest: MapPostion; + } + interface MapPostion { + /** 纬度 */ + latitude: number; + /** 经度 */ + longitude: number; + } + /** 用来扩展(或收缩)参照节点布局区域的边界 */ + interface Margins { + /** 节点布局区域的下边界 */ + bottom?: number; + /** 节点布局区域的左边界 */ + left?: number; + /** 节点布局区域的右边界 */ + right?: number; + /** 节点布局区域的上边界 */ + top?: number; + } + /** 匹配到的缓存 */ + interface MatchCache { + /** 缓存 id */ + cacheId: string; + /** 缓存创建时间 */ + createTime: number; + /** 缓存内容,会带有 fromCache 标记,方便开发者区分内容是否来自缓存 */ + data: any; + /** 缓存有效时间 */ + maxAge: number; + /** 命中的规则 id */ + 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; + /** [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) + * + * 在插件中使用:支持 + * + * 添加音频源 */ + addAudioSource( + /** [VideoDecoder](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.html) + * + * 视频解码器实例。作为音频源添加到音频播放器中 */ + source: VideoDecoder + ): Promise; + /** [Promise MediaAudioPlayer.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.destroy.html) + * + * 在插件中使用:支持 + * + * 销毁播放器 */ + 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) + * + * 在插件中使用:支持 + * + * 移除音频源 */ + removeAudioSource( + /** [VideoDecoder](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.html) + * + * 视频解码器实例 */ + source: VideoDecoder + ): Promise; + /** [Promise MediaAudioPlayer.start()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.start.html) + * + * 在插件中使用:支持 + * + * 启动播放器 */ + start(): Promise; + /** [Promise MediaAudioPlayer.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.stop.html) + * + * 在插件中使用:支持 + * + * 停止播放器 */ + stop(): Promise; + } + /** 本地临时文件列表 */ + interface MediaFile { + /** 视频的时间长度 */ + duration: number; + /** 文件类型 + * + * 可选值: + * - 'image': 图片; + * - 'video': 视频; */ + fileType: 'image' | 'video'; + /** 视频的高度 */ + height: number; + /** 本地临时文件大小,单位 B */ + size: number; + /** 本地临时文件路径 (本地路径) */ + tempFilePath: string; + /** 视频缩略图临时文件路径 */ + thumbTempFilePath: string; + /** 视频的宽度 */ + width: number; + } + interface MediaQueryObserverObserveCallbackResult { + /** 页面的当前状态是否满足所指定的 media query */ + matches: boolean; + } + /** 需要预览的资源列表 */ + interface MediaSource { + /** 图片或视频的地址 */ + url: string; + /** 视频的封面图片 */ + poster?: string; + /** 资源的类型,默认为图片 + * + * 可选值: + * - 'image': 图片; + * - 'video': 视频; */ + type?: 'image' | 'video'; + } + /** 需要基础库: `2.9.0` + * + * 可通过 [MediaContainer.extractDataSource](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.extractDataSource.html) 返回。 + * + * [MediaTrack](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaTrack.html) 音频或视频轨道,可以对轨道进行一些操作 */ + interface MediaTrack { + /** 轨道长度,只读 */ + duration: number; + /** 轨道类型,只读 + * + * 可选值: + * - 'audio': 音频轨道; + * - 'video': 视频轨道; */ + kind: 'audio' | 'video'; + /** 音量,音频轨道下有效,可写 */ + volume: number; + } + /** 小程序账号信息 */ + interface MiniProgram { + /** 小程序 appId */ + appId: string; + /** 需要基础库: `2.10.0` + * + * 小程序版本 + * + * 可选值: + * - 'develop': 开发版; + * - 'trial': 体验版; + * - 'release': 正式版; */ + envVersion: 'develop' | 'trial' | 'release'; + /** 需要基础库: `2.10.2` + * + * 线上小程序版本号 */ + version: string; + } + interface MkdirOption { + /** 创建的目录路径 (本地路径) */ + dirPath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: MkdirCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: MkdirFailCallback; + /** 需要基础库: `2.3.0` + * + * 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 */ + recursive?: boolean; + /** 接口调用成功的回调函数 */ + success?: MkdirSuccessCallback; + } + interface MoveAlongOption { + /** 平滑移动的时间 */ + duration: number; + /** 指定 marker */ + markerId: number; + /** 移动路径的坐标串,坐标点格式 `{longitude, latitude}` */ + path: any[]; + /** 根据路径方向自动改变 marker 的旋转角度 */ + autoRotate?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: MoveAlongCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: MoveAlongFailCallback; + /** 接口调用成功的回调函数 */ + success?: MoveAlongSuccessCallback; + } + interface MoveToLocationOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: MoveToLocationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: MoveToLocationFailCallback; + /** 需要基础库: `2.8.0` + * + * 纬度 */ + latitude?: number; + /** 需要基础库: `2.8.0` + * + * 经度 */ + longitude?: number; + /** 接口调用成功的回调函数 */ + success?: MoveToLocationSuccessCallback; + } + /** 静音设置 */ + interface MuteConfig { + /** 是否静音耳机 */ + muteEarphone?: boolean; + /** 是否静音麦克风 */ + muteMicrophone?: boolean; + } + interface MuteOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: MuteCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: MuteFailCallback; + /** 接口调用成功的回调函数 */ + success?: MuteSuccessCallback; + } + /** 需要基础库: `2.11.2` */ + interface NFCAdapter { + /** 标签类型枚举 */ + tech: TechType; + /** [NFCAdapter.offDiscovered(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.offDiscovered.html) +* +* 需要基础库: `2.11.2` +* +* 在插件中使用:支持 +* +* 移除 NFC Tag的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +NFCAdapter.onDiscovered(listener) +NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对象 +``` */ + offDiscovered( + /** onDiscovered 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffDiscoveredCallback + ): void; + /** [NFCAdapter.onDiscovered(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.onDiscovered.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 监听 NFC Tag */ + onDiscovered( + /** 的监听函数 */ + 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; + /** [NFCAdapter.stopDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NFCAdapter.stopDiscovery.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 */ + 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` + * + * 在插件中使用:支持 + * + * 获取IsoDep实例,实例支持ISO-DEP (ISO 14443-4)标准的读写 */ + 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` + * + * 在插件中使用:支持 + * + * 获取MifareClassic实例,实例支持MIFARE Classic标签的读写 */ + 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` + * + * 在插件中使用:支持 + * + * 获取MifareUltralight实例,实例支持MIFARE Ultralight标签的读写 */ + 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` + * + * 在插件中使用:支持 + * + * 获取Ndef实例,实例支持对NDEF格式的NFC标签上的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` + * + * 在插件中使用:支持 + * + * 获取NfcA实例,实例支持NFC-A (ISO 14443-3A)标准的读写 */ + 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` + * + * 在插件中使用:支持 + * + * 获取NfcB实例,实例支持NFC-B (ISO 14443-3B)标准的读写 */ + 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` + * + * 在插件中使用:支持 + * + * 获取NfcF实例,实例支持NFC-F (JIS 6319-4)标准的读写 */ + 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` + * + * 在插件中使用:支持 + * + * 获取NfcV实例,实例支持NFC-V (ISO 15693)标准的读写 */ + getNfcV(): NfcV; + } + interface NavigateBackMiniProgramOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: NavigateBackMiniProgramCompleteCallback; + /** 需要返回给上一个小程序的数据,上一个小程序可在 `App.onShow` 中获取到这份数据。 [详情](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html)。 */ + extraData?: IAnyObject; + /** 接口调用失败的回调函数 */ + fail?: NavigateBackMiniProgramFailCallback; + /** 接口调用成功的回调函数 */ + success?: NavigateBackMiniProgramSuccessCallback; + } + interface NavigateBackOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: NavigateBackCompleteCallback; + /** 返回的页面数,如果 delta 大于现有页面数,则返回到首页。 */ + delta?: number; + /** 接口调用失败的回调函数 */ + fail?: NavigateBackFailCallback; + /** 接口调用成功的回调函数 */ + success?: NavigateBackSuccessCallback; + } + interface NavigateToMiniProgramOption { + /** 要打开的小程序 appId */ + appId?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: NavigateToMiniProgramCompleteCallback; + /** 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 + * + * 可选值: + * - '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; + /** 接口调用失败的回调函数 */ + fail?: NavigateToMiniProgramFailCallback; + /** 需要基础库: `2.24.0` + * + * 不reLaunch目标小程序,直接打开目标跳转的小程序退后台时的页面,需满足以下条件:1. 目标跳转的小程序生命周期未被销毁;2. 且目标当次启动的path、query与上次启动相同,apiCategory以wx.getApiCategory接口的返回结果为准。 */ + 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; + /** 需要基础库: `2.18.1` + * + * 小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。 */ + shortLink?: string; + /** 接口调用成功的回调函数 */ + success?: NavigateToMiniProgramSuccessCallback; + } + interface NavigateToOption { + /** 需要跳转的应用内非 tabBar 的页面的路径 (代码包路径), 路径后可以带参数。参数与路径之间使用 `?` 分隔,参数键与参数值用 `=` 相连,不同参数用 `&` 分隔;如 'path?key=value&key2=value2' */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: NavigateToCompleteCallback; + /** 页面间通信接口,用于监听被打开页面发送到当前页面的数据。基础库 2.7.3 开始支持。 */ + events?: IAnyObject; + /** 接口调用失败的回调函数 */ + fail?: NavigateToFailCallback; + /** 2.29.2 自定义路由类型,相关文档 [自定义路由](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/custom-route.html) */ + routeType?: string; + /** 接口调用成功的回调函数 */ + success?: NavigateToSuccessCallback; + } + interface NavigateToSuccessCallbackResult { + /** [EventChannel](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.html) + * + * 和被打开页面进行通信 */ + eventChannel: EventChannel; + errMsg: string; + } + interface NdefCloseOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: NdefCloseCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: NdefCloseFailCallback; + /** 接口调用成功的回调函数 */ + success?: NdefCloseSuccessCallback; + } + interface NdefConnectOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ConnectCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ConnectFailCallback; + /** 接口调用成功的回调函数 */ + success?: ConnectSuccessCallback; + } + interface NodeCallbackResult { + /** 节点对应的 Node 实例 */ + node: IAnyObject; + } + interface NotifyBLECharacteristicValueChangeOption { + /** 蓝牙特征的 UUID */ + characteristicId: string; + /** 蓝牙设备 id */ + deviceId: string; + /** 蓝牙特征对应服务的 UUID */ + serviceId: string; + /** 是否启用 notify */ + state: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: NotifyBLECharacteristicValueChangeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: NotifyBLECharacteristicValueChangeFailCallback; + /** 接口调用成功的回调函数 */ + success?: NotifyBLECharacteristicValueChangeSuccessCallback; + /** 需要基础库: `2.4.0` + * + * 设置特征订阅类型,有效值有 `notification` 和 `indication` */ + type?: string; + } + /** 需要基础库: `2.27.0` + * + * OCR检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/ocr.html)。 */ + interface OCRTrack { + /** 需要基础库: `2.27.0` + * + * OCR检测模式 + * + * 可选值: + * - 1: 通过摄像头实时检测; + * - 2: 静态图片检测; */ + mode: 1 | 2; + } + /** media query 描述符 */ + interface ObserveDescriptor { + /** 页面高度( px 为单位) */ + height: number; + /** 页面最大高度( px 为单位) */ + maxHeight: number; + /** 页面最大宽度( px 为单位) */ + maxWidth: number; + /** 页面最小高度( px 为单位) */ + minHeight: number; + /** 页面最小宽度( px 为单位) */ + minWidth: number; + /** 屏幕方向( `landscape` 或 `portrait` ) */ + orientation: string; + /** 页面宽度( px 为单位) */ + width: number; + } + /** 设置 type 监听单个类型的指标,设置 entryTypes 监听多个类型指标。 */ + interface ObserveOption { + /** 指标类型列表。不能和 type 同时使用。 */ + entryTypes?: string[]; + /** 指标类型。不能和 entryTypes 同时使用 + * + * 可选值: + * - '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; + /** 画布宽度 */ + 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` + * + * 在插件中使用:需要基础库 `2.16.1` + * + * 创建一个图片对象。支持在 2D Canvas 和 WebGL Canvas 下使用, 但不支持混用 2D 和 WebGL 的方法。 + * + * **** + * + * 注意不允许混用 webgl 和 2d 画布创建的图片对象,使用时请注意尽量使用 canvas 自身的 `createImage` 创建图片对象。 */ + 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` + * + * 在插件中使用:需要基础库 `2.16.1` + * + * 该方法返回 OffscreenCanvas 的绘图上下文 + * + * **** + * + * 注意不允许混用 webgl 和 2d 绘图上下文,传入的 contextType 必须要与 `wx.createOffscreenCanvas` 传入的 type 类型一致。 */ + getContext( + /** 绘图上下文类型,需要与 createOffscreenCanvas 时传入的 type 一致 + * + * 参数 contextType 可选值: + * - 'webgl': webgl类型上下文; + * - '2d': 2d类型上下文; */ + contextType: 'webgl' | '2d' + ): any; + } + interface OnAccelerometerChangeListenerResult { + /** X 轴 */ + x: number; + /** Y 轴 */ + y: number; + /** Z 轴 */ + z: number; + } + interface OnApiCategoryChangeListenerResult { + /** API 类别 + * + * 可选值: + * - 'default': 默认类别; + * - 'nativeFunctionalized': 原生功能化,视频号直播商品、商品橱窗等场景打开的小程序; + * - 'browseOnly': 仅浏览,朋友圈快照页等场景打开的小程序; + * - 'embedded': 内嵌,通过打开半屏小程序能力打开的小程序; */ + apiCategory: 'default' | 'nativeFunctionalized' | 'browseOnly' | 'embedded'; + } + interface OnBLECharacteristicValueChangeListenerResult { + /** 蓝牙特征的 UUID */ + characteristicId: string; + /** 蓝牙设备 id */ + deviceId: string; + /** 蓝牙特征对应服务的 UUID */ + serviceId: string; + /** 特征最新的值 */ + value: ArrayBuffer; + } + interface OnBLEConnectionStateChangeListenerResult { + /** 是否处于已连接状态 */ + connected: boolean; + /** 蓝牙设备 id */ + deviceId: string; + } + interface OnBLEMTUChangeListenerResult { + /** 蓝牙设备 id */ + deviceId: string; + /** 最大传输单元 */ + mtu: number; + } + interface OnBLEPeripheralConnectionStateChangedListenerResult { + /** 连接目前状态 */ + connected: boolean; + /** 连接状态变化的设备 id */ + deviceId: string; + /** server 的 UUID */ + serverId: string; + } + interface OnBackgroundFetchDataListenerResult { + /** 缓存数据类别,取值为 periodic 或 pre */ + fetchType: string; + /** 缓存数据 */ + fetchedData: string; + /** 小程序页面路径 */ + path: string; + /** 传给页面的 query 参数 */ + query: string; + /** 进入小程序的场景值 */ + scene: number; + /** 客户端拿到缓存数据的时间戳 */ + timeStamp: number; + } + interface OnBeaconServiceChangeListenerResult { + /** 服务目前是否可用 */ + available: boolean; + /** 目前是否处于搜索状态 */ + discovering: boolean; + } + interface OnBeaconUpdateListenerResult { + /** 当前搜寻到的所有 Beacon 设备列表 */ + beacons: BeaconInfo[]; + } + interface OnBluetoothAdapterStateChangeListenerResult { + /** 蓝牙适配器是否可用 */ + available: boolean; + /** 蓝牙适配器是否处于搜索状态 */ + discovering: boolean; + } + interface OnBluetoothDeviceFoundListenerResult { + /** 新搜索到的设备列表 */ + devices: BlueToothDevice[]; + } + interface OnCameraFrameCallbackResult { + /** 图像像素点数据,一维数组,每四项表示一个像素点的 rgba */ + data: ArrayBuffer; + /** 图像数据矩形的高度 */ + height: number; + /** 图像数据矩形的宽度 */ + width: number; + } + interface OnCharacteristicReadRequestListenerResult { + /** 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 */ + callbackId: number; + /** 蓝牙特征的 UUID */ + characteristicId: string; + /** 蓝牙特征对应服务的 UUID */ + serviceId: string; + } + interface OnCharacteristicSubscribedListenerResult { + /** 蓝牙特征的 UUID */ + characteristicId: string; + /** 蓝牙特征对应服务的 UUID */ + serviceId: string; + } + interface OnCharacteristicWriteRequestListenerResult { + /** 唯一标识码,调用 [writeCharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 时使用 */ + callbackId: number; + /** 蓝牙特征的 UUID */ + characteristicId: string; + /** 蓝牙特征对应服务的 UUID */ + serviceId: string; + /** 请求写入特征的二进制数据值 */ + value: ArrayBuffer; + } + interface OnCheckForUpdateListenerResult { + /** 是否有新版本 */ + hasUpdate: boolean; + } + interface OnChunkReceivedListenerResult { + /** 返回的chunk buffer */ + data: ArrayBuffer; + } + interface OnCompassChangeListenerResult { + /** 需要基础库: `2.4.0` + * + * 精度 */ + accuracy: number | string; + /** 面对的方向度数 */ + direction: number; + } + interface OnCopyUrlListenerResult { + /** 用短链打开小程序时当前页面携带的查询字符串。小程序中使用时,应在进入页面时调用 `wx.onCopyUrl` 自定义 `query`,退出页面时调用 `wx.offCopyUrl`,防止影响其它页面。 */ + query: string; + } + interface OnCustomRendererEventCallbackResult { + /** 推流高度 */ + height: number; + /** 推流宽度 */ + width: number; + } + interface OnDeviceMotionChangeListenerResult { + /** 当 手机坐标 X/Y 和 地球 X/Y 重合时,绕着 Z 轴转动的夹角为 alpha,范围值为 [0, 2*PI)。逆时针转动为正。 */ + alpha: number; + /** 当手机坐标 Y/Z 和地球 Y/Z 重合时,绕着 X 轴转动的夹角为 beta。范围值为 [-1*PI, PI) 。顶部朝着地球表面转动为正。也有可能朝着用户为正。 */ + beta: number; + /** 当手机 X/Z 和地球 X/Z 重合时,绕着 Y 轴转动的夹角为 gamma。范围值为 [-1*PI/2, PI/2)。右边朝着地球表面转动为正。 */ + gamma: number; + } + interface OnDiscoveredListenerResult { + id: ArrayBuffer; + /** 可选,NdefMessage 数组,消息格式为 {id: ArrayBuffer, type: ArrayBuffer, payload: ArrayBuffer} */ + messages: any[]; + /** tech 数组,用于匹配NFC卡片具体可以使用什么标准(NfcA等实例)处理 */ + techs: any[]; + } + interface OnEmbeddedMiniProgramHeightChangeListenerResult { + /** 可视高度 */ + height: number; + /** 半屏小程序初始高度 */ + initialHeight: number; + } + interface OnFrameRecordedListenerResult { + /** 录音分片数据 */ + frameBuffer: ArrayBuffer; + /** 当前帧是否正常录音结束前的最后一帧 */ + isLastFrame: boolean; + } + interface OnGetWifiListListenerResult { + /** Wi-Fi 列表数据 */ + wifiList: WifiInfo[]; + } + interface OnGyroscopeChangeListenerResult { + /** x 轴的角速度 */ + x: number; + /** y 轴的角速度 */ + y: number; + /** z 轴的角速度 */ + z: number; + } + interface OnHCEMessageListenerResult { + /** `messageType=1` 时 ,客户端接收到 NFC 设备的指令 */ + data: ArrayBuffer; + /** 消息类型 + * + * 可选值: + * - 1: HCE APDU Command类型,小程序需对此指令进行处理,并调用 sendHCEMessage 接口返回处理指令; + * - 2: 设备离场事件类型; */ + messageType: 1 | 2; + /** `messageType=2` 时,原因 */ + reason: number; + } + interface OnHeadersReceivedListenerResult { + /** 开发者服务器返回的 HTTP Response Header */ + header: IAnyObject; + } + interface OnKeyboardHeightChangeListenerResult { + /** 键盘高度 */ + height: number; + } + interface OnLazyLoadErrorListenerResult { + /** 详细信息 */ + errMsg: string; + /** 异步组件所属的分包 */ + subpackage: any[]; + /** 'subpackage' 失败类型 */ + type: string; + } + interface OnLocalServiceFoundListenerResult { + /** 服务的 ip 地址 */ + ip: string; + /** 服务的端口 */ + port: number; + /** 服务的名称 */ + serviceName: string; + /** 服务的类型 */ + serviceType: string; + } + interface OnLocalServiceLostListenerResult { + /** 服务的名称 */ + serviceName: string; + /** 服务的类型 */ + serviceType: string; + } + interface OnLocationChangeErrorListenerResult { + /** 错误码 */ + errCode: number; + } + interface OnLocationChangeListenerResult { + /** 位置的精确度 */ + accuracy: number; + /** 需要基础库: `1.2.0` + * + * 高度,单位 m */ + altitude: number; + /** 需要基础库: `1.2.0` + * + * 水平精度,单位 m */ + horizontalAccuracy: number; + /** 纬度,范围为 -90~90,负数表示南纬。使用 gcj02 国测局坐标系 */ + latitude: number; + /** 经度,范围为 -180~180,负数表示西经。使用 gcj02 国测局坐标系 */ + longitude: number; + /** 速度,单位 m/s */ + speed: number; + /** 需要基础库: `1.2.0` + * + * 垂直精度,单位 m(Android 无法获取,返回 0) */ + verticalAccuracy: number; + } + interface OnMemoryWarningListenerResult { + /** 内存告警等级,只有 Android 才有,对应系统宏定义 + * + * 可选值: + * - 5: TRIM_MEMORY_RUNNING_MODERATE; + * - 10: TRIM_MEMORY_RUNNING_LOW; + * - 15: TRIM_MEMORY_RUNNING_CRITICAL; */ + level: 5 | 10 | 15; + } + interface OnNetworkStatusChangeListenerResult { + /** 当前是否有网络连接 */ + isConnected: boolean; + /** 网络类型 + * + * 可选值: + * - 'wifi': wifi 网络; + * - '2g': 2g 网络; + * - '3g': 3g 网络; + * - '4g': 4g 网络; + * - '5g': 5g 网络; + * - 'unknown': Android 下不常见的网络类型; + * - 'none': 无网络; */ + networkType: 'wifi' | '2g' | '3g' | '4g' | '5g' | 'unknown' | 'none'; + } + interface OnNetworkWeakChangeListenerResult { + /** 当前网络类型 */ + networkType: string; + /** 当前是否处于弱网状态 */ + weakNet: boolean; + } + interface OnOpenListenerResult { + /** 需要基础库: `2.0.0` + * + * 连接成功的 HTTP 响应 Header */ + header: IAnyObject; + /** 需要基础库: `2.10.4` + * + * 网络请求过程中一些调试信息 */ + profile: SocketProfile; + } + interface OnPageNotFoundListenerResult { + /** 是否本次启动的首个页面(例如从分享等入口进来,首个页面是开发者配置的分享页面) */ + isEntryPage: boolean; + /** 不存在页面的路径 (代码包路径) */ + path: string; + /** 打开不存在页面的 query 参数 */ + query: Record; + } + interface OnScreenRecordingStateChangedListenerResult { + /** 录屏状态 + * + * 可选值: + * - 'start': 开始录屏; + * - 'stop': 结束录屏; */ + state: 'start' | 'stop'; + } + interface OnSocketOpenListenerResult { + /** 需要基础库: `2.0.0` + * + * 连接成功的 HTTP 响应 Header */ + header: IAnyObject; + } + interface OnStopListenerResult { + /** 录音总时长,单位:ms */ + duration: number; + /** 录音文件大小,单位:Byte */ + fileSize: number; + /** 录音文件的临时路径 (本地路径) */ + tempFilePath: string; + } + interface OnThemeChangeListenerResult { + /** 系统当前的主题,取值为`light`或`dark` + * + * 可选值: + * - 'dark': 深色主题; + * - 'light': 浅色主题; */ + theme: 'dark' | 'light'; + } + interface OnUnhandledRejectionListenerResult { + /** 被拒绝的 Promise 对象 */ + promise: Promise; + /** 拒绝原因,一般是一个 Error 对象 */ + reason: string; + } + interface OnVoIPChatInterruptedListenerResult { + /** 错误码 */ + errCode: number; + /** 调用结果(错误原因) */ + errMsg: string; + } + interface OnVoIPChatMembersChangedListenerResult { + /** 错误码 */ + errCode: number; + /** 调用结果 */ + errMsg: string; + /** 还在实时语音通话中的成员 openId 名单 */ + openIdList: string[]; + } + interface OnVoIPChatSpeakersChangedListenerResult { + /** 错误码 */ + errCode: number; + /** 调用结果(错误原因) */ + errMsg: string; + /** 还在实时语音通话中的成员 openId 名单 */ + openIdList: string[]; + } + interface OnVoIPChatStateChangedListenerResult { + /** 事件码 */ + code: number; + /** 附加信息 */ + data: IAnyObject; + /** 错误码 */ + errCode: number; + /** 调用结果 */ + errMsg: string; + } + interface OnVoIPVideoMembersChangedListenerResult { + /** 错误码 */ + errCode: number; + /** 调用结果 */ + errMsg: string; + /** 开启视频的成员名单 */ + openIdList: string[]; + } + interface OnWifiConnectedListenerResult { + /** [WifiInfo](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/WifiInfo.html) + * + * Wi-Fi 信息 */ + wifi: WifiInfo; + } + interface OnWifiConnectedWithPartialInfoListenerResult { + /** [WifiInfo](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/WifiInfo.html) + * + * 只包含 SSID 属性的 WifiInfo 对象 */ + wifi: WifiInfo; + } + interface OnWindowResizeListenerResult { + size: Size; + } + interface OpenAppAuthorizeSettingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenAppAuthorizeSettingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenAppAuthorizeSettingFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenAppAuthorizeSettingSuccessCallback; + } + interface OpenBluetoothAdapterOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenBluetoothAdapterCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenBluetoothAdapterFailCallback; + /** 需要基础库: `2.10.0` + * + * 蓝牙模式,可作为主/从设备,仅 iOS 需要。 + * + * 可选值: + * - 'central': 主机模式; + * - 'peripheral': 从机(外围设备)模式; */ + mode?: 'central' | 'peripheral'; + /** 接口调用成功的回调函数 */ + success?: OpenBluetoothAdapterSuccessCallback; + } + interface OpenCardOption { + /** 需要打开的卡券列表 */ + cardList: OpenCardRequestInfo[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenCardCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenCardFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenCardSuccessCallback; + } + /** 需要打开的卡券列表 */ + interface OpenCardRequestInfo { + /** 卡券 ID */ + 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; + } + interface OpenChannelsActivityOption { + /** 视频 feedId */ + feedId: string; + /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ + finderUserName: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenChannelsActivityCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenChannelsActivityFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenChannelsActivitySuccessCallback; + } + interface OpenChannelsEventOption { + /** 活动 id */ + eventId: string; + /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ + finderUserName: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenChannelsEventCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenChannelsEventFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenChannelsEventSuccessCallback; + } + interface OpenChannelsLiveOption { + /** 视频号 id,以“sph”开头的id,可在视频号助手获取 */ + finderUserName: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenChannelsLiveCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenChannelsLiveFailCallback; + /** 直播 feedId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) */ + feedId?: string; + /** 直播 nonceId,通过 getChannelsLiveInfo 接口获取(基础库 v2.19.2 之前的版本需要填写) */ + nonceId?: string; + /** 接口调用成功的回调函数 */ + success?: OpenChannelsLiveSuccessCallback; + } + interface OpenChannelsUserProfileOption { + /** 视频号 id */ + finderUserName: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenChannelsUserProfileCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenChannelsUserProfileFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenChannelsUserProfileSuccessCallback; + } + interface OpenCustomerServiceChatOption { + /** 企业ID */ + corpId: string; + /** 客服信息 */ + extInfo: ExtInfoOption; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenCustomerServiceChatCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenCustomerServiceChatFailCallback; + /** 气泡消息图片 */ + sendMessageImg?: string; + /** 气泡消息小程序路径 */ + sendMessagePath?: string; + /** 气泡消息标题 */ + sendMessageTitle?: string; + /** 是否发送小程序气泡消息 */ + showMessageCard?: boolean; + /** 接口调用成功的回调函数 */ + success?: OpenCustomerServiceChatSuccessCallback; + } + interface OpenDocumentOption { + /** 文件路径 (本地路径) ,可通过 downloadFile 获得 */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenDocumentCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenDocumentFailCallback; + /** 需要基础库: `1.4.0` + * + * 文件类型,指定文件类型打开文件 + * + * 可选值: + * - 'doc': doc 格式; + * - 'docx': docx 格式; + * - 'xls': xls 格式; + * - 'xlsx': xlsx 格式; + * - 'ppt': ppt 格式; + * - 'pptx': pptx 格式; + * - 'pdf': pdf 格式; */ + fileType?: 'doc' | 'docx' | 'xls' | 'xlsx' | 'ppt' | 'pptx' | 'pdf'; + /** 需要基础库: `2.11.0` + * + * 是否显示右上角菜单 */ + showMenu?: boolean; + /** 接口调用成功的回调函数 */ + success?: OpenDocumentSuccessCallback; + } + interface OpenEmbeddedMiniProgramOption { + /** 要打开的小程序 appId */ + appId: string; + /** 需要基础库: `2.33.0` + * + * 打开的小程序是否支持全屏 */ + allowFullScreen?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenEmbeddedMiniProgramCompleteCallback; + /** 要打开的小程序版本。仅在当前小程序为开发版或体验版时此参数有效。如果当前小程序是正式版,则打开的小程序必定是正式版。 + * + * 可选值: + * - '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; + /** 接口调用失败的回调函数 */ + fail?: OpenEmbeddedMiniProgramFailCallback; + /** 需要基础库: `2.24.0` + * + * 不reLaunch目标小程序,直接打开目标跳转的小程序退后台时的页面,需满足以下条件:1. 目标跳转的小程序生命周期未被销毁;2. 且目标当次启动的path、query与上次启动相同,apiCategory以wx.getApiCategory接口的返回结果为准。 */ + 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; + /** 小程序链接,当传递该参数后,可以不传 appId 和 path。链接可以通过【小程序菜单】->【复制链接】获取。仅 verify=binding 支持。 */ + shortLink?: string; + /** 接口调用成功的回调函数 */ + success?: OpenEmbeddedMiniProgramSuccessCallback; + /** 需要基础库: `2.24.3` + * + * 校验方式。 + * + * 可选值: + * - 'binding': 校验小程序管理后台的绑定关系。; + * - 'unionProduct': 校验目标打开链接是否为[小程序联盟](https://developers.weixin.qq.com/doc/ministore/union/brief-introduction.html)商品。; */ + verify?: 'binding' | 'unionProduct'; + } + interface OpenLocationOption { + /** 纬度,范围为-90~90,负数表示南纬。使用 gcj02 国测局坐标系 */ + latitude: number; + /** 经度,范围为-180~180,负数表示西经。使用 gcj02 国测局坐标系 */ + longitude: number; + /** 地址的详细说明 */ + address?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenLocationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenLocationFailCallback; + /** 位置名 */ + name?: string; + /** 缩放比例,范围5~18 */ + scale?: number; + /** 接口调用成功的回调函数 */ + success?: OpenLocationSuccessCallback; + } + interface OpenMapAppOption { + /** 目的地名称 */ + destination: string; + /** 目的地纬度 */ + latitude: number; + /** 目的地经度 */ + longitude: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenMapAppCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenMapAppFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenMapAppSuccessCallback; + } + interface OpenOption { + /** 文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenFailCallback; + /** 文件系统标志,默认值: 'r' + * + * 可选值: + * - 'a': 打开文件用于追加。 如果文件不存在,则创建该文件; + * - 'ax': 类似于 'a',但如果路径存在,则失败; + * - 'a+': 打开文件用于读取和追加。 如果文件不存在,则创建该文件; + * - 'ax+': 类似于 'a+',但如果路径存在,则失败; + * - 'as': 打开文件用于追加(在同步模式中)。 如果文件不存在,则创建该文件; + * - 'as+': 打开文件用于读取和追加(在同步模式中)。 如果文件不存在,则创建该文件; + * - 'r': 打开文件用于读取。 如果文件不存在,则会发生异常; + * - 'r+': 打开文件用于读取和写入。 如果文件不存在,则会发生异常; + * - 'w': 打开文件用于写入。 如果文件不存在则创建文件,如果文件存在则截断文件; + * - 'wx': 类似于 'w',但如果路径存在,则失败; + * - 'w+': 打开文件用于读取和写入。 如果文件不存在则创建文件,如果文件存在则截断文件; + * - 'wx+': 类似于 'w+',但如果路径存在,则失败; */ + flag?: + | 'a' + | 'ax' + | 'a+' + | 'ax+' + | 'as' + | 'as+' + | 'r' + | 'r+' + | 'w' + | 'wx' + | 'w+' + | 'wx+'; + /** 接口调用成功的回调函数 */ + success?: OpenSuccessCallback; + } + interface OpenPrivacyContractOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenPrivacyContractCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenPrivacyContractFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenPrivacyContractSuccessCallback; + } + interface OpenSettingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenSettingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenSettingFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenSettingSuccessCallback; + /** 需要基础库: `2.10.3` + * + * 是否同时获取用户订阅消息的订阅状态,默认不获取。注意:withSubscriptions 只返回用户勾选过订阅面板中的“总是保持以上选择,不再询问”的订阅消息。 */ + withSubscriptions?: boolean; + } + interface OpenSettingSuccessCallbackResult { + /** [AuthSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/AuthSetting.html) + * + * 用户授权结果 */ + 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; + } + interface OpenSingleStickerViewOption { + /** 表情链接,可前往[表情开放平台](https://sticker.weixin.qq.com/)获取 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenSingleStickerViewCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenSingleStickerViewFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenSingleStickerViewSuccessCallback; + } + interface OpenStickerIPViewOption { + /** 表情IP合辑链接,可前往[表情开放平台](https://sticker.weixin.qq.com/)获取 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenStickerIPViewCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenStickerIPViewFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenStickerIPViewSuccessCallback; + } + interface OpenStickerSetViewOption { + /** 表情专辑链接,可前往[表情开放平台](https://sticker.weixin.qq.com/)获取 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenStickerSetViewCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenStickerSetViewFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenStickerSetViewSuccessCallback; + } + interface OpenSuccessCallbackResult { + /** 文件描述符 */ + fd: string; + errMsg: string; + } + interface OpenSyncOption { + /** 文件路径 (本地路径) */ + filePath: string; + /** 文件系统标志,默认值: 'r' + * + * 可选值: + * - 'a': 打开文件用于追加。 如果文件不存在,则创建该文件; + * - 'ax': 类似于 'a',但如果路径存在,则失败; + * - 'a+': 打开文件用于读取和追加。 如果文件不存在,则创建该文件; + * - 'ax+': 类似于 'a+',但如果路径存在,则失败; + * - 'as': 打开文件用于追加(在同步模式中)。 如果文件不存在,则创建该文件; + * - 'as+': 打开文件用于读取和追加(在同步模式中)。 如果文件不存在,则创建该文件; + * - 'r': 打开文件用于读取。 如果文件不存在,则会发生异常; + * - 'r+': 打开文件用于读取和写入。 如果文件不存在,则会发生异常; + * - 'w': 打开文件用于写入。 如果文件不存在则创建文件,如果文件存在则截断文件; + * - 'wx': 类似于 'w',但如果路径存在,则失败; + * - 'w+': 打开文件用于读取和写入。 如果文件不存在则创建文件,如果文件存在则截断文件; + * - 'wx+': 类似于 'w+',但如果路径存在,则失败; */ + flag?: + | 'a' + | 'ax' + | 'a+' + | 'ax+' + | 'as' + | 'as+' + | 'r' + | 'r+' + | 'w' + | 'wx' + | 'w+' + | 'wx+'; + } + interface OpenSystemBluetoothSettingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenSystemBluetoothSettingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenSystemBluetoothSettingFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenSystemBluetoothSettingSuccessCallback; + } + interface OpenVideoEditorOption { + /** 视频源的路径,只支持本地路径 */ + filePath: string; + /** 需要基础库: `2.16.1` + * + * 视频裁剪的最大长度 */ + maxDuration: string; + /** 需要基础库: `2.16.1` + * + * 视频裁剪的最小长度 */ + minDuration: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: OpenVideoEditorCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: OpenVideoEditorFailCallback; + /** 接口调用成功的回调函数 */ + success?: OpenVideoEditorSuccessCallback; + } + interface OpenVideoEditorSuccessCallbackResult { + /** 剪辑后生成的视频文件的时长,单位毫秒(ms) */ + duration: number; + /** 剪辑后生成的视频文件大小,单位字节数(byte) */ + size: number; + /** 编辑后生成的视频文件的临时路径 */ + tempFilePath: string; + /** 编辑后生成的缩略图文件的临时路径 */ + tempThumbPath: string; + errMsg: string; + } + interface PageScrollToOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PageScrollToCompleteCallback; + /** 滚动动画的时长,单位 ms */ + duration?: number; + /** 接口调用失败的回调函数 */ + fail?: PageScrollToFailCallback; + /** 需要基础库: `2.23.1` + * + * 偏移距离,需要和 selector 参数搭配使用,可以滚动到 selector 加偏移距离的位置,单位 px */ + offsetTop?: number; + /** 滚动到页面的目标位置,单位 px */ + scrollTop?: number; + /** 需要基础库: `2.7.3` + * + * 选择器 */ + selector?: string; + /** 接口调用成功的回调函数 */ + success?: PageScrollToSuccessCallback; + } + interface PauseBGMOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PauseBGMCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PauseBGMFailCallback; + /** 接口调用成功的回调函数 */ + success?: PauseBGMSuccessCallback; + } + interface PauseBackgroundAudioOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PauseBackgroundAudioCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PauseBackgroundAudioFailCallback; + /** 接口调用成功的回调函数 */ + success?: PauseBackgroundAudioSuccessCallback; + } + interface PauseOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PauseCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PauseFailCallback; + /** 接口调用成功的回调函数 */ + success?: PauseSuccessCallback; + } + interface PauseVoiceOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PauseVoiceCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PauseVoiceFailCallback; + /** 接口调用成功的回调函数 */ + 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; + /** 需要基础库: `2.24.0` + * + * 解析域名开始时间。仅 resourceTiming 指标有效。 */ + domainLookupStart: number; + /** 耗时 ms。仅对于表示阶段的指标有效。 */ + duration: number; + /** 指标类型 + * + * 可选值: + * - 'navigation': 路由; + * - 'render': 渲染; + * - 'script': 脚本; */ + entryType: 'navigation' | 'render' | 'script'; + /** 需要基础库: `2.21.2` + * + * 注入文件列表。仅 evaluateScript 指标有效。 */ + fileList: string[]; + /** 需要基础库: `2.21.2` + * + * 首次渲染参数在渲染层收到的时间。仅 firstRender 指标有效。 */ + initDataRecvTime: number; + /** 需要基础库: `2.21.2` + * + * 首次渲染参数从逻辑层发出的时间。仅 firstRender 指标有效。 */ + initDataSendTime: number; + /** 需要基础库: `2.24.0` + * + * 初始化性能条目的资源类型。仅 resourceTiming 指标有效。 + * + * 可选值: + * - 'audio': 音频; + * - 'cover-image': cover-image 组件的图片; + * - 'image': 组件的图片; + * - 'open-data': 组件的图片; */ + initiatorType: 'audio' | 'cover-image' | 'image' | 'open-data'; + /** 分包名,主包表示为 __APP__ (2.21.2 开始)。仅 evaluateScript 指标有效。 */ + moduleName: string; + /** 指标名称 + * + * 可选值: + * - 'appLaunch': 小程序启动耗时。(entryType: navigation); + * - 'route': 路由处理耗时。(entryType: navigation); + * - 'firstRender': 页面首次渲染耗时。(entryType: render); + * - 'firstPaint': 页面首次绘制(FP)时间点,无 duration。(iOS 不支持)(entryType: render); + * - 'firstContentfulPaint': 页面首次内容绘制(FCP)时间点,无 duration。(iOS 14.5 以下版本不支持)(entryType: render); + * - 'largestContentfulPaint': 页面最大内容绘制(LCP)时间点,无 duration。(iOS 不支持)(entryType: render); + * - 'evaluateScript': 逻辑层 JS 代码注入耗时。(entryType: script); + * - 'downloadPackage': 代码包下载耗时。(entryType: loadPackage); + * - 'resourceTiming': 视图层资源加载耗时。(entryType: resource); */ + name: + | 'appLaunch' + | 'route' + | 'firstRender' + | 'firstPaint' + | 'firstContentfulPaint' + | 'largestContentfulPaint' + | 'evaluateScript' + | 'downloadPackage' + | 'resourceTiming'; + /** 路由真正响应开始时间。仅 navigation 类型指标有效。 */ + navigationStart: number; + /** 路由详细类型,与小程序路由方法对应。仅 navigation 类型指标有效。 */ + navigationType: string; + /** 需要基础库: `2.24.0` + * + * 代码包名称。仅 downloadPackage 指标有效。 */ + packageName: string; + /** 需要基础库: `2.24.0` + * + * 代码包大小。仅 downloadPackage 指标有效。 */ + packageSize: number; + /** 需要基础库: `2.23.1` + * + * path 对应页面实例 Id(随机生成,不保证递增)。仅 render/navigation 指标有效。 */ + pageId: number; + /** 页面路径。仅 render 和 navigation 类型指标有效。 */ + path: string; + /** 需要基础库: `2.23.1` + * + * referrerPath对应页面实例 Id(随机生成,不保证递增)。仅 route 指标有效。 */ + referrerPageId: number; + /** 需要基础库: `2.23.1` + * + * 页面跳转来源页面路径。仅 route 指标有效。 */ + referrerPath: number; + /** 开始时间,不同指标的具体含义会有差异。 */ + startTime: number; + /** 需要基础库: `2.24.0` + * + * 表示获取资源的大小(以八位字节为单位)的数字。仅 resourceTiming 指标有效。(iOS 不支持) */ + transferSize: number; + /** 需要基础库: `2.24.0` + * + * 资源路径。仅 resourceTiming 指标有效。 */ + uri: string; + /** 需要基础库: `2.21.2` + * + * 渲染层代码注入完成时间。仅 firstRender 指标有效。 */ + viewLayerReadyTime: number; + /** 需要基础库: `2.21.2` + * + * 渲染层执行渲染结束时间。仅 firstRender 指标有效。 */ + viewLayerRenderEndTime: number; + /** 需要基础库: `2.21.2` + * + * 渲染层执行渲染开始时间。仅 firstRender 指标有效。 */ + viewLayerRenderStartTime: number; + } + /** 需要基础库: `2.11.0` + * + * PerformanceObserver 对象,用于监听性能相关事件 */ + interface PerformanceObserver { + /** 获取当前支持的所有性能指标类型 */ + supportedEntryTypes: any[]; + /** [PerformanceObserver.disconnect()](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceObserver.disconnect.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 停止监听 */ + disconnect(): void; + /** [PerformanceObserver.observe(Object options)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceObserver.observe.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 开始监听 */ + observe( + /** 设置 type 监听单个类型的指标,设置 entryTypes 监听多个类型指标。 */ + options: ObserveOption + ): void; + } + /** 平面跟踪配置 */ + interface PlaneTrack { + /** 平面跟踪配置模式 + * + * 可选值: + * - 1: 检测横向平面; + * - 2: 检测纵向平面,只有 v2 版本支持; + * - 3: 检测横向和纵向平面,只有 v2 版本支持; */ + mode: 1 | 2 | 3; + } + interface PlayBGMOption { + /** 加入背景混音的资源地址 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PlayBGMCompleteCallback; + /** 需要基础库: `2.31.0` + * + * BGM结束播放时间点,单位ms,0代表播放至文件结尾,若入参为负或超过文件长度,则默认播放至文件结尾 */ + endTimeMs?: number; + /** 接口调用失败的回调函数 */ + fail?: PlayBGMFailCallback; + /** 需要基础库: `2.31.0` + * + * BGM开始播时间点,单位ms,若入参为负或超过文件长度,则默认从文件开头进行播放 */ + startTimeMs?: number; + /** 接口调用成功的回调函数 */ + success?: PlayBGMSuccessCallback; + } + interface PlayBackgroundAudioOption { + /** 音乐链接,目前支持的格式有 m4a, aac, mp3, wav */ + dataUrl: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PlayBackgroundAudioCompleteCallback; + /** 封面URL */ + coverImgUrl?: string; + /** 接口调用失败的回调函数 */ + fail?: PlayBackgroundAudioFailCallback; + /** 接口调用成功的回调函数 */ + success?: PlayBackgroundAudioSuccessCallback; + /** 音乐标题 */ + title?: string; + } + interface PlayOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PlayCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PlayFailCallback; + /** 接口调用成功的回调函数 */ + success?: PlaySuccessCallback; + } + interface PlayVoiceOption { + /** 需要播放的语音文件的文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PlayVoiceCompleteCallback; + /** 需要基础库: `1.6.0` + * + * 指定播放时长,到达指定的播放时长后会自动停止播放,单位:秒 */ + duration?: number; + /** 接口调用失败的回调函数 */ + fail?: PlayVoiceFailCallback; + /** 接口调用成功的回调函数 */ + success?: PlayVoiceSuccessCallback; + } + /** 插件账号信息(仅在插件中调用时包含这一项) */ + interface Plugin { + /** 插件 appId */ + appId: string; + /** 插件版本号 */ + version: string; + } + interface PluginLoginOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PluginLoginCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PluginLoginFailCallback; + /** 接口调用成功的回调函数 */ + 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; + } + interface PreDownloadSubpackageOption { + /** 分包加载结束回调事件(加载成功、失败都会执行) */ + complete: (...args: any[]) => any; + /** 分包加载失败回调事件 */ + fail: (...args: any[]) => any; + /** 分包的类型。目前仅支持填 "workers",表示 workers 分包。 */ + packageType: string; + /** 分包加载成功回调事件 */ + success: (...args: any[]) => any; + } + interface PreDownloadSubpackageTaskOnProgressUpdateListenerResult { + /** 分包下载进度百分比 */ + progress: number; + /** 预期需要下载的数据总长度,单位 Bytes */ + totalBytesExpectedToWrite: number; + /** 已经下载的数据长度,单位 Bytes */ + totalBytesWritten: number; + } + interface PreloadAssetsOption { + data: Asset[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PreloadAssetsCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PreloadAssetsFailCallback; + /** 接口调用成功的回调函数 */ + success?: PreloadAssetsSuccessCallback; + } + interface PreloadSkylineViewOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PreloadSkylineViewCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PreloadSkylineViewFailCallback; + /** 接口调用成功的回调函数 */ + success?: PreloadSkylineViewSuccessCallback; + } + interface PreloadWebviewOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PreloadWebviewCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: PreloadWebviewFailCallback; + /** 接口调用成功的回调函数 */ + success?: PreloadWebviewSuccessCallback; + } + interface PreviewImageOption { + /** 需要预览的图片链接列表。[2.2.3](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持云文件ID。 */ + urls: string[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PreviewImageCompleteCallback; + /** 当前显示图片的链接 */ + current?: string; + /** 接口调用失败的回调函数 */ + fail?: PreviewImageFailCallback; + /** 需要基础库: `2.13.0` + * + * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ + referrerPolicy?: string; + /** 需要基础库: `2.13.0` + * + * 是否显示长按菜单。 */ + showmenu?: boolean; + /** 接口调用成功的回调函数 */ + success?: PreviewImageSuccessCallback; + } + interface PreviewMediaOption { + /** 需要预览的资源列表 */ + sources: MediaSource[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: PreviewMediaCompleteCallback; + /** 当前显示的资源序号 */ + current?: number; + /** 接口调用失败的回调函数 */ + fail?: PreviewMediaFailCallback; + /** 需要基础库: `2.13.0` + * + * `origin`: 发送完整的referrer; `no-referrer`: 不发送。格式固定为 `https://servicewechat.com/{appid}/{version}/page-frame.html`,其中 {appid} 为小程序的 appid,{version} 为小程序的版本号,版本号为 0 表示为开发版、体验版以及审核版本,版本号为 devtools 表示为开发者工具,其余为正式版本; */ + referrerPolicy?: string; + /** 需要基础库: `2.13.0` + * + * 是否显示长按菜单。 */ + showmenu?: boolean; + /** 接口调用成功的回调函数 */ + success?: PreviewMediaSuccessCallback; + } + /** 推广员 */ + interface PromoterResult { + /** 推广员昵称 */ + finderNickname: string; + /** 推广员 id */ + promoterId: string; + /** 推广员 openid */ + promoterOpenId: string; + } + interface ReLaunchOption { + /** 需要跳转的应用内页面路径 (代码包路径),路径后可以带参数。参数与路径之间使用?分隔,参数键与参数值用=相连,不同参数用&分隔;如 'path?key=value&key2=value2' */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ReLaunchCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ReLaunchFailCallback; + /** 接口调用成功的回调函数 */ + success?: ReLaunchSuccessCallback; + } + interface ReadBLECharacteristicValueOption { + /** 蓝牙特征的 UUID */ + characteristicId: string; + /** 蓝牙设备 id */ + deviceId: string; + /** 蓝牙特征对应服务的 UUID */ + serviceId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ReadBLECharacteristicValueCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ReadBLECharacteristicValueFailCallback; + /** 接口调用成功的回调函数 */ + success?: ReadBLECharacteristicValueSuccessCallback; + } + interface ReadCompressedFileOption { + /** 文件压缩类型,目前仅支持 'br'。 + * + * 可选值: + * - 'br': brotli压缩文件; */ + compressionAlgorithm: 'br'; + /** 要读取的文件的路径 (本地用户文件或代码包文件) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ReadCompressedFileCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ReadCompressedFileFailCallback; + /** 接口调用成功的回调函数 */ + success?: ReadCompressedFileSuccessCallback; + } + interface ReadCompressedFileSuccessCallbackResult { + /** 文件内容 */ + data: ArrayBuffer; + errMsg: string; + } + interface ReadCompressedFileSyncOption { + /** 文件压缩类型,目前仅支持 'br'。 + * + * 可选值: + * - 'br': brotli压缩文件; */ + compressionAlgorithm: 'br'; + /** 要读取的文件的路径 (本地用户文件或代码包文件) */ + filePath: string; + } + interface ReadFileOption { + /** 要读取的文件的路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ReadFileCompleteCallback; + /** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 + * + * 可选值: + * - '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; + /** 需要基础库: `2.10.0` + * + * 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */ + length?: number; + /** 需要基础库: `2.10.0` + * + * 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte */ + position?: number; + /** 接口调用成功的回调函数 */ + success?: ReadFileSuccessCallback; + } + interface ReadFileSuccessCallbackResult { + /** 文件内容 */ + data: string | ArrayBuffer; + errMsg: string; + } + interface ReadOption { + /** 数据写入的缓冲区,必须是 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; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ReadCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ReadFailCallback; + /** 要从文件中读取的字节数,默认0 */ + length?: number; + /** 缓冲区中的写入偏移量,默认0 */ + offset?: number; + /** 文件读取的起始位置,如不传或传 null,则会从当前文件指针的位置读取。如果 position 是正整数,则文件指针位置会保持不变并从 position 读取文件。 */ + position?: number; + /** 接口调用成功的回调函数 */ + success?: ReadSuccessCallback; + } + /** 文件读取结果。 通过 [FileSystemManager.readSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readSync.html) 接口返回 */ + interface ReadResult { + /** 被写入的缓存区的对象,即接口入参的 arrayBuffer */ + arrayBuffer: ArrayBuffer; + /** 实际读取的字节数 */ + bytesRead: number; + } + interface ReadSuccessCallbackResult { + /** 被写入的缓存区的对象,即接口入参的 arrayBuffer */ + arrayBuffer: ArrayBuffer; + /** 实际读取的字节数 */ + bytesRead: number; + errMsg: string; + } + interface ReadSyncOption { + /** 数据写入的缓冲区,必须是 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; + /** 要从文件中读取的字节数,默认0 */ + length?: number; + /** 缓冲区中的写入偏移量,默认0 */ + offset?: number; + /** 文件读取的起始位置,如不传或传 null,则会从当前文件指针的位置读取。如果 position 是正整数,则文件指针位置会保持不变并从 position 读取文件。 */ + position?: number; + } + interface ReadZipEntryOption { + /** 要读取的压缩包内的文件列表(当传入"all" 时表示读取压缩包内所有文件) */ + entries: EntryItem[] | 'all'; + /** 要读取的压缩包的路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ReadZipEntryCompleteCallback; + /** 统一指定读取文件的字符编码,只在 entries 值为"all"时有效。如果 entries 值为"all"且不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 + * + * 可选值: + * - '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; + /** 接口调用成功的回调函数 */ + success?: ReadZipEntrySuccessCallback; + } + interface ReadZipEntrySuccessCallbackResult { + /** 文件读取结果。res.entries 是一个对象,key是文件路径,value是一个对象 FileItem ,表示该文件的读取结果。每个 FileItem 包含 data (文件内容) 和 errMsg (错误信息) 属性。 */ + entries: EntriesResult; + errMsg: string; + } + interface ReaddirOption { + /** 要读取的目录路径 (本地路径) */ + dirPath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ReaddirCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ReaddirFailCallback; + /** 接口调用成功的回调函数 */ + success?: ReaddirSuccessCallback; + } + interface ReaddirSuccessCallbackResult { + /** 指定目录下的文件名数组。 */ + files: string[]; + errMsg: string; + } + interface ReconnectCastingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ReconnectCastingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ReconnectCastingFailCallback; + /** 接口调用成功的回调函数 */ + success?: ReconnectCastingSuccessCallback; + } + interface RecorderManagerStartOption { + /** 需要基础库: `2.1.0` + * + * 指定录音的音频输入源,可通过 [wx.getAvailableAudioSources()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.getAvailableAudioSources.html) 获取当前可用的音频源 + * + * 可选值: + * - 'auto': 自动设置,默认使用手机麦克风,插上耳麦后自动切换使用耳机麦克风,所有平台适用; + * - 'buildInMic': 手机麦克风,仅限 iOS; + * - 'headsetMic': 有线耳机麦克风,仅限 iOS; + * - 'mic': 麦克风(没插耳麦时是手机麦克风,插耳麦时是耳机麦克风),仅限 Android; + * - 'camcorder': 同 mic,适用于录制音视频内容,仅限 Android; + * - 'voice_communication': 同 mic,适用于实时沟通,仅限 Android; + * - 'voice_recognition': 同 mic,适用于语音识别,仅限 Android; */ + audioSource?: + | 'auto' + | 'buildInMic' + | 'headsetMic' + | 'mic' + | 'camcorder' + | 'voice_communication' + | 'voice_recognition'; + /** 录音的时长,单位 ms,最大值 600000(10 分钟) */ + duration?: number; + /** 编码码率,有效值见下表格 */ + encodeBitRate?: number; + /** 音频格式 + * + * 可选值: + * - 'mp3': mp3 格式; + * - 'aac': aac 格式; + * - 'wav': wav 格式; + * - 'PCM': pcm 格式; */ + format?: 'mp3' | 'aac' | 'wav' | 'PCM'; + /** 指定帧大小,单位 KB。传入 frameSize 后,每录制指定帧大小的内容后,会回调录制的文件内容,不指定则不会回调。暂仅支持 mp3、pcm 格式。 */ + frameSize?: number; + /** 录音通道数 + * + * 可选值: + * - 1: 1 个通道; + * - 2: 2 个通道; */ + numberOfChannels?: 1 | 2; + /** 采样率(pc不支持) + * + * 可选值: + * - 8000: 8000 采样率; + * - 11025: 11025 采样率; + * - 12000: 12000 采样率; + * - 16000: 16000 采样率; + * - 22050: 22050 采样率; + * - 24000: 24000 采样率; + * - 32000: 32000 采样率; + * - 44100: 44100 采样率; + * - 48000: 48000 采样率; */ + sampleRate?: + | 8000 + | 11025 + | 12000 + | 16000 + | 22050 + | 24000 + | 32000 + | 44100 + | 48000; + } + interface RedirectToOption { + /** 需要跳转的应用内非 tabBar 的页面的路径 (代码包路径), 路径后可以带参数。参数与路径之间使用 `?` 分隔,参数键与参数值用 `=` 相连,不同参数用 `&` 分隔;如 'path?key=value&key2=value2' */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RedirectToCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RedirectToFailCallback; + /** 接口调用成功的回调函数 */ + success?: RedirectToSuccessCallback; + } + interface RedoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RedoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RedoFailCallback; + /** 接口调用成功的回调函数 */ + success?: RedoSuccessCallback; + } + /** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */ + interface ReferrerInfo { + /** 来源小程序、公众号或 App 的 appId */ + appId: string; + /** 来源小程序传过来的数据,scene=1037或1038时支持 */ + extraData: IAnyObject; + } + /** 参照区域的边界 */ + interface RelativeRectResult { + /** 下边界 */ + bottom: number; + /** 左边界 */ + left: number; + /** 右边界 */ + right: number; + /** 上边界 */ + top: number; + } + /** 发送端地址信息 */ + interface RemoteInfo { + /** 发送消息的 socket 的地址 */ + address: string; + /** 使用的协议族,为 IPv4 或者 IPv6 */ + family: string; + /** 端口号 */ + port: number; + /** message 的大小,单位:字节 */ + size: number; + } + interface RemoveArcOption { + /** 圆弧 id */ + id: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveArcCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveArcFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveArcSuccessCallback; + } + interface RemoveCustomLayerOption { + /** 个性化图层id */ + layerId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveCustomLayerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveCustomLayerFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveCustomLayerSuccessCallback; + } + interface RemoveFormatOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveFormatCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveFormatFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveFormatSuccessCallback; + } + interface RemoveGroundOverlayOption { + /** 图片图层 id */ + id: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveGroundOverlayCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveGroundOverlayFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveGroundOverlaySuccessCallback; + } + interface RemoveMarkersOption { + /** marker 的 id 集合。 */ + markerIds: any[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveMarkersCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveMarkersFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveMarkersSuccessCallback; + } + interface RemoveSavedFileOption { + /** 需要删除的文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveSavedFileCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveSavedFileFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveSavedFileSuccessCallback; + } + interface RemoveServiceOption { + /** service 的 UUID */ + serviceId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveServiceCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveServiceFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveServiceSuccessCallback; + } + interface RemoveStorageOption { + /** 本地缓存中指定的 key */ + key: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveStorageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveStorageFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveStorageSuccessCallback; + } + interface RemoveTabBarBadgeOption { + /** tabBar 的哪一项,从左边算起 */ + index: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveTabBarBadgeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveTabBarBadgeFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveTabBarBadgeSuccessCallback; + } + interface RemoveVisualLayerOption { + /** 可视化图层id */ + layerId: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RemoveVisualLayerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RemoveVisualLayerFailCallback; + /** 接口调用成功的回调函数 */ + success?: RemoveVisualLayerSuccessCallback; + } + interface RenameOption { + /** 新文件路径,支持本地路径 */ + newPath: string; + /** 源文件路径,支持本地路径 */ + oldPath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RenameCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RenameFailCallback; + /** 接口调用成功的回调函数 */ + success?: RenameSuccessCallback; + } + /** Canvas 绘图上下文。 + * + * **** + * + * - 通过 Canvas.getContext('2d') 接口可以获取 CanvasRenderingContext2D 对象,实现了 [HTML Canvas 2D Context](https://www.w3.org/TR/2dcontext/) 定义的属性、方法。 + * - 通过 Canvas.getContext('webgl') 或 OffscreenCanvas.getContext('webgl') 接口可以获取 WebGLRenderingContext 对象,实现了 [WebGL 1.0](https://www.khronos.org/registry/webgl/specs/latest/1.0/) 定义的所有属性、方法、常量。 + * - CanvasRenderingContext2D 的 drawImage 方法 2.10.0 起支持传入通过 [SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) 获取的 video 对象,2.29.0 起支持传入开启了自定义渲染的 [LivePusherContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.html) 对象。 + * + * **示例代码** + * + * video 画到 2D Canvas 示例 + * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/tJTak7mU7sfX) */ + interface RenderingContext {} + interface RequestDeviceVoIPOption { + /** 设备名称,将显示在授权弹窗内(长度不超过13)。授权框中「设备名字」= 「deviceName」 + 「modelId 对应设备型号」。 */ + deviceName: string; + /** 需要基础库: `2.30.4` + * + * 设备组的唯一标识 id 。isGroup 为 true 时只需要传该参数,isGroup 为 false 时不需要传该参数,但需要传 sn、snTicket、modelId、deviceName 。 */ + groupId: string; + /** 设备型号 id。通过微信公众平台注册设备获得。 */ + modelId: string; + /** 设备唯一序列号。由厂商分配,长度不能超过128字节。字符只接受数字,大小写字母,下划线(_)和连字符(-)。 */ + sn: string; + /** [设备票据](https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/hardware-device/getSnTicket.html),5分钟内有效。 */ + snTicket: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestDeviceVoIPCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RequestDeviceVoIPFailCallback; + /** 需要基础库: `2.30.4` + * + * 是否为授权设备组,默认 false 。 */ + isGroup?: boolean; + /** 接口调用成功的回调函数 */ + success?: RequestDeviceVoIPSuccessCallback; + } + /** 需要基础库: `3.0.0` + * + * 网络请求过程中的一些异常信息,例如httpdns重试等 */ + interface RequestException { + /** 本次请求底层失败信息,所有失败信息均符合Errno错误码 */ + reasons: ExceptionReason; + /** 本次请求底层重试次数 */ + retryCount: number; + } + interface RequestFailCallbackErr { + /** 错误信息 */ + errMsg: string; + /** 需要基础库: `2.24.0` + * + * errno 错误码,错误码的详细说明参考 [Errno错误码](https://developers.weixin.qq.com/miniprogram/dev/framework/usability/PublicErrno.html) */ + errno: number; + } + interface RequestOption< + T extends string | IAnyObject | ArrayBuffer = + | string + | IAnyObject + | ArrayBuffer + > { + /** 开发者服务器接口地址 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestCompleteCallback; + /** 请求的参数 */ + data?: string | IAnyObject | ArrayBuffer; + /** 返回的数据格式 + * + * 可选值: + * - 'json': 返回的数据为 JSON,返回后会对返回的数据进行一次 JSON.parse; + * - '其他': 不对返回的内容进行 JSON.parse; */ + dataType?: 'json' | '其他'; + /** 需要基础库: `2.10.4` + * + * 开启 cache */ + enableCache?: boolean; + /** 需要基础库: `2.20.2` + * + * 开启 transfer-encoding chunked。 */ + enableChunked?: boolean; + /** 需要基础库: `2.10.4` + * + * 开启 http2 */ + enableHttp2?: boolean; + /** 需要基础库: `2.19.1` + * + * 是否开启 HttpDNS 服务。如开启,需要同时填入 httpDNSServiceId 。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html) */ + enableHttpDNS?: boolean; + /** 需要基础库: `2.10.4` + * + * 开启 quic */ + enableQuic?: boolean; + /** 接口调用失败的回调函数 */ + fail?: RequestFailCallback; + /** 需要基础库: `2.21.0` + * + * 强制使用蜂窝网络发送请求 */ + forceCellularNetwork?: boolean; + /** 设置请求的 header,header 中不能设置 Referer。 + * + * `content-type` 默认为 `application/json` */ + header?: IAnyObject; + /** 需要基础库: `2.19.1` + * + * HttpDNS 服务商 Id。 HttpDNS 用法详见 [移动解析HttpDNS](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/HTTPDNS.html) */ + httpDNSServiceId?: string; + /** HTTP 请求方法 + * + * 可选值: + * - 'OPTIONS': HTTP 请求 OPTIONS; + * - 'GET': HTTP 请求 GET; + * - 'HEAD': HTTP 请求 HEAD; + * - 'POST': HTTP 请求 POST; + * - 'PUT': HTTP 请求 PUT; + * - 'DELETE': HTTP 请求 DELETE; + * - 'TRACE': HTTP 请求 TRACE; + * - 'CONNECT': HTTP 请求 CONNECT; */ + method?: + | 'OPTIONS' + | 'GET' + | 'HEAD' + | 'POST' + | 'PUT' + | 'DELETE' + | 'TRACE' + | 'CONNECT'; + /** 需要基础库: `1.7.0` + * + * 响应的数据类型 + * + * 可选值: + * - 'text': 响应的数据为文本; + * - 'arraybuffer': 响应的数据为 ArrayBuffer; */ + responseType?: 'text' | 'arraybuffer'; + /** 接口调用成功的回调函数 */ + success?: RequestSuccessCallback; + /** 需要基础库: `2.10.0` + * + * 超时时间,单位为毫秒。默认值为 60000 */ + timeout?: number; + } + interface RequestOrderPaymentOption { + /** 随机字符串,长度为32个字符以下 */ + nonceStr: string; + /** 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=*** */ + package: string; + /** 签名,具体见微信支付文档 */ + paySign: string; + /** 时间戳,从 1970 年 1 月 1 日 00:00:00 至今的秒数,即当前的时间 */ + timeStamp: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestOrderPaymentCompleteCallback; + /** 外部APP用户ID */ + extUserUin?: string; + /** 接口调用失败的回调函数 */ + fail?: RequestOrderPaymentFailCallback; + /** 订单信息,仅在需要校验的场景下需要传递,具体见[接口说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/API/order/requestOrderPayment) */ + orderInfo?: IAnyObject; + /** 签名算法,应与后台下单时的值一致 + * + * 可选值: + * - 'MD5': 仅在 v2 版本接口适用; + * - 'HMAC-SHA256': 仅在 v2 版本接口适用; + * - 'RSA': 仅在 v3 版本接口适用; */ + signType?: 'MD5' | 'HMAC-SHA256' | 'RSA'; + /** 接口调用成功的回调函数 */ + success?: RequestOrderPaymentSuccessCallback; + } + interface RequestPaymentOption { + /** 随机字符串,长度为32个字符以下 */ + nonceStr: string; + /** 统一下单接口返回的 prepay_id 参数值,提交格式如:prepay_id=*** */ + package: string; + /** 签名,具体见微信支付文档 */ + paySign: string; + /** 时间戳,从 1970 年 1 月 1 日 00:00:00 至今的秒数,即当前的时间 */ + timeStamp: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestPaymentCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RequestPaymentFailCallback; + /** 签名算法,应与后台下单时的值一致 + * + * 可选值: + * - 'MD5': 仅在 v2 版本接口适用; + * - 'HMAC-SHA256': 仅在 v2 版本接口适用; + * - 'RSA': 仅在 v3 版本接口适用; */ + signType?: 'MD5' | 'HMAC-SHA256' | 'RSA'; + /** 接口调用成功的回调函数 */ + success?: RequestPaymentSuccessCallback; + } + interface RequestPictureInPictureOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestPictureInPictureCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RequestPictureInPictureFailCallback; + /** 接口调用成功的回调函数 */ + success?: RequestPictureInPictureSuccessCallback; + } + interface RequestPluginPaymentOption { + /** 需要显示在页面中的金额,单位为分 */ + fee: number; + /** 任意数据,传递给功能页中的响应函数 */ + paymentArgs: IAnyObject; + /** 插件版本 + * + * 可选值: + * - 'develop': 开发版; + * - 'trial': 体验版; + * - 'release': 正式版; */ + version: 'develop' | 'trial' | 'release'; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestPluginPaymentCompleteCallback; + /** 需要显示在页面中的货币符号的代码 */ + currencyType?: string; + /** 接口调用失败的回调函数 */ + fail?: RequestPluginPaymentFailCallback; + /** 接口调用成功的回调函数 */ + success?: RequestPluginPaymentSuccessCallback; + } + /** 需要基础库: `2.10.4` + * + * 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) */ + interface RequestProfile { + /** SSL建立完成的时间,如果不是安全连接,则值为 0 */ + SSLconnectionEnd: number; + /** SSL建立连接的时间,如果不是安全连接,则值为 0 */ + SSLconnectionStart: number; + /** HTTP(TCP) 完成建立连接的时间(完成握手),如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接完成的时间。注意这里握手结束,包括安全连接建立完成、SOCKS 授权通过 */ + connectEnd: number; + /** HTTP(TCP) 开始建立连接的时间,如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接开始的时间 */ + connectStart: number; + /** DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 */ + domainLookUpEnd: number; + /** DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 */ + domainLookUpStart: number; + /** 评估当前网络下载的kbps */ + downstreamThroughputKbpsEstimate: number; + /** 评估的网络状态 unknown, offline, slow 2g, 2g, 3g, 4g, last/0, 1, 2, 3, 4, 5, 6 */ + estimate_nettype: number; + /** 组件准备好使用 HTTP 请求抓取资源的时间,这发生在检查本地缓存之前 */ + fetchStart: number; + /** 协议层根据多个请求评估当前网络的 rtt(仅供参考) */ + httpRttEstimate: number; + /** 当前请求的IP */ + peerIP: string; + /** 当前请求的端口 */ + port: number; + /** 使用协议类型,有效值:http1.1, h2, quic, unknown */ + protocol: string; + /** 收到字节数 */ + receivedBytedCount: number; + /** 最后一个 HTTP 重定向完成时的时间。有跳转且是同域名内部的重定向才算,否则值为 0 */ + redirectEnd: number; + /** 第一个 HTTP 重定向发生时的时间。有跳转且是同域名内的重定向才算,否则值为 0 */ + redirectStart: number; + /** HTTP请求读取真实文档结束的时间 */ + requestEnd: number; + /** HTTP请求读取真实文档开始的时间(完成建立连接),包括从本地读取缓存。连接错误重连时,这里显示的也是新建立连接的时间 */ + requestStart: number; + /** HTTP 响应全部接收完成的时间(获取到最后一个字节),包括从本地读取缓存 */ + responseEnd: number; + /** HTTP 开始接收响应的时间(获取到第一个字节),包括从本地读取缓存 */ + responseStart: number; + /** 当次请求连接过程中实时 rtt */ + rtt: number; + /** 发送的字节数 */ + sendBytesCount: number; + /** 是否复用连接 */ + socketReused: boolean; + /** 当前网络的实际下载kbps */ + throughputKbps: number; + /** 传输层根据多个请求评估的当前网络的 rtt(仅供参考) */ + transportRttEstimate: number; + } + interface RequestSubscribeDeviceMessageFailCallbackResult { + /** 接口调用失败错误码,有可能为空 */ + errCode: number; + /** 接口调用失败错误信息 */ + errMsg: string; + } + interface RequestSubscribeDeviceMessageOption { + /** 设备型号 id 。通过微信公众平台注册设备获得。 */ + modelId: string; + /** 设备唯一序列号。由厂商分配,长度不能超过128字节。字符只接受数字,大小写字母,下划线(_)和连字符(-)。 */ + sn: string; + /** 设备票据,5分钟内有效。 */ + snTicket: string; + /** 需要订阅的消息模板的 id 的集合,一次调用最多可订阅3条消息 */ + tmplIds: any[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestSubscribeDeviceMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RequestSubscribeDeviceMessageFailCallback; + /** 接口调用成功的回调函数 */ + 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; + /** 接口调用成功时errMsg值为'requestSubscribeDeviceMessage:ok' */ + errMsg: string; + } + interface RequestSubscribeMessageFailCallbackResult { + /** 接口调用失败错误码 */ + errCode: number; + /** 接口调用失败错误信息 */ + 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[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestSubscribeMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RequestSubscribeMessageFailCallback; + /** 接口调用成功的回调函数 */ + 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; + /** 接口调用成功时errMsg值为'requestSubscribeMessage:ok' */ + errMsg: string; + } + interface RequestSuccessCallbackResult< + T extends string | IAnyObject | ArrayBuffer = + | string + | IAnyObject + | ArrayBuffer + > { + /** 需要基础库: `2.10.0` + * + * 开发者服务器返回的 cookies,格式为字符串数组 */ + cookies: string[]; + /** 开发者服务器返回的数据 */ + data: T; + /** 需要基础库: `3.0.0` + * + * 网络请求过程中的一些异常信息,例如httpdns重试等 */ + exception: RequestException; + /** 需要基础库: `1.2.0` + * + * 开发者服务器返回的 HTTP Response Header */ + header: IAnyObject; + /** 需要基础库: `2.10.4` + * + * 网络请求过程中一些调试信息,[查看详细说明](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/network.html) */ + profile: RequestProfile; + /** 开发者服务器返回的 HTTP 状态码 */ + statusCode: number; + errMsg: string; + } + interface RequestVirtualPaymentFailCallbackErr { + /** 错误码 */ + errCode: number; + /** 错误信息 */ + errMsg: string; + } + interface RequestVirtualPaymentOption { + /** 支付的类型, 不同的支付类型有各自额外要传的附加参数 + * + * 可选值: + * - '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; + /** 具体支付参数见signData, 该参数需以string形式传递, 例如signData: '{"offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","platform":"android","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}' */ + signData: SignData; + /** 用户态签名, 详见[《签名详解》](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html) */ + signature: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequestVirtualPaymentCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RequestVirtualPaymentFailCallback; + /** 接口调用成功的回调函数 */ + success?: RequestVirtualPaymentSuccessCallback; + } + interface RequestVirtualPaymentSuccessCallbackResult { + /** 调用成功信息 */ + errMsg: string; + } + interface RequirePrivacyAuthorizeOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RequirePrivacyAuthorizeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RequirePrivacyAuthorizeFailCallback; + /** 接口调用成功的回调函数 */ + success?: RequirePrivacyAuthorizeSuccessCallback; + } + interface ReserveChannelsLiveOption { + /** 预告 id,通过 getChannelsLiveNoticeInfo 接口获取 */ + noticeId: string; + } + interface RestartMiniProgramOption { + /** 打开的页面路径,path 中 ? 后面的部分会成为 query */ + path: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RestartMiniProgramCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RestartMiniProgramFailCallback; + /** 接口调用成功的回调函数 */ + success?: RestartMiniProgramSuccessCallback; + } + interface ResumeBGMOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ResumeBGMCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ResumeBGMFailCallback; + /** 接口调用成功的回调函数 */ + success?: ResumeBGMSuccessCallback; + } + interface ResumeOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ResumeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ResumeFailCallback; + /** 接口调用成功的回调函数 */ + success?: ResumeSuccessCallback; + } + interface RewardedVideoAdOnCloseListenerResult { + /** 需要基础库: `2.1.0` + * + * 视频是否是在用户完整观看的情况下被关闭的 */ + isEnded: boolean; + } + interface RewardedVideoAdOnErrorListenerResult { + /** 需要基础库: `2.2.2` + * + * 错误码 + * + * 可选值: + * - 1000: 后端接口调用失败; + * - 1001: 参数错误; + * - 1002: 广告单元无效; + * - 1003: 内部错误; + * - 1004: 无合适的广告; + * - 1005: 广告组件审核中; + * - 1006: 广告组件被驳回; + * - 1007: 广告组件被封禁; + * - 1008: 广告单元已关闭; */ + errCode: 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008; + /** 错误信息 */ + errMsg: string; + } + interface RmdirOption { + /** 要删除的目录路径 (本地路径) */ + dirPath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: RmdirCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: RmdirFailCallback; + /** 需要基础库: `2.3.0` + * + * 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 */ + recursive?: boolean; + /** 接口调用成功的回调函数 */ + success?: RmdirSuccessCallback; + } + interface RunOCROption { + /** 待识别图像的像素点数据,每四项表示一个像素点的 RGBA */ + frameBuffer: ArrayBuffer; + /** 图像高度 */ + height: number; + /** 图像宽度 */ + width: number; + } + interface SafeArea { + /** 安全区域右下角纵坐标 */ + bottom: number; + /** 安全区域的高度,单位逻辑像素 */ + height: number; + /** 安全区域左上角横坐标 */ + left: number; + /** 安全区域右下角横坐标 */ + right: number; + /** 安全区域左上角纵坐标 */ + top: number; + /** 安全区域的宽度,单位逻辑像素 */ + width: number; + } + interface SaveFileOption { + /** 临时存储文件路径 (本地路径) */ + tempFilePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SaveFileCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SaveFileFailCallback; + /** 要存储的文件路径 (本地路径) */ + filePath?: string; + /** 接口调用成功的回调函数 */ + success?: SaveFileSuccessCallback; + } + interface SaveFileSuccessCallbackResult { + /** 存储后的文件路径 (本地路径) */ + savedFilePath: string; + errMsg: string; + } + interface SaveFileToDiskOption { + /** 待保存文件路径 */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SaveFileToDiskCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SaveFileToDiskFailCallback; + /** 接口调用成功的回调函数 */ + success?: SaveFileToDiskSuccessCallback; + } + interface SaveImageToPhotosAlbumOption { + /** 图片文件路径,可以是临时文件路径或永久文件路径 (本地路径) ,不支持网络路径 */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SaveImageToPhotosAlbumCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SaveImageToPhotosAlbumFailCallback; + /** 接口调用成功的回调函数 */ + success?: SaveImageToPhotosAlbumSuccessCallback; + } + interface SaveVideoToPhotosAlbumOption { + /** 视频文件路径,可以是临时文件路径也可以是永久文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SaveVideoToPhotosAlbumCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SaveVideoToPhotosAlbumFailCallback; + /** 接口调用成功的回调函数 */ + success?: SaveVideoToPhotosAlbumSuccessCallback; + } + interface ScanCodeOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ScanCodeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ScanCodeFailCallback; + /** 需要基础库: `1.2.0` + * + * 是否只能从相机扫码,不允许从相册选择图片 */ + onlyFromCamera?: boolean; + /** 需要基础库: `1.7.0` + * + * 扫码类型 + * + * 可选值: + * - 'barCode': 一维码; + * - 'qrCode': 二维码; + * - 'datamatrix': Data Matrix 码; + * - 'pdf417': PDF417 条码; */ + scanType?: Array<'barCode' | 'qrCode' | 'datamatrix' | 'pdf417'>; + /** 接口调用成功的回调函数 */ + success?: ScanCodeSuccessCallback; + } + interface ScanCodeSuccessCallbackResult { + /** 所扫码的字符集 */ + charSet: string; + /** 当所扫的码为当前小程序二维码时,会返回此字段,内容为二维码携带的 path */ + path: string; + /** 原始数据,base64编码 */ + rawData: string; + /** 所扫码的内容 */ + result: string; + /** 所扫码的类型 + * + * 可选值: + * - 'QR_CODE': 二维码; + * - 'AZTEC': 一维码; + * - 'CODABAR': 一维码; + * - 'CODE_39': 一维码; + * - 'CODE_93': 一维码; + * - 'CODE_128': 一维码; + * - 'DATA_MATRIX': 二维码; + * - 'EAN_8': 一维码; + * - 'EAN_13': 一维码; + * - 'ITF': 一维码; + * - 'MAXICODE': 一维码; + * - 'PDF_417': 二维码; + * - 'RSS_14': 一维码; + * - 'RSS_EXPANDED': 一维码; + * - 'UPC_A': 一维码; + * - 'UPC_E': 一维码; + * - 'UPC_EAN_EXTENSION': 一维码; + * - 'WX_CODE': 二维码; + * - 'CODE_25': 一维码; */ + scanType: + | 'QR_CODE' + | 'AZTEC' + | 'CODABAR' + | 'CODE_39' + | 'CODE_93' + | 'CODE_128' + | 'DATA_MATRIX' + | 'EAN_8' + | 'EAN_13' + | 'ITF' + | 'MAXICODE' + | 'PDF_417' + | 'RSS_14' + | 'RSS_EXPANDED' + | 'UPC_A' + | 'UPC_E' + | 'UPC_EAN_EXTENSION' + | 'WX_CODE' + | 'CODE_25'; + errMsg: string; + } + interface ScrollOffsetCallbackResult { + /** 节点的 dataset */ + dataset: IAnyObject; + /** 节点的 ID */ + id: string; + /** 节点的水平滚动位置 */ + scrollLeft: number; + /** 节点的竖直滚动位置 */ + scrollTop: number; + } + interface ScrollToOption { + /** 是否启用滚动动画 */ + animated?: boolean; + /** 滚动动画时长 (仅在 iOS 下生效) */ + duration?: number; + /** 左边界距离 */ + left?: number; + /** 顶部距离 */ + top?: number; + /** 初始速度 (仅在 iOS 下生效) */ + velocity?: number; + } + /** 需要基础库: `2.14.4` +* +* 增强 ScrollView 实例,可通过 [wx.createSelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createSelectorQuery.html) 的 [NodesRef.node](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/NodesRef.node.html) 方法获取。 仅在 scroll-view 组件开启 enhanced 属性后生效。 +* +* **示例代码** +* +* ```js +wx.createSelectorQuery() + .select('#scrollview') + .node() + .exec((res) => { + const scrollView = res[0].node; + scrollView.scrollEnabled = false; + }) +``` */ + interface ScrollViewContext { + /** 设置滚动边界弹性 (仅在 iOS 下生效) */ + bounces: boolean; + /** 取消滚动惯性 (仅在 iOS 下生效) */ + decelerationDisabled: boolean; + /** 设置滚动减速速率 (仅在 iOS 下生效) */ + fastDeceleration: boolean; + /** 分页滑动开关 */ + pagingEnabled: boolean; + /** 滚动开关 */ + scrollEnabled: boolean; + /** 设置是否显示滚动条 */ + showScrollbar: boolean; + /** [ScrollViewContext.closeRefresh()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.closeRefresh.html) + * + * 需要基础库: `3.0.0` + * + * 在插件中使用:支持 + * + * 关闭下拉刷新。 */ + closeRefresh(): void; + /** [ScrollViewContext.closeTwoLevel(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.closeTwoLevel.html) + * + * 需要基础库: `3.0.0` + * + * 在插件中使用:支持 + * + * 关闭下拉二级。 */ + closeTwoLevel(option: TriggerRefreshOption): void; + /** [ScrollViewContext.scrollIntoView(string selector)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.scrollIntoView.html) + * + * 需要基础库: `2.14.4` + * + * 在插件中使用:支持 + * + * 滚动至指定位置 */ + scrollIntoView( + /** 元素选择器 */ + selector: string + ): void; + /** [ScrollViewContext.scrollTo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.scrollTo.html) + * + * 需要基础库: `2.14.4` + * + * 在插件中使用:支持 + * + * 滚动至指定位置 */ + scrollTo(option: ScrollToOption): void; + /** [ScrollViewContext.triggerRefresh(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.triggerRefresh.html) + * + * 需要基础库: `3.0.0` + * + * 在插件中使用:支持 + * + * 触发下拉刷新。 */ + triggerRefresh(option: TriggerRefreshOption): void; + /** [ScrollViewContext.triggerTwoLevel(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.triggerTwoLevel.html) + * + * 需要基础库: `3.0.0` + * + * 在插件中使用:支持 + * + * 触发下拉二级。 */ + triggerTwoLevel(option: TriggerRefreshOption): void; + } + interface SeekBackgroundAudioOption { + /** 音乐位置,单位:秒 */ + position: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SeekBackgroundAudioCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SeekBackgroundAudioFailCallback; + /** 接口调用成功的回调函数 */ + success?: SeekBackgroundAudioSuccessCallback; + } + interface SendHCEMessageOption { + /** 二进制数据 */ + data: ArrayBuffer; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SendHCEMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SendHCEMessageFailCallback; + /** 接口调用成功的回调函数 */ + success?: SendHCEMessageSuccessCallback; + } + interface SendMessageOption { + /** SEI消息 */ + msg: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SendMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SendMessageFailCallback; + /** 接口调用成功的回调函数 */ + success?: SendMessageSuccessCallback; + } + interface SendSmsOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SendSmsCompleteCallback; + /** 预填到发送短信面板的内容 */ + content?: string; + /** 接口调用失败的回调函数 */ + fail?: SendSmsFailCallback; + /** 预填到发送短信面板的手机号 */ + phoneNumber?: string; + /** 接口调用成功的回调函数 */ + success?: SendSmsSuccessCallback; + } + interface SendSocketMessageOption { + /** 需要发送的内容 */ + data: string | ArrayBuffer; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SendSocketMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SendSocketMessageFailCallback; + /** 接口调用成功的回调函数 */ + success?: SendSocketMessageSuccessCallback; + } + interface SetBGMVolumeOption { + /** 音量大小,范围是 0-1 */ + volume: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetBGMVolumeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetBGMVolumeFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetBGMVolumeSuccessCallback; + } + interface SetBLEMTUFailCallbackResult { + /** 最终协商的 MTU 值。如果协商失败则无此参数。安卓客户端 8.0.9 开始支持。 */ + mtu: number; + } + interface SetBLEMTUOption { + /** 蓝牙设备 id */ + deviceId: string; + /** 最大传输单元。设置范围为 (22,512) 区间内,单位 bytes */ + mtu: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetBLEMTUCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetBLEMTUFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetBLEMTUSuccessCallback; + } + interface SetBLEMTUSuccessCallbackResult { + /** 最终协商的 MTU 值,与传入参数一致。安卓客户端 8.0.9 开始支持。 */ + mtu: number; + errMsg: string; + } + interface SetBackgroundColorOption { + /** 窗口的背景色,必须为十六进制颜色值 */ + backgroundColor?: string; + /** 底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 */ + backgroundColorBottom?: string; + /** 顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持 */ + backgroundColorTop?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetBackgroundColorCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetBackgroundColorFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetBackgroundColorSuccessCallback; + } + interface SetBackgroundFetchTokenOption { + /** 自定义的登录态 */ + token: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetBackgroundFetchTokenCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetBackgroundFetchTokenFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetBackgroundFetchTokenSuccessCallback; + } + interface SetBackgroundTextStyleOption { + /** 下拉背景字体、loading 图的样式。 + * + * 可选值: + * - 'dark': dark 样式; + * - 'light': light 样式; */ + textStyle: 'dark' | 'light'; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetBackgroundTextStyleCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetBackgroundTextStyleFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetBackgroundTextStyleSuccessCallback; + } + interface SetBoundaryOption { + /** 东北角经纬度 */ + northeast: MapPostion; + /** 西南角经纬度 */ + southwest: MapPostion; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetBoundaryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetBoundaryFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetBoundarySuccessCallback; + } + interface SetCenterOffsetOption { + /** 偏移量,两位数组 */ + offset: number[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetCenterOffsetCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetCenterOffsetFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetCenterOffsetSuccessCallback; + } + interface SetClipboardDataOption { + /** 剪贴板的内容 */ + data: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetClipboardDataCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetClipboardDataFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetClipboardDataSuccessCallback; + } + interface SetContentsOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetContentsCompleteCallback; + /** 表示内容的delta对象 */ + delta?: IAnyObject; + /** 接口调用失败的回调函数 */ + fail?: SetContentsFailCallback; + /** 带标签的HTML内容 */ + html?: string; + /** 接口调用成功的回调函数 */ + success?: SetContentsSuccessCallback; + } + interface SetEnable1v1ChatOption { + /** 是否开启 */ + enable: boolean; + /** 窗口背景色(音频通话背景以及小窗模式背景) + * + * 可选值: + * - 0: #262930; + * - 1: #FA5151; + * - 2: #FA9D3B; + * - 3: #3D7257; + * - 4: #1485EE; + * - 5: #6467F0; */ + backgroundType?: 0 | 1 | 2 | 3 | 4 | 5; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetEnable1v1ChatCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetEnable1v1ChatFailCallback; + /** 小窗样式 */ + minWindowType?: number; + /** 接口调用成功的回调函数 */ + success?: SetEnable1v1ChatSuccessCallback; + } + interface SetEnableDebugOption { + /** 是否打开调试 */ + enableDebug: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetEnableDebugCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetEnableDebugFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetEnableDebugSuccessCallback; + } + interface SetInnerAudioOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetInnerAudioOptionCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetInnerAudioOptionFailCallback; + /** 是否与其他音频混播,设置为 true 之后,不会终止其他应用或微信内的音乐 */ + mixWithOther?: boolean; + /** (仅在 iOS 生效)是否遵循静音开关,设置为 false 之后,即使是在静音模式下,也能播放声音 */ + obeyMuteSwitch?: boolean; + /** true 代表用扬声器播放,false 代表听筒播放,默认值为 true。 */ + speakerOn?: boolean; + /** 接口调用成功的回调函数 */ + success?: SetInnerAudioOptionSuccessCallback; + } + interface SetKeepScreenOnOption { + /** 是否保持屏幕常亮 */ + keepScreenOn: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetKeepScreenOnCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetKeepScreenOnFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetKeepScreenOnSuccessCallback; + } + interface SetLocMarkerIconOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetLocMarkerIconCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetLocMarkerIconFailCallback; + /** 图标路径,支持网络路径、本地路径、代码包路径 */ + iconPath?: string; + /** 接口调用成功的回调函数 */ + success?: SetLocMarkerIconSuccessCallback; + } + interface SetMICVolumeOption { + /** 音量大小,范围是 0.0-1.0 */ + volume: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetMICVolumeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetMICVolumeFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetMICVolumeSuccessCallback; + } + interface SetNavigationBarColorOption { + /** 背景颜色值,有效值为十六进制颜色 */ + backgroundColor: string; + /** 前景颜色值,包括按钮、标题、状态栏的颜色,仅支持 #ffffff 和 #000000 */ + frontColor: string; + /** 动画效果 */ + animation?: AnimationOption; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetNavigationBarColorCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetNavigationBarColorFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetNavigationBarColorSuccessCallback; + } + interface SetNavigationBarTitleOption { + /** 页面标题 */ + title: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetNavigationBarTitleCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetNavigationBarTitleFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetNavigationBarTitleSuccessCallback; + } + interface SetScreenBrightnessOption { + /** 屏幕亮度值,范围 0 ~ 1,0 最暗,1 最亮。在安卓端支持传入特殊值 -1,表示屏幕亮度跟随系统变化 */ + value: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetScreenBrightnessCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetScreenBrightnessFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetScreenBrightnessSuccessCallback; + } + interface SetStorageOption { + /** 需要存储的内容。只支持原生类型、Date、及能够通过`JSON.stringify`序列化的对象。 */ + data: T; + /** 本地缓存中指定的 key */ + key: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetStorageCompleteCallback; + /** 需要基础库: `2.21.3` + * + * 是否开启加密存储。只有异步的 setStorage 接口支持开启加密存储。开启后,将会对 data 使用 AES128 加密,接口回调耗时将会增加。若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true。此外,由于加密后的数据会比原始数据膨胀1.4倍,因此开启 encrypt 的情况下,单个 key 允许存储的最大数据长度为 0.7MB,所有数据存储上限为 7.1MB */ + encrypt?: boolean; + /** 接口调用失败的回调函数 */ + fail?: SetStorageFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetStorageSuccessCallback; + } + interface SetTabBarBadgeOption { + /** tabBar 的哪一项,从左边算起 */ + index: number; + /** 显示的文本,超过 4 个字符则显示成 ... */ + text: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetTabBarBadgeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetTabBarBadgeFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetTabBarBadgeSuccessCallback; + } + interface SetTabBarItemOption { + /** tabBar 的哪一项,从左边算起 */ + index: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetTabBarItemCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetTabBarItemFailCallback; + /** 图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效 */ + iconPath?: string; + /** 选中时的图片路径,icon 大小限制为 40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效 */ + selectedIconPath?: string; + /** 接口调用成功的回调函数 */ + success?: SetTabBarItemSuccessCallback; + /** tab 上的按钮文字 */ + text?: string; + } + interface SetTabBarStyleOption { + /** tab 的背景色,HexColor */ + backgroundColor?: string; + /** tabBar上边框的颜色, 仅支持 black/white */ + borderStyle?: string; + /** tab 上的文字默认颜色,HexColor */ + color?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetTabBarStyleCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetTabBarStyleFailCallback; + /** tab 上的文字选中时的颜色,HexColor */ + selectedColor?: string; + /** 接口调用成功的回调函数 */ + success?: SetTabBarStyleSuccessCallback; + } + interface SetTimeoutOption { + /** 设置超时时间 (ms) */ + timeout: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetTimeoutCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetTimeoutFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetTimeoutSuccessCallback; + } + interface SetTopBarTextOption { + /** 置顶栏文字 */ + text: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetTopBarTextCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetTopBarTextFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetTopBarTextSuccessCallback; + } + interface SetVisualEffectOnCaptureOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetVisualEffectOnCaptureCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetVisualEffectOnCaptureFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetVisualEffectOnCaptureSuccessCallback; + /** 截屏/录屏时的表现,仅支持 none / hidden,传入 hidden 则表示在截屏/录屏时隐藏屏幕 */ + visualEffect?: string; + } + interface SetWifiListOption { + /** 提供预设的 Wi-Fi 信息列表 */ + wifiList: WifiData[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetWifiListCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetWifiListFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetWifiListSuccessCallback; + } + interface SetWindowSizeOption { + /** 窗口高度,以像素为单位 */ + height: number; + /** 窗口宽度,以像素为单位 */ + width: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SetWindowSizeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SetWindowSizeFailCallback; + /** 接口调用成功的回调函数 */ + success?: SetWindowSizeSuccessCallback; + } + interface SetZoomSuccessCallbackResult { + /** 实际设置的缩放级别。由于系统限制,某些机型可能无法设置成指定值,会改用最接近的可设值。 */ + zoom: number; + errMsg: string; + } + interface ShareFileMessageOption { + /** 要分享的文件地址,必须为本地路径或临时路径 */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShareFileMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShareFileMessageFailCallback; + /** 自定义文件名,若留空则使用filePath中的文件名 */ + fileName?: string; + /** 接口调用成功的回调函数 */ + success?: ShareFileMessageSuccessCallback; + } + interface ShareToWeRunOption { + /** 运动数据列表 */ + recordList: WxaSportRecord[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShareToWeRunCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShareToWeRunFailCallback; + /** 接口调用成功的回调函数 */ + success?: ShareToWeRunSuccessCallback; + } + interface ShareVideoMessageOption { + /** 要分享的视频地址,必须为本地路径或临时路径 */ + videoPath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShareVideoMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShareVideoMessageFailCallback; + /** 接口调用成功的回调函数 */ + success?: ShareVideoMessageSuccessCallback; + /** 缩略图路径,若留空则使用视频首帧 */ + thumbPath?: string; + } + interface ShowActionSheetOption { + /** 按钮的文字数组,数组长度最大为 6 */ + itemList: string[]; + /** 需要基础库: `2.14.0` + * + * 警示文案 */ + alertText?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowActionSheetCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShowActionSheetFailCallback; + /** 按钮的文字颜色 */ + itemColor?: string; + /** 接口调用成功的回调函数 */ + success?: ShowActionSheetSuccessCallback; + } + interface ShowActionSheetSuccessCallbackResult { + /** 用户点击的按钮序号,从上到下的顺序,从0开始 */ + tapIndex: number; + errMsg: string; + } + interface ShowLoadingOption { + /** 提示的内容 */ + title: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowLoadingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShowLoadingFailCallback; + /** 是否显示透明蒙层,防止触摸穿透 */ + mask?: boolean; + /** 接口调用成功的回调函数 */ + success?: ShowLoadingSuccessCallback; + } + interface ShowModalOption { + /** 取消按钮的文字颜色,必须是 16 进制格式的颜色字符串 */ + cancelColor?: string; + /** 取消按钮的文字,最多 4 个字符 */ + cancelText?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowModalCompleteCallback; + /** 确认按钮的文字颜色,必须是 16 进制格式的颜色字符串 */ + confirmColor?: string; + /** 确认按钮的文字,最多 4 个字符 */ + confirmText?: string; + /** 提示的内容 */ + content?: string; + /** 需要基础库: `2.17.1` + * + * 是否显示输入框 */ + editable?: boolean; + /** 接口调用失败的回调函数 */ + fail?: ShowModalFailCallback; + /** 需要基础库: `2.17.1` + * + * 显示输入框时的提示文本 */ + placeholderText?: string; + /** 是否显示取消按钮 */ + showCancel?: boolean; + /** 接口调用成功的回调函数 */ + success?: ShowModalSuccessCallback; + /** 提示的标题 */ + title?: string; + } + interface ShowModalSuccessCallbackResult { + /** 需要基础库: `1.1.0` + * + * 为 true 时,表示用户点击了取消(用于 Android 系统区分点击蒙层关闭还是点击取消按钮关闭) */ + cancel: boolean; + /** 为 true 时,表示用户点击了确定按钮 */ + confirm: boolean; + /** editable 为 true 时,用户输入的文本 */ + content: string; + errMsg: string; + } + interface ShowNavigationBarLoadingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowNavigationBarLoadingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShowNavigationBarLoadingFailCallback; + /** 接口调用成功的回调函数 */ + success?: ShowNavigationBarLoadingSuccessCallback; + } + interface ShowRedPackageOption { + /** 封面地址 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowRedPackageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShowRedPackageFailCallback; + /** 接口调用成功的回调函数 */ + success?: ShowRedPackageSuccessCallback; + } + interface ShowShareImageMenuOption { + /** 要分享的图片地址,必须为本地路径或临时路径 */ + path: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowShareImageMenuCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShowShareImageMenuFailCallback; + /** 接口调用成功的回调函数 */ + success?: ShowShareImageMenuSuccessCallback; + } + interface ShowShareMenuOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowShareMenuCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShowShareMenuFailCallback; + /** 需要基础库: `2.11.3` + * + * 本接口为 Beta 版本,暂只在 Android 平台支持。需要显示的转发按钮名称列表,默认['shareAppMessage']。按钮名称合法值包含 "shareAppMessage"、"shareTimeline" 两种 */ + menus?: string[]; + /** 接口调用成功的回调函数 */ + success?: ShowShareMenuSuccessCallback; + /** 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ + withShareTicket?: boolean; + } + interface ShowTabBarOption { + /** 是否需要动画效果 */ + animation?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowTabBarCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShowTabBarFailCallback; + /** 接口调用成功的回调函数 */ + success?: ShowTabBarSuccessCallback; + } + interface ShowTabBarRedDotOption { + /** tabBar 的哪一项,从左边算起 */ + index: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowTabBarRedDotCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ShowTabBarRedDotFailCallback; + /** 接口调用成功的回调函数 */ + success?: ShowTabBarRedDotSuccessCallback; + } + interface ShowToastOption { + /** 提示的内容 */ + title: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ShowToastCompleteCallback; + /** 提示的延迟时间 */ + duration?: number; + /** 接口调用失败的回调函数 */ + fail?: ShowToastFailCallback; + /** 图标 + * + * 可选值: + * - 'success': 显示成功图标,此时 title 文本最多显示 7 个汉字长度; + * - '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'; + /** 需要基础库: `1.1.0` + * + * 自定义图标的本地路径,image 的优先级高于 icon */ + image?: string; + /** 是否显示透明蒙层,防止触摸穿透 */ + mask?: boolean; + /** 接口调用成功的回调函数 */ + success?: ShowToastSuccessCallback; + } + /** 具体支付参数见signData, 该参数需以string形式传递, 例如signData: '{"offerId":"123","buyQuantity":1,"env":0,"currencyType":"CNY","platform":"android","productId":"testproductId","goodsPrice":10,"outTradeNo":"xxxxxx","attach":"testdata"}' */ + interface SignData { + /** 透传数据, 发货通知时会透传给开发者 */ + attach: string; + /** 购买数量 */ + buyQuantity: number; + /** 币种 + * + * 可选值: + * - 'CNY': 人民币; */ + currencyType: 'CNY'; + /** 道具单价(分), **该字段仅mode=short_series_goods时可用**, 用来校验价格与后台道具价格是否一致, 避免用户在业务商城页看到的价格与实际价格不一致导致投诉 */ + goodsPrice: number; + /** 在米大师侧申请的应用 id, mp-支付基础配置中的offerid */ + offerId: string; + /** 业务订单号, 每个订单号只能使用一次, 重复使用会失败(极端情况不保证唯一, 不建议业务强依赖唯一性). 要求8-32个字符内, 只能是数字、大小写字母、符号 _-|*@组成, 不能以下划线(_)开头 */ + outTradeNo: string; + /** 道具ID, **该字段仅mode=short_series_goods时可用** */ + productId: string; + /** 环境配置, 0 米大师正式环境, 1 米大师沙箱环境, 默认为 0 */ + env?: number; + /** 申请接入时的平台, platform 与应用id有关 + * + * 可选值: + * - 'android': 安卓平台; */ + platform?: 'android'; + } + interface Size { + /** 变化后的窗口高度,单位 px */ + windowHeight: number; + /** 变化后的窗口宽度,单位 px */ + 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; + /** 当前运行环境 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的版本号,形如 `0.9.7` */ + version: string; + /** 当前运行环境不支持 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的原因,仅在 `isSupported` 为 `false` 时出现 + * + * 可选值: + * - 'client not supported)) 当前微信客户端不支持 [Skyline 渲染引擎]((skyline/introduction': ,可以尝试通过升级微信客户端解决; + * - 'baselib not supported)) 当前基础库不支持 [Skyline 渲染引擎]((skyline/introduction': ,基础库会自动更新到当前客户端所能支持的最新的版本,基础库不支持时也可以尝试通过升级微信客户端解决; + * - '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 起步 > 快捷切换入口]((skyline/migration#快捷切换入口': 一节; */ + reason?: + | 'client not supported)) 当前微信客户端不支持 [Skyline 渲染引擎]((skyline/introduction' + | 'baselib not supported)) 当前基础库不支持 [Skyline 渲染引擎]((skyline/introduction' + | '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 起步 > 快捷切换入口]((skyline/migration#快捷切换入口'; + } + /** Snapshot 实例,可通过 [SelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/SelectorQuery.html) 获取。 + * + * [Snapshot](https://developers.weixin.qq.com/miniprogram/dev/api/snapshot/Snapshot.html) 通过 `id` 跟一个 [snapshot](#) 组件绑定,操作对应的 [snapshot(#) 组件。 + * + * **示例代码** + * + * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/jdkplEm17hJP) */ + interface Snapshot { + /** 画布高度 */ + height: number; + /** 画布宽度 */ + width: number; + /** [Snapshot.takeSnapshot(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/snapshot/Snapshot.takeSnapshot.html) + * + * 需要基础库: `3.0.0` + * + * 在插件中使用:支持 + * + * 对 snapshot 组件子树进行截图 */ + takeSnapshot(option: TakeSnapshotOption): void; + } + /** 需要基础库: `2.10.4` + * + * 网络请求过程中一些调试信息 */ + interface SocketProfile { + /** 完成建立连接的时间(完成握手),如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接完成的时间。注意这里握手结束,包括安全连接建立完成、SOCKS 授权通过 */ + connectEnd: number; + /** 开始建立连接的时间,如果是持久连接,则与 fetchStart 值相等。注意如果在传输层发生了错误且重新建立连接,则这里显示的是新建立的连接开始的时间 */ + connectStart: number; + /** 上层请求到返回的耗时 */ + cost: number; + /** DNS 域名查询完成的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 */ + domainLookupEnd: number; + /** DNS 域名查询开始的时间,如果使用了本地缓存(即无 DNS 查询)或持久连接,则与 fetchStart 值相等 */ + domainLookupStart: number; + /** 组件准备好使用 SOCKET 建立请求的时间,这发生在检查本地缓存之前 */ + fetchStart: number; + /** 握手耗时 */ + handshakeCost: number; + /** 单次连接的耗时,包括 connect ,tls */ + rtt: number; + } + interface SocketTaskCloseOption { + /** 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 */ + code?: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SocketTaskCloseCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SocketTaskCloseFailCallback; + /** 一个可读的字符串,表示连接被关闭的原因。这个字符串必须是不长于 123 字节的 UTF-8 文本(不是字符)。 */ + reason?: string; + /** 接口调用成功的回调函数 */ + success?: SocketTaskCloseSuccessCallback; + } + interface SocketTaskOnCloseListenerResult { + /** 一个数字值表示关闭连接的状态号,表示连接被关闭的原因。 */ + code: number; + /** 一个可读的字符串,表示连接被关闭的原因。 */ + reason: string; + } + interface SocketTaskOnMessageListenerResult { + /** 服务器返回的消息 */ + data: string | ArrayBuffer; + } + interface SocketTaskSendOption { + /** 需要发送的内容 */ + data: string | ArrayBuffer; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SendCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SendFailCallback; + /** 接口调用成功的回调函数 */ + success?: SendSuccessCallback; + } + /** 动画配置 */ + interface SpringOption { + /** 阻尼系数 */ + damping?: number; + /** 重量系数,值越大移动越慢 */ + mass?: number; + /** 动画是否可以在指定值上反弹 */ + overshootClamping?: boolean; + /** 弹簧静止时的位移 */ + restDisplacementThreshold?: number; + /** 弹簧静止的速度 */ + restSpeedThreshold?: number; + /** 弹性系数 */ + stiffness?: number; + /** 速度 */ + velocity?: number; + } + interface StartAccelerometerOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartAccelerometerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartAccelerometerFailCallback; + /** 需要基础库: `2.1.0` + * + * 监听加速度数据回调函数的执行频率 + * + * 可选值: + * - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; + * - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; + * - 'normal': 普通的回调频率,在 200ms/次 左右; */ + interval?: 'game' | 'ui' | 'normal'; + /** 接口调用成功的回调函数 */ + success?: StartAccelerometerSuccessCallback; + } + interface StartAdvertisingObject { + /** 广播自定义参数 */ + advertiseRequest: AdvertiseReqObj; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartAdvertisingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartAdvertisingFailCallback; + /** 广播功率 + * + * 可选值: + * - 'low': 功率低; + * - 'medium': 功率适中; + * - 'high': 功率高; */ + powerLevel?: 'low' | 'medium' | 'high'; + /** 接口调用成功的回调函数 */ + success?: StartAdvertisingSuccessCallback; + } + interface StartBeaconDiscoveryOption { + /** Beacon 设备广播的 UUID 列表 */ + uuids: string[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartBeaconDiscoveryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartBeaconDiscoveryFailCallback; + /** 是否校验蓝牙开关,仅在 iOS 下有效。iOS 11 起,控制面板里关掉蓝牙,还是能继续使用 Beacon 服务。 */ + ignoreBluetoothAvailable?: boolean; + /** 接口调用成功的回调函数 */ + success?: StartBeaconDiscoverySuccessCallback; + } + interface StartBluetoothDevicesDiscoveryOption { + /** 是否允许重复上报同一设备。如果允许重复上报,则 [wx.onBlueToothDeviceFound](#) 方法会多次上报同一设备,但是 RSSI 值会有不同。 */ + allowDuplicatesKey?: boolean; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartBluetoothDevicesDiscoveryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartBluetoothDevicesDiscoveryFailCallback; + /** 上报设备的间隔,单位 ms。0 表示找到新设备立即上报,其他数值根据传入的间隔上报。 */ + interval?: number; + /** 扫描模式,越高扫描越快,也越耗电。仅安卓微信客户端 7.0.12 及以上支持。 + * + * 可选值: + * - 'low': 低; + * - 'medium': 中; + * - 'high': 高; */ + powerLevel?: 'low' | 'medium' | 'high'; + /** 要搜索的蓝牙设备主服务的 UUID 列表(支持 16/32/128 位 UUID)。某些蓝牙设备会广播自己的主 service 的 UUID。如果设置此参数,则只搜索广播包有对应 UUID 的主服务的蓝牙设备。建议通过该参数过滤掉周边不需要处理的其他蓝牙设备。 */ + services?: string[]; + /** 接口调用成功的回调函数 */ + success?: StartBluetoothDevicesDiscoverySuccessCallback; + } + interface StartCastingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartCastingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartCastingFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartCastingSuccessCallback; + } + interface StartCompassOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartCompassCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartCompassFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartCompassSuccessCallback; + } + interface StartDeviceMotionListeningOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartDeviceMotionListeningCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartDeviceMotionListeningFailCallback; + /** 监听设备方向的变化回调函数的执行频率 + * + * 可选值: + * - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; + * - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; + * - 'normal': 普通的回调频率,在 200ms/次 左右; */ + interval?: 'game' | 'ui' | 'normal'; + /** 接口调用成功的回调函数 */ + success?: StartDeviceMotionListeningSuccessCallback; + } + interface StartDiscoveryOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartDiscoveryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartDiscoveryFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartDiscoverySuccessCallback; + } + interface StartGyroscopeOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartGyroscopeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartGyroscopeFailCallback; + /** 监听陀螺仪数据回调函数的执行频率 + * + * 可选值: + * - 'game': 适用于更新游戏的回调频率,在 20ms/次 左右; + * - 'ui': 适用于更新 UI 的回调频率,在 60ms/次 左右; + * - 'normal': 普通的回调频率,在 200ms/次 左右; */ + interval?: 'game' | 'ui' | 'normal'; + /** 接口调用成功的回调函数 */ + success?: StartGyroscopeSuccessCallback; + } + interface StartHCEOption { + /** 需要注册到系统的 AID 列表 */ + aid_list: string[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartHCECompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartHCEFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartHCESuccessCallback; + } + interface StartLocalServiceDiscoveryFailCallbackResult { + /** 错误信息 + * + * 可选值: + * - 'invalid param': serviceType 为空; + * - 'scan task already exist': 在当前 startLocalServiceDiscovery 发起的搜索未停止的情况下,再次调用 startLocalServiceDiscovery; */ + errMsg: string; + } + interface StartLocalServiceDiscoveryOption { + /** 要搜索的服务类型 */ + serviceType: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartLocalServiceDiscoveryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartLocalServiceDiscoveryFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartLocalServiceDiscoverySuccessCallback; + } + interface StartLocationUpdateBackgroundOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartLocationUpdateBackgroundCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartLocationUpdateBackgroundFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartLocationUpdateBackgroundSuccessCallback; + /** wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 */ + type?: string; + } + interface StartLocationUpdateOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartLocationUpdateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartLocationUpdateFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartLocationUpdateSuccessCallback; + /** wgs84 返回 gps 坐标,gcj02 返回可用于 wx.openLocation 的坐标 */ + type?: string; + } + interface StartPreviewOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartPreviewCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartPreviewFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartPreviewSuccessCallback; + } + interface StartPullDownRefreshOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartPullDownRefreshCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartPullDownRefreshFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartPullDownRefreshSuccessCallback; + } + interface StartRecordSuccessCallbackResult { + /** 录音文件的临时路径 (本地路径) */ + tempFilePath: string; + errMsg: string; + } + interface StartRecordTimeoutCallbackResult { + /** 封面图片文件的临时路径 (本地路径) */ + tempThumbPath: string; + /** 视频的文件的临时路径 (本地路径) */ + tempVideoPath: string; + } + interface StartSoterAuthenticationOption { + /** 挑战因子。挑战因子为调用者为此次生物鉴权准备的用于签名的字符串关键识别信息,将作为 `resultJSON` 的一部分,供调用者识别本次请求。例如:如果场景为请求用户对某订单进行授权确认,则可以将订单号填入此参数。 */ + challenge: string; + /** 请求使用的可接受的生物认证方式 + * + * 可选值: + * - 'fingerPrint': 指纹识别; + * - 'facial': 人脸识别; + * - 'speech': 声纹识别(暂未支持); */ + requestAuthModes: Array<'fingerPrint' | 'facial' | 'speech'>; + /** 验证描述,即识别过程中显示在界面上的对话框提示内容 */ + authContent?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartSoterAuthenticationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartSoterAuthenticationFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartSoterAuthenticationSuccessCallback; + } + interface StartSoterAuthenticationSuccessCallbackResult { + /** 生物认证方式 */ + authMode: string; + /** 错误码 */ + errCode: number; + /** 错误信息 */ + errMsg: string; + /** 在设备安全区域(TEE)内获得的本机安全信息(如TEE名称版本号等以及防重放参数)以及本次认证信息(仅Android支持,本次认证的指纹ID)。具体说明见下文 */ + resultJSON: string; + /** 用SOTER安全密钥对 `resultJSON` 的签名(SHA256 with RSA/PSS, saltlen=20) */ + resultJSONSignature: string; + } + interface StartWifiOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartWifiCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartWifiFailCallback; + /** 接口调用成功的回调函数 */ + success?: StartWifiSuccessCallback; + } + interface StatOption { + /** 文件/目录路径 (本地路径) */ + path: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StatCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StatFailCallback; + /** 需要基础库: `2.3.0` + * + * 是否递归获取目录下的每个文件的 Stats 信息 */ + recursive?: boolean; + /** 接口调用成功的回调函数 */ + 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; + } + /** 描述文件状态的对象 */ + interface Stats { + /** 文件最近一次被存取或被执行的时间,UNIX 时间戳,对应 POSIX stat.st_atime */ + lastAccessedTime: number; + /** 文件最后一次被修改的时间,UNIX 时间戳,对应 POSIX stat.st_mtime */ + lastModifiedTime: number; + /** 文件的类型和存取的权限,对应 POSIX stat.st_mode */ + mode: number; + /** 文件大小,单位:B,对应 POSIX stat.st_size */ + size: number; + /** [boolean Stats.isDirectory()](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isDirectory.html) + * + * 在插件中使用:需要基础库 `2.19.2` + * + * 判断当前文件是否一个目录 */ + isDirectory(): boolean; + /** [boolean Stats.isFile()](https://developers.weixin.qq.com/miniprogram/dev/api/file/Stats.isFile.html) + * + * 在插件中使用:需要基础库 `2.19.2` + * + * 判断当前文件是否一个普通文件 */ + isFile(): boolean; + } + interface StepOption { + /** 动画延迟时间,单位 ms */ + delay?: number; + /** 动画持续时间,单位 ms */ + duration?: number; + /** 动画的效果 + * + * 可选值: + * - 'linear': 动画从头到尾的速度是相同的; + * - 'ease': 动画以低速开始,然后加快,在结束前变慢; + * - 'ease-in': 动画以低速开始; + * - 'ease-in-out': 动画以低速开始和结束; + * - 'ease-out': 动画以低速结束; + * - 'step-start': 动画第一帧就跳至结束状态直到结束; + * - 'step-end': 动画一直保持开始状态,最后一帧跳到结束状态; */ + timingFunction?: + | 'linear' + | 'ease' + | 'ease-in' + | 'ease-in-out' + | 'ease-out' + | 'step-start' + | 'step-end'; + transformOrigin?: string; + } + /** 贴纸类型 */ + interface Sticker { + /** 贴纸帧数 */ + len: number; + /** 贴纸资源路径。资源必须为一个资源文件夹路径或一个压缩包路径,文件夹或压缩包内的贴纸资源必须按照 `{title}_{index}.{ext}` 格式命名。其中 `{title}` 为贴纸名称;`{index}` 为帧序号,从0开始;`{ext}` 为拓展名。 */ + path: string; + /** 贴纸名称 */ + title: string; + /** 贴纸触发动作 + * + * 可选值: + * - -1: 循环播放; + * - 10: 张嘴; + * - 11: 噘嘴/kiss; + * - 12: 眨/闭左眼; + * - 13: 眨/闭右眼; + * - 14: 眨/闭眼; + * - 15: 挑眉毛; + * - 16: 左右摇头; + * - 17: 上下点头; + * - 100: 比心; + * - 101: 张开手掌; + * - 102: 剪刀手/比耶/胜利; + * - 103: 握拳; + * - 104: 数字1; + * - 105: 我爱你; + * - 106: 点赞; + * - 107: OK; + * - 108: Rock&Roll; + * - 109: 数字6; + * - 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; + /** 贴纸ID */ + id?: string; + /** 贴纸资源 md5 */ + md5?: string; + /** 贴纸位置,格式为 [x1,y1,x2,y2] 。当 `type` 为 `'2D'` 或 `'front'` 时必填。仅 2D 贴纸和前景贴纸有效 */ + pos?: string[]; + /** 背景贴纸展示位置。仅背景贴纸有效 + * + * 可选值: + * - 0: 背景贴纸; + * - 1: 只在人像区域显示的贴纸; */ + segtype?: 0 | 1; + } + interface StopAccelerometerOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopAccelerometerCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopAccelerometerFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopAccelerometerSuccessCallback; + } + interface StopAdvertisingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopAdvertisingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopAdvertisingFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopAdvertisingSuccessCallback; + } + interface StopBGMOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopBGMCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopBGMFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopBGMSuccessCallback; + } + interface StopBackgroundAudioOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopBackgroundAudioCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopBackgroundAudioFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopBackgroundAudioSuccessCallback; + } + interface StopBeaconDiscoveryOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopBeaconDiscoveryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopBeaconDiscoveryFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopBeaconDiscoverySuccessCallback; + } + interface StopBluetoothDevicesDiscoveryOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopBluetoothDevicesDiscoveryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopBluetoothDevicesDiscoveryFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopBluetoothDevicesDiscoverySuccessCallback; + } + interface StopCompassOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopCompassCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopCompassFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopCompassSuccessCallback; + } + interface StopDeviceMotionListeningOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopDeviceMotionListeningCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopDeviceMotionListeningFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopDeviceMotionListeningSuccessCallback; + } + interface StopDiscoveryOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopDiscoveryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopDiscoveryFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopDiscoverySuccessCallback; + } + interface StopFaceDetectOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopFaceDetectCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopFaceDetectFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopFaceDetectSuccessCallback; + } + interface StopGyroscopeOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopGyroscopeCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopGyroscopeFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopGyroscopeSuccessCallback; + } + interface StopHCEOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopHCECompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopHCEFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopHCESuccessCallback; + } + interface StopLocalServiceDiscoveryFailCallbackResult { + /** 错误信息 + * + * 可选值: + * - 'task not found': 在当前没有处在搜索服务中的情况下调用 stopLocalServiceDiscovery; */ + errMsg: string; + } + interface StopLocalServiceDiscoveryOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopLocalServiceDiscoveryCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopLocalServiceDiscoveryFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopLocalServiceDiscoverySuccessCallback; + } + interface StopLocationUpdateOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopLocationUpdateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopLocationUpdateFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopLocationUpdateSuccessCallback; + } + interface StopOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopSuccessCallback; + } + interface StopPreviewOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopPreviewCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopPreviewFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopPreviewSuccessCallback; + } + interface StopPullDownRefreshOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopPullDownRefreshCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopPullDownRefreshFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopPullDownRefreshSuccessCallback; + } + interface StopRecordSuccessCallbackResult { + /** 封面图片文件的临时路径 (本地路径) */ + tempThumbPath: string; + /** 视频的文件的临时路径 (本地路径) */ + tempVideoPath: string; + errMsg: string; + } + interface StopVoiceOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopVoiceCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopVoiceFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopVoiceSuccessCallback; + } + interface StopWifiOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopWifiCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopWifiFailCallback; + /** 接口调用成功的回调函数 */ + success?: StopWifiSuccessCallback; + } + interface SubscribeVoIPVideoMembersOption { + /** 订阅的成员列表 */ + openIdList: string[]; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SubscribeVoIPVideoMembersCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SubscribeVoIPVideoMembersFailCallback; + /** 接口调用成功的回调函数 */ + success?: SubscribeVoIPVideoMembersSuccessCallback; + } + /** 订阅消息设置 +* +* **示例代码** +* +* ```javascript +wx.getSetting({ + withSubscriptions: true, + success (res) { + console.log(res.authSetting) + // res.authSetting = { + // "scope.userInfo": true, + // "scope.userLocation": true + // } + console.log(res.subscriptionsSetting) + // res.subscriptionsSetting = { + // mainSwitch: true, // 订阅消息总开关 + // itemSettings: { // 每一项开关 + // SYS_MSG_TYPE_INTERACTIVE: 'accept', // 小游戏系统订阅消息 + // SYS_MSG_TYPE_RANK: 'accept' + // zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: 'reject', // 普通一次性订阅消息 + // ke_OZC_66gZxALLcsuI7ilCJSP2OJ2vWo2ooUPpkWrw: 'ban', + // } + // } + } +}) +``` */ + interface SubscriptionsSetting { + /** 订阅消息总开关,true为开启,false为关闭 */ + 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; + } + interface SwitchCameraOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SwitchCameraCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SwitchCameraFailCallback; + /** 接口调用成功的回调函数 */ + success?: SwitchCameraSuccessCallback; + } + interface SwitchCastingOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SwitchCastingCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SwitchCastingFailCallback; + /** 接口调用成功的回调函数 */ + success?: SwitchCastingSuccessCallback; + } + interface SwitchTabOption { + /** 需要跳转的 tabBar 页面的路径 (代码包路径)(需在 app.json 的 [tabBar](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#tabbar) 字段定义的页面),路径后不能带参数。 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: SwitchTabCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: SwitchTabFailCallback; + /** 接口调用成功的回调函数 */ + success?: SwitchTabSuccessCallback; + } + interface SystemInfo { + /** 需要基础库: `1.1.0` + * + * 客户端基础库版本 */ + SDKVersion: string; + /** 需要基础库: `2.6.0` + * + * 允许微信使用相册的开关(仅 iOS 有效) */ + albumAuthorized: boolean; + /** 需要基础库: `1.8.0` + * + * 设备性能等级(仅 Android)。取值为:-2 或 0(该设备无法运行小游戏),-1(性能未知),>=1(设备性能值,该值越高,设备性能越好,目前最高不到50) */ + benchmarkLevel: number; + /** 需要基础库: `2.6.0` + * + * 蓝牙的系统开关 */ + bluetoothEnabled: boolean; + /** 需要基础库: `1.5.0` + * + * 设备品牌 */ + brand: string; + /** 需要基础库: `2.6.0` + * + * 允许微信使用摄像头的开关 */ + cameraAuthorized: boolean; + /** 设备方向 + * + * 可选值: + * - '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; + /** 需要基础库: `1.5.0` + * + * 用户字体大小(单位px)。以微信客户端「我-设置-通用-字体大小」中的设置为准 */ + fontSizeSetting: number; + /** 需要基础库: `2.12.3` + * + * 当前小程序运行的宿主环境 */ + host: SystemInfoHost; + /** 微信设置的语言 */ + language: string; + /** 需要基础库: `2.6.0` + * + * 允许微信使用定位的开关 */ + locationAuthorized: boolean; + /** 需要基础库: `2.6.0` + * + * 地理位置的系统开关 */ + locationEnabled: boolean; + /** `true` 表示模糊定位,`false` 表示精确定位,仅 iOS 支持 */ + locationReducedAccuracy: boolean; + /** 需要基础库: `2.6.0` + * + * 允许微信使用麦克风的开关 */ + microphoneAuthorized: boolean; + /** 设备型号。新机型刚推出一段时间会显示unknown,微信会尽快进行适配。 */ + model: string; + /** 需要基础库: `2.6.0` + * + * 允许微信通知带有提醒的开关(仅 iOS 有效) */ + notificationAlertAuthorized: boolean; + /** 需要基础库: `2.6.0` + * + * 允许微信通知的开关 */ + notificationAuthorized: boolean; + /** 需要基础库: `2.6.0` + * + * 允许微信通知带有标记的开关(仅 iOS 有效) */ + notificationBadgeAuthorized: boolean; + /** 需要基础库: `2.6.0` + * + * 允许微信通知带有声音的开关(仅 iOS 有效) */ + notificationSoundAuthorized: boolean; + /** 需要基础库: `2.19.3` + * + * 允许微信使用日历的开关 */ + phoneCalendarAuthorized: boolean; + /** 设备像素比 */ + pixelRatio: number; + /** 客户端平台 + * + * 可选值: + * - 'ios': iOS微信(包含 iPhone、iPad); + * - 'android': Android微信; + * - 'windows': Windows微信; + * - 'mac': macOS微信; + * - 'devtools': 微信开发者工具; */ + platform: 'ios' | 'android' | 'windows' | 'mac' | 'devtools'; + /** 需要基础库: `2.7.0` + * + * 在竖屏正方向下的安全区域。部分机型没有安全区域概念,也不会返回 safeArea 字段,开发者需自行兼容。 */ + safeArea: SafeArea; + /** 需要基础库: `1.1.0` + * + * 屏幕高度,单位px */ + screenHeight: number; + /** 需要基础库: `1.1.0` + * + * 屏幕宽度,单位px */ + screenWidth: number; + /** 需要基础库: `1.9.0` + * + * 状态栏的高度,单位px */ + statusBarHeight: number; + /** 操作系统及版本 */ + system: string; + /** 微信版本号 */ + version: string; + /** 需要基础库: `2.6.0` + * + * Wi-Fi 的系统开关 */ + wifiEnabled: boolean; + /** 可使用窗口高度,单位px */ + windowHeight: number; + /** 可使用窗口宽度,单位px */ + windowWidth: number; + /** 需要基础库: `2.11.0` + * + * 系统当前主题,取值为`light`或`dark`,全局配置`"darkmode":true`时才能获取,否则为 undefined (不支持小游戏) + * + * 可选值: + * - 'dark': 深色主题; + * - 'light': 浅色主题; */ + theme?: 'dark' | 'light'; + } + /** 需要基础库: `2.12.3` + * + * 当前小程序运行的宿主环境 */ + interface SystemInfoHost { + /** 宿主 app 对应的 appId */ + appId: string; + } + interface SystemSetting { + /** 蓝牙的系统开关 */ + bluetoothEnabled: boolean; + /** 设备方向 + * + * 可选值: + * - 'portrait': 竖屏; + * - 'landscape': 横屏; */ + deviceOrientation: 'portrait' | 'landscape'; + /** 地理位置的系统开关 */ + locationEnabled: boolean; + /** Wi-Fi 的系统开关 */ + wifiEnabled: boolean; + } + interface TCPSocketConnectOption { + /** 套接字要连接的地址 */ + address: string; + /** 套接字要连接的端口 */ + port: number; + /** 套接字要连接的超时时间,默认为 2s */ + timeout?: number; + } + interface TCPSocketOnMessageListenerResult { + /** 接收端地址信息 */ + localInfo: LocalInfo; + /** 收到的消息 */ + message: ArrayBuffer; + /** 发送端地址信息 */ + remoteInfo: RemoteInfo; + } + interface TakePhotoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: TakePhotoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: TakePhotoFailCallback; + /** 成像质量 + * + * 可选值: + * - 'high': 高质量; + * - 'normal': 普通质量; + * - 'low': 低质量; */ + quality?: 'high' | 'normal' | 'low'; + /** 需要基础库: `2.22.0` + * + * 是否开启镜像 */ + selfieMirror?: boolean; + /** 接口调用成功的回调函数 */ + success?: TakePhotoSuccessCallback; + } + interface TakePhotoSuccessCallbackResult { + /** 照片文件的临时路径 (本地路径),安卓是jpg图片格式,ios是png */ + tempImagePath: string; + errMsg: string; + } + interface TakeSnapshotOption { + /** 截图文件格式,'rgba' 或 'png',默认值为 'png' */ + format: string; + /** 截图导出类型,'file' 保存到临时文件目录或 'arraybuffer' 返回图片二进制数据,默认值为 'file' */ + type: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: TakeSnapshotCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: TakeSnapshotFailCallback; + /** 接口调用成功的回调函数 */ + success?: TakeSnapshotSuccessCallback; + } + interface TakeSnapshotSuccessCallbackResult { + /** 截图对应的二进制数据,当 type 为 arraybuffer 该字段生效 */ + data: ArrayBuffer; + /** 截图保存的临时文件路径,当 type 为 file 该字段生效 */ + tempFilePath: string; + errMsg: string; + } + /** 标签类型枚举 */ + interface TechType { + /** 对应IsoDep实例,实例支持ISO-DEP (ISO 14443-4)标准的读写 */ + isoDep: string; + /** 对应MifareClassic实例,实例支持MIFARE Classic标签的读写 */ + mifareClassic: string; + /** 对应MifareUltralight实例,实例支持MIFARE Ultralight标签的读写 */ + mifareUltralight: string; + /** 对应Ndef实例,实例支持对NDEF格式的NFC标签上的NDEF数据的读写 */ + ndef: string; + /** 对应NfcA实例,实例支持NFC-A (ISO 14443-3A)标准的读写 */ + nfcA: string; + /** 对应NfcB实例,实例支持NFC-B (ISO 14443-3B)标准的读写 */ + nfcB: string; + /** 对应NfcF实例,实例支持NFC-F (JIS 6319-4)标准的读写 */ + nfcF: string; + /** 对应NfcV实例,实例支持NFC-V (ISO 15693)标准的读写 */ + nfcV: string; + } + /** 需要基础库: `2.30.0` +* +* 在插件中使用:需要基础库 `2.30.0` +* +* Tensor +* +* **** +* +* ```js +session.run({ + input1: { + type: 'float32', + data: new Float32Array(3 * 224 * 224).buffer, + shape: [1, 3, 224, 224] // NCHW 顺序 + }, + input2: { + type: 'uint8', + data: new Uint8Array(224 * 224).buffer, + shape: [1, 1, 224, 224] + }, +}).then(res => { + console.log(res.output0) + // output0 结构如下: + // { + // type: 'uint8', + // data: new Uint8Array(224 * 224).buffer, + // shape: [1, 1, 224, 224] + // } +}) +``` */ + interface Tensor { + /** Tensor 值,一段 ArrayBuffer */ + data: ArrayBuffer; + /** Tensor shape (Tensor 形状,例如 `[1, 3, 224, 224]` 即表示一个4唯Tensor,每个维度的长度分别为1, 3, 224, 224) */ + shape: number[]; + /** ArrayBuffer 值的类型,合法值有 `uint8`, `int8`, `uint32`, `int32`, `float32` */ + type: string; + } + /** 需要基础库: `2.30.0` +* +* 在插件中使用:需要基础库 `2.30.0` +* +* Tensors 是 key-value 形式的对象,对象的 key 会作为 input/output name,对象的 value 则是 Tensor。 Tensor 结构如下。 +* +* **** +* +* ```js +session.run({ + input1: { + type: 'float32', + data: new Float32Array(3 * 224 * 224).buffer, + shape: [1, 3, 224, 224] // NCHW 顺序 + }, + input2: { + type: 'uint8', + data: new Uint8Array(224 * 224).buffer, + shape: [1, 1, 224, 224] + }, +}).then(res => { + console.log(res.output0) + // output0 结构如下: + // { + // type: 'uint8', + // data: new Uint8Array(224 * 224).buffer, + // shape: [1, 1, 224, 224] + // } +}) +``` */ + interface Tensors { + /** [Tensor](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/Tensor.html) + * + * Tensor,每个 Tensor 包含 shape、data、type 字段。 */ + key: Tensor; + } + interface TextMetrics { + /** 文本的宽度 */ + width: number; + } + /** 动画配置 */ + interface TimingOption { + /** 动画时长 */ + duration?: number; + /** 动画曲线,参考 [Easing](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/animation/worklet.Easing.html) 模块。 */ + easing?: (...args: any[]) => any; + } + interface ToScreenLocationOption { + /** 纬度 */ + latitude: number; + /** 经度 */ + longitude: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ToScreenLocationCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ToScreenLocationFailCallback; + /** 接口调用成功的回调函数 */ + success?: ToScreenLocationSuccessCallback; + } + interface ToScreenLocationSuccessCallbackResult { + /** x 坐标值 */ + x: number; + /** y 坐标值 */ + y: number; + errMsg: string; + } + interface ToggleTorchOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: ToggleTorchCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: ToggleTorchFailCallback; + /** 接口调用成功的回调函数 */ + success?: ToggleTorchSuccessCallback; + } + /** 跟踪能力配置,目前不同的跟踪能力之间是互斥的,默认使用平面跟踪能力。需要注意目前 track 中不同的跟踪配置存在互斥关系(比如 marker 跟踪配置和 OSD 跟踪配置不能同时存在),请按需配置。 */ + interface Track { + /** 平面跟踪配置 */ + plane: PlaneTrack; + /** 需要基础库: `2.27.0` + * + * OCR检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/ocr.html)。 */ + OCR?: OCRTrack; + /** 需要基础库: `2.24.5` + * + * OSD 跟踪配置 */ + OSD?: boolean; + /** 需要基础库: `2.28.0` + * + * 人体检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/body.html)。 */ + body?: BodyTrack; + /** 需要基础库: `3.0.0` + * + * 深度识别配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/depth.html)。 */ + 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; + /** 需要基础库: `2.28.0` + * + * 手势检测配置。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/hand.html)。 */ + hand?: HandTrack; + /** 需要基础库: `2.24.5` + * + * marker 跟踪配置,基础库(3.0.0)开始允许同时支持v2的水平面检测能力 */ + marker?: boolean; + /** 需要基础库: `2.28.0` + * + * 提供基础AR功能,输出相机旋转的3个自由度的位姿,利用手机陀螺仪传感器,实现快速稳定的AR定位能力,适用于简单AR场景。 */ + threeDof?: boolean; + } + interface TransceiveOption { + /** 需要传递的二进制数据 */ + data: ArrayBuffer; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: TransceiveCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: TransceiveFailCallback; + /** 接口调用成功的回调函数 */ + success?: TransceiveSuccessCallback; + } + interface TransceiveSuccessCallbackResult { + data: ArrayBuffer; + errMsg: string; + } + interface TranslateMarkerOption { + /** 移动过程中是否自动旋转 marker */ + autoRotate: boolean; + /** 指定 marker 移动到的目标点 */ + destination: DestinationOption; + /** 指定 marker */ + markerId: number; + /** marker 的旋转角度 */ + rotate: number; + /** 动画结束回调函数 */ + animationEnd?: (...args: any[]) => any; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: TranslateMarkerCompleteCallback; + /** 动画持续时长,平移与旋转分别计算 */ + duration?: number; + /** 接口调用失败的回调函数 */ + fail?: TranslateMarkerFailCallback; + /** 需要基础库: `2.13.0` + * + * 平移和旋转同时进行 */ + moveWithRotate?: boolean; + /** 接口调用成功的回调函数 */ + success?: TranslateMarkerSuccessCallback; + } + interface TriggerRefreshOption { + /** 动画时长 */ + duration?: number; + /** [动画曲线](#) */ + easingFunction?: string; + } + interface TruncateOption { + /** 要截断的文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: TruncateCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: TruncateFailCallback; + /** 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') */ + length?: number; + /** 接口调用成功的回调函数 */ + success?: TruncateSuccessCallback; + } + interface TruncateSyncOption { + /** 要截断的文件路径 (本地路径) */ + filePath: string; + /** 截断位置,默认0。如果 length 小于文件长度(字节),则只有前面 length 个字节会保留在文件中,其余内容会被删除;如果 length 大于文件长度,则会对其进行扩展,并且扩展部分将填充空字节('\0') */ + length?: number; + } + interface UDPSocketConnectOption { + /** 要发消息的地址 */ + address: string; + /** 要发送消息的端口号 */ + port: number; + } + interface UDPSocketOnMessageListenerResult { + /** 接收端地址信息,2.18.0 起支持 */ + localInfo: LocalInfo; + /** 收到的消息。消息长度需要小于4096。 */ + message: ArrayBuffer; + /** 发送端地址信息 */ + remoteInfo: RemoteInfo; + } + interface UDPSocketSendOption { + /** 要发消息的地址。在基础库 <= 2.9.3 版本必须是和本机同网段的 IP 地址,或安全域名列表内的域名地址;之后版本可以是任意 IP 和域名 */ + address: string; + /** 要发送的数据 */ + message: string | ArrayBuffer; + /** 要发送消息的端口号 */ + port: number; + /** 发送数据的长度,仅当 message 为 ArrayBuffer 类型时有效 */ + length?: number; + /** 发送数据的偏移量,仅当 message 为 ArrayBuffer 类型时有效 */ + offset?: number; + /** 向指定地址发消息时,是否要开启广播,基础库 2.24.0 开始支持 */ + setBroadcast?: boolean; + } + interface UndoOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: UndoCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: UndoFailCallback; + /** 接口调用成功的回调函数 */ + success?: UndoSuccessCallback; + } + interface UnlinkOption { + /** 要删除的文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: UnlinkCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: UnlinkFailCallback; + /** 接口调用成功的回调函数 */ + success?: UnlinkSuccessCallback; + } + interface UnzipOption { + /** 目标目录路径, 支持本地路径 */ + targetPath: string; + /** 源文件路径,支持本地路径, 只可以是 zip 压缩文件 */ + zipFilePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: UnzipCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: UnzipFailCallback; + /** 接口调用成功的回调函数 */ + success?: UnzipSuccessCallback; + } + /** 参数列表 */ + interface UpdatableMessageFrontEndParameter { + /** 参数名 */ + name: string; + /** 参数值 */ + value: string; + } + /** 需要基础库: `2.4.0` + * + * 动态消息的模板信息 */ + interface UpdatableMessageFrontEndTemplateInfo { + /** 参数列表 */ + parameterList: UpdatableMessageFrontEndParameter[]; + } + interface UpdateGroundOverlayOption { + /** 图片覆盖的经纬度范围 */ + bounds: MapBounds; + /** 图片图层 id */ + id: string; + /** 图片路径,支持网络图片、临时路径、代码包路径 */ + src: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: UpdateGroundOverlayCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: UpdateGroundOverlayFailCallback; + /** 图层透明度 */ + opacity?: number; + /** 接口调用成功的回调函数 */ + success?: UpdateGroundOverlaySuccessCallback; + /** 是否可见 */ + visible?: boolean; + /** 图层绘制顺序 */ + zIndex?: number; + } + interface UpdateShareMenuOption { + /** 需要基础库: `2.4.0` + * + * 动态消息的 activityId。通过 [updatableMessage.createActivityId](#) 接口获取 */ + activityId?: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: UpdateShareMenuCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: UpdateShareMenuFailCallback; + /** 需要基础库: `2.13.0` + * + * 是否是私密消息。详见 [小程序私密消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/private-message.html) */ + isPrivateMessage?: boolean; + /** 需要基础库: `2.4.0` + * + * 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/updatable-message.html) */ + isUpdatableMessage?: boolean; + /** 接口调用成功的回调函数 */ + success?: UpdateShareMenuSuccessCallback; + /** 需要基础库: `2.4.0` + * + * 动态消息的模板信息 */ + templateInfo?: UpdatableMessageFrontEndTemplateInfo; + /** 需要基础库: `2.11.0` + * + * 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](#) 接口获取。详见[群待办消息](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ + toDoActivityId?: string; + /** 是否使用带 shareTicket 的转发[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) */ + withShareTicket?: boolean; + } + interface UpdateVoIPChatMuteConfigOption { + /** 静音设置 */ + muteConfig: MuteConfig; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: UpdateVoIPChatMuteConfigCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: UpdateVoIPChatMuteConfigFailCallback; + /** 接口调用成功的回调函数 */ + success?: UpdateVoIPChatMuteConfigSuccessCallback; + } + interface UpdateWeChatAppOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: UpdateWeChatAppCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: UpdateWeChatAppFailCallback; + /** 接口调用成功的回调函数 */ + success?: UpdateWeChatAppSuccessCallback; + } + interface UploadFileOption { + /** 要上传文件资源的路径 (本地路径) */ + filePath: string; + /** 文件对应的 key,开发者在服务端可以通过这个 key 获取文件的二进制内容 */ + name: string; + /** 开发者服务器地址 */ + url: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: UploadFileCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: UploadFileFailCallback; + /** HTTP 请求中其他额外的 form data */ + formData?: IAnyObject; + /** HTTP 请求 Header,Header 中不能设置 Referer */ + header?: IAnyObject; + /** 接口调用成功的回调函数 */ + success?: UploadFileSuccessCallback; + /** 需要基础库: `2.10.0` + * + * 超时时间,单位为毫秒 */ + timeout?: number; + } + interface UploadFileSuccessCallbackResult { + /** 开发者服务器返回的数据 */ + data: string; + /** 开发者服务器返回的 HTTP 状态码 */ + statusCode: number; + errMsg: string; + } + interface UploadTaskOnProgressUpdateListenerResult { + /** 上传进度百分比 */ + progress: number; + /** 预期需要上传的数据总长度,单位 Bytes */ + totalBytesExpectedToSend: number; + /** 已经上传的数据长度,单位 Bytes */ + 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; + /** 用户所在城市。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) */ + city: string; + /** 用户所在国家。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) */ + country: string; + /** 用户性别。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) + * + * 可选值: + * - 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'; + /** 用户昵称 */ + nickName: string; + /** 用户所在省份。不再返回,参考 [相关公告](https://developers.weixin.qq.com/community/develop/doc/00028edbe3c58081e7cc834705b801) */ + province: string; + } + /** 需要基础库: `2.28.0` + * + * 人体 anchor + * + * **示例代码** + * + * [静态图像body检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/photo-body-detect) + * + * [实时摄像头body检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/body-detect) */ + interface VKBodyAnchor { + /** 关键点的置信度 */ + confidence: number[]; + /** 识别序号 */ + detectId: number; + /** 唯一标识 */ + id: number; + /** 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + origin: VKOrigin; + /** 关键点 */ + points: VKOrigin[]; + /** 总体置信值 */ + score: number; + /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + size: VKSize; + /** 类型 + * + * 可选值: + * - 5: 人体; */ + type: 5; + } + /** 需要基础库: `2.20.0` + * + * 相机对象 */ + interface VKCamera { + /** 需要基础库: `2.22.0` + * + * 相机内参,只有 v2 版本支持 */ + intrinsics: 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` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 获取投影矩阵 */ + getProjectionMatrix( + /** 近视点 */ + near: number, + /** 远视点 */ + far: number + ): Float32Array; + } + interface VKConfig { + /** 跟踪能力配置,目前不同的跟踪能力之间是互斥的,默认使用平面跟踪能力。需要注意目前 track 中不同的跟踪配置存在互斥关系(比如 marker 跟踪配置和 OSD 跟踪配置不能同时存在),请按需配置。 */ + track: Track; + /** 需要基础库: `2.23.0` + * + * 绑定的 WebGLRenderingContext 对象 */ + gl?: WebGLRenderingContext; + /** 需要基础库: `2.22.0` + * + * vision kit 版本。 + * + * 可选值: + * - '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'; + } + /** 需要基础库: `2.33.0` + * + * depth anchor + * + * **示例代码** + * + * [深度估计能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/depth-detect) */ + interface VKDepthAnchor { + /** 包含深度信息的数组 */ + depthArray: number[]; + /** 唯一标识 */ + id: number; + /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + size: VKSize; + /** 类型 + * + * 可选值: + * - 8: DEPTH; */ + type: 8; + } + /** 需要基础库: `2.25.0` + * + * 人脸 anchor + * + * **示例代码** + * + * [静态图像人脸检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/photo-face-detect) + * + * [实时摄像头人脸检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/face-detect) */ + interface VKFaceAnchor { + /** 人脸角度信息 */ + angle: number[]; + /** 关键点的置信度 */ + confidence: number[]; + /** 识别序号 */ + detectId: number; + /** 唯一标识 */ + id: number; + /** 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + origin: VKOrigin; + /** 人脸 106 个关键点的坐标 */ + points: VKPoint[]; + /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + size: VKSize; + /** 类型 + * + * 可选值: + * - 3: 人脸; */ + type: 3; + } + /** 需要基础库: `2.20.0` + * + * vision kit 会话对象。 */ + interface VKFrame { + /** [VKCamera](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKCamera.html) + * + * 相机对象 */ + camera: VKCamera; + /** 生成时间,单位:纳秒(ns) */ + 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` + * + * 在插件中使用:不支持 + * + * 获取当前帧 rgba buffer。iOS 端微信在 v8.0.20 开始支持,安卓端微信在 v8.0.30 开始支持。按 aspect-fill 规则裁剪,此接口要求在创建 VKSession 对象时必须传入 gl 参数。此接口仅建议拿来做帧分析使用,上屏请使用 getCameraTexture 来代替。 */ + getCameraBuffer( + /** 宽度,受系统限制,必须是 16 的整数倍 */ + width: number, + /** 高度 */ + height: number + ): ArrayBuffer; + /** [Float32Array VKFrame.getDisplayTransform()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getDisplayTransform.html) + * + * 需要基础库: `2.20.0` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 获取纹理调整矩阵。默认获取到的纹理是未经裁剪调整的纹理,此矩阵可用于在着色器中根据帧对象尺寸对纹理进行裁剪。 */ + getDisplayTransform(): Float32Array; + /** [Object VKFrame.getCameraTexture(WebGLRenderingContext gl)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getCameraTexture.html) + * + * 需要基础库: `2.20.0` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 获取当前帧纹理,目前只支持 YUV 纹理。 */ + getCameraTexture( + /** 画布 */ + gl: WebGLRenderingContext + ): YUVTextureRes; + } + /** 需要基础库: `2.28.0` + * + * 手势 anchor + * + * **示例代码** + * + * [静态图像hand检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/photo-hand-detect) + * + * [实时摄像头hand检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/hand-detect) */ + interface VKHandAnchor { + /** 关键点的置信度 */ + confidence: number[]; + /** 识别序号 */ + detectId: number; + /** 手势分类, 返回整数-1到18, -1表示无效手势 + * + * 可选值: + * - 0: 单手比心; + * - 1: 布(数字5); + * - 2: 剪刀(数字2); + * - 3: 握拳; + * - 4: 数字1; + * - 5: 热爱; + * - 6: 点赞; + * - 7: 数字3; + * - 8: 摇滚; + * - 9: 数字6; + * - 10: 数字8; + * - 11: 双手抱拳(恭喜发财); + * - 12: 数字4; + * - 13: 比ok; + * - 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; + /** 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + origin: VKOrigin; + /** 关键点 */ + points: VKOrigin[]; + /** 总体置信值 */ + score: number; + /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + size: VKSize; + /** 类型 + * + * 可选值: + * - 7: 手势; */ + type: 7; + } + interface VKMarker { + /** marker id */ + markerId: number; + /** 图片路径 */ + path: string; + } + /** 需要基础库: `2.24.5` + * + * marker anchor + * + * **示例代码** + * + * [2D Marker能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/2dmarker-ar) */ + interface VKMarkerAnchor { + /** 唯一标识 */ + id: number; + /** marker id */ + markerId: number; + /** 图片路径 */ + path: string; + /** 包含位置、旋转、放缩信息的矩阵,以列为主序 */ + transform: Float32Array; + /** 类型 + * + * 可选值: + * - 1: marker; */ + type: 1; + } + /** 需要基础库: `2.27.0` + * + * OCR anchor + * + * **示例代码** + * + * [静态图像OCR检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/photo-ocr-detect) + * + * [实时摄像头OCR检测能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/ocr-detect) */ + interface VKOCRAnchor { + /** 唯一标识 */ + id: number; + /** 识别的文字结果 */ + text: string; + /** 类型 + * + * 可选值: + * - 6: OCR; */ + type: 6; + } + /** 需要基础库: `2.24.5` + * + * OSD anchor + * + * **示例代码** + * + * [单样本检测(OSD)能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/osd-ar) */ + interface VKOSDAnchor { + /** 唯一标识 */ + id: number; + /** marker id */ + markerId: number; + /** 相对视窗的位置信息,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + origin: VKOrigin; + /** 图片路径 */ + path: string; + /** 相对视窗的尺寸,取值范围为 [0, 1],0 为左/上边缘,1 为右/下边缘 */ + size: VKSize; + /** 类型 + * + * 可选值: + * - 2: OSD; */ + type: 2; + } + interface VKOrigin { + /** 横坐标 */ + x: number; + /** 纵坐标 */ + y: number; + } + /** 需要基础库: `2.22.0` + * + * 平面 anchor,只有 v2 版本支持 + * + * **示例代码** + * + * v1 版本:[水平面AR能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/plane-ar) + * v2 版本:[水平面AR能力v2使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/plane-ar-v2) */ + interface VKPlaneAnchor { + /** 方向 */ + alignment: number; + /** 唯一标识 */ + id: number; + /** 尺寸 */ + size: VKSize; + /** 包含位置、旋转、放缩信息的矩阵,以列为主序 */ + transform: Float32Array; + /** 类型 + * + * 可选值: + * - 0: 平面; */ + type: 0; + } + /** 人脸 106 个关键点的坐标 */ + interface VKPoint { + /** 横坐标 */ + x: number; + /** 纵坐标 */ + y: number; + } + /** 需要基础库: `2.20.0` + * + * vision kit 会话对象。 */ + interface VKSession { + /** 相机尺寸 */ + cameraSize: VKSize; + /** 会话配置 */ + config: VKConfig; + /** 会话状态 + * + * 可选值: + * - 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` + * + * 在插件中使用:需要基础库 `2.24.5` + * + * 获取所有 marker,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.marker 为 true */ + getAllMarker(): VKMarker[]; + /** [Array.<Object> VKSession.getAllOSDMarker()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.getAllOSDMarker.html) + * + * 需要基础库: `2.24.5` + * + * 在插件中使用:需要基础库 `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[]; + /** [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` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 触摸检测,v1 版本只支持单平面(即 hitTest 生成一次平面后,后续 hitTest 均不会再生成平面,而是以之前生成的平面为基础进行检测)。如果需要重新识别其他平面,可以在调用此方法时将 reset 参数置为 true。 */ + hitTest( + /** 相对视窗的横坐标,取值范围为 [0, 1],0 为左边缘,1 为右边缘 */ + x: number, + /** 相对视窗的纵坐标,取值范围为 [0, 1],0 为上边缘,1 为下边缘 */ + y: number, + /** 是否需要重新识别其他平面,v2 版本不再需要此参数 */ + reset: IAnyObject + ): HitTestRes[]; + /** [VKSession.cancelAnimationFrame(number requestID)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.cancelAnimationFrame.html) + * + * 需要基础库: `2.20.0` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 取消由 requestAnimationFrame 添加到计划中的动画帧请求。 */ + cancelAnimationFrame(requestID: number): void; + /** [VKSession.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.destroy.html) + * + * 需要基础库: `2.20.0` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 销毁会话。 */ + destroy(): void; + /** [VKSession.detectBody(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.detectBody.html) + * + * 需要基础库: `2.28.0` + * + * 在插件中使用:需要基础库 `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; + /** [VKSession.detectDepth(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.detectDepth.html) + * + * 需要基础库: `2.33.0` + * + * 在插件中使用:需要基础库 `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; + /** [VKSession.detectFace(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.detectFace.html) + * + * 需要基础库: `2.25.0` + * + * 在插件中使用:需要基础库 `2.25.0` + * + * 静态图像人脸关键点检测。当 wx.createVKSession 参数传入 {track: {face: {mode: 2} } } 时可用。用法详情[指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/face.html)。安卓微信8.0.25开始支持,iOS微信8.0.24开始支持。 + * + * **** + * + * ### 特别说明 + * 若小程序人脸识别功能涉及采集、存储用户生物特征(如人脸照片或视频、身份证和手持身份证、身份证照和免冠照等),此类型服务需使用[微信原生人脸识别接口](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; + /** [VKSession.detectHand(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.detectHand.html) + * + * 需要基础库: `2.28.0` + * + * 在插件中使用:需要基础库 `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; + /** [VKSession.off(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.off.html) + * + * 需要基础库: `2.20.0` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 取消监听会话事件。 */ + off( + /** 事件名称 */ + eventName: string, + /** 事件监听函数 */ + 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` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 监听会话事件。 */ + on( + /** 事件名称 + * + * 参数 eventName 可选值: + * - 'resize': 相机尺寸变化事件,回调参数为相机尺寸; + * - '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', + /** 事件监听函数 */ + 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` + * + * 在插件中使用:需要基础库 `2.24.5` + * + * 删除一个 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; + /** [VKSession.removeOSDMarker(number markerId)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.removeOSDMarker.html) + * + * 需要基础库: `2.24.5` + * + * 在插件中使用:需要基础库 `2.24.5` + * + * 删除一个 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; + /** [VKSession.runOCR(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.runOCR.html) + * + * 需要基础库: `2.27.0` + * + * 在插件中使用:需要基础库 `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; + /** [VKSession.start(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.start.html) + * + * 需要基础库: `2.20.0` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 开启会话。 */ + start( + /** 开启会话回调 */ + callback: VKSessionStartCallback + ): void; + /** [VKSession.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.stop.html) + * + * 需要基础库: `2.20.0` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 停止会话。 */ + stop(): void; + /** [VKSession.update3DMode(boolean open3d)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.update3DMode.html) + * + * 需要基础库: `2.30.2` + * + * 在插件中使用:需要基础库 `2.30.2` + * + * 开启3D模式 */ + update3DMode( + /** 是否开启 */ + open3d: boolean + ): void; + /** [VKSession.updateOSDThreshold(number threshold)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.updateOSDThreshold.html) + * + * 需要基础库: `2.24.5` + * + * 在插件中使用:需要基础库 `2.24.5` + * + * 更新 OSD 识别精确度,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.OSD 为 true */ + updateOSDThreshold( + /** 阈值 */ + 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` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 获取帧对象,每调用一次都会触发一次帧分析过程。目前 VKSession 相机的最大帧数是 30 fps,因此调用 getVKFrame 的频率也可以限制在 30 fps,以减少渲染开销。 */ + getVKFrame( + /** 宽度 */ + width: number, + /** 高度 */ + height: number + ): VKFrame; + /** [number VKSession.addMarker(string path)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.addMarker.html) + * + * 需要基础库: `2.24.5` + * + * 在插件中使用:需要基础库 `2.24.5` + * + * 添加一个 marker,要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.marker 为 true + * + * **使用提示** + * + * 注意事项: + * 1. 使用 addMarker 接口之前,需要在 createVKSession 的时候声明开启 marker 跟踪。即 wx.createVKSession({ track: { marker: true } }) + * 2. 可以添加多个 marker 图片,但不能重复添加相同的 marker 图片。 + * 3. 在v2模式下同时支持水平面检测与marker检测,同时可输出多个2d/3d marker位姿(需要基础库版本不低于 [2.33.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + * + * ### 2Dmarker + * 对传入的图片有如下要求: + * 1. 格式:jpg/png 格式三通道彩图或者 1 通道灰度图 + * 2. 分辨率:尺寸在 480x480 ~ 1920x1920 之间,建议为 1080 分辨率 + * 3. 宽高比:在 1:1 ~ 16:9 之间,要求尽量方正,避免狭长的图片 + * 4. 质量:目标图像为平面模型,需要占画面主体,避免大面积留白,建议用扫描件 + * + * 示例: + * + * image.png + * + * 建议: + * + * 1. 图片具有丰富的细节 + * 2. 避免重复单一的纹理,例如: + * + * image.png + *
+ * image.png + *
+ * image.png + *
+ * + * 3. 避免使用柔和平滑边缘的纹理及大量渐变图像,例如: + * + * image.png + * + * 4. 避免模糊,建议采用高清、高对比度图像作为识别对象 + * 5. 建议图像有均匀的特征(角点)分布,正确示例: + * + * image.png + * + * 避免角点较少、中间大量空白、没有特征及角点的图像,错误示例: + * + * image.png + * + * ### 3Dmarker + * 现小程序demo支持通过上传视频, 生成对应模型的3dmarker识别文件,后缀名为.map + * + * 对传入的视频有如下要求: + * 1.视频长宽比为16:9或4:3; 短边大于480px + * 2.目标物体易于和背景物体区分出来,同时目标物体放置与背景物体一定距离,放置底面与物体易于区分,底面可以放置一张白纸,例如: + * + * image.png + * + * 3.目标物体最好为刚体,本身不会发生较大形变, 容易变形的物体不适合用作识别对象 + * 4.视频匀速移动,避免模糊,对目标识别面环绕物体拍摄,需要保证相机有足够的平移移动 + * 5.marker物体要求与2d图像要求类似,具有丰富细节,避免重复单一纹理,不反光,无高光 + * 6.拍摄视频中特征纹理丰富,如果marker本身问题较弱,可以在背景中适当添加纹理物体 + * 服务耗时:当前版本30s视频耗时约20分钟,请静待算法返回模型 + * + * 建议: + * + * 1.视频格式:视频帧率30fps,分辨率建议1080p + * 2.视频时长:视频建议时长在20s~30s,超过30s会被截断,时长过短会导致marker效果欠佳 */ + addMarker( + /** 图片路径,目前只支持本地用户图片 */ + path: string + ): number; + /** [number VKSession.addOSDMarker(string path)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.addOSDMarker.html) + * + * 需要基础库: `2.24.5` + * + * 在插件中使用:需要基础库 `2.24.5` + * + * 添加一个 OSD marker(one-shot detection marker),要求调 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 时传入的 track.OSD 为 true + * + * **使用提示** + * + * 注意事项: + * 1. 使用 addOSDMarker 接口之前,需要在 createVKSession 的时候声明开启 OSD 跟踪。即 wx.createVKSession({ track: { OSD: true } }) + * 2. 可以添加多个 OSDMarker 图片,但不能重复添加相同的 OSDMarker 图片。 + * + * 对传入的图片有如下要求: + * 1. 格式:jpg 格式彩色图片 + * 2. 分辨率:尺寸不低于 240x240 + * 3. 宽高比:在 1:1 ~ 16:9 之间,要求尽量方正,避免狭长的图片 + * 4. 质量:目标物体需要占画面主体,避免大面积留白,避免大面积文字,不能含其他物体。 + * + * 示例: + * + * image.png + *
+ * image.png + *
+ * image.png + *
+ * + * 建议: + * + * 1. 具有丰富的细节,避免纯色且形状特点不鲜明的物体,例如: + * + * image.png + * + * 2. 避免模糊,最好采用高清图片 */ + addOSDMarker( + /** 图片路径,目前只支持本地用户图片 */ + path: string + ): number; + /** [number VKSession.requestAnimationFrame(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKSession.requestAnimationFrame.html) + * + * 需要基础库: `2.20.0` + * + * 在插件中使用:需要基础库 `2.20.0` + * + * 在下次进行重绘时执行。 */ + requestAnimationFrame( + /** 执行的 callback */ + callback: (...args: any[]) => any + ): number; + } + interface VKSize { + /** 高度 */ + height: number; + /** 宽度 */ + width: number; + } + interface VibrateLongOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: VibrateLongCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: VibrateLongFailCallback; + /** 接口调用成功的回调函数 */ + success?: VibrateLongSuccessCallback; + } + interface VibrateShortFailCallbackResult { + /** 错误信息 + * + * 可选值: + * - 'style is not support': 当前设备不支持设置震动等级; */ + errMsg: string; + } + interface VibrateShortOption { + /** 需要基础库: `2.13.0` + * + * 震动强度类型,有效值为:heavy、medium、light */ + type: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: VibrateShortCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: VibrateShortFailCallback; + /** 接口调用成功的回调函数 */ + success?: VibrateShortSuccessCallback; + } + interface VideoContextRequestFullScreenOption { + /** 需要基础库: `1.7.0` + * + * 设置全屏时视频的方向,不指定则根据宽高比自动判断。 + * + * 可选值: + * - 0: 正常竖向; + * - 90: 屏幕逆时针90度; + * - -90: 屏幕顺时针90度; */ + direction?: 0 | 90 | -90; + } + interface VideoDecoderStartOption { + /** 需要解码的视频源文件。基础库 2.13.0 以下的版本只支持本地路径。 2.13.0 开始支持 http:// 和 https:// 协议的远程路径。 */ + source: string; + /** 需要基础库: `2.15.0` + * + * 是否不需要音频轨道 */ + abortAudio?: boolean; + /** 需要基础库: `2.15.0` + * + * 是否不需要视频轨道 */ + abortVideo?: boolean; + /** 解码模式。0:按 pts 解码;1:以最快速度解码 */ + mode?: number; + } + interface VoIP1v1ChatUser { + /** 昵称 */ + nickname: string; + /** 小程序内 openid */ + openid: string; + /** 头像 */ + headImage?: string; + } + /** 需要基础库: `2.19.0` +* +* WebAudioContext 实例,通过[wx.createWebAudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.createWebAudioContext.html) 接口获取该实例。 +* +* **示例代码** +* +* ```js +// 监听状态 +const audioCtx = wx.createWebAudioContext() +audioCtx.onstatechange = () => { + console.log(ctx.state) +} +setTimeout(audioCtx.suspend, 1000) +setTimeout(audioCtx.resume, 2000) +``` */ + interface WebAudioContext { + /** 获取当前上下文的时间戳。 */ + currentTime: number; + /** [WebAudioContextNode](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContextNode.html) + * + * 当前上下文的最终目标节点,一般是音频渲染设备。 */ + destination: WebAudioContextNode; + /** 空间音频监听器。 */ + listener: AudioListener; + /** 可写属性,开发者可以对该属性设置一个监听函数,当WebAudio状态改变的时候,会触发开发者设置的监听函数。 */ + onstatechange: (...args: any[]) => any; + /** 采样率,通常在8000-96000之间,通常44100hz的采样率最为常见。 */ + sampleRate: number; + /** 当前WebAudio上下文的状态。可能的值如下:suspended(暂停)、running(正在运行)、closed(已关闭)。需要注意的是,不要在 audioContext close后再访问state属性 */ + state: string; + /** [AnalyserNode WebAudioContext.createAnalyser()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createAnalyser.html) + * + * 需要基础库: `2.22.0` + * + * 在插件中使用:不支持 + * + * 创建一个 AnalyserNode 。可以用来获取音频时间和频率数据,以及实现数据可视化。 */ + createAnalyser(): AnalyserNode; + /** [BiquadFilterNode WebAudioContext.createBiquadFilter()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createBiquadFilter.html) + * + * 在插件中使用:不支持 + * + * 创建一个BiquadFilterNode */ + createBiquadFilter(): BiquadFilterNode; + /** [ChannelMergerNode WebAudioContext.createChannelMerger(number numberOfInputs)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createChannelMerger.html) + * + * 在插件中使用:不支持 + * + * 创建一个ChannelMergerNode */ + createChannelMerger( + /** 输出流中需要保持的输入流的个数 */ + numberOfInputs: number + ): ChannelMergerNode; + /** [ChannelSplitterNode WebAudioContext.createChannelSplitter(number numberOfOutputs)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createChannelSplitter.html) + * + * 在插件中使用:不支持 + * + * 创建一个ChannelSplitterNode */ + createChannelSplitter( + /** 要分别输出的输入音频流中的通道数 */ + numberOfOutputs: number + ): ChannelSplitterNode; + /** [ConstantSourceNode WebAudioContext.createConstantSource()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createConstantSource.html) + * + * 在插件中使用:不支持 + * + * 创建一个ConstantSourceNode */ + createConstantSource(): ConstantSourceNode; + /** [DelayNode WebAudioContext.createDelay(number maxDelayTime)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createDelay.html) + * + * 在插件中使用:不支持 + * + * 创建一个DelayNode */ + createDelay( + /** 最大延迟时间 */ + maxDelayTime: number + ): DelayNode; + /** [DynamicsCompressorNode WebAudioContext.createDynamicsCompressor()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createDynamicsCompressor.html) + * + * 在插件中使用:不支持 + * + * 创建一个DynamicsCompressorNode */ + createDynamicsCompressor(): DynamicsCompressorNode; + /** [GainNode WebAudioContext.createGain()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createGain.html) + * + * 在插件中使用:不支持 + * + * 创建一个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) + * + * 在插件中使用:不支持 + * + * 创建一个IIRFilterNode */ + createIIRFilter( + /** 一个浮点值数组,指定IIR滤波器传递函数的前馈(分子)系数。 */ + feedforward: number[], + /** 一个浮点值数组,指定IIR滤波器传递函数的反馈(分母)系数。 */ + feedback: number[] + ): IIRFilterNode; + /** [OscillatorNode WebAudioContext.createOscillator()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createOscillator.html) + * + * 在插件中使用:不支持 + * + * 创建一个OscillatorNode */ + createOscillator(): OscillatorNode; + /** [PannerNode WebAudioContext.createPanner()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createPanner.html) + * + * 在插件中使用:不支持 + * + * 创建一个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) +* +* 在插件中使用:不支持 +* +* 创建一个PeriodicWaveNode +* +* **注意** +* +* `real`和`imag`数组必须拥有一样的长度,否则抛出错误 +* ```js +const real = new Float32Array(2) +const imag = new Float32Array(2) +real[0] = 0 +imag[0] = 0 +real[1] = 1 +imag[1] = 0 + +const waveNode = audioContext.createPeriodicWave(real, imag, {disableNormalization: true}) +``` */ + createPeriodicWave( + /** 一组余弦项(传统上是A项) */ + real: Float32Array, + /** 一组余弦项(传统上是A项) */ + imag: Float32Array, + /** 一个字典对象,它指定是否应该禁用规范化(默认启用规范化) */ + constraints: Constraints + ): PeriodicWaveNode; + /** [Promise WebAudioContext.close()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.close.html) +* +* 在插件中使用:不支持 +* +* 关闭WebAudioContext +* +* **注意事项** +* +* 同步关闭对应的WebAudio上下文。close后会立即释放当前上下文的资源,不要在close后再次访问state属性。 +* ```js +const audioCtx = wx.createWebAudioContext() +audioCtx.close().then(() => { + console.log(audioCtx.state) // bad case:不应该在close后再访问state +}) +``` */ + close(): Promise; + /** [Promise WebAudioContext.resume()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.resume.html) + * + * 在插件中使用:不支持 + * + * 同步恢复已经被暂停的WebAudioContext上下文 */ + resume(): Promise; + /** [Promise WebAudioContext.suspend()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.suspend.html) + * + * 在插件中使用:不支持 + * + * 同步暂停WebAudioContext上下文 */ + suspend(): Promise; + /** [ScriptProcessorNode WebAudioContext.createScriptProcessor(number bufferSize, number numberOfInputChannels, number numberOfOutputChannels)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createScriptProcessor.html) + * + * 在插件中使用:不支持 + * + * 创建一个ScriptProcessorNode */ + createScriptProcessor( + /** 缓冲区大小,以样本帧为单位 */ + bufferSize: number, + /** 用于指定输入node的声道的数量 */ + numberOfInputChannels: number, + /** 用于指定输出node的声道的数量 */ + numberOfOutputChannels: number + ): ScriptProcessorNode; + /** [WaveShaperNode WebAudioContext.createWaveShaper()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createWaveShaper.html) + * + * 在插件中使用:不支持 + * + * 创建一个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) + * + * 在插件中使用:不支持 + * + * 创建一个AudioBuffer,代表着一段驻留在内存中的短音频 */ + createBuffer( + /** 定义了 buffer 中包含的声频通道数量的整数 */ + numOfChannels: number, + /** 代表 buffer 中的样本帧数的整数 */ + length: number, + /** 线性音频样本的采样率,即每一秒包含的关键帧的个数 */ + sampleRate: number + ): AudioBuffer; + /** [[AudioBuffer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.html) WebAudioContext.decodeAudioData()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.decodeAudioData.html) + * + * 在插件中使用:不支持 + * + * 异步解码一段资源为AudioBuffer。 */ + decodeAudioData(): 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; + } + /** 需要基础库: `2.19.0` + * + * 一类音频处理模块,不同的Node具备不同的功能,如GainNode(音量调整)等。一个WebAudioContextNode可以通过上下文来创建。 + * 目前已经支持以下Node: + * IIRFilterNode + * WaveShaperNode + * ConstantSourceNode + * ChannelMergerNode + * OscillatorNode + * GainNode + * BiquadFilterNode + * PeriodicWaveNode + * BufferSourceNode + * ChannelSplitterNode + * ChannelMergerNode + * DelayNode + * DynamicsCompressorNode + * ScriptProcessorNode + * PannerNode + * AnalyserNode */ + interface WebAudioContextNode { + /** 表示监听器的前向系统在同一笛卡尔坐标系中的水平位置,作为位置(位置x,位置和位置和位置)值。 */ + forwardX: number; + /** 表示听众的前向方向在同一笛卡尔坐标系中作为位置(位置x,位置和位置和位置)值的垂直位置。 */ + forwardY: number; + /** 表示与position (positionX、positionY和positionZ)值在同一笛卡尔坐标系下的听者前进方向的纵向(前后)位置。 */ + forwardZ: number; + /** 右手笛卡尔坐标系中X轴的位置。 */ + positionX: number; + /** 右手笛卡尔坐标系中Y轴的位置。 */ + positionY: number; + /** 右手笛卡尔坐标系中Z轴的位置。 */ + positionZ: number; + /** 设置监听器的方向 */ + setOrientation: (...args: any[]) => any; + /** 设置监听器的位置 + * + * /** */ + setPosition: (...args: any[]) => any; + /** 表示在与position (positionX、positionY和positionZ)值相同的笛卡尔坐标系中侦听器向前方向的水平位置。 */ + upX: number; + /** 表示在与position (positionX、positionY和positionZ)值相同的笛卡尔坐标系中侦听器向上方向的水平位置。 */ + upY: number; + /** 表示在与position (positionX、positionY和positionZ)值相同的笛卡尔坐标系中侦听器向后方向的水平位置。 */ + upZ: number; + } + /** 提供预设的 Wi-Fi 信息列表 */ + interface WifiData { + /** Wi-Fi 的 BSSID */ + BSSID?: string; + /** Wi-Fi 的 SSID */ + SSID?: string; + /** Wi-Fi 设备密码 */ + password?: string; + } + /** Wifi 信息 + * + * **注意** + * + * - 安卓 wx.connectWifi / wx.getConnectedWifi 若设置了 partialInfo:true ,或者调用了 wx.onWifiConnectedWithPartialInfo 事件。将会返回只包含 SSID 属性的 WifiInfo 对象。 + * - iOS wx.getConnectedWifi 若设置了 partialInfo:true ,将会返回只包含 SSID、BSSID 属性的 WifiInfo 对象,且需要用户开启微信定位权限才能正确返回结果。 + * - 在某些情况下,可能 Wi-Fi 已经连接成功,但会因为获取不到完整的 WifiInfo 对象报错。具体错误信息为 errCode: 12010, errMsg: can't gain current wifi 或 no wifi is connected 。如果开发者不需要完整的 WifiInfo 对象,则可以通过采取上述策略解决报错问题。 */ + interface WifiInfo { + /** Wi-Fi 的 BSSID */ + BSSID: string; + /** Wi-Fi 的 SSID */ + SSID: string; + /** 需要基础库: `2.12.0` + * + * Wi-Fi 频段单位 MHz */ + frequency: number; + /** Wi-Fi 是否安全 */ + secure: boolean; + /** Wi-Fi 信号强度, 安卓取值 0 ~ 100 ,iOS 取值 0 ~ 1 ,值越大强度越大 */ + signalStrength: number; + } + interface WindowInfo { + /** 设备像素比 */ + pixelRatio: number; + /** 在竖屏正方向下的安全区域。部分机型没有安全区域概念,也不会返回 safeArea 字段,开发者需自行兼容。 */ + safeArea: SafeArea; + /** 屏幕高度,单位px */ + screenHeight: number; + /** 窗口上边缘的y值 */ + screenTop: number; + /** 屏幕宽度,单位px */ + screenWidth: number; + /** 状态栏的高度,单位px */ + statusBarHeight: number; + /** 可使用窗口高度,单位px */ + windowHeight: number; + /** 可使用窗口宽度,单位px */ + windowWidth: number; + } + /** Worker 实例,主线程中可通过 [wx.createWorker](https://developers.weixin.qq.com/miniprogram/dev/api/worker/wx.createWorker.html) 接口获取,worker 线程中可通过全局变量 `worker` 获取。 +* +* **示例代码** +* +* 运行以下代码需先进行基础配置,详细请查阅 [小程序多线程](https://developers.weixin.qq.com/miniprogram/dev/framework/workers.html) | [小游戏多线程](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/worker.html) 文档了解基础知识和配置方法。 +* +* ```js +const worker = wx.createWorker('workers/request/index.js') // 文件名指定 worker 的入口文件路径,绝对路径 + +worker.onMessage(function (res) { + console.log(res) +}) +// 监听worker被系统回收事件 +worker.onProcessKilled(function () { + console.log('worker has been killed') + // 重新创建一个worker + // wx.createWorker() +}) + +worker.postMessage({ + msg: 'hello worker' +}) + +worker.terminate() +``` */ + interface Worker { + /** worker内的环境变量 */ + env: WorkerEnv; + /** [ArrayBuffer Worker.getCameraFrameData()](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.getCameraFrameData.html) +* +* 需要基础库: `2.25.1` +* +* 在插件中使用:不支持 +* +* 获取摄像头当前帧图像,返回ArrayBuffer数据。仅限在 worker 线程中使用。 +* +* **示例代码** +* +* ```js +// app.js +const worker = wx.createWorker('workers/index.js', { + useExperimentalWorker: true +}) + +const cameraContext = wx.createCameraContext() +const cameraFrameListener = cameraContext.onCameraFrame(function() {}) +cameraFrameListener.start({ + worker: worker +}) +``` +* +* ```js +// workers/index.js +const data = worker.getCameraFrameData() +console.log(data) +``` */ + getCameraFrameData(): ArrayBuffer; + /** [Worker.onMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.onMessage.html) + * + * 在插件中使用:不支持 + * + * 监听主线程/Worker 线程向当前线程发送的消息的事件。 */ + onMessage( + /** 主线程/Worker 线程向当前线程发送的消息的事件的监听函数 */ + listener: WorkerOnMessageCallback + ): void; + /** [Worker.onProcessKilled(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.onProcessKilled.html) + * + * 在插件中使用:不支持 + * + * 监听 worker线程被系统回收事件(开启 useExperimentalWorker 后,当iOS系统资源紧张时,ExperimentalWorker 线程存在被系统回收的可能,开发者可监听此事件并重新创建一个worker)。仅限在主线程 worker 对象上调用。 */ + onProcessKilled( + /** worker线程被系统回收事件的监听函数 */ + listener: OnProcessKilledCallback + ): void; + /** [Worker.postMessage(Object message)](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.postMessage.html) +* +* 在插件中使用:不支持 +* +* 向主线程/Worker 线程发送的消息。 +* +* **示例代码** +* +* worker 线程中 +* ```js +worker.postMessage({ + msg: 'hello from worker' +}) +``` +* +* 主线程中 +* ```js +const worker = wx.createWorker('workers/request/index.js') + +worker.postMessage({ + msg: 'hello from main' +}) +``` +* +* **提醒** +* +* 在基础库版本2.20.2之前,postMessage仅支持传递可序列化的key-value对象。 +* 在基础库2.20.2之后,postMessage支持传递任意类型的数据。 */ + postMessage( + /** 需要发送的消息。 */ + message: IAnyObject + ): void; + /** [Worker.terminate()](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.terminate.html) + * + * 在插件中使用:不支持 + * + * 结束当前 Worker 线程。仅限在主线程 worker 对象上调用。 */ + terminate(): void; + /** [Worker.testOnProcessKilled()](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.testOnProcessKilled.html) +* +* 需要基础库: `2.27.1` +* +* 在插件中使用:不支持 +* +* 用于模拟 iOS ExperimentalWorker 线程被系统回收事件,以便于调试。接口仅在 worker 线程内可用。参考 [Worker.onProcessKilled](https://developers.weixin.qq.com/miniprogram/dev/api/worker/Worker.onProcessKilled.html) +* +* **示例代码** +* +* ```js +// game.js +const worker = wx.createWorker('workers/index.js', { + useExperimentalWorker: true +}) + +// 监听 ExperimentalWorker 被系统回收事件 +worker.onProcessKilled(function () { + console.log('worker has been killed') + // 重新创建一个worker + // wx.createWorker() +}) +``` +* +* ```js +// workers/index.js +setTimeout(() => { + // 模拟 ExperimentalWorker 线程被系统回收事件 + worker.testOnProcessKilled() +}, 2000) +``` */ + testOnProcessKilled(): void; + } + /** worker内的环境变量 */ + interface WorkerEnv { + /** 文件系统中的用户目录路径 (本地路径) */ + USER_DATA_PATH: string; + } + interface WorkerOnMessageListenerResult { + /** 主线程/Worker 线程向当前线程发送的消息 */ + message: IAnyObject; + } + /** Easing 模块实现了常见的动画缓动函数(动画效果参考 https://easings.net/ ),可从 [wx.worklet](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/wx.worklet.html) 对象中读取。 +* +* **** +* +* ## 示例代码 +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/f94TCOmg7JFH) +* +* ### 预置动画函数 +* +* * [Easing.bounce](#Easing.bounce) 反弹动画 +* * [Easing.ease](#Easing.ease) 惯性动画 +* * [Easing.elastic](#Easing.elastic) 弹性动画 +* +* ### 标准缓动函数 +* +* * [Easing.linear](#Easing.linear) 线性 +* * [Easing.quad](#Easing.quad) 二次方 +* * [Easing.cubic](#Easing.cubic) 三次方 +* * [Easing.poly](#Easing.poly) 实现其它幂函数 +* +* ### 其它数学函数 +* +* * [Easing.bezier](#Easing.bezier) 三次贝塞尔曲线 +* * [Easing.circle](#Easing.circle) 圆形曲线 +* * [Easing.sin](#Easing.sin) 正弦函数 +* * [Easing.exp](#Easing.exp) 指数函数 +* +* ### 缓动方式 +* +* 以上效果均有三种缓动方式 +* +* * [Easing.in](#in) 正向执行缓动函数 +* * [Easing.out](#out) 反向执行缓动函数 +* * [Easing.inOut](#inout) 前半程正向,后半程反向 +* 以 `sin` 函数为例,其中 `Easing.in(Easing.sin)` 和直接使用 `Easing.sin` 效果相同。 +* +* 1. `Easing.in(Easing.sin)` 动画效果参考 https://easings.net/#easeInSine +* 2. `Easing.out(Easing.sin)` 动画效果参考 https://easings.net/#easeOutSine +* 3. `Easing.inOut(Easing.sin)` 动画效果参考 https://easings.net/#easeInOutSine +* +* ### Easing.bounce +* +* 简单的反弹效果,[动画效果参考](https://easings.net/#easeInBounce) +* +* ```js +Easing.bounce(t) +``` +* +* ### Easing.ease +* +* 简单的惯性动画,[动画效果参考](https://cubic-bezier.com/#.42,0,1,1) +* +* ```js +Easing.ease(t) +``` +* +* ### Easing.elastic +* +* 简单的弹性动画,类似弹簧来回摆动,高阶函数。默认弹性为 1,会稍微超出一次。弹性为 0 时 不会过冲。[动画效果参考](https://easings.net/#easeInElastic) +* +* ```js +Easing.elastic(bounciness = 1) +``` +* +* ### Easing.linear +* +* 线性函数,f(t) = t,[动画效果参考](https://cubic-bezier.com/#0,0,1,1) +* +* ```js +Easing.linear(t) +``` +* ### Easing.quad +* +* 二次方函数,f(t) = t * t,[动画效果参考](https://easings.net/#easeInQuad) +* +* ```js +Easing.quad(t) +``` +* +* ### Easing.cubic +* +* 立方函数,f(t) = t * t * t,[动画效果参考](https://easings.net/#easeInCubic) +* +* ```js +Easing.cubic(t) +``` +* +* ### Easing.poly +* +* 高阶函数,返回幂函数 +* +* poly(4): [动画效果参考](https://easings.net/#easeInQuart) +* +* poly(5): [动画效果参考](https://easings.net/#easeInQuint) +* +* ```js +Easing.poly(n) +``` +* +* ### Easing.bezier +* +* 三次贝塞尔曲线,效果同 css `transition-timing-function` +* +* 调试参数可借助 [可视化工具](https://cubic-bezier.com/) +* +* ```js +Easing.bezier(x1, y1, x2, y2) +``` +* +* ### Easing.circle +* +* 圆形曲线,[动画效果参考](https://easings.net/#easeInCirc) +* +* ```js +Easing.circle(t) +``` +* +* ### Easing.sin +* +* 正弦函数,[动画效果参考](https://easings.net/#easeInSine) +* +* ```js +Easing.sin(t) +``` +* +* ### Easing.exp +* +* 指数函数,[动画效果参考](https://easings.net/#easeInExpo) +* +* ```js +Easing.exp(t) +``` +* +* ### Easing.in +* +* 正向运行 `easing function`,高阶函数。 +* +* ```js +Easing.in(easing) +``` +* +* ### Easing.out +* +* 反向运行 `easing function`,高阶函数。 +* +* ```js +Easing.out(easing) +``` +* +* ### Easing.inOut +* +* 前半程正向,后半程反向,高阶函数。 +* +* ```js +Easing.inOut(easing) +``` */ + interface WorkletEasing {} + interface WriteBLECharacteristicValueOption { + /** 蓝牙特征的 UUID */ + characteristicId: string; + /** 蓝牙设备 id */ + deviceId: string; + /** 蓝牙特征对应服务的 UUID */ + serviceId: string; + /** 蓝牙设备特征对应的二进制值 */ + value: ArrayBuffer; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: WriteBLECharacteristicValueCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: WriteBLECharacteristicValueFailCallback; + /** 接口调用成功的回调函数 */ + success?: WriteBLECharacteristicValueSuccessCallback; + /** 蓝牙特征值的写模式设置,有两种模式,iOS 优先 write,安卓优先 writeNoResponse 。(基础库 2.22.0 开始支持) + * + * 可选值: + * - 'write': 强制回复写,不支持时报错; + * - 'writeNoResponse': 强制无回复写,不支持时报错; */ + writeType?: 'write' | 'writeNoResponse'; + } + interface WriteCharacteristicValueObject { + /** 蓝牙特征的 UUID */ + characteristicId: string; + /** 是否需要通知主机 value 已更新 */ + needNotify: boolean; + /** 蓝牙特征对应服务的 UUID */ + serviceId: string; + /** characteristic 对应的二进制值 */ + value: ArrayBuffer; + /** 可选,处理回包时使用 */ + callbackId?: number; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: WriteCharacteristicValueCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: WriteCharacteristicValueFailCallback; + /** 接口调用成功的回调函数 */ + success?: WriteCharacteristicValueSuccessCallback; + } + interface WriteFileOption { + /** 要写入的文本或二进制数据 */ + data: string | ArrayBuffer; + /** 要写入的文件路径 (本地路径) */ + filePath: string; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: WriteFileCompleteCallback; + /** 指定写入文件的字符编码 + * + * 可选值: + * - 'ascii': ; + * - 'base64': (注意,选择 base64 编码,data 只需要传 base64 内容本身,不要传 Data URI 前缀,否则会报 fail base64 encode error 错误。例如,传 aGVsbG8= 而不是传 data:image/png;base64,aGVsbG8= ); + * - '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; + /** 接口调用成功的回调函数 */ + success?: WriteFileSuccessCallback; + } + interface WriteNdefMessageOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: WriteNdefMessageCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: WriteNdefMessageFailCallback; + /** 二进制对象数组, 需要指明 id, type 以及 payload (均为 ArrayBuffer 类型) */ + records?: any[]; + /** 接口调用成功的回调函数 */ + success?: WriteNdefMessageSuccessCallback; + /** text 数组 */ + texts?: any[]; + /** uri 数组 */ + uris?: any[]; + } + interface WriteOption { + /** 写入的内容,类型为 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; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: WriteCompleteCallback; + /** 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8 + * + * 可选值: + * - '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; + /** 只在 data 类型是 ArrayBuffer 时有效,指定要写入的字节数,默认为 arrayBuffer 从0开始偏移 offset 个字节后剩余的字节数 */ + length?: number; + /** 只在 data 类型是 ArrayBuffer 时有效,决定 arrayBuffe 中要被写入的部位,即 arrayBuffer 中的索引,默认0 */ + offset?: number; + /** 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 */ + position?: number; + /** 接口调用成功的回调函数 */ + success?: WriteSuccessCallback; + } + /** 文件写入结果。 通过 [FileSystemManager.writeSync](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeSync.html) 接口返回 */ + interface WriteResult { + /** 实际被写入到文件中的字节数(注意,被写入的字节数不一定与被写入的字符串字符数相同) */ + bytesWritten: number; + } + interface WriteSuccessCallbackResult { + /** 实际被写入到文件中的字节数(注意,被写入的字节数不一定与被写入的字符串字符数相同) */ + bytesWritten: number; + errMsg: string; + } + interface WriteSyncOption { + /** 写入的内容,类型为 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; + /** 只在 data 类型是 String 时有效,指定写入文件的字符编码,默认为 utf8 + * + * 可选值: + * - '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; + /** 只在 data 类型是 ArrayBuffer 时有效,决定 arrayBuffe 中要被写入的部位,即 arrayBuffer 中的索引,默认0 */ + offset?: number; + /** 指定文件开头的偏移量,即数据要被写入的位置。当 position 不传或者传入非 Number 类型的值时,数据会被写入当前指针所在位置。 */ + position?: number; + } + interface WxStartRecordOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StartRecordCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StartRecordFailCallback; + /** 接口调用成功的回调函数 */ + success?: WxStartRecordSuccessCallback; + } + interface WxStopRecordOption { + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + complete?: StopRecordCompleteCallback; + /** 接口调用失败的回调函数 */ + fail?: StopRecordFailCallback; + /** 接口调用成功的回调函数 */ + success?: WxStopRecordSuccessCallback; + } + /** 运动数据列表 */ + interface WxaSportRecord { + /** 消耗卡路里 */ + calorie: number; + /** 运动距离 */ + distance: number; + /** 运动时长 */ + time: number; + /** 运动项目id */ + typeId: number; + } + /** 帧纹理对象 */ + interface YUVTextureRes { + /** UV 分量纹理 */ + uvTexture: WebGLTexture; + /** Y 分量纹理 */ + yTexture: WebGLTexture; + } + /** 文件路径 */ + interface ZipFileItem { + /** 文件内容 */ + data: string | ArrayBuffer; + /** 错误信息 */ + errMsg: string; + } + interface Animation { + /** [Object Animation.export()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/animation/Animation.export.html) + * + * 在插件中使用:支持 + * + * 导出动画队列。**export 方法每次调用后会清掉之前的动画操作。** */ + 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) + * + * 在插件中使用:支持 + * + * 设置背景色 */ + backgroundColor( + /** 颜色值 */ + 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) + * + * 在插件中使用:支持 + * + * 设置 bottom 值 */ + bottom( + /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ + 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) + * + * 在插件中使用:支持 + * + * 设置高度 */ + height( + /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ + 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) + * + * 在插件中使用:支持 + * + * 设置 left 值 */ + left( + /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ + 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; + /** [[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; + /** [[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) + * + * 在插件中使用:支持 + * + * 设置透明度 */ + opacity( + /** 透明度,范围 0-1 */ + 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) + * + * 在插件中使用:支持 + * + * 设置 right 值 */ + right( + /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ + 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) + * + * 在插件中使用:支持 + * + * 从原点顺时针旋转一个角度 */ + rotate( + /** 旋转的角度。范围 [-180, 180] */ + 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) + * + * 在插件中使用:支持 + * + * 从 固定 轴顺时针旋转一个角度 */ + rotate3d( + /** 旋转轴的 x 坐标 */ + x: number, + /** 旋转轴的 y 坐标 */ + y: number, + /** 旋转轴的 z 坐标 */ + z: number, + /** 旋转的角度。范围 [-180, 180] */ + 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) + * + * 在插件中使用:支持 + * + * 从 X 轴顺时针旋转一个角度 */ + rotateX( + /** 旋转的角度。范围 [-180, 180] */ + 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) + * + * 在插件中使用:支持 + * + * 从 Y 轴顺时针旋转一个角度 */ + rotateY( + /** 旋转的角度。范围 [-180, 180] */ + 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) + * + * 在插件中使用:支持 + * + * 从 Z 轴顺时针旋转一个角度 */ + rotateZ( + /** 旋转的角度。范围 [-180, 180] */ + 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) + * + * 在插件中使用:支持 + * + * 缩放 */ + scale( + /** 当仅有 sx 参数时,表示在 X 轴、Y 轴同时缩放sx倍数 */ + sx: number, + /** 在 Y 轴缩放 sy 倍数 */ + 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) + * + * 在插件中使用:支持 + * + * 缩放 */ + scale3d( + /** x 轴的缩放倍数 */ + sx: number, + /** y 轴的缩放倍数 */ + sy: number, + /** z 轴的缩放倍数 */ + 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) + * + * 在插件中使用:支持 + * + * 缩放 X 轴 */ + scaleX( + /** X 轴的缩放倍数 */ + 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) + * + * 在插件中使用:支持 + * + * 缩放 Y 轴 */ + scaleY( + /** Y 轴的缩放倍数 */ + 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) + * + * 在插件中使用:支持 + * + * 缩放 Z 轴 */ + scaleZ( + /** Z 轴的缩放倍数 */ + 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) + * + * 在插件中使用:支持 + * + * 对 X、Y 轴坐标进行倾斜 */ + skew( + /** 对 X 轴坐标倾斜的角度,范围 [-180, 180] */ + ax: number, + /** 对 Y 轴坐标倾斜的角度,范围 [-180, 180] */ + 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) + * + * 在插件中使用:支持 + * + * 对 X 轴坐标进行倾斜 */ + skewX( + /** 倾斜的角度,范围 [-180, 180] */ + 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) + * + * 在插件中使用:支持 + * + * 对 Y 轴坐标进行倾斜 */ + skewY( + /** 倾斜的角度,范围 [-180, 180] */ + 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; + /** [[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) + * + * 在插件中使用:支持 + * + * 设置 top 值 */ + top( + /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ + 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) + * + * 在插件中使用:支持 + * + * 平移变换 */ + translate( + /** 当仅有该参数时表示在 X 轴偏移 tx,单位 px */ + tx?: number, + /** 在 Y 轴平移的距离,单位为 px */ + 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) + * + * 在插件中使用:支持 + * + * 对 xyz 坐标进行平移变换 */ + translate3d( + /** 在 X 轴平移的距离,单位为 px */ + tx?: number, + /** 在 Y 轴平移的距离,单位为 px */ + ty?: number, + /** 在 Z 轴平移的距离,单位为 px */ + 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) + * + * 在插件中使用:支持 + * + * 对 X 轴平移 */ + translateX( + /** 在 X 轴平移的距离,单位为 px */ + 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) + * + * 在插件中使用:支持 + * + * 对 Y 轴平移 */ + translateY( + /** 在 Y 轴平移的距离,单位为 px */ + 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) + * + * 在插件中使用:支持 + * + * 对 Z 轴平移 */ + translateZ( + /** 在 Z 轴平移的距离,单位为 px */ + 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) + * + * 在插件中使用:支持 + * + * 设置宽度 */ + width( + /** 长度值,如果传入 number 则默认使用 px,可传入其他自定义单位的长度值 */ + value: number | string + ): Animation; + } + interface AudioContext { + /** [AudioContext.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.pause.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) 替换 + * + * 暂停音频。 */ + 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; + /** [AudioContext.seek(number position)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.seek.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) 替换 + * + * 跳转到指定位置。 */ + seek( + /** 跳转位置,单位 s */ + position: number + ): void; + /** [AudioContext.setSrc(string src)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.setSrc.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) 替换 + * + * 设置音频地址 */ + setSrc( + /** 音频地址 */ + src: string + ): void; + } + interface BLEPeripheralServer { + /** [BLEPeripheralServer.addService(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.addService.html) + * + * 需要基础库: `2.10.3` + * + * 在插件中使用:不支持 + * + * 添加服务。 */ + 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` + * + * 在插件中使用:不支持 + * + * 关闭当前服务端。 */ + 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` +* +* 在插件中使用:不支持 +* +* 移除已连接的设备请求读当前外围设备的特征值事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +BLEPeripheralServer.onCharacteristicReadRequest(listener) +BLEPeripheralServer.offCharacteristicReadRequest(listener) // 需传入与监听时同一个的函数对象 +``` */ + offCharacteristicReadRequest( + /** onCharacteristicReadRequest 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffCharacteristicReadRequestCallback + ): void; + /** [BLEPeripheralServer.offCharacteristicSubscribed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicSubscribed.html) +* +* 需要基础库: `2.13.0` +* +* 在插件中使用:不支持 +* +* 移除特征订阅事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +BLEPeripheralServer.onCharacteristicSubscribed(listener) +BLEPeripheralServer.offCharacteristicSubscribed(listener) // 需传入与监听时同一个的函数对象 +``` */ + offCharacteristicSubscribed( + /** onCharacteristicSubscribed 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffCharacteristicSubscribedCallback + ): void; + /** [BLEPeripheralServer.offCharacteristicUnsubscribed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicUnsubscribed.html) +* +* 需要基础库: `2.13.0` +* +* 在插件中使用:不支持 +* +* 移除取消特征订阅事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +BLEPeripheralServer.onCharacteristicUnsubscribed(listener) +BLEPeripheralServer.offCharacteristicUnsubscribed(listener) // 需传入与监听时同一个的函数对象 +``` */ + offCharacteristicUnsubscribed( + /** onCharacteristicUnsubscribed 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffCharacteristicUnsubscribedCallback + ): void; + /** [BLEPeripheralServer.offCharacteristicWriteRequest(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.offCharacteristicWriteRequest.html) +* +* 需要基础库: `2.10.3` +* +* 在插件中使用:不支持 +* +* 移除已连接的设备请求写当前外围设备的特征值事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +BLEPeripheralServer.onCharacteristicWriteRequest(listener) +BLEPeripheralServer.offCharacteristicWriteRequest(listener) // 需传入与监听时同一个的函数对象 +``` */ + offCharacteristicWriteRequest( + /** onCharacteristicWriteRequest 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffCharacteristicWriteRequestCallback + ): void; + /** [BLEPeripheralServer.onCharacteristicReadRequest(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicReadRequest.html) + * + * 需要基础库: `2.10.3` + * + * 在插件中使用:不支持 + * + * 监听已连接的设备请求读当前外围设备的特征值事件。收到该消息后需要立刻调用 [writeCharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 写回数据,否则主机不会收到响应。 */ + onCharacteristicReadRequest( + /** 已连接的设备请求读当前外围设备的特征值事件的监听函数 */ + listener: OnCharacteristicReadRequestCallback + ): void; + /** [BLEPeripheralServer.onCharacteristicSubscribed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicSubscribed.html) + * + * 需要基础库: `2.13.0` + * + * 在插件中使用:不支持 + * + * 监听特征订阅事件,仅 iOS 支持。 */ + onCharacteristicSubscribed( + /** 特征订阅事件的监听函数 */ + listener: OnCharacteristicSubscribedCallback + ): void; + /** [BLEPeripheralServer.onCharacteristicUnsubscribed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicUnsubscribed.html) + * + * 需要基础库: `2.13.0` + * + * 在插件中使用:不支持 + * + * 监听取消特征订阅事件,仅 iOS 支持。 */ + onCharacteristicUnsubscribed( + /** 取消特征订阅事件的监听函数 */ + listener: OnCharacteristicUnsubscribedCallback + ): void; + /** [BLEPeripheralServer.onCharacteristicWriteRequest(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.onCharacteristicWriteRequest.html) + * + * 需要基础库: `2.10.3` + * + * 在插件中使用:不支持 + * + * 监听已连接的设备请求写当前外围设备的特征值事件。收到该消息后需要立刻调用 [writeCharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.writeCharacteristicValue.html) 写回数据,否则主机不会收到响应。 */ + onCharacteristicWriteRequest( + /** 已连接的设备请求写当前外围设备的特征值事件的监听函数 */ + listener: OnCharacteristicWriteRequestCallback + ): void; + /** [BLEPeripheralServer.removeService(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/BLEPeripheralServer.removeService.html) + * + * 需要基础库: `2.10.3` + * + * 在插件中使用:不支持 + * + * 移除服务。 */ + 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` + * + * 在插件中使用:不支持 + * + * 开始广播本地创建的外围设备。 + * + * **注意** + * + * - Android 8.0.9 开始,支持直接使用 16/32/128 位 UUID; + * - Android 8.0.9 以下版本只支持 128 位 UUID,使用 16/32 位的 UUID 时需要进行补位(系统会自动识别是否属于预分配区间),可以参考[蓝牙指南](https://developers.weixin.qq.com/miniprogram/dev/framework/device/ble.html); + * - iOS 必须直接使用 16 位的 UUID,不能补位到 128 位,否则系统组包时仍会按照 128 位传输。iOS 暂不支持 32 位 UUID。 + * - iOS 同时只能发起一个广播,安卓支持同时发起多个广播。 + * - 传 beacon 参数时,不能同时传入 deviceName,serviceUuids,manufacturerData 参数。 */ + 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` + * + * 在插件中使用:不支持 + * + * 停止广播。 */ + 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` + * + * 在插件中使用:不支持 + * + * 往指定特征写入二进制数据值,并通知已连接的主机,从机的特征值已发生变化,该接口会处理是走回包还是走订阅。 */ + writeCharacteristicValue(Object: WriteCharacteristicValueObject): void; + } + interface BackgroundAudioError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 10001 | | 系统错误 | + * | 10002 | | 网络错误 | + * | 10003 | | 文件错误,请检查是否responseheader是否缺少Content-Length | + * | 10004 | | 格式错误 | + * | -1 | | 未知错误 | */ errMsg: string; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 10001 | | 系统错误 | + * | 10002 | | 网络错误 | + * | 10003 | | 文件错误,请检查是否responseheader是否缺少Content-Length | + * | 10004 | | 格式错误 | + * | -1 | | 未知错误 | */ errCode: number; + } + interface BeaconError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 0 | ok | 正常 | + * | 11000 | unsupport | 系统或设备不支持 | + * | 11001 | bluetooth service unavailable | 蓝牙服务不可用 | + * | 11002 | location service unavailable | 位置服务不可用 | + * | 11003 | already start | 已经开始搜索 | + * | 11004 | not startBeaconDiscovery | 还未开始搜索 | + * | 11005 | system error | 系统错误 | + * | 11006 | invalid data | 参数不正确 | */ errMsg: string; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 0 | ok | 正常 | + * | 11000 | unsupport | 系统或设备不支持 | + * | 11001 | bluetooth service unavailable | 蓝牙服务不可用 | + * | 11002 | location service unavailable | 位置服务不可用 | + * | 11003 | already start | 已经开始搜索 | + * | 11004 | not startBeaconDiscovery | 还未开始搜索 | + * | 11005 | system error | 系统错误 | + * | 11006 | invalid data | 参数不正确 | */ errCode: number; + } + interface BluetoothError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 0 | ok | 正常 | + * | -1 | already connect | 已连接 | + * | 10000 | not init | 未初始化蓝牙适配器 | + * | 10001 | not available | 当前蓝牙适配器不可用 | + * | 10002 | no device | 没有找到指定设备 | + * | 10003 | connection fail | 连接失败 | + * | 10004 | no service | 没有找到指定服务 | + * | 10005 | no characteristic | 没有找到指定特征 | + * | 10006 | no connection | 当前连接已断开 | + * | 10007 | property not support | 当前特征不支持此操作 | + * | 10008 | system error | 其余所有系统上报的异常 | + * | 10009 | system not support | Android 系统特有,系统版本低于 4.3 不支持 BLE | + * | 10012 | operate time out | 连接超时 | + * | 10013 | invalid_data | 连接 deviceId 为空或者是格式不正确 | */ errMsg: string; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 0 | ok | 正常 | + * | -1 | already connect | 已连接 | + * | 10000 | not init | 未初始化蓝牙适配器 | + * | 10001 | not available | 当前蓝牙适配器不可用 | + * | 10002 | no device | 没有找到指定设备 | + * | 10003 | connection fail | 连接失败 | + * | 10004 | no service | 没有找到指定服务 | + * | 10005 | no characteristic | 没有找到指定特征 | + * | 10006 | no connection | 当前连接已断开 | + * | 10007 | property not support | 当前特征不支持此操作 | + * | 10008 | system error | 其余所有系统上报的异常 | + * | 10009 | system not support | Android 系统特有,系统版本低于 4.3 不支持 BLE | + * | 10012 | operate time out | 连接超时 | + * | 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) + * + * 需要基础库: `2.10.0` + * + * 在插件中使用:支持 + * + * 设置缩放级别 */ + 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; + /** [CameraContext.stopRecord(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraContext.stopRecord.html) + * + * 在插件中使用:支持 + * + * 结束录像 */ + 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; + /** [[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` +* +* 在插件中使用:不支持 +* +* 获取 Camera 实时帧数据 +* +* **** +* +* 注: 使用该接口需同时在 [camera](https://developers.weixin.qq.com/miniprogram/dev/component/camera.html) 组件属性中指定 frame-size。 +* +* **示例代码** +* +* ```js +const context = wx.createCameraContext() +const listener = context.onCameraFrame((frame) => { + console.log(frame.data instanceof ArrayBuffer, frame.width, frame.height) +}) +listener.start() +``` */ + onCameraFrame( + /** 回调函数 */ + callback: OnCameraFrameCallback + ): CameraFrameListener; + } + interface CameraFrameListener { + /** [CameraFrameListener.start(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/camera/CameraFrameListener.start.html) + * + * 在插件中使用:不支持 + * + * 开始监听帧数据 */ + 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; + } + interface CanvasGradient { + /** [CanvasGradient.addColorStop(number stop, string color)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasGradient.addColorStop.html) +* +* 在插件中使用:不支持 +* @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) 替换 +* +* @warning **CanvasContext 是旧版的接口,新版 [Canvas 2D](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 接口与 Web 一致** +* +* 添加颜色的渐变点。小于最小 stop 的部分会按最小 stop 的 color 来渲染,大于最大 stop 的部分会按最大 stop 的 color 来渲染 +* +* **示例代码** +* +* ```js +const ctx = wx.createCanvasContext('myCanvas') + +// Create circular gradient +const grd = ctx.createLinearGradient(30, 10, 120, 10) +grd.addColorStop(0, 'red') +grd.addColorStop(0.16, 'orange') +grd.addColorStop(0.33, 'yellow') +grd.addColorStop(0.5, 'green') +grd.addColorStop(0.66, 'cyan') +grd.addColorStop(0.83, 'blue') +grd.addColorStop(1, 'purple') + +// Fill with gradient +ctx.setFillStyle(grd) +ctx.fillRect(10, 10, 150, 80) +ctx.draw() +``` +* ![](@program/dev/image/canvas/color-stop.png) */ + addColorStop( + /** 表示渐变中开始与结束之间的位置,范围 0-1。 */ + stop: number, + /** 渐变点的颜色。 */ + color: string + ): void; + } + interface Console { + /** [console.debug()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.debug.html) + * + * 在插件中使用:不支持 + * + * 向调试面板中打印 debug 日志 */ + debug( + /** 日志内容,可以有任意多个。 */ + ...args: any[] + ): void; + /** [console.error()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.error.html) + * + * 在插件中使用:不支持 + * + * 向调试面板中打印 error 日志 */ + error( + /** 日志内容,可以有任意多个。 */ + ...args: any[] + ): void; + /** [console.group(string label)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.group.html) + * + * 在插件中使用:不支持 + * + * 在调试面板中创建一个新的分组。随后输出的内容都会被添加一个缩进,表示该内容属于当前分组。调用 [console.groupEnd](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.groupEnd.html)之后分组结束。 + * + * **注意** + * + * 仅在工具中有效,在 vConsole 中为空函数实现。 */ + group( + /** 分组标记,可选。 */ + label?: string + ): void; + /** [console.groupEnd()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.groupEnd.html) + * + * 在插件中使用:不支持 + * + * 结束由 [console.group](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.group.html) 创建的分组 + * + * **注意** + * + * 仅在工具中有效,在 vConsole 中为空函数实现。 */ + groupEnd(): void; + /** [console.info()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.info.html) + * + * 在插件中使用:不支持 + * + * 向调试面板中打印 info 日志 */ + info( + /** 日志内容,可以有任意多个。 */ + ...args: any[] + ): void; + /** [console.log()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.log.html) + * + * 在插件中使用:不支持 + * + * 向调试面板中打印 log 日志 */ + log( + /** 日志内容,可以有任意多个。 */ + ...args: any[] + ): void; + /** [console.warn()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/console.warn.html) + * + * 在插件中使用:不支持 + * + * 向调试面板中打印 warn 日志 */ + warn( + /** 日志内容,可以有任意多个。 */ + ...args: any[] + ): void; + } + interface DownloadTask { + /** [DownloadTask.abort()](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.abort.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 中断下载任务 */ + abort(): void; + /** [DownloadTask.offHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.offHeadersReceived.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:支持 +* +* 移除 HTTP Response Header 事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +DownloadTask.onHeadersReceived(listener) +DownloadTask.offHeadersReceived(listener) // 需传入与监听时同一个的函数对象 +``` */ + offHeadersReceived( + /** onHeadersReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffHeadersReceivedCallback + ): void; + /** [DownloadTask.offProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.offProgressUpdate.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:支持 +* +* 移除下载进度变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +DownloadTask.onProgressUpdate(listener) +DownloadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函数对象 +``` */ + offProgressUpdate( + /** onProgressUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: DownloadTaskOffProgressUpdateCallback + ): void; + /** [DownloadTask.onHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.onHeadersReceived.html) + * + * 需要基础库: `2.1.0` + * + * 在插件中使用:支持 + * + * 监听 HTTP Response Header 事件。会比请求完成事件更早 */ + onHeadersReceived( + /** HTTP Response Header 事件的监听函数 */ + listener: OnHeadersReceivedCallback + ): void; + /** [DownloadTask.onProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/DownloadTask.onProgressUpdate.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 监听下载进度变化事件 */ + onProgressUpdate( + /** 下载进度变化事件的监听函数 */ + listener: DownloadTaskOnProgressUpdateCallback + ): void; + } + interface EditorContext { + /** [EditorContext.blur(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.blur.html) + * + * 需要基础库: `2.8.3` + * + * 在插件中使用:支持 + * + * 编辑器失焦,同时收起键盘。 */ + blur(option?: BlurOption): void; + /** [EditorContext.clear(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.clear.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 清空编辑器内容 */ + 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` + * + * 在插件中使用:支持 + * + * 修改样式 + * + * **** + * + * ## 支持设置的样式列表 + * | name | value | verson | + * | --------------------------------------------------------- | ------------------------------- | ------ | + * | bold | | 2.7.0 | + * | italic | | 2.7.0 | + * | underline | | 2.7.0 | + * | strike | | 2.7.0 | + * | ins | | 2.7.0 | + * | script | sub / super | 2.7.0 | + * | header | H1 / H2 / h3 / H4 / h5 / H6 | 2.7.0 | + * | align | left / center / right / justify | 2.7.0 | + * | direction | rtl | 2.7.0 | + * | indent | -1 / +1 | 2.7.0 | + * | list | ordered / bullet / check | 2.7.0 | + * | color | hex color | 2.7.0 | + * | backgroundColor | hex color | 2.7.0 | + * | margin/marginTop/marginBottom/marginLeft/marginRight | css style | 2.7.0 | + * | padding/paddingTop/paddingBottom/paddingLeft/paddingRight | css style | 2.7.0 | + * | font/fontSize/fontStyle/fontVariant/fontWeight/fontFamily | css style | 2.7.0 | + * | lineHeight | css style | 2.7.0 | + * | letterSpacing | css style | 2.7.0 | + * | textDecoration | css style | 2.7.0 | + * | textIndent | css style | 2.8.0 | + * | wordWrap | css style | 2.10.2 | + * | wordBreak | css style | 2.10.2 | + * | whiteSpace | css style | 2.10.2 | + * + * 对已经应用样式的选区设置会取消样式。css style 表示 css 中规定的允许值。 */ + format( + /** 属性 */ + name: string, + /** 值 */ + value?: string + ): void; + /** [EditorContext.getContents(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.getContents.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 获取编辑器内容 */ + getContents(option?: GetContentsOption): void; + /** [EditorContext.getSelectionText(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.getSelectionText.html) + * + * 需要基础库: `2.10.2` + * + * 在插件中使用:支持 + * + * 获取编辑器已选区域内的纯文本内容。当编辑器失焦或未选中一段区间时,返回内容为空。 */ + getSelectionText(option?: GetSelectionTextOption): void; + /** [EditorContext.insertDivider(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertDivider.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 插入分割线 */ + insertDivider(option?: InsertDividerOption): void; + /** [EditorContext.insertImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertImage.html) +* +* 需要基础库: `2.7.0` +* +* 在插件中使用:支持 +* +* 插入图片。 +* +* 地址为临时文件时,获取的编辑器html格式内容中 标签增加属性 data-local,delta 格式内容中图片 attributes 属性增加 data-local 字段,该值为传入的临时文件地址。 +* +* 开发者可选择在提交阶段上传图片到服务器,获取到网络地址后进行替换。替换时对于html内容应替换掉 的 src 值,对于 delta 内容应替换掉 `insert { image: abc }` 值。 +* +* **示例代码** +* +* ```javascript +this.editorCtx.insertImage({ + src: 'xx', + width: '100px', + height: '50px', + extClass: className +}) +``` */ + insertImage(option: InsertImageOption): void; + /** [EditorContext.insertText(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.insertText.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 覆盖当前选区,设置一段文本 */ + insertText(option: InsertTextOption): void; + /** [EditorContext.redo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.redo.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 恢复 */ + redo(option?: RedoOption): void; + /** [EditorContext.removeFormat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.removeFormat.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 清除当前选区的样式 */ + removeFormat(option?: RemoveFormatOption): void; + /** [EditorContext.scrollIntoView()](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.scrollIntoView.html) + * + * 需要基础库: `2.8.3` + * + * 在插件中使用:支持 + * + * 使得编辑器光标处滚动到窗口可视区域内。 */ + scrollIntoView(): void; + /** [EditorContext.setContents(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.setContents.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 初始化编辑器内容,html和delta同时存在时仅delta生效 */ + setContents(option: SetContentsOption): void; + /** [EditorContext.undo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.undo.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 撤销 */ + 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) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 该方法返回当前列表中的所有性能数据 */ + 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` + * + * 在插件中使用:不支持 + * + * 获取当前列表中所有名称为 [name] 且类型为 [entryType] 的性能数据 */ + 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` + * + * 在插件中使用:不支持 + * + * 获取当前列表中所有类型为 [entryType] 的性能数据 */ + getEntriesByType(entryType: string): PerformanceEntry[]; + } + interface EventChannel { + /** [EventChannel.emit(string eventName, any args)](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.emit.html) + * + * 需要基础库: `2.7.3` + * + * 在插件中使用:支持 + * + * 触发一个事件 */ + emit( + /** 事件名称 */ + eventName: string, + /** 事件参数 */ + ...args: any + ): void; + /** [EventChannel.off(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.off.html) + * + * 需要基础库: `2.7.3` + * + * 在插件中使用:支持 + * + * 取消监听一个事件。给出第二个参数时,只取消给出的监听函数,否则取消所有监听函数 */ + off( + /** 事件名称 */ + eventName: string, + /** 事件监听函数 */ + fn: EventCallback + ): void; + /** [EventChannel.on(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.on.html) + * + * 需要基础库: `2.7.3` + * + * 在插件中使用:支持 + * + * 持续监听一个事件 */ + on( + /** 事件名称 */ + eventName: string, + /** 事件监听函数 */ + fn: EventCallback + ): void; + /** [EventChannel.once(string eventName, function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.once.html) + * + * 需要基础库: `2.7.3` + * + * 在插件中使用:支持 + * + * 监听一个事件一次,触发后失效 */ + once( + /** 事件名称 */ + eventName: string, + /** 事件监听函数 */ + fn: EventCallback + ): void; + } + interface FileError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 1300001 | operation not permitted | 操作不被允许(例如,filePath 预期传入一个文件而实际传入一个目录) | + * | 1300002 | no such file or directory ${path} | 文件/目录不存在,或者目标文件路径的上层目录不存在 | + * | 1300005 | Input/output error | 输入输出流不可用 | + * | 1300009 | bad file descriptor | 无效的文件描述符 | + * | 1300013 | permission denied | 权限错误,文件是只读或只写 | + * | 1300014 | Path permission denied | 传入的路径没有权限 | + * | 1300020 | not a directory | dirPath 指定路径不是目录,常见于指定的写入路径的上级路径为一个文件的情况 | + * | 1300021 | Is a directory | 指定路径是一个目录 | + * | 1300022 | Invalid argument | 无效参数,可以检查length或offset是否越界 | + * | 1300036 | File name too long | 文件名过长 | + * | 1300066 | directory not empty | 目录不为空 | + * | 1300201 | system error | 系统接口调用失败 | + * | 1300202 | the maximum size of the file storage limit is exceeded | 存储空间不足,或文件大小超出上限(上限100M) | + * | 1300203 | base64 encode error | 字符编码转换失败(例如 base64 格式错误) | + * | 1300300 | sdcard not mounted | android sdcard 挂载失败 | + * | 1300301 | unable to open as fileType | 无法以fileType打开文件 | + * | 1301000 | permission denied, cannot access file path | 目标路径无访问权限(usr目录) | + * | 1301002 | data to write is empty | 写入数据为空 | + * | 1301003 | illegal operation on a directory | 不可对目录进行此操作(例如,指定的 filePath 是一个已经存在的目录) | + * | 1301004 | illegal operation on a package directory | 不可对代码包目录进行此操作 | + * | 1301005 | file already exists ${dirPath} | 已有同名文件或目录 | + * | 1301006 | value of length is out of range | 传入的 length 不合法 | + * | 1301007 | value of offset is out of range | 传入的 offset 不合法 | + * | 1301009 | value of position is out of range | position值越界 | + * | 1301100 | store directory is empty | store目录为空 | + * | 1301102 | unzip open file fail | 压缩文件打开失败 | + * | 1301103 | unzip entry fail | 解压单个文件失败 | + * | 1301104 | unzip fail | 解压失败 | + * | 1301111 | brotli decompress fail | brotli解压失败(例如,指定的 compressionAlgorithm 与文件实际压缩格式不符) | + * | 1301112 | tempFilePath file not exist | 指定的 tempFilePath 找不到文件 | + * | 1302001 | fail permission denied | 指定的 fd 路径没有读权限/没有写权限 | + * | 1302002 | excced max concurrent fd limit | fd数量已达上限 | + * | 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; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 1300001 | operation not permitted | 操作不被允许(例如,filePath 预期传入一个文件而实际传入一个目录) | + * | 1300002 | no such file or directory ${path} | 文件/目录不存在,或者目标文件路径的上层目录不存在 | + * | 1300005 | Input/output error | 输入输出流不可用 | + * | 1300009 | bad file descriptor | 无效的文件描述符 | + * | 1300013 | permission denied | 权限错误,文件是只读或只写 | + * | 1300014 | Path permission denied | 传入的路径没有权限 | + * | 1300020 | not a directory | dirPath 指定路径不是目录,常见于指定的写入路径的上级路径为一个文件的情况 | + * | 1300021 | Is a directory | 指定路径是一个目录 | + * | 1300022 | Invalid argument | 无效参数,可以检查length或offset是否越界 | + * | 1300036 | File name too long | 文件名过长 | + * | 1300066 | directory not empty | 目录不为空 | + * | 1300201 | system error | 系统接口调用失败 | + * | 1300202 | the maximum size of the file storage limit is exceeded | 存储空间不足,或文件大小超出上限(上限100M) | + * | 1300203 | base64 encode error | 字符编码转换失败(例如 base64 格式错误) | + * | 1300300 | sdcard not mounted | android sdcard 挂载失败 | + * | 1300301 | unable to open as fileType | 无法以fileType打开文件 | + * | 1301000 | permission denied, cannot access file path | 目标路径无访问权限(usr目录) | + * | 1301002 | data to write is empty | 写入数据为空 | + * | 1301003 | illegal operation on a directory | 不可对目录进行此操作(例如,指定的 filePath 是一个已经存在的目录) | + * | 1301004 | illegal operation on a package directory | 不可对代码包目录进行此操作 | + * | 1301005 | file already exists ${dirPath} | 已有同名文件或目录 | + * | 1301006 | value of length is out of range | 传入的 length 不合法 | + * | 1301007 | value of offset is out of range | 传入的 offset 不合法 | + * | 1301009 | value of position is out of range | position值越界 | + * | 1301100 | store directory is empty | store目录为空 | + * | 1301102 | unzip open file fail | 压缩文件打开失败 | + * | 1301103 | unzip entry fail | 解压单个文件失败 | + * | 1301104 | unzip fail | 解压失败 | + * | 1301111 | brotli decompress fail | brotli解压失败(例如,指定的 compressionAlgorithm 与文件实际压缩格式不符) | + * | 1301112 | tempFilePath file not exist | 指定的 tempFilePath 找不到文件 | + * | 1302001 | fail permission denied | 指定的 fd 路径没有读权限/没有写权限 | + * | 1302002 | excced max concurrent fd limit | fd数量已达上限 | + * | 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; + } + interface FileSystemManager { + /** [Array.<string> FileSystemManager.readdirSync(string dirPath)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdirSync.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* [FileSystemManager.readdir](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdir.html) 的同步版本 +* +* **注意事项 +* - readdir接口无法访问文件系统根路径(wxfile://)。 +* 示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.readdir({ + dirPath: `${wx.env.USER_DATA_PATH}/example`, + success(res) { + console.log(res.files) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.readdirSync(`${wx.env.USER_DATA_PATH}/example`) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + readdirSync( + /** 要读取的目录路径 (本地路径) */ + dirPath: string + ): string[]; + /** [ArrayBuffer FileSystemManager.readCompressedFileSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readCompressedFileSync.html) +* +* 需要基础库: `2.21.1` +* +* 在插件中使用:不支持 +* +* 同步读取指定压缩类型的本地文件内容 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() + +// 异步接口 +fs.readCompressedFile({ + filePath: '${wx.env.USER_DATA_PATH}/hello.br', + compressionAlgorithm: 'br', + success(res) { + console.log(res.data) + }, + fail(res) { + console.log('readCompressedFile fail', res) + } +}) + +// 同步接口 +try { + const data = fs.readCompressedFileSync({ + filePath: '${wx.env.USER_DATA_PATH}/hello.br', + compressionAlgorithm: 'br', + }) + console.log(data) +} catch (err) { + console.log(err) +} +``` */ + readCompressedFileSync(option: ReadCompressedFileSyncOption): ArrayBuffer; + /** [FileSystemManager.access(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.access.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 判断文件/目录是否存在 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +// 判断文件/目录是否存在 +fs.access({ + path: `${wx.env.USER_DATA_PATH}/hello.txt`, + success(res) { + // 文件存在 + console.log(res) + }, + fail(res) { + // 文件不存在或其他错误 + console.error(res) + } +}) + +// 同步接口 +try { + fs.accessSync(`${wx.env.USER_DATA_PATH}/hello.txt`) +} catch(e) { + console.error(e) +} +``` */ + access(option: AccessOption): void; + /** [FileSystemManager.accessSync(string path)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.accessSync.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* [FileSystemManager.access](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.access.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +// 判断文件/目录是否存在 +fs.access({ + path: `${wx.env.USER_DATA_PATH}/hello.txt`, + success(res) { + // 文件存在 + console.log(res) + }, + fail(res) { + // 文件不存在或其他错误 + console.error(res) + } +}) + +// 同步接口 +try { + fs.accessSync(`${wx.env.USER_DATA_PATH}/hello.txt`) +} catch(e) { + console.error(e) +} +``` */ + accessSync( + /** 要判断是否存在的文件/目录路径 (本地路径) */ + path: string + ): void; + /** [FileSystemManager.appendFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFile.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 在文件结尾追加内容 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() + +fs.appendFile({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + data: 'some text', + encoding: 'utf8', + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + fs.appendFileSync(`${wx.env.USER_DATA_PATH}/hello.txt`, 'some text', 'utf8') +} catch(e) { + console.error(e) +} +``` */ + 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` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* [FileSystemManager.appendFile](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.appendFile.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() + +fs.appendFile({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + data: 'some text', + encoding: 'utf8', + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + fs.appendFileSync(`${wx.env.USER_DATA_PATH}/hello.txt`, 'some text', 'utf8') +} catch(e) { + console.error(e) +} +``` */ + appendFileSync( + /** 要追加内容的文件路径 (本地路径) */ + filePath: string, + /** 要追加的文本或二进制数据 */ + data: string | ArrayBuffer, + /** 指定写入文件的字符编码 + * + * 参数 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' + ): void; + /** [FileSystemManager.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.close.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 关闭文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +// 打开文件 +fs.open({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+', + success(res) { + // 关闭文件 + fs.close({ + fd: res.fd + }) + } +}) +``` */ + close(option: FileSystemManagerCloseOption): void; + /** [FileSystemManager.copyFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFile.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 复制文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.copyFile({ + srcPath: `${wx.env.USER_DATA_PATH}/hello.txt`, + destPath: `${wx.env.USER_DATA_PATH}/hello_copy.txt` + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + fs.copyFileSync( + `${wx.env.USER_DATA_PATH}/hello.txt`, + `${wx.env.USER_DATA_PATH}/hello_copy.txt` + ) +} catch(e) { + console.error(e) +} +``` */ + 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` +* +* [FileSystemManager.copyFile](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.copyFile.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.copyFile({ + srcPath: `${wx.env.USER_DATA_PATH}/hello.txt`, + destPath: `${wx.env.USER_DATA_PATH}/hello_copy.txt` + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + fs.copyFileSync( + `${wx.env.USER_DATA_PATH}/hello.txt`, + `${wx.env.USER_DATA_PATH}/hello_copy.txt` + ) +} catch(e) { + console.error(e) +} +``` */ + copyFileSync( + /** 源文件路径,支持本地路径 */ + srcPath: string, + /** 目标文件路径,支持本地路径 */ + destPath: string + ): void; + /** [FileSystemManager.fstat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.fstat.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 获取文件的状态信息 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +// 打开文件 +fs.open({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+', + success(res) { + // 获取文件的状态信息 + fs.fstat({ + fd: res.fd, + success(res) { + console.log(res.stats) + } + }) + } +}) +``` */ + fstat(option: FstatOption): void; + /** [FileSystemManager.ftruncate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.ftruncate.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 对文件内容进行截断操作 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +// 打开文件 +fs.open({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+', + success(res) { + // 对文件内容进行截断操作 + fs.ftruncate({ + fd: res.fd, + length: 10, // 从第10个字节开始截断文件 + success(res) { + console.log(res) + } + }) + } +}) +``` */ + ftruncate(option: FtruncateOption): void; + /** [FileSystemManager.getFileInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getFileInfo.html) + * + * 在插件中使用:不支持 + * + * 获取该小程序下的 本地临时文件 或 本地缓存文件 信息 */ + getFileInfo(option: GetFileInfoOption): void; + /** [FileSystemManager.getSavedFileList(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.getSavedFileList.html) + * + * 在插件中使用:不支持 + * + * 获取该小程序下已保存的本地缓存文件列表 */ + getSavedFileList(option?: GetSavedFileListOption): void; + /** [FileSystemManager.mkdir(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdir.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 创建目录 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.mkdir({ + dirPath: `${wx.env.USER_DATA_PATH}/example`, + recursive: false + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + fs.mkdirSync(`${wx.env.USER_DATA_PATH}/example`, false) +} catch(e) { + console.error(e) +} +``` */ + 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` +* +* [FileSystemManager.mkdir](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.mkdir.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.mkdir({ + dirPath: `${wx.env.USER_DATA_PATH}/example`, + recursive: false + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + fs.mkdirSync(`${wx.env.USER_DATA_PATH}/example`, false) +} catch(e) { + console.error(e) +} +``` */ + mkdirSync( + /** 创建的目录路径 (本地路径) */ + dirPath: string, + /** 需要基础库: `2.3.0` + * + * 是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。 */ + recursive?: boolean + ): void; + /** [FileSystemManager.open(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.open.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 打开文件,返回文件描述符 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.open({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+', + success(res) { + console.log(res.fd) + } +}) +``` */ + open(option: OpenOption): void; + /** [FileSystemManager.read(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.read.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 读文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +const ab = new ArrayBuffer(1024) +// 打开文件 +fs.open({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+', + success(res) { + // 读取文件到 ArrayBuffer 中 + fs.read({ + fd: res.fd, + arrayBuffer: ab, + length: 10, + success(res) { + console.log(res) + } + }) + } +}) +``` */ + read(option: ReadOption): void; + /** [FileSystemManager.readCompressedFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readCompressedFile.html) +* +* 需要基础库: `2.21.1` +* +* 在插件中使用:不支持 +* +* 读取指定压缩类型的本地文件内容 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() + +// 异步接口 +fs.readCompressedFile({ + filePath: '${wx.env.USER_DATA_PATH}/hello.br', + compressionAlgorithm: 'br', + success(res) { + console.log(res.data) + }, + fail(res) { + console.log('readCompressedFile fail', res) + } +}) + +// 同步接口 +const data = fs.readCompressedFileSync({ + filePath: '${wx.env.USER_DATA_PATH}/hello.br', + compressionAlgorithm: 'br', +}) +console.log(data) +``` */ + readCompressedFile(option: ReadCompressedFileOption): void; + /** [FileSystemManager.readFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFile.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 读取本地文件内容。单个文件大小上限为100M。 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.readFile({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + encoding: 'utf8', + position: 0, + success(res) { + console.log(res.data) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.readFileSync(`${wx.env.USER_DATA_PATH}/hello.txt`, 'utf8', 0) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + readFile(option: ReadFileOption): void; + /** [FileSystemManager.readZipEntry(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readZipEntry.html) +* +* 需要基础库: `2.17.3` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 读取压缩包内的文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +// 读取zip内某个或多个文件 +fs.readZipEntry({ + filePath: 'wxfile://from/to.zip', + entries: [{ + path: 'some_folder/my_file.txt', // zip内文件路径 + encoding: 'utf-8', // 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 + position: 0, // 从文件指定位置开始读,如果不指定,则从文件头开始读。读取的范围应该是左闭右开区间 [position, position+length)。有效范围:[0, fileLength - 1]。单位:byte + length: 10000, // 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte + }, { + path: 'other_folder/orther_file.txt', // zip内文件路径 + }], + success(res) { + console.log(res.entries) + // res.entries === { + // 'some_folder/my_file.txt': { + // errMsg: 'readZipEntry:ok', + // data: 'xxxxxx' + // }, + // 'other_folder/orther_file.txt': { + // data: (ArrayBuffer) + // } + // } + }, + fail(res) { + console.log(res.errMsg) + }, +}) + +// 读取zip内所有文件。允许指定统一的encoding。position、length则不再允许指定,分别默认为0和文件长度 +fs.readZipEntry({ + filePath: 'wxfile://from/to.zip', + entries: 'all' + encoding: 'utf-8', // 统一指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 + success(res) { + console.log(res.entries) + // res.entries === { + // 'some_folder/my_file.txt': { + // errMsg: 'readZipEntry:ok', + // data: 'xxxxxx' + // }, + // 'other_folder/orther_file.txt': { + // errMsg: 'readZipEntry:ok', + // data: 'xxxxxx' + // } + // } + }, + fail(res) { + console.log(res.errMsg) + }, +}) +``` */ + readZipEntry(option: ReadZipEntryOption): void; + /** [FileSystemManager.readdir(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readdir.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 读取目录内文件列表 +* +* **注意事项 +* - readdir接口无法访问文件系统根路径(wxfile://)。 +* 示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.readdir({ + dirPath: `${wx.env.USER_DATA_PATH}/example`, + success(res) { + console.log(res.files) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.readdirSync(`${wx.env.USER_DATA_PATH}/example`) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + readdir(option: ReaddirOption): void; + /** [FileSystemManager.removeSavedFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.removeSavedFile.html) + * + * 在插件中使用:不支持 + * + * 删除该小程序下已保存的本地缓存文件 */ + removeSavedFile(option: RemoveSavedFileOption): void; + /** [FileSystemManager.rename(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rename.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 重命名文件。可以把文件从 oldPath 移动到 newPath +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.rename({ + oldPath: `${wx.env.USER_DATA_PATH}/hello.txt`, + newPath: `${wx.env.USER_DATA_PATH}/hello_new.txt`, + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.renameSync( + `${wx.env.USER_DATA_PATH}/hello.txt`, + `${wx.env.USER_DATA_PATH}/hello_new.txt` + ) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + 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` +* +* [FileSystemManager.rename](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rename.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.rename({ + oldPath: `${wx.env.USER_DATA_PATH}/hello.txt`, + newPath: `${wx.env.USER_DATA_PATH}/hello_new.txt`, + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.renameSync( + `${wx.env.USER_DATA_PATH}/hello.txt`, + `${wx.env.USER_DATA_PATH}/hello_new.txt` + ) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + renameSync( + /** 源文件路径,支持本地路径 */ + oldPath: string, + /** 新文件路径,支持本地路径 */ + newPath: string + ): void; + /** [FileSystemManager.rmdir(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdir.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 删除目录 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.rmdir({ + dirPath: `${wx.env.USER_DATA_PATH}/example`, + recursive: false, + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.rmdirSync(`${wx.env.USER_DATA_PATH}/example`, false) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + 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` +* +* [FileSystemManager.rmdir](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.rmdir.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.rmdir({ + dirPath: `${wx.env.USER_DATA_PATH}/example`, + recursive: false, + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.rmdirSync(`${wx.env.USER_DATA_PATH}/example`, false) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + rmdirSync( + /** 要删除的目录路径 (本地路径) */ + dirPath: string, + /** 需要基础库: `2.3.0` + * + * 是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。 */ + recursive?: boolean + ): void; + /** [FileSystemManager.saveFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFile.html) + * + * 在插件中使用:不支持 + * + * 保存临时文件到本地。此接口会移动临时文件,因此调用成功后,tempFilePath 将不可用。 */ + 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; + /** [FileSystemManager.truncate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncate.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 对文件内容进行截断操作 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.truncate({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + length: 10, // 从第10个字节开始截断 + success(res) { + console.log(res) + } +}) +``` */ + truncate(option: TruncateOption): void; + /** [FileSystemManager.unlink(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlink.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 删除文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.unlink({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.unlinkSync(`${wx.env.USER_DATA_PATH}/hello.txt`) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + unlink(option: UnlinkOption): void; + /** [FileSystemManager.unlinkSync(string filePath)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlinkSync.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* [FileSystemManager.unlink](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unlink.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.unlink({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.unlinkSync(`${wx.env.USER_DATA_PATH}/hello.txt`) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + unlinkSync( + /** 要删除的文件路径 (本地路径) */ + filePath: string + ): void; + /** [FileSystemManager.unzip(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.unzip.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 解压文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.unzip({ + zipFilePath: `${wx.env.USER_DATA_PATH}/example.zip`, + targetPath: '${wx.env.USER_DATA_PATH}/example', + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) +``` */ + unzip(option: UnzipOption): void; + /** [FileSystemManager.write(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.write.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 写入文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +// 打开文件 +fs.open({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+', + success(res) { + // 写入文件 + fs.write({ + fd: res.fd, + data: 'some text', + success(res) { + console.log(res.bytesWritten) + } + }) + } +}) +``` */ + write(option: WriteOption): void; + /** [FileSystemManager.writeFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html) +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 写文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.writeFile({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + data: 'some text or arrayBuffer', + encoding: 'utf8', + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.writeFileSync( + `${wx.env.USER_DATA_PATH}/hello.txt`, + 'some text or arrayBuffer', + 'utf8' + ) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + 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` +* +* [FileSystemManager.writeFile](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.writeFile({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + data: 'some text or arrayBuffer', + encoding: 'utf8', + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.writeFileSync( + `${wx.env.USER_DATA_PATH}/hello.txt`, + 'some text or arrayBuffer', + 'utf8' + ) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + writeFileSync( + /** 要写入的文件路径 (本地路径) */ + filePath: string, + /** 要写入的文本或二进制数据 */ + data: string | ArrayBuffer, + /** 指定写入文件的字符编码 + * + * 参数 encoding 可选值: + * - 'ascii': ; + * - 'base64': (注意,选择 base64 编码,data 只需要传 base64 内容本身,不要传 Data URI 前缀,否则会报 fail base64 encode error 错误。例如,传 aGVsbG8= 而不是传 data:image/png;base64,aGVsbG8= ); + * - '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' + ): 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` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 读文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +const ab = new ArrayBuffer(1024) +const fd = fs.openSync({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+' +}) +const res = fs.readSync({ + fd: fd, + arrayBuffer: ab, + length: 10 +}) +console.log(res) +``` */ + 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` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 同步获取文件的状态信息 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +const fd = fs.openSync({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+' +}) +const stats = fs.fstatSync({fd: fd}) +console.log(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` + * + * [FileSystemManager.stat](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.stat.html) 的同步版本 */ + statSync( + /** 文件/目录路径 (本地路径) */ + path: string, + /** 需要基础库: `2.3.0` + * + * 是否递归获取目录下的每个文件的 Stats 信息 */ + 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` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 同步写入文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +const fd = fs.openSync({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+' +}) +const res = fs.writeSync({ + fd: fd, + data: 'some text' +}) +console.log(res.bytesWritten) +``` */ + writeSync(option: WriteSyncOption): WriteResult; + /** [string FileSystemManager.openSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.openSync.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 同步打开文件,返回文件描述符 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +const fd = fs.openSync({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+' +}) +console.log(fd) +``` */ + openSync(option: OpenSyncOption): string; + /** [string FileSystemManager.saveFileSync(string tempFilePath, string filePath)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFileSync.html) + * + * 在插件中使用:不支持 + * + * [FileSystemManager.saveFile](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.saveFile.html) 的同步版本 */ + saveFileSync( + /** 临时存储文件路径 (本地路径) */ + tempFilePath: 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` +* +* [FileSystemManager.readFile](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.readFile.html) 的同步版本 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.readFile({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + encoding: 'utf8', + position: 0, + success(res) { + console.log(res.data) + }, + fail(res) { + console.error(res) + } +}) + +// 同步接口 +try { + const res = fs.readFileSync(`${wx.env.USER_DATA_PATH}/hello.txt`, 'utf8', 0) + console.log(res) +} catch(e) { + console.error(e) +} +``` */ + readFileSync( + /** 要读取的文件的路径 (本地路径) */ + filePath: string, + /** 指定读取文件的字符编码,如果不传 encoding,则以 ArrayBuffer 格式读取文件的二进制内容 + * + * 参数 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 */ + position?: number, + /** 需要基础库: `2.10.0` + * + * 指定文件的长度,如果不指定,则读到文件末尾。有效范围:[1, fileLength]。单位:byte */ + length?: number + ): string | ArrayBuffer; + /** [undefined FileSystemManager.closeSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.closeSync.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 同步关闭文件 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +const fd = fs.openSync({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+' +}) + +// 关闭文件 +fs.closeSync({fd: fd}) +``` */ + closeSync(option: CloseSyncOption): undefined; + /** [undefined FileSystemManager.ftruncateSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.ftruncateSync.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 对文件内容进行截断操作 +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +const fd = fs.openSync({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + flag: 'a+' +}) +fs.ftruncateSync({ + fd: fd, + length: 10 // 从第10个字节开始截断文件 +}) +``` */ + ftruncateSync(option: FtruncateSyncOption): undefined; + /** [undefined FileSystemManager.truncateSync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.truncateSync.html) +* +* 需要基础库: `2.16.1` +* +* 在插件中使用:需要基础库 `2.19.2` +* +* 对文件内容进行截断操作 (truncate 的同步版本) +* +* **示例代码** +* +* ```js +const fs = wx.getFileSystemManager() +fs.truncateSync({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + length: 10, // 从第10个字节开始截断 +}) +``` */ + truncateSync(option: TruncateSyncOption): undefined; + } + interface InferenceSession { + /** [InferenceSession.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.destroy.html) +* +* 需要基础库: `2.30.0` +* +* 在插件中使用:需要基础库 `2.30.0` +* +* 销毁 InferenceSession 实例 +* +* **示例代码** +* +* ```js +// 销毁会话 +session.destroy() +``` */ + destroy(): void; + /** [InferenceSession.offError(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/InferenceSession.offError.html) + * + * 需要基础库: `2.30.0` + * + * 在插件中使用:需要基础库 `2.30.0` + * + * 取消监听模型加载失败事件 */ + offError( + /** 模型加载失败回调函数。传入指定回调函数则只取消指定回调,不传则取消所有回调 */ + 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` + * + * 在插件中使用:需要基础库 `2.30.0` + * + * 取消监听模型加载完成事件 */ + offLoad( + /** 模型加载完成回调函数。传入指定回调函数则只取消指定回调,不传则取消所有回调 */ + 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` +* +* 在插件中使用:需要基础库 `2.30.0` +* +* 监听模型加载失败事件 +* +* **示例代码** +* +* ```js +// 创建会话,加载模型 +const session = wx.createInferenceSession({ + model: `${wx.env.USER_DATA_PATH}/MNIST.onnx`, + precisionLevel: 4, + typicalShape:{input1:[1, 3, 224, 224], input2:[1, 1, 224, 224]}, //除非使用动态轴,一般不用显式指定 + allowNPU: false, + allowQuantize: false +}) + +// 监听error事件 +session.onError(err => { + console.error(err) +}) +``` */ + onError( + /** 模型加载失败回调函数 */ + 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` +* +* 在插件中使用:需要基础库 `2.30.0` +* +* 监听模型加载完成事件 +* +* **示例代码** +* +* ```js +// 创建会话,加载模型 +const session = wx.createInferenceSession({ + model: `${wx.env.USER_DATA_PATH}/MNIST.onnx`, + precisionLevel: 4, + typicalShape:{input1:[1, 3, 224, 224], input2:[1, 1, 224, 224]}, //除非使用动态轴,一般不用显式指定 + allowNPU: false, + allowQuantize: false +}) + +// 监听模型加载完成事件 +session.onLoad(() => { + // 运行推理 + // 其中input1, input2, output0 必须与使用的onnx模型中实际的输入输出名字完全一致,不可随意填写。 + // 模型输入输出信息可以通过Netron 打开onnx模型看到 + session.run({ + input1: { + type: 'float32', + data: new Float32Array(3 * 224 * 224).buffer, + shape: [1, 3, 224, 224] // NCHW 顺序 + }, + // 多个input的添加方法,假设第二个input需要数据类型为uint8 + input2: { + type: 'uint8', + data: new Uint8Array(224 * 224).buffer, + shape: [1, 1, 224, 224] + }, + }).then(res => { + console.log(res.output0) + }) +}) +``` */ + onLoad( + /** 模型加载完成回调函数 */ + 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` +* +* 在插件中使用:需要基础库 `2.30.0` +* +* 运行推断。需要在 session.onLoad 回调后使用。接口参数为 Tensors 对象,返回 Promise。一个 InferenceSession 被创建完成后可以重复多次调用 InferenceSession.run(), 直到调用 session.destroy() 进行销毁。 +* +* **示例代码** +* +* ```js +// 创建会话,加载模型 +const session = wx.createInferenceSession({ + model: `${wx.env.USER_DATA_PATH}/MNIST.onnx`, + precisionLevel: 4, + typicalShape:{input1:[1, 3, 224, 224], input2:[1, 1, 224, 224]}, //除非使用动态轴,一般不用显式指定 + allowNPU: false, + allowQuantize: false +}) + +// 监听模型加载完成事件 +session.onLoad(() => { + // 运行推理 + // 其中input1, input2, output0 必须与使用的onnx模型中实际的输入输出名字完全一致,不可随意填写。 + // 模型输入输出信息可以通过Netron 打开onnx模型看到 + session.run({ + input1: { + type: 'float32', + data: new Float32Array(3 * 224 * 224).buffer, + shape: [1, 3, 224, 224] // NCHW 顺序 + }, + // 多个input的添加方法,假设第二个input需要数据类型为uint8 + input2: { + type: 'uint8', + data: new Uint8Array(224 * 224).buffer, + shape: [1, 1, 224, 224] + }, + }).then(res => { + console.log(res.output0) + }) +}) +``` */ + run( + /** [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>; + } + interface IntersectionObserver { + /** [IntersectionObserver.disconnect()](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.disconnect.html) + * + * 在插件中使用:支持 + * + * 停止监听。回调函数将不再触发 */ + disconnect(): void; + /** [IntersectionObserver.observe(string targetSelector, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/IntersectionObserver.observe.html) + * + * 在插件中使用:支持 + * + * 指定目标节点并开始监听相交状态变化情况 */ + observe( + /** 选择器 */ + targetSelector: string, + /** 监听相交状态变化的回调函数 */ + 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) + * + * 在插件中使用:支持 + * + * 使用选择器指定一个节点,作为参照区域之一。 */ + relativeTo( + /** 选择器 */ + selector: string, + /** 用来扩展(或收缩)参照节点布局区域的边界 */ + 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) +* +* 在插件中使用:支持 +* +* 指定页面显示区域作为参照区域之一 +* +* **示例代码** +* +* 下面的示例代码中,如果目标节点(用选择器 .target-class 指定)进入显示区域以下 100px 时,就会触发回调函数。 +* ```javascript +Page({ + onLoad: function(){ + wx.createIntersectionObserver().relativeToViewport({bottom: 100}).observe('.target-class', (res) => { + res.intersectionRatio // 相交区域占目标节点的布局区域的比例 + res.intersectionRect // 相交区域 + res.intersectionRect.left // 相交区域的左边界坐标 + res.intersectionRect.top // 相交区域的上边界坐标 + res.intersectionRect.width // 相交区域的宽度 + res.intersectionRect.height // 相交区域的高度 + }) + } +}) +``` */ + relativeToViewport( + /** 用来扩展(或收缩)参照节点布局区域的边界 */ + margins?: Margins + ): IntersectionObserver; + } + interface InterstitialAd { + /** [InterstitialAd.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.destroy.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 销毁插屏广告实例。 */ + destroy(): void; + /** [InterstitialAd.offClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.offClose.html) +* +* 在插件中使用:不支持 +* +* 移除插屏广告关闭事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InterstitialAd.onClose(listener) +InterstitialAd.offClose(listener) // 需传入与监听时同一个的函数对象 +``` */ + offClose( + /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: UDPSocketOffCloseCallback + ): void; + /** [InterstitialAd.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.offError.html) +* +* 在插件中使用:不支持 +* +* 移除插屏错误事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InterstitialAd.onError(listener) +InterstitialAd.offError(listener) // 需传入与监听时同一个的函数对象 +``` */ + offError( + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: InterstitialAdOffErrorCallback + ): void; + /** [InterstitialAd.offLoad(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.offLoad.html) +* +* 在插件中使用:不支持 +* +* 移除插屏广告加载事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +InterstitialAd.onLoad(listener) +InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLoad( + /** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLoadCallback + ): void; + /** [InterstitialAd.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.onClose.html) + * + * 在插件中使用:不支持 + * + * 监听插屏广告关闭事件。 */ + onClose( + /** 插屏广告关闭事件的监听函数 */ + listener: UDPSocketOnCloseCallback + ): void; + /** [InterstitialAd.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.onError.html) + * + * 在插件中使用:不支持 + * + * 监听插屏错误事件。 + * + * **错误码信息与解决方案表** + * + * 错误码是通过onError获取到的错误信息。调试期间,可以通过异常返回来捕获信息。 + * 在小程序发布上线之后,如果遇到异常问题,可以在[“运维中心“](https://mp.weixin.qq.com/)里面搜寻错误日志,还可以针对异常返回加上适当的监控信息。 + * + * | 代码 | 异常情况 | 理由 | 解决方案 | + * | ------ | -------------- | --------------- | -------------------------- | + * | 1000 | 后端错误调用失败 | 该项错误不是开发者的异常情况 | 一般情况下忽略一段时间即可恢复。 | + * | 1001 | 参数错误 | 使用方法错误 | 可以前往developers.weixin.qq.com确认具体教程(小程序和小游戏分别有各自的教程,可以在顶部选项中,“设计”一栏的右侧进行切换。| + * | 1002 | 广告单元无效 | 可能是拼写错误、或者误用了其他APP的广告ID | 请重新前往mp.weixin.qq.com确认广告位ID。 | + * | 1003 | 内部错误 | 该项错误不是开发者的异常情况 | 一般情况下忽略一段时间即可恢复。| + * | 1004 | 无适合的广告 | 广告不是每一次都会出现,这次没有出现可能是由于该用户不适合浏览广告 | 属于正常情况,且开发者需要针对这种情况做形态上的兼容。 | + * | 1005 | 广告组件审核中 | 你的广告正在被审核,无法展现广告 | 请前往mp.weixin.qq.com确认审核状态,且开发者需要针对这种情况做形态上的兼容。| + * | 1006 | 广告组件被驳回 | 你的广告审核失败,无法展现广告 | 请前往mp.weixin.qq.com确认审核状态,且开发者需要针对这种情况做形态上的兼容。| + * | 1007 | 广告组件被封禁 | 你的广告能力已经被封禁,封禁期间无法展现广告 | 请前往mp.weixin.qq.com确认小程序广告封禁状态。 | + * | 1008 | 广告单元已关闭 | 该广告位的广告能力已经被关闭 | 请前往mp.weixin.qq.com重新打开对应广告位的展现。| */ + onError( + /** 插屏错误事件的监听函数 */ + listener: InterstitialAdOnErrorCallback + ): void; + /** [InterstitialAd.onLoad(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.onLoad.html) + * + * 在插件中使用:不支持 + * + * 监听插屏广告加载事件。 */ + onLoad( + /** 插屏广告加载事件的监听函数 */ + listener: OnLoadCallback + ): void; + /** [Promise InterstitialAd.load()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.load.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 加载插屏广告。 */ + load(): Promise<any>; + /** [Promise InterstitialAd.show()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/InterstitialAd.show.html) + * + * 在插件中使用:不支持 + * + * 显示插屏广告。 + * + * **错误码信息表** + * + * 如果插屏广告显示失败,InterstitialAd.show() 方法会返回一个rejected Promise,开发者可以获取到错误码及对应的错误信息。 + * + * | 代码 | 异常情况 | 理由 | + * | ------ | -------------- | -------------------------- | + * | 2001 | 触发频率限制 | 小程序启动一定时间内不允许展示插屏广告 | + * | 2002 | 触发频率限制 | 距离小程序插屏广告或者激励视频广告上次播放时间间隔不足,不允许展示插屏广告 | + * | 2003 | 触发频率限制 | 当前正在播放激励视频广告或者插屏广告,不允许再次展示插屏广告 | + * | 2004 | 广告渲染失败 | 该项错误不是开发者的异常情况,或因小程序页面切换导致广告渲染失败 | + * | 2005 | 广告调用异常 | 插屏广告实例不允许跨页面调用 | */ + show(): Promise<any>; + } + interface IsoDep { + /** [IsoDep.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.close.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 断开连接 */ + close(option?: NdefCloseOption): void; + /** [IsoDep.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.connect.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 连接 NFC 标签 */ + connect(option?: NdefConnectOption): void; + /** [IsoDep.getHistoricalBytes(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.getHistoricalBytes.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取复位信息 */ + getHistoricalBytes(option?: GetHistoricalBytesOption): void; + /** [IsoDep.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.getMaxTransceiveLength.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取最大传输长度 */ + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; + /** [IsoDep.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.isConnected.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * @warning **该接口已废弃,连接状态开发者自行维护即可** + * + * 检查是否已连接 */ + isConnected(option?: IsConnectedOption): void; + /** [IsoDep.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.setTimeout.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 设置超时时间 */ + setTimeout(option: SetTimeoutOption): void; + /** [IsoDep.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/IsoDep.transceive.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 发送数据 */ + transceive(option: TransceiveOption): void; + } + interface Join1v1ChatError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | -20000 | not open 1v1 Chat | 未开通双人通话 | + * | -20001 | device not support | 当前设备不支持 | + * | -20002 | on call | 正在通话中 | + * | -20003 | occupied by other miniprogram | 其它小程序正在通话中 | + * | -30000 | system error | 内部系统错误 | + * | -30001 | wechat has no camera authorization | 微信缺失相机权限 | + * | -30002 | wechat has no record authorization | 微信缺失录音权限 | + * | -30003 | miniprogram has no record authorization | 小程序缺失录音权限 | + * | -30004 | miniprogram has no camera authorization | 小程序缺失相机权限 | + * | -1 | | 当前已在房间内 | + * | -2 | | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | + * | -3 | | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | + * | -1000 | | 系统错误 | */ errMsg: string; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | -20000 | not open 1v1 Chat | 未开通双人通话 | + * | -20001 | device not support | 当前设备不支持 | + * | -20002 | on call | 正在通话中 | + * | -20003 | occupied by other miniprogram | 其它小程序正在通话中 | + * | -30000 | system error | 内部系统错误 | + * | -30001 | wechat has no camera authorization | 微信缺失相机权限 | + * | -30002 | wechat has no record authorization | 微信缺失录音权限 | + * | -30003 | miniprogram has no record authorization | 小程序缺失录音权限 | + * | -30004 | miniprogram has no camera authorization | 小程序缺失相机权限 | + * | -1 | | 当前已在房间内 | + * | -2 | | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | + * | -3 | | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | + * | -1000 | | 系统错误 | */ errCode: number; + } + interface JoinVoIPChatError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | -1 | 当前已在房间内 | | + * | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | + * | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | + * | -1000 | 系统错误 | | */ errMsg: string; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | -1 | 当前已在房间内 | | + * | -2 | 录音设备被占用,可能是当前正在使用微信内语音通话或系统通话 | | + * | -3 | 加入会话期间退出(可能是用户主动退出,或者退后台、来电等原因),因此加入失败 | | + * | -1000 | 系统错误 | | */ errCode: number; + } + interface LivePlayerContext { + /** [LivePlayerContext.exitCasting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitCasting.html) + * + * 需要基础库: `2.32.0` + * + * 在插件中使用:支持 + * + * 退出投屏。仅支持在 tap 事件回调内调用。 */ + 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; + /** [LivePlayerContext.exitPictureInPicture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.exitPictureInPicture.html) + * + * 在插件中使用:支持 + * + * 退出小窗,该方法可在任意页面调用 */ + 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; + /** [LivePlayerContext.pause(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.pause.html) + * + * 需要基础库: `1.9.90` + * + * 在插件中使用:支持 + * + * 暂停 */ + 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; + /** [LivePlayerContext.reconnectCasting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.reconnectCasting.html) + * + * 需要基础库: `2.32.0` + * + * 在插件中使用:支持 + * + * 重连投屏设备。仅支持在 tap 事件回调内调用。 */ + 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; + /** [LivePlayerContext.requestPictureInPicture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.requestPictureInPicture.html) + * + * 需要基础库: `2.15.0` + * + * 在插件中使用:支持 + * + * 进入小窗 */ + requestPictureInPicture(option?: RequestPictureInPictureOption): void; + /** [LivePlayerContext.resume(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.resume.html) + * + * 需要基础库: `1.9.90` + * + * 在插件中使用:支持 + * + * 恢复 */ + resume(option?: ResumeOption): void; + /** [LivePlayerContext.snapshot(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.snapshot.html) + * + * 需要基础库: `2.7.1` + * + * 在插件中使用:支持 + * + * 截图 */ + snapshot(option: LivePlayerContextSnapshotOption): void; + /** [LivePlayerContext.startCasting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.startCasting.html) + * + * 需要基础库: `2.32.0` + * + * 在插件中使用:支持 + * + * 开始投屏, 拉起半屏搜索设备。仅支持在 tap 事件回调内调用。 */ + 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; + /** [LivePlayerContext.switchCasting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.switchCasting.html) + * + * 需要基础库: `2.32.0` + * + * 在插件中使用:支持 + * + * 切换投屏设备。仅支持在 tap 事件回调内调用。 */ + switchCasting(option?: SwitchCastingOption): void; + } + interface LivePusherContext { + /** [LivePusherContext.applyBlusherStickMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyBlusherStickMakeup.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 添加腮红美妆特效 */ + applyBlusherStickMakeup(option: ApplyBlusherStickMakeupOption): void; + /** [LivePusherContext.applyEyeBrowMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyEyeBrowMakeup.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 添加眉毛美妆特效 */ + applyEyeBrowMakeup(option: ApplyEyeBrowMakeupOption): void; + /** [LivePusherContext.applyEyeShadowMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyEyeShadowMakeup.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 添加眼影美妆特效 */ + applyEyeShadowMakeup(option: ApplyEyeShadowMakeupOption): void; + /** [LivePusherContext.applyFaceContourMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyFaceContourMakeup.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 添加修容美妆特效 */ + applyFaceContourMakeup(option: ApplyFaceContourMakeupOption): void; + /** [LivePusherContext.applyFilter(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyFilter.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 添加滤镜效果 */ + applyFilter(option: ApplyFilterOption): void; + /** [LivePusherContext.applyLipStickMakeup(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applyLipStickMakeup.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 添加口红美妆特效 */ + applyLipStickMakeup(option: ApplyLipStickMakeupOption): void; + /** [LivePusherContext.applySticker(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.applySticker.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 添加贴纸特效 */ + applySticker(option: ApplyStickerOption): void; + /** [LivePusherContext.clearFilters(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.clearFilters.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 清除所有滤镜效果 */ + clearFilters(option?: ClearFiltersOption): void; + /** [LivePusherContext.clearMakeups(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.clearMakeups.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 清除所有美妆特效 */ + clearMakeups(option?: ClearMakeupsOption): void; + /** [LivePusherContext.clearStickers(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.clearStickers.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 清除所有贴纸特效 */ + clearStickers(option?: ClearStickersOption): void; + /** [LivePusherContext.createOffscreenCanvas(object options)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.createOffscreenCanvas.html) + * + * 需要基础库: `2.29.0` + * + * 在插件中使用:支持 + * + * 创建一个能够承接 LivePusher 采集纹理的离屏 Canvas,客户端 8.0.31 版本开始支持。 */ + createOffscreenCanvas( + /** 同[wx.createOffscreenCanvas](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createOffscreenCanvas.html) */ + options: IAnyObject + ): void; + /** [LivePusherContext.exitPictureInPicture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.exitPictureInPicture.html) + * + * 需要基础库: `2.25.0` + * + * 在插件中使用:支持 + * + * 退出小窗,该方法可在任意页面调用 */ + exitPictureInPicture(option?: ExitPictureInPictureOption): void; + /** [LivePusherContext.getMaxZoom(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.getMaxZoom.html) + * + * 需要基础库: `2.31.0` + * + * 在插件中使用:支持 + * + * 获取最大缩放级别 */ + 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` + * + * 在插件中使用:支持 + * + * 开启自定义渲染时,开发者通过此方法订阅相关事件,客户端 8.0.31 版本开始支持。 */ + onCustomRendererEvent( + /** 事件类型,后订阅的监听器会取消之前的监听器 + * + * 参数 event 可选值: + * - 'frame': 采集到视频帧后触发; + * - 'update': 推流尺寸变更时触发; */ + event: 'frame' | 'update', + /** 自定义渲染事件处理回调函数 */ + callback: CustomRendererFrameEventCallback + ): void; + /** [LivePusherContext.pause(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.pause.html) + * + * 在插件中使用:支持 + * + * 暂停推流 */ + pause(option?: PauseOption): void; + /** [LivePusherContext.pauseBGM(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.pauseBGM.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:支持 + * + * 暂停背景音 */ + pauseBGM(option?: PauseBGMOption): void; + /** [LivePusherContext.playBGM(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.playBGM.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:支持 + * + * 播放背景音 */ + 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; + /** [LivePusherContext.resumeBGM(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.resumeBGM.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:支持 + * + * 恢复背景音 */ + resumeBGM(option?: ResumeBGMOption): void; + /** [LivePusherContext.sendMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.sendMessage.html) + * + * 需要基础库: `2.10.0` + * + * 在插件中使用:支持 + * + * 发送SEI消息 */ + sendMessage(option: SendMessageOption): void; + /** [LivePusherContext.setBGMVolume(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.setBGMVolume.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:支持 + * + * 设置背景音音量 */ + setBGMVolume(option: SetBGMVolumeOption): void; + /** [LivePusherContext.setMICVolume(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.setMICVolume.html) + * + * 需要基础库: `2.10.0` + * + * 在插件中使用:支持 + * + * 设置麦克风音量 */ + setMICVolume(option: SetMICVolumeOption): void; + /** [LivePusherContext.setZoom(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.setZoom.html) + * + * 需要基础库: `2.31.0` + * + * 在插件中使用:支持 + * + * 设置缩放级别 */ + setZoom(option: LivePusherContextSetZoomOption): void; + /** [LivePusherContext.snapshot(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.snapshot.html) + * + * 需要基础库: `1.9.90` + * + * 在插件中使用:支持 + * + * 快照 */ + 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; + /** [LivePusherContext.startPreview(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.startPreview.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 开启摄像头预览 */ + 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; + /** [LivePusherContext.stopBGM(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.stopBGM.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:支持 + * + * 停止背景音 */ + stopBGM(option?: StopBGMOption): void; + /** [LivePusherContext.stopPreview(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.stopPreview.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:支持 + * + * 关闭摄像头预览 */ + 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; + /** [LivePusherContext.toggleTorch(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePusherContext.toggleTorch.html) + * + * 需要基础库: `2.1.0` + * + * 在插件中使用:支持 + * + * 切换手电筒 */ + toggleTorch(option?: ToggleTorchOption): void; + } + interface LogManager { + /** [LogManager.debug()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.debug.html) + * + * 在插件中使用:不支持 + * + * 写 debug 日志 */ + debug( + /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过100Kb */ + ...args: any[] + ): void; + /** [LogManager.info()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.info.html) + * + * 在插件中使用:不支持 + * + * 写 info 日志 */ + info( + /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过100Kb */ + ...args: any[] + ): void; + /** [LogManager.log()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.log.html) + * + * 在插件中使用:不支持 + * + * 写 log 日志 */ + log( + /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过100Kb */ + ...args: any[] + ): void; + /** [LogManager.warn()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/LogManager.warn.html) + * + * 在插件中使用:不支持 + * + * 写 warn 日志 */ + warn( + /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过100Kb */ + ...args: any[] + ): void; + } + interface MapContext { + /** [MapContext.addArc(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addArc.html) + * + * 需要基础库: `2.22.0` + * + * 在插件中使用:支持 + * + * 添加弧线,途经点与夹角必须设置一个。途经点必须在起终点有效坐标范围内,否则不能生成正确的弧线,同时设置夹角角度时,以夹角角度为准。夹角定义为起点到终点,与起点外切线逆时针旋转的角度。工具侧暂未支持。 */ + addArc(option: AddArcOption): void; + /** [MapContext.addCustomLayer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addCustomLayer.html) + * + * 需要基础库: `2.12.0` + * + * 在插件中使用:支持 + * + * 添加个性化图层。图层创建[参考文档](https://lbs.qq.com/dev/console/customLayer/create) */ + addCustomLayer(option: AddCustomLayerOption): void; + /** [MapContext.addGroundOverlay(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addGroundOverlay.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:支持 + * + * 创建自定义图片图层,图片会随着地图缩放而缩放。 */ + addGroundOverlay(option: AddGroundOverlayOption): void; + /** [MapContext.addMarkers(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addMarkers.html) + * + * 需要基础库: `2.13.0` + * + * 在插件中使用:支持 + * + * 添加 marker。 */ + addMarkers(option: AddMarkersOption): void; + /** [MapContext.addVisualLayer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.addVisualLayer.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:支持 + * + * 添加可视化图层。需要刷新时,interval 可设置的最小值为 15 s。 */ + addVisualLayer(option: AddVisualLayerOption): void; + /** [MapContext.eraseLines(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.eraseLines.html) + * + * 需要基础库: `2.5.0` + * + * 在插件中使用:支持 + * + * 擦除或置灰已添加到地图中的线段。 */ + eraseLines(option: EraseLinesOption): void; + /** [MapContext.executeVisualLayerCommand(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.executeVisualLayerCommand.html) + * + * 需要基础库: `2.26.0` + * + * 在插件中使用:支持 + * + * 执行可视化图层指令,结合 `MapContext.on('visualLayerEvent')` 监听事件使用。 */ + executeVisualLayerCommand(option: ExecuteVisualLayerCommandOption): void; + /** [MapContext.fromScreenLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.fromScreenLocation.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:支持 + * + * 获取屏幕上的点对应的经纬度,坐标原点为地图左上角。 */ + 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; + /** [MapContext.getRegion(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getRegion.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 获取当前地图的视野范围 */ + getRegion(option?: GetRegionOption): void; + /** [MapContext.getRotate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getRotate.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:支持 + * + * 获取当前地图的旋转角 */ + getRotate(option?: GetRotateOption): void; + /** [MapContext.getScale(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getScale.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 获取当前地图的缩放级别 */ + getScale(option?: GetScaleOption): void; + /** [MapContext.getSkew(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.getSkew.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:支持 + * + * 获取当前地图的倾斜角 */ + getSkew(option?: GetSkewOption): void; + /** [MapContext.includePoints(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.includePoints.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:支持 + * + * 缩放视野展示所有经纬度 */ + includePoints(option: IncludePointsOption): void; + /** [MapContext.initMarkerCluster(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.initMarkerCluster.html) + * + * 需要基础库: `2.13.0` + * + * 在插件中使用:支持 + * + * 初始化点聚合的配置,未调用时采用默认配置。 */ + initMarkerCluster(option: InitMarkerClusterOption): void; + /** [MapContext.moveAlong(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.moveAlong.html) + * + * 需要基础库: `2.13.0` + * + * 在插件中使用:支持 + * + * 沿指定路径移动 `marker`,用于轨迹回放等场景。动画完成时触发回调事件,若动画进行中,对同一 `marker` 再次调用 `moveAlong` 方法,前一次的动画将被打断。 */ + moveAlong(option: MoveAlongOption): void; + /** [MapContext.moveToLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.moveToLocation.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:支持 + * + * 将地图中心移置当前定位点,此时需设置地图组件 show-location 为true。[2.8.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持将地图中心移动到指定位置。 */ + 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` +* +* 在插件中使用:支持 +* +* 监听地图事件。 +* +* ### visualLayerEvent +* +* 可视化图层 visualLayer 统一回调出口,[2.26.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起支持。 +* +* #### 返回参数 +* +* | 参数 | 类型 | 说明 | +* | --------- | ------ | -------- | +* | layerId | String | 图层 id | +* | eventType | String | 事件类型 | +* | eventInfo | String | 事件信息 | +* +* ### markerClusterCreate +* +* 缩放或拖动导致新的聚合簇产生时触发,仅返回新创建的聚合簇信息。 +* +* #### 返回参数 +* +* | 参数 | 类型 | 说明 | +* | -------- | -------------------- | ---------- | +* | clusters | `Array<ClusterInfo>` | 聚合簇数据 | +* +* ### markerClusterClick +* +* 聚合簇的点击事件。 +* +* #### 返回参数 +* +* | 参数 | 类型 | 说明 | +* | --------- | ------------- | --------- | +* | cluster | ClusterInfo | 聚合簇 | +* +* #### ClusterInfo 结构 +* +* | 参数 | 类型 | 说明 | +* | --------- | --------------- | -------------------------- | +* | clusterId | Number | 聚合簇的 id | +* | center | LatLng | 聚合簇的坐标 | +* | markerIds | `Array<Number>` | 该聚合簇内的点标记数据数组 | +* +* **示例代码** +* +* ```js + MapContext.on('visualLayerEvent', (res) => {}) + MapContext.on('markerClusterCreate', (res) => {}) + MapContext.on('markerClusterClick', (res) => {}) +``` */ + on( + /** 事件名 + * + * 参数 event 可选值: + * - 'markerClusterCreate': ; + * - 'markerClusterClick': ; + * - 'visualLayerEvent': ; */ + event: 'markerClusterCreate' | 'markerClusterClick' | 'visualLayerEvent', + /** 事件的回调函数 */ + 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` + * + * 在插件中使用:支持 + * + * 拉起地图APP选择导航。 */ + openMapApp(option: OpenMapAppOption): void; + /** [MapContext.removeArc(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeArc.html) + * + * 需要基础库: `2.22.0` + * + * 在插件中使用:支持 + * + * 删除弧线。工具侧暂未支持。 */ + removeArc(option: RemoveArcOption): void; + /** [MapContext.removeCustomLayer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeCustomLayer.html) + * + * 需要基础库: `2.12.0` + * + * 在插件中使用:支持 + * + * 移除个性化图层。 */ + removeCustomLayer(option: RemoveCustomLayerOption): void; + /** [MapContext.removeGroundOverlay(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeGroundOverlay.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:支持 + * + * 移除自定义图片图层。 */ + removeGroundOverlay(option: RemoveGroundOverlayOption): void; + /** [MapContext.removeMarkers(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeMarkers.html) + * + * 需要基础库: `2.13.0` + * + * 在插件中使用:支持 + * + * 移除 marker。 */ + removeMarkers(option: RemoveMarkersOption): void; + /** [MapContext.removeVisualLayer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.removeVisualLayer.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:支持 + * + * 移除可视化图层。 */ + removeVisualLayer(option: RemoveVisualLayerOption): void; + /** [MapContext.setBoundary(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.setBoundary.html) + * + * 需要基础库: `2.22.0` + * + * 在插件中使用:支持 + * + * 限制地图的显示范围。此接口同时会限制地图的最小缩放整数级别。 */ + setBoundary(option: SetBoundaryOption): void; + /** [MapContext.setCenterOffset(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.setCenterOffset.html) + * + * 需要基础库: `2.10.0` + * + * 在插件中使用:支持 + * + * 设置地图中心点偏移,向后向下为增长,屏幕比例范围(0.25~0.75),默认偏移为[0.5, 0.5] */ + setCenterOffset(option: SetCenterOffsetOption): void; + /** [MapContext.setLocMarkerIcon(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.setLocMarkerIcon.html) + * + * 需要基础库: `2.16.0` + * + * 在插件中使用:支持 + * + * 设置定位点图标,支持网络路径、本地路径、代码包路径 */ + setLocMarkerIcon(option: SetLocMarkerIconOption): void; + /** [MapContext.toScreenLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.toScreenLocation.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:支持 + * + * 获取经纬度对应的屏幕坐标,坐标原点为地图左上角。 */ + toScreenLocation(option: ToScreenLocationOption): void; + /** [MapContext.translateMarker(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.translateMarker.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:支持 + * + * 平移marker,带动画。 */ + translateMarker(option: TranslateMarkerOption): void; + /** [MapContext.updateGroundOverlay(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.updateGroundOverlay.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:支持 + * + * 更新自定义图片图层。 */ + 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) + * + * 需要基础库: `2.9.0` + * + * 在插件中使用:支持 + * + * 将音频或视频轨道添加到容器 */ + addTrack( + /** [MediaTrack](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaTrack.html) + * + * 要添加的音频或视频轨道 */ + track: MediaTrack + ): void; + /** [MediaContainer.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.destroy.html) + * + * 需要基础库: `2.9.0` + * + * 在插件中使用:支持 + * + * 将容器销毁,释放资源 */ + destroy(): void; + /** [MediaContainer.export()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.export.html) + * + * 需要基础库: `2.9.0` + * + * 在插件中使用:支持 + * + * 将容器内的轨道合并并导出视频文件 */ + export(): void; + /** [MediaContainer.extractDataSource(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaContainer.extractDataSource.html) + * + * 需要基础库: `2.9.0` + * + * 在插件中使用:支持 + * + * 将传入的视频源分离轨道。不会自动将轨道添加到待合成的容器里。 */ + 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` + * + * 在插件中使用:支持 + * + * 将音频或视频轨道从容器中移除 */ + removeTrack( + /** [MediaTrack](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-processing/MediaTrack.html) + * + * 要移除的音频或视频轨道 */ + track: MediaTrack + ): void; + } + interface MediaQueryObserver { + /** [MediaQueryObserver.disconnect()](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/MediaQueryObserver.disconnect.html) + * + * 在插件中使用:支持 + * + * 停止监听。回调函数将不再触发 */ + disconnect(): void; + /** [MediaQueryObserver.observe(Object descriptor, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/MediaQueryObserver.observe.html) + * + * 在插件中使用:支持 + * + * 开始监听页面 media query 变化情况 */ + observe( + /** media query 描述符 */ + descriptor: ObserveDescriptor, + /** 监听 media query 状态变化的回调函数 */ + 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) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 取消监听录制事件。当对应事件触发时,该回调函数不再执行。 */ + off( + /** 事件名 */ + eventName: string, + /** 事件触发时执行的回调函数 */ + 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` + * + * 在插件中使用:支持 + * + * 注册监听录制事件的回调函数。当对应事件触发时,回调函数会被执行。 */ + on( + /** 事件名 + * + * 参数 eventName 可选值: + * - 'start': 录制开始事件。; + * - 'stop': 录制结束事件。返回 {tempFilePath, duration, fileSize}; + * - 'pause': 录制暂停事件。; + * - 'resume': 录制继续事件。; + * - 'timeupdate': 录制时间更新事件。; */ + eventName: 'start' | 'stop' | 'pause' | 'resume' | 'timeupdate', + /** 事件触发时执行的回调函数 */ + 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` + * + * 在插件中使用:支持 + * + * 销毁录制器 */ + destroy(): Promise<any>; + /** [Promise MediaRecorder.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.pause.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 暂停录制 */ + pause(): Promise<any>; + /** [Promise MediaRecorder.requestFrame(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.requestFrame.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 请求下一帧录制,在 callback 里完成一帧渲染后开始录制当前帧 */ + requestFrame(callback: (...args: any[]) => any): Promise<any>; + /** [Promise MediaRecorder.resume()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.resume.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 恢复录制 */ + resume(): Promise<any>; + /** [Promise MediaRecorder.start()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.start.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 开始录制 */ + start(): Promise<any>; + /** [Promise MediaRecorder.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/MediaRecorder.stop.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 结束录制 */ + stop(): Promise<any>; + } + interface MifareClassic { + /** [MifareClassic.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.close.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 断开连接 */ + close(option?: NdefCloseOption): void; + /** [MifareClassic.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.connect.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 连接 NFC 标签 */ + connect(option?: NdefConnectOption): void; + /** [MifareClassic.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.getMaxTransceiveLength.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取最大传输长度 */ + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; + /** [MifareClassic.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.isConnected.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * @warning **该接口已废弃,连接状态开发者自行维护即可** + * + * 检查是否已连接 */ + isConnected(option?: IsConnectedOption): void; + /** [MifareClassic.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.setTimeout.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 设置超时时间 */ + setTimeout(option: SetTimeoutOption): void; + /** [MifareClassic.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareClassic.transceive.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 发送数据 */ + transceive(option: TransceiveOption): void; + } + interface MifareUltralight { + /** [MifareUltralight.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.close.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 断开连接 */ + close(option?: NdefCloseOption): void; + /** [MifareUltralight.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.connect.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 连接 NFC 标签 */ + connect(option?: NdefConnectOption): void; + /** [MifareUltralight.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.getMaxTransceiveLength.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取最大传输长度 */ + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; + /** [MifareUltralight.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.isConnected.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * @warning **该接口已废弃,连接状态开发者自行维护即可** + * + * 检查是否已连接 */ + isConnected(option?: IsConnectedOption): void; + /** [MifareUltralight.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.setTimeout.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 设置超时时间 */ + setTimeout(option: SetTimeoutOption): void; + /** [MifareUltralight.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/MifareUltralight.transceive.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 发送数据 */ + transceive(option: TransceiveOption): void; + } + interface NFCError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 0 | ok | 正常 | + * | 13000 | | 当前设备不支持NFC | + * | 13001 | | 当前设备支持NFC,但系统NFC开关未开启 | + * | 13002 | | 当前设备支持NFC,但不支持HCE | + * | 13003 | | AID列表参数格式错误 | + * | 13004 | | 未设置微信为默认NFC支付应用 | + * | 13005 | | 返回的指令不合法 | + * | 13006 | | 注册AID失败 | */ errMsg: string; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 0 | ok | 正常 | + * | 13000 | | 当前设备不支持NFC | + * | 13001 | | 当前设备支持NFC,但系统NFC开关未开启 | + * | 13002 | | 当前设备支持NFC,但不支持HCE | + * | 13003 | | AID列表参数格式错误 | + * | 13004 | | 未设置微信为默认NFC支付应用 | + * | 13005 | | 返回的指令不合法 | + * | 13006 | | 注册AID失败 | */ errCode: number; + } + interface Ndef { + /** [Ndef.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.close.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 断开连接 */ + close(option?: NdefCloseOption): void; + /** [Ndef.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.connect.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 连接 NFC 标签 */ + connect(option?: NdefConnectOption): void; + /** [Ndef.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.isConnected.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * @warning **该接口已废弃,连接状态开发者自行维护即可** + * + * 检查是否已连接 */ + isConnected(option?: IsConnectedOption): void; + /** [Ndef.offNdefMessage(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.offNdefMessage.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 取消监听 Ndef 消息 */ + 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` + * + * 在插件中使用:支持 + * + * 监听 Ndef 消息 */ + 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` + * + * 在插件中使用:支持 + * + * 设置超时时间 */ + setTimeout(option: SetTimeoutOption): void; + /** [Ndef.writeNdefMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/Ndef.writeNdefMessage.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 重写 Ndef 标签内容 */ + writeNdefMessage(option: WriteNdefMessageOption): void; + } + interface NfcA { + /** [NfcA.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.close.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 断开连接 */ + close(option?: NdefCloseOption): void; + /** [NfcA.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.connect.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 连接 NFC 标签 */ + connect(option?: NdefConnectOption): void; + /** [NfcA.getAtqa(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getAtqa.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取ATQA信息 */ + getAtqa(option?: GetAtqaOption): void; + /** [NfcA.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getMaxTransceiveLength.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取最大传输长度 */ + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; + /** [NfcA.getSak(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.getSak.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取SAK信息 */ + getSak(option?: GetSakOption): void; + /** [NfcA.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.isConnected.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * @warning **该接口已废弃,连接状态开发者自行维护即可** + * + * 检查是否已连接 */ + isConnected(option?: IsConnectedOption): void; + /** [NfcA.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.setTimeout.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 设置超时时间 */ + setTimeout(option: SetTimeoutOption): void; + /** [NfcA.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcA.transceive.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 发送数据 */ + transceive(option: TransceiveOption): void; + } + interface NfcB { + /** [NfcB.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.close.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 断开连接 */ + close(option?: NdefCloseOption): void; + /** [NfcB.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.connect.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 连接 NFC 标签 */ + connect(option?: NdefConnectOption): void; + /** [NfcB.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.getMaxTransceiveLength.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取最大传输长度 */ + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; + /** [NfcB.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.isConnected.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * @warning **该接口已废弃,连接状态开发者自行维护即可** + * + * 检查是否已连接 */ + isConnected(option?: IsConnectedOption): void; + /** [NfcB.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.setTimeout.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 设置超时时间 */ + setTimeout(option: SetTimeoutOption): void; + /** [NfcB.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcB.transceive.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 发送数据 */ + transceive(option: TransceiveOption): void; + } + interface NfcF { + /** [NfcF.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.close.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 断开连接 */ + close(option?: NdefCloseOption): void; + /** [NfcF.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.connect.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 连接 NFC 标签 */ + connect(option?: NdefConnectOption): void; + /** [NfcF.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.getMaxTransceiveLength.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取最大传输长度 */ + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; + /** [NfcF.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.isConnected.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * @warning **该接口已废弃,连接状态开发者自行维护即可** + * + * 检查是否已连接 */ + isConnected(option?: IsConnectedOption): void; + /** [NfcF.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.setTimeout.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 设置超时时间 */ + setTimeout(option: SetTimeoutOption): void; + /** [NfcF.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcF.transceive.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 发送数据 */ + transceive(option: TransceiveOption): void; + } + interface NfcV { + /** [NfcV.close(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.close.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 断开连接 */ + close(option?: NdefCloseOption): void; + /** [NfcV.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.connect.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 连接 NFC 标签 */ + connect(option?: NdefConnectOption): void; + /** [NfcV.getMaxTransceiveLength(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.getMaxTransceiveLength.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 获取最大传输长度 */ + getMaxTransceiveLength(option?: GetMaxTransceiveLengthOption): void; + /** [NfcV.isConnected(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.isConnected.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * @warning **该接口已废弃,连接状态开发者自行维护即可** + * + * 检查是否已连接 */ + isConnected(option?: IsConnectedOption): void; + /** [NfcV.setTimeout(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.setTimeout.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 设置超时时间 */ + setTimeout(option: SetTimeoutOption): void; + /** [NfcV.transceive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc/NfcV.transceive.html) + * + * 需要基础库: `2.11.2` + * + * 在插件中使用:支持 + * + * 发送数据 */ + transceive(option: TransceiveOption): void; + } + interface Nfcrwerror { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 13000 | 设备不支持NFC | | + * | 13001 | 系统NFC开关未打开 | | + * | 13010 | 未知错误 | | + * | 13019 | user is not authorized | 用户未授权 | + * | 13011 | invalid parameter | 参数无效 | + * | 13012 | parse NdefMessage failed | 将参数解析为NdefMessage失败 | + * | 13021 | NFC discovery already started | 已经开始NFC扫描 | + * | 13018 | NFC discovery has not started | 尝试在未开始NFC扫描时停止NFC扫描 | + * | 13022 | Tech already connected | 标签已经连接 | + * | 13023 | Tech has not connected | 尝试在未连接标签时断开连接 | + * | 13013 | NFC tag has not been discovered | 未扫描到NFC标签 | + * | 13014 | invalid tech | 无效的标签技术 | + * | 13015 | unavailable tech | 从标签上获取对应技术失败 | + * | 13024 | function not support | 当前标签技术不支持该功能 | + * | 13017 | system internal error | 相关读写操作失败 | + * | 13016 | connect fail | 连接失败 | */ errMsg: string; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 13000 | 设备不支持NFC | | + * | 13001 | 系统NFC开关未打开 | | + * | 13010 | 未知错误 | | + * | 13019 | user is not authorized | 用户未授权 | + * | 13011 | invalid parameter | 参数无效 | + * | 13012 | parse NdefMessage failed | 将参数解析为NdefMessage失败 | + * | 13021 | NFC discovery already started | 已经开始NFC扫描 | + * | 13018 | NFC discovery has not started | 尝试在未开始NFC扫描时停止NFC扫描 | + * | 13022 | Tech already connected | 标签已经连接 | + * | 13023 | Tech has not connected | 尝试在未连接标签时断开连接 | + * | 13013 | NFC tag has not been discovered | 未扫描到NFC标签 | + * | 13014 | invalid tech | 无效的标签技术 | + * | 13015 | unavailable tech | 从标签上获取对应技术失败 | + * | 13024 | function not support | 当前标签技术不支持该功能 | + * | 13017 | system internal error | 相关读写操作失败 | + * | 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) +* +* 在插件中使用:支持 +* +* 添加节点的布局位置的查询请求。相对于显示区域,以像素为单位。其功能类似于 DOM 的 `getBoundingClientRect`。返回 `NodesRef` 对应的 `SelectorQuery`。 +* +* **示例代码** +* +* ```js +Page({ + getRect () { + wx.createSelectorQuery().select('#the-id').boundingClientRect(function(rect){ + rect.id // 节点的ID + rect.dataset // 节点的dataset + rect.left // 节点的左边界坐标 + rect.right // 节点的右边界坐标 + rect.top // 节点的上边界坐标 + rect.bottom // 节点的下边界坐标 + rect.width // 节点的宽度 + rect.height // 节点的高度 + }).exec() + }, + getAllRects () { + wx.createSelectorQuery().selectAll('.a-class').boundingClientRect(function(rects){ + rects.forEach(function(rect){ + rect.id // 节点的ID + rect.dataset // 节点的dataset + rect.left // 节点的左边界坐标 + rect.right // 节点的右边界坐标 + rect.top // 节点的上边界坐标 + rect.bottom // 节点的下边界坐标 + rect.width // 节点的宽度 + rect.height // 节点的高度 + }) + }).exec() + } +}) +``` */ + boundingClientRect( + /** 回调函数,在执行 `SelectorQuery.exec` 方法后,节点信息会在 `callback` 中返回。 */ + 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` +* +* 在插件中使用:支持 +* +* 添加节点的 Context 对象查询请求。目前支持 [VideoContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.html)、[CanvasContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html)、[LivePlayerContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.html)、[EditorContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/editor/EditorContext.html)和 [MapContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.html) 的获取。 +* +* **示例代码** +* +* ```js +Page({ + getContext () { + wx.createSelectorQuery().select('.the-video-class').context(function(res){ + console.log(res.context) // 节点对应的 Context 对象。如:选中的节点是 <video> 组件,那么此处即返回 VideoContext 对象 + }).exec() + } +}) +``` */ + context( + /** 回调函数,在执行 `SelectorQuery.exec` 方法后,返回节点信息。 */ + 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) +* +* 在插件中使用:支持 +* +* 获取节点的相关信息。需要获取的字段在fields中指定。返回值是 `nodesRef` 对应的 `selectorQuery` +* +* **注意** +* +* computedStyle 的优先级高于 size,当同时在 computedStyle 里指定了 width/height 和传入了 size: true,则优先返回 computedStyle 获取到的 width/height。 +* +* **示例代码** +* +* ```js +Page({ + getFields () { + wx.createSelectorQuery().select('#the-id').fields({ + dataset: true, + size: true, + scrollOffset: true, + properties: ['scrollX', 'scrollY'], + computedStyle: ['margin', 'backgroundColor'], + context: true, + }, function (res) { + res.dataset // 节点的dataset + res.width // 节点的宽度 + res.height // 节点的高度 + res.scrollLeft // 节点的水平滚动位置 + res.scrollTop // 节点的竖直滚动位置 + res.scrollX // 节点 scroll-x 属性的当前值 + res.scrollY // 节点 scroll-y 属性的当前值 + // 此处返回指定要返回的样式名 + res.margin + res.backgroundColor + res.context // 节点对应的 Context 对象 + }).exec() + } +}) +``` */ + fields( + fields: Fields, + /** 回调函数 */ + 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` +* +* 在插件中使用:支持 +* +* 获取 Node 节点实例。目前支持 [Canvas](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.html) 和 [ScrollViewContext](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/ScrollViewContext.html) 的获取。 +* +* **示例代码** +* +* ```js +Page({ + getNode() { + wx.createSelectorQuery().select('.canvas').node(function(res){ + console.log(res.node) // 节点对应的 Canvas 实例。 + }).exec() + } +}) +``` */ + node( + /** 回调函数,在执行 `SelectorQuery.exec` 方法后,返回节点信息。 */ + callback?: NodeCallback + ): 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) +* +* 在插件中使用:支持 +* +* 添加节点的滚动位置查询请求。以像素为单位。节点必须是 `scroll-view` 或者 `viewport`,返回 `NodesRef` 对应的 `SelectorQuery`。 +* +* **示例代码** +* +* ```js +Page({ + getScrollOffset () { + wx.createSelectorQuery().selectViewport().scrollOffset(function(res){ + res.id // 节点的ID + res.dataset // 节点的dataset + res.scrollLeft // 节点的水平滚动位置 + res.scrollTop // 节点的竖直滚动位置 + }).exec() + } +}) +``` */ + scrollOffset( + /** 回调函数,在执行 `SelectorQuery.exec` 方法后,节点信息会在 `callback` 中返回。 */ + 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) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 添加路径到当前路径。 */ + addPath( + /** [Path2D](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.html) + * + * 添加的 Path2D 路径。 */ + 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` + * + * 在插件中使用:不支持 + * + * 添加一段圆弧路径。 */ + arc( + /** 圆心横坐标。 */ + x: number, + /** 圆心纵坐标。 */ + y: number, + /** 圆形半径,必须为正数。 */ + radius: number, + /** 圆弧开始角度。 */ + startAngle: number, + /** 圆弧结束角度。 */ + endAngle: number, + /** 是否逆时针绘制。如果传 true, 则会从 endAngle 开始绘制到 startAngle。 */ + 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` + * + * 在插件中使用:不支持 + * + * 通过给定控制点添加一段圆弧路径。 */ + arcTo( + /** 第一个控制点横坐标。 */ + x1: number, + /** 第一个控制点纵坐标。 */ + y1: number, + /** 第二个控制点横坐标。 */ + x2: number, + /** 第二个控制点纵坐标。 */ + y2: number, + /** 圆形半径,必须为非负数。 */ + 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` + * + * 在插件中使用:不支持 + * + * 添加三次贝塞尔曲线路径。 */ + bezierCurveTo( + /** 第一个控制点横坐标。 */ + cp1x: number, + /** 第一个控制点纵坐标。 */ + cp1y: number, + /** 第二个控制点横坐标。 */ + cp2x: number, + /** 第二个控制点纵坐标。 */ + cp2y: number, + /** 结束点横坐标。 */ + x: number, + /** 结束点纵坐标。 */ + y: number + ): void; + /** [Path2D.closePath()](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.closePath.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 闭合路径到起点。 */ + 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` + * + * 在插件中使用:不支持 + * + * 添加椭圆弧路径 */ + ellipse( + /** 椭圆圆心横坐标。 */ + x: number, + /** 椭圆圆心纵坐标。 */ + y: number, + /** 椭圆长轴半径,必须为非负数。 */ + radiusX: number, + /** 椭圆短轴半径,必须为非负数。 */ + radiusY: number, + /** 椭圆旋转角度。 */ + rotation: number, + /** 圆弧开始角度。 */ + startAngle: number, + /** 圆弧结束角度。 */ + endAngle: number, + /** 是否逆时针绘制。如果传 true, 则会从 endAngle 开始绘制到 startAngle。 */ + counterclockwise?: boolean + ): void; + /** [Path2D.lineTo(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.lineTo.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 添加直线路径 */ + lineTo( + /** 结束点横坐标。 */ + x: number, + /** 结束点纵坐标。 */ + y: number + ): void; + /** [Path2D.moveTo(number x, number y)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Path2D.moveTo.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 移动路径开始点 */ + moveTo( + /** 横坐标。 */ + x: number, + /** 纵坐标。 */ + 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` + * + * 在插件中使用:不支持 + * + * 添加二次贝塞尔曲线路径。 */ + quadraticCurveTo( + /** 控制点横坐标。 */ + cpx: number, + /** 控制点纵坐标。 */ + cpy: number, + /** 结束点横坐标。 */ + x: number, + /** 结束点纵坐标。 */ + 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` + * + * 在插件中使用:不支持 + * + * 添加方形路径。 */ + rect( + /** 开始点横坐标。 */ + x: number, + /** 开始点纵坐标。 */ + y: number, + /** 方形宽度,正数向右,负数向左。 */ + width: number, + /** 方形高度,正数向下,负数向上。 */ + 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) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 该方法返回当前缓冲区中的所有性能数据 */ + 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` + * + * 在插件中使用:不支持 + * + * 获取当前缓冲区中所有名称为 [name] 且类型为 [entryType] 的性能数据 */ + getEntriesByName( + /** 名称 */ + name: string, + /** 类型 */ + 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` + * + * 在插件中使用:不支持 + * + * 获取当前缓冲区中所有类型为 [entryType] 的性能数据 */ + getEntriesByType( + /** 类型 */ + entryType: string + ): PerformanceEntry[]; + /** [Performance.setBufferSize(number size)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/Performance.setBufferSize.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 设置缓冲区大小,默认缓冲 30 条性能数据 */ + 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` + * + * 在插件中使用:不支持 + * + * 创建全局性能事件监听器 */ + createObserver( + /** 回调函数 */ + callback: (...args: any[]) => any + ): PerformanceObserver; + } + interface PreDownloadSubpackageTask { + /** [PreDownloadSubpackageTask.onProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/subpackage/PreDownloadSubpackageTask.onProgressUpdate.html) + * + * 需要基础库: `2.27.3` + * + * 在插件中使用:不支持 + * + * 监听分包加载进度变化事件 */ + onProgressUpdate( + /** 分包加载进度变化事件的监听函数 */ + listener: PreDownloadSubpackageTaskOnProgressUpdateCallback + ): void; + } + interface RealtimeLogManager { + /** [Object RealtimeLogManager.getCurrentState()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.getCurrentState.html) + * + * 需要基础库: `2.19.4` + * + * 在插件中使用:不支持 + * + * 实时日志会将一定时间间隔内缓存的日志聚合上报,如果该时间内缓存的内容超出限制,则会被丢弃。此方法可以获取当前缓存剩余空间。 + * + * > 注意:基础库内部在对日志进行上报时会补充一些结构化数据,如果遇到上报溢出的情况也会补充警告日志,所以此方法获取到的当前占用信息会比预期的大一些。 */ + getCurrentState(): CurrentState; + /** [RealtimeLogManager.addFilterMsg(string msg)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.addFilterMsg.html) + * + * 需要基础库: `2.8.1` + * + * 在插件中使用:不支持 + * + * 添加过滤关键字,暂不支持在插件使用 */ + addFilterMsg( + /** 是setFilterMsg的添加接口。用于设置多个过滤关键字。 */ + msg: string + ): void; + /** [RealtimeLogManager.error()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.error.html) + * + * 需要基础库: `2.7.1` + * + * 在插件中使用:不支持 + * + * 写 error 日志,暂不支持在插件使用 */ + error( + /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过5Kb */ + ...args: any[] + ): void; + /** [RealtimeLogManager.in(Page pageInstance)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.in.html) + * + * 需要基础库: `2.9.1` + * + * 在插件中使用:不支持 + * + * 设置实时日志page参数所在的页面,暂不支持在插件使用 */ + in( + /** page实例 */ + pageInstance: Page.TrivialInstance + ): void; + /** [RealtimeLogManager.info()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.info.html) + * + * 需要基础库: `2.7.1` + * + * 在插件中使用:不支持 + * + * 写 info 日志,暂不支持在插件使用 */ + info( + /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过5Kb */ + ...args: any[] + ): void; + /** [RealtimeLogManager.setFilterMsg(string msg)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.setFilterMsg.html) + * + * 需要基础库: `2.7.3` + * + * 在插件中使用:不支持 + * + * 设置过滤关键字,暂不支持在插件使用 */ + setFilterMsg( + /** 过滤关键字,最多不超过1Kb,可以在小程序管理后台根据设置的内容搜索得到对应的日志。 */ + msg: string + ): void; + /** [RealtimeLogManager.warn()](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeLogManager.warn.html) + * + * 需要基础库: `2.7.1` + * + * 在插件中使用:不支持 + * + * 写 warn 日志,暂不支持在插件使用 */ + warn( + /** 日志内容,可以有任意多个。每次调用的参数的总大小不超过5Kb */ + ...args: any[] + ): 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` + * + * 在插件中使用:需要基础库 `2.16.0` + * + * 获取给定标签的日志管理器实例,目前只支持在插件使用 */ + tag( + /** 标签名 */ + tagName: string + ): RealtimeTagLogManager; + } + interface RealtimeTagLogManager { + /** [RealtimeTagLogManager.addFilterMsg(string msg)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/RealtimeTagLogManager.addFilterMsg.html) + * + * 需要基础库: `2.16.0` + * + * 在插件中使用:需要基础库 `2.16.0` + * + * 添加过滤关键字 */ + addFilterMsg( + /** 是setFilterMsg的添加接口。用于设置多个过滤关键字。 */ + 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` + * + * 在插件中使用:需要基础库 `2.16.0` + * + * 写 error 日志 */ + error( + /** 日志的 key */ + key: string, + /** 日志的值,每次调用的参数的总大小不超过5Kb */ + 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` + * + * 在插件中使用:需要基础库 `2.16.0` + * + * 写 info 日志 */ + info( + /** 日志的 key */ + key: string, + /** 日志的值,每次调用的参数的总大小不超过5Kb */ + 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` + * + * 在插件中使用:需要基础库 `2.16.0` + * + * 设置过滤关键字 */ + setFilterMsg( + /** 过滤关键字,最多不超过1Kb,可以在小程序管理后台根据设置的内容搜索得到对应的日志。 */ + 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` + * + * 在插件中使用:需要基础库 `2.16.0` + * + * 写 warn 日志 */ + warn( + /** 日志的 key */ + key: string, + /** 日志的值,每次调用的参数的总大小不超过5Kb */ + 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) + * + * 在插件中使用:支持 + * + * 监听录音错误事件 */ + onError( + /** 录音错误事件的监听函数 */ + listener: UDPSocketOnErrorCallback + ): void; + /** [RecorderManager.onFrameRecorded(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onFrameRecorded.html) + * + * 在插件中使用:支持 + * + * 监听已录制完指定帧大小的文件事件。如果设置了 frameSize,则会回调此事件。 */ + onFrameRecorded( + /** 已录制完指定帧大小的文件事件的监听函数 */ + listener: OnFrameRecordedCallback + ): void; + /** [RecorderManager.onInterruptionBegin(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onInterruptionBegin.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:支持 + * + * 监听录音因为受到系统占用而被中断开始事件。以下场景会触发此事件:微信语音聊天、微信视频聊天。此事件触发后,录音会被暂停。pause 事件在此事件后触发 */ + onInterruptionBegin( + /** 录音因为受到系统占用而被中断开始事件的监听函数 */ + listener: OnInterruptionBeginCallback + ): void; + /** [RecorderManager.onInterruptionEnd(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onInterruptionEnd.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:支持 + * + * 监听录音中断结束事件。在收到 interruptionBegin 事件之后,小程序内所有录音会暂停,收到此事件之后才可再次录音成功。 */ + onInterruptionEnd( + /** 录音中断结束事件的监听函数 */ + listener: OnInterruptionEndCallback + ): void; + /** [RecorderManager.onPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onPause.html) + * + * 在插件中使用:支持 + * + * 监听录音暂停事件 */ + onPause( + /** 录音暂停事件的监听函数 */ + listener: OnPauseCallback + ): void; + /** [RecorderManager.onResume(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onResume.html) + * + * 在插件中使用:支持 + * + * 监听录音继续事件 */ + onResume( + /** 录音继续事件的监听函数 */ + listener: OnResumeCallback + ): void; + /** [RecorderManager.onStart(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onStart.html) + * + * 在插件中使用:支持 + * + * 监听录音开始事件 */ + onStart( + /** 录音开始事件的监听函数 */ + listener: OnStartCallback + ): void; + /** [RecorderManager.onStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.onStop.html) + * + * 在插件中使用:支持 + * + * 监听录音结束事件 */ + onStop( + /** 录音结束事件的监听函数 */ + listener: RecorderManagerOnStopCallback + ): void; + /** [RecorderManager.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.pause.html) + * + * 在插件中使用:支持 + * + * 暂停录音 */ + pause(): void; + /** [RecorderManager.resume()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.resume.html) + * + * 在插件中使用:支持 + * + * 继续录音 */ + resume(): void; + /** [RecorderManager.start(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.start.html) + * + * 在插件中使用:支持 + * + * 开始录音 + * + * **采样率与编码码率限制** + * + * 每种采样率有对应的编码码率范围有效值,设置不合法的采样率或编码码率会导致录音失败,具体对应关系如下表。 + * + * | 采样率 | 编码码率 | + * | ------ | -------------- | + * | 8000 | 16000 ~ 48000 | + * | 11025 | 16000 ~ 48000 | + * | 12000 | 24000 ~ 64000 | + * | 16000 | 24000 ~ 96000 | + * | 22050 | 32000 ~ 128000 | + * | 24000 | 32000 ~ 128000 | + * | 32000 | 48000 ~ 192000 | + * | 44100 | 64000 ~ 320000 | + * | 48000 | 64000 ~ 320000 | */ + start(option: RecorderManagerStartOption): void; + /** [RecorderManager.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/RecorderManager.stop.html) + * + * 在插件中使用:支持 + * + * 停止录音 */ + stop(): void; + } + interface RequestTask { + /** [RequestTask.abort()](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.abort.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 中断请求任务 */ + abort(): void; + /** [RequestTask.offChunkReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.offChunkReceived.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:支持 +* +* 移除 Transfer-Encoding Chunk Received 事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +RequestTask.onChunkReceived(listener) +RequestTask.offChunkReceived(listener) // 需传入与监听时同一个的函数对象 +``` */ + offChunkReceived( + /** onChunkReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffChunkReceivedCallback + ): void; + /** [RequestTask.offHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.offHeadersReceived.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:支持 +* +* 移除 HTTP Response Header 事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +RequestTask.onHeadersReceived(listener) +RequestTask.offHeadersReceived(listener) // 需传入与监听时同一个的函数对象 +``` */ + offHeadersReceived( + /** onHeadersReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffHeadersReceivedCallback + ): void; + /** [RequestTask.onChunkReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.onChunkReceived.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:支持 + * + * 监听 Transfer-Encoding Chunk Received 事件。当接收到新的chunk时触发。 */ + onChunkReceived( + /** Transfer-Encoding Chunk Received 事件的监听函数 */ + listener: OnChunkReceivedCallback + ): void; + /** [RequestTask.onHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.onHeadersReceived.html) + * + * 需要基础库: `2.1.0` + * + * 在插件中使用:支持 + * + * 监听 HTTP Response Header 事件。会比请求完成事件更早 */ + onHeadersReceived( + /** HTTP Response Header 事件的监听函数 */ + listener: OnHeadersReceivedCallback + ): void; + } + interface RewardedVideoAd { + /** [Promise RewardedVideoAd.load()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.load.html) + * + * 在插件中使用:不支持 + * + * 加载激励视频广告。 */ + load(): Promise<any>; + /** [Promise RewardedVideoAd.show()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.show.html) + * + * 在插件中使用:不支持 + * + * 显示激励视频广告。激励视频广告将从屏幕下方推入。 */ + show(): Promise<any>; + /** [RewardedVideoAd.destroy()](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.destroy.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 销毁激励视频广告实例。 */ + destroy(): void; + /** [RewardedVideoAd.offClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.offClose.html) +* +* 在插件中使用:不支持 +* +* 移除用户点击 `关闭广告` 按钮的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +RewardedVideoAd.onClose(listener) +RewardedVideoAd.offClose(listener) // 需传入与监听时同一个的函数对象 +``` */ + offClose( + /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: RewardedVideoAdOffCloseCallback + ): void; + /** [RewardedVideoAd.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.offError.html) +* +* 在插件中使用:不支持 +* +* 移除激励视频错误事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +RewardedVideoAd.onError(listener) +RewardedVideoAd.offError(listener) // 需传入与监听时同一个的函数对象 +``` */ + offError( + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: RewardedVideoAdOffErrorCallback + ): void; + /** [RewardedVideoAd.offLoad(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.offLoad.html) +* +* 在插件中使用:不支持 +* +* 移除激励视频广告加载事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +RewardedVideoAd.onLoad(listener) +RewardedVideoAd.offLoad(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLoad( + /** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLoadCallback + ): void; + /** [RewardedVideoAd.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.onClose.html) + * + * 在插件中使用:不支持 + * + * 监听用户点击 `关闭广告` 按钮的事件。 */ + onClose( + /** 用户点击 `关闭广告` 按钮的事件的监听函数 */ + listener: RewardedVideoAdOnCloseCallback + ): void; + /** [RewardedVideoAd.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.onError.html) + * + * 在插件中使用:不支持 + * + * 监听激励视频错误事件。 + * + * **错误码信息与解决方案表** + * + * 错误码是通过onError获取到的错误信息。调试期间,可以通过异常返回来捕获信息。 + * 在小程序发布上线之后,如果遇到异常问题,可以在[“运维中心“](https://mp.weixin.qq.com/)里面搜寻错误日志,还可以针对异常返回加上适当的监控信息。 + * + * | 代码 | 异常情况 | 理由 | 解决方案 | + * | ------ | -------------- | --------------- | -------------------------- | + * | 1000 | 后端错误调用失败 | 该项错误不是开发者的异常情况 | 一般情况下忽略一段时间即可恢复。 | + * | 1001 | 参数错误 | 使用方法错误 | 可以前往developers.weixin.qq.com确认具体教程(小程序和小游戏分别有各自的教程,可以在顶部选项中,“设计”一栏的右侧进行切换。| + * | 1002 | 广告单元无效 | 可能是拼写错误、或者误用了其他APP的广告ID | 请重新前往mp.weixin.qq.com确认广告位ID。 | + * | 1003 | 内部错误 | 该项错误不是开发者的异常情况 | 一般情况下忽略一段时间即可恢复。| + * | 1004 | 无适合的广告 | 广告不是每一次都会出现,这次没有出现可能是由于该用户不适合浏览广告 | 属于正常情况,且开发者需要针对这种情况做形态上的兼容。 | + * | 1005 | 广告组件审核中 | 你的广告正在被审核,无法展现广告 | 请前往mp.weixin.qq.com确认审核状态,且开发者需要针对这种情况做形态上的兼容。| + * | 1006 | 广告组件被驳回 | 你的广告审核失败,无法展现广告 | 请前往mp.weixin.qq.com确认审核状态,且开发者需要针对这种情况做形态上的兼容。| + * | 1007 | 广告组件被封禁 | 你的广告能力已经被封禁,封禁期间无法展现广告 | 请前往mp.weixin.qq.com确认小程序广告封禁状态。 | + * | 1008 | 广告单元已关闭 | 该广告位的广告能力已经被关闭 | 请前往mp.weixin.qq.com重新打开对应广告位的展现。| */ + onError( + /** 激励视频错误事件的监听函数 */ + listener: RewardedVideoAdOnErrorCallback + ): void; + /** [RewardedVideoAd.onLoad(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ad/RewardedVideoAd.onLoad.html) + * + * 在插件中使用:不支持 + * + * 监听激励视频广告加载事件。 */ + onLoad( + /** 激励视频广告加载事件的监听函数 */ + 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) +* +* 在插件中使用:不支持 +* +* 添加自定义路由配置 +* +* **自定义路由示例** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/y1IbQpmA7wGZ) +* +* ```js +// 定义自定义效果,从右侧推入 +const slideRouteBuilder = (customRouteContext) => { + const { primaryAnimation } = customRouteContext + const handlePrimaryAnimation = () => { + 'worklet' + const transX = windowWidth * (1 - primaryAnimation.value) + return { + transform: `translateX(${transX}px)`, + } + } + return { + handlePrimaryAnimation + } +} + +wx.router.addRouteBuilder('slide', slideRouteBuilder) + +// 使用自定义路由 +wx.navigateTo({ + url: 'xxx', + routeType: 'slide' +}) +``` */ + addRouteBuilder( + /** 路由类型 */ + routeType: string, + /** [路由动画定义函数](#) */ + routeBuilder: CustomRouteBuilder + ): void; + /** [router.getRouteContext(Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/route/router/base/router.getRouteContext.html) + * + * 在插件中使用:不支持 + * + * 获取页面对应的自定义路由上下文对象 */ + getRouteContext( + /** 页面/自定义组件实例 */ + component: Component.TrivialInstance | Page.TrivialInstance + ): void; + /** [router.removeRouteBuilder(string routeType)](https://developers.weixin.qq.com/miniprogram/dev/api/route/router/base/router.removeRouteBuilder.html) + * + * 在插件中使用:不支持 + * + * 移除自定义路由配置 */ + removeRouteBuilder( + /** 路由类型 */ + 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) + * + * 在插件中使用:支持 + * + * 执行所有的请求。请求结果按请求次序构成数组,在callback的第一个参数中返回。 */ + exec( + /** 回调函数 */ + 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) + * + * 在插件中使用:支持 + * + * 在当前页面下选择第一个匹配选择器 `selector` 的节点。返回一个 `NodesRef` 对象实例,可以用于获取节点信息。 + * + * **selector 语法** + * + * selector类似于 CSS 的选择器,但仅支持下列语法。 + * + * - ID选择器:#the-id + * - class选择器(可以连续指定多个):.a-class.another-class + * - 子元素选择器:.the-parent > .the-child + * - 后代选择器:.the-ancestor .the-descendant + * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant + * - 多选择器的并集:#a-node, .some-other-nodes */ + select( + /** 选择器 */ + 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) + * + * 在插件中使用:支持 + * + * 在当前页面下选择匹配选择器 selector 的所有节点。 + * + * **selector 语法** + * + * selector类似于 CSS 的选择器,但仅支持下列语法。 + * + * - ID选择器:#the-id + * - class选择器(可以连续指定多个):.a-class.another-class + * - 子元素选择器:.the-parent > .the-child + * - 后代选择器:.the-ancestor .the-descendant + * - 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant + * - 多选择器的并集:#a-node, .some-other-nodes */ + selectAll( + /** 选择器 */ + 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; + /** [[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` +* +* 在插件中使用:支持 +* +* 将选择器的选取范围更改为自定义组件 `component` 内。(初始时,选择器仅选取页面范围的节点,不会选取任何自定义组件中的节点)。 +* +* **示例代码** +* +* ```js +Component({ + queryMultipleNodes (){ + const query = wx.createSelectorQuery().in(this) + query.select('#the-id').boundingClientRect(function(res){ + res.top // 这个组件内 #the-id 节点的上边界坐标 + }).exec() + } +}) +``` */ + in( + /** 自定义组件实例 */ + 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) + * + * 在插件中使用:支持 + * + * 关闭 WebSocket 连接 */ + close(option: SocketTaskCloseOption): void; + /** [SocketTask.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onClose.html) + * + * 在插件中使用:支持 + * + * 监听 WebSocket 连接关闭事件 */ + onClose( + /** WebSocket 连接关闭事件的监听函数 */ + listener: SocketTaskOnCloseCallback + ): void; + /** [SocketTask.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onError.html) + * + * 在插件中使用:支持 + * + * 监听 WebSocket 错误事件 */ + onError( + /** WebSocket 错误事件的监听函数 */ + listener: UDPSocketOnErrorCallback + ): void; + /** [SocketTask.onMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onMessage.html) + * + * 在插件中使用:支持 + * + * 监听 WebSocket 接收到服务器的消息事件 */ + onMessage( + /** WebSocket 接收到服务器的消息事件的监听函数 */ + listener: SocketTaskOnMessageCallback + ): void; + /** [SocketTask.onOpen(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.onOpen.html) + * + * 在插件中使用:支持 + * + * 监听 WebSocket 连接打开事件 */ + onOpen( + /** WebSocket 连接打开事件的监听函数 */ + 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; + } + interface TCPSocket { + /** [TCPSocket.bindWifi(Object options)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.bindWifi.html) + * + * 需要基础库: `2.25.0` + * + * 在插件中使用:不支持 + * + * 将 TCP Socket 绑定到当前 wifi 网络,成功后会触发 onBindWifi 事件(仅安卓支持) */ + bindWifi(options: BindWifiOption): void; + /** [TCPSocket.close()](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.close.html) + * + * 在插件中使用:不支持 + * + * 关闭连接 */ + close(): void; + /** [TCPSocket.connect(Object options)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.connect.html) + * + * 在插件中使用:不支持 + * + * 在给定的套接字上启动连接 */ + connect(options: TCPSocketConnectOption): void; + /** [TCPSocket.offBindWifi(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offBindWifi.html) +* +* 需要基础库: `2.25.0` +* +* 在插件中使用:不支持 +* +* 移除当一个 socket 绑定当前 wifi 网络成功时触发该事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +TCPSocket.onBindWifi(listener) +TCPSocket.offBindWifi(listener) // 需传入与监听时同一个的函数对象 +``` */ + offBindWifi( + /** onBindWifi 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffBindWifiCallback + ): void; + /** [TCPSocket.offClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offClose.html) +* +* 在插件中使用:不支持 +* +* 移除一旦 socket 完全关闭就发出该事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +TCPSocket.onClose(listener) +TCPSocket.offClose(listener) // 需传入与监听时同一个的函数对象 +``` */ + offClose( + /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: UDPSocketOffCloseCallback + ): void; + /** [TCPSocket.offConnect(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offConnect.html) +* +* 在插件中使用:不支持 +* +* 移除当一个 socket 连接成功建立的时候触发该事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +TCPSocket.onConnect(listener) +TCPSocket.offConnect(listener) // 需传入与监听时同一个的函数对象 +``` */ + offConnect( + /** onConnect 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffConnectCallback + ): void; + /** [TCPSocket.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offError.html) +* +* 在插件中使用:不支持 +* +* 移除当错误发生时触发的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +TCPSocket.onError(listener) +TCPSocket.offError(listener) // 需传入与监听时同一个的函数对象 +``` */ + offError( + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: UDPSocketOffErrorCallback + ): void; + /** [TCPSocket.offMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.offMessage.html) +* +* 在插件中使用:不支持 +* +* 移除当接收到数据的时触发该事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +TCPSocket.onMessage(listener) +TCPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 +``` */ + offMessage( + /** onMessage 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: TCPSocketOffMessageCallback + ): void; + /** [TCPSocket.onBindWifi(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onBindWifi.html) + * + * 需要基础库: `2.25.0` + * + * 在插件中使用:不支持 + * + * 监听当一个 socket 绑定当前 wifi 网络成功时触发该事件 */ + onBindWifi( + /** 当一个 socket 绑定当前 wifi 网络成功时触发该事件的监听函数 */ + listener: OnBindWifiCallback + ): void; + /** [TCPSocket.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onClose.html) + * + * 在插件中使用:不支持 + * + * 监听一旦 socket 完全关闭就发出该事件 */ + onClose( + /** 一旦 socket 完全关闭就发出该事件的监听函数 */ + listener: UDPSocketOnCloseCallback + ): void; + /** [TCPSocket.onConnect(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onConnect.html) + * + * 在插件中使用:不支持 + * + * 监听当一个 socket 连接成功建立的时候触发该事件 */ + onConnect( + /** 当一个 socket 连接成功建立的时候触发该事件的监听函数 */ + listener: OnConnectCallback + ): void; + /** [TCPSocket.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onError.html) + * + * 在插件中使用:不支持 + * + * 监听当错误发生时触发 */ + onError( + /** 的监听函数 */ + listener: UDPSocketOnErrorCallback + ): void; + /** [TCPSocket.onMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.onMessage.html) + * + * 在插件中使用:不支持 + * + * 监听当接收到数据的时触发该事件 */ + onMessage( + /** 当接收到数据的时触发该事件的监听函数 */ + listener: TCPSocketOnMessageCallback + ): void; + /** [TCPSocket.write(string|ArrayBuffer data)](https://developers.weixin.qq.com/miniprogram/dev/api/network/tcp/TCPSocket.write.html) + * + * 在插件中使用:不支持 + * + * 在 socket 上发送数据 */ + write( + /** 要发送的数据 */ + data: string | ArrayBuffer + ): void; + } + interface UDPSocket { + /** [UDPSocket.close()](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.close.html) + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 关闭 UDP Socket 实例,相当于销毁。 在关闭之后,UDP Socket 实例不能再发送消息,每次调用 `UDPSocket.send` 将会触发错误事件,并且 message 事件回调函数也不会再也执行。在 `UDPSocket` 实例被创建后将被 Native 强引用,保证其不被 GC。在 `UDPSocket.close` 后将解除对其的强引用,让 UDPSocket 实例遵从 GC。 */ + close(): void; + /** [UDPSocket.connect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.connect.html) + * + * 需要基础库: `2.15.0` + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 预先连接到指定的 IP 和 port,需要配合 write 方法一起使用 */ + connect(option: UDPSocketConnectOption): void; + /** [UDPSocket.offClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.offClose.html) +* +* 在插件中使用:需要基础库 `2.11.1` +* +* 移除关闭事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +UDPSocket.onClose(listener) +UDPSocket.offClose(listener) // 需传入与监听时同一个的函数对象 +``` */ + offClose( + /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: UDPSocketOffCloseCallback + ): void; + /** [UDPSocket.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.offError.html) +* +* 在插件中使用:需要基础库 `2.11.1` +* +* 移除错误事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +UDPSocket.onError(listener) +UDPSocket.offError(listener) // 需传入与监听时同一个的函数对象 +``` */ + offError( + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: UDPSocketOffErrorCallback + ): void; + /** [UDPSocket.offListening(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.offListening.html) +* +* 在插件中使用:需要基础库 `2.11.1` +* +* 移除开始监听数据包消息的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +UDPSocket.onListening(listener) +UDPSocket.offListening(listener) // 需传入与监听时同一个的函数对象 +``` */ + offListening( + /** onListening 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffListeningCallback + ): void; + /** [UDPSocket.offMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.offMessage.html) +* +* 在插件中使用:需要基础库 `2.11.1` +* +* 移除收到消息的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +UDPSocket.onMessage(listener) +UDPSocket.offMessage(listener) // 需传入与监听时同一个的函数对象 +``` */ + offMessage( + /** onMessage 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: UDPSocketOffMessageCallback + ): void; + /** [UDPSocket.onClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.onClose.html) + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 监听关闭事件 */ + onClose( + /** 关闭事件的监听函数 */ + listener: UDPSocketOnCloseCallback + ): void; + /** [UDPSocket.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.onError.html) + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 监听错误事件 */ + onError( + /** 错误事件的监听函数 */ + listener: UDPSocketOnErrorCallback + ): void; + /** [UDPSocket.onListening(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.onListening.html) + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 监听开始监听数据包消息的事件 */ + onListening( + /** 开始监听数据包消息的事件的监听函数 */ + listener: OnListeningCallback + ): void; + /** [UDPSocket.onMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.onMessage.html) + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 监听收到消息的事件 */ + onMessage( + /** 收到消息的事件的监听函数 */ + 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; + /** [UDPSocket.setTTL(number ttl)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.setTTL.html) + * + * 需要基础库: `2.18.0` + * + * 在插件中使用:支持 + * + * 设置 IP_TTL 套接字选项,用于设置一个 IP 数据包传输时允许的最大跳步数 */ + setTTL( + /** ttl 参数可以是 0 到 255 之间 */ + ttl: number + ): void; + /** [UDPSocket.write()](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.write.html) + * + * 需要基础库: `2.15.0` + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 用法与 send 方法相同,如果没有预先调用 connect 则与 send 无差异(注意即使调用了 connect 也需要在本接口填入地址和端口参数) */ + write(): void; + /** [number UDPSocket.bind(number port)](https://developers.weixin.qq.com/miniprogram/dev/api/network/udp/UDPSocket.bind.html) + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 绑定一个系统随机分配的可用端口,或绑定一个指定的端口号 */ + bind( + /** 需要基础库: `2.9.0` + * + * 指定要绑定的端口号,不传则返回系统随机分配的可用端口 */ + port?: number + ): number; + } + interface UpdateManager { + /** [UpdateManager.applyUpdate()](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.applyUpdate.html) + * + * 在插件中使用:不支持 + * + * 强制小程序重启并使用新版本。在小程序新版本下载完成后(即收到 `onUpdateReady` 回调)调用。 + * + * **示例代码** + * + * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ + applyUpdate(): void; + /** [UpdateManager.onCheckForUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onCheckForUpdate.html) + * + * 在插件中使用:不支持 + * + * 监听向微信后台请求检查更新结果事件。微信在小程序每次启动(包括热启动)时自动检查更新,不需由开发者主动触发。 + * + * **示例代码** + * + * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ + onCheckForUpdate( + /** 向微信后台请求检查更新结果事件的监听函数 */ + listener: OnCheckForUpdateCallback + ): void; + /** [UpdateManager.onUpdateFailed(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateFailed.html) + * + * 在插件中使用:不支持 + * + * 监听小程序更新失败事件。小程序有新版本,客户端主动触发下载(无需开发者触发),下载失败(可能是网络原因等)后回调 + * + * **示例代码** + * + * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ + onUpdateFailed( + /** 小程序更新失败事件的监听函数 */ + listener: OnUpdateFailedCallback + ): void; + /** [UpdateManager.onUpdateReady(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.onUpdateReady.html) + * + * 在插件中使用:不支持 + * + * 监听小程序有版本更新事件。客户端主动触发下载(无需开发者触发),下载成功后回调 + * + * **示例代码** + * + * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ + onUpdateReady( + /** 小程序有版本更新事件的监听函数 */ + listener: OnUpdateReadyCallback + ): void; + } + interface UploadTask { + /** [UploadTask.abort()](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.abort.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 中断上传任务 */ + abort(): void; + /** [UploadTask.offHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.offHeadersReceived.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:支持 +* +* 移除 HTTP Response Header 事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +UploadTask.onHeadersReceived(listener) +UploadTask.offHeadersReceived(listener) // 需传入与监听时同一个的函数对象 +``` */ + offHeadersReceived( + /** onHeadersReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffHeadersReceivedCallback + ): void; + /** [UploadTask.offProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.offProgressUpdate.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:支持 +* +* 移除上传进度变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +UploadTask.onProgressUpdate(listener) +UploadTask.offProgressUpdate(listener) // 需传入与监听时同一个的函数对象 +``` */ + offProgressUpdate( + /** onProgressUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: UploadTaskOffProgressUpdateCallback + ): void; + /** [UploadTask.onHeadersReceived(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.onHeadersReceived.html) + * + * 需要基础库: `2.1.0` + * + * 在插件中使用:支持 + * + * 监听 HTTP Response Header 事件。会比请求完成事件更早 */ + onHeadersReceived( + /** HTTP Response Header 事件的监听函数 */ + listener: OnHeadersReceivedCallback + ): void; + /** [UploadTask.onProgressUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/UploadTask.onProgressUpdate.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 监听上传进度变化事件 */ + onProgressUpdate( + /** 上传进度变化事件的监听函数 */ + listener: UploadTaskOnProgressUpdateCallback + ): void; + } + interface UserCryptoManager { + /** [UserCryptoManager.getLatestUserKey(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/crypto/UserCryptoManager.getLatestUserKey.html) +* +* 需要基础库: `2.17.3` +* +* 在插件中使用:不支持 +* +* 获取最新的用户加密密钥 +* +* **示例代码** +* +* ```js +const userCryptoManager = wx.getUserCryptoManager() +userCryptoManager.getLatestUserKey({ + success: res => { + const {encryptKey, iv, version, expireTime} = res + console.log(encryptKey, iv, version, expireTime) + } +}) +``` */ + getLatestUserKey(option?: GetLatestUserKeyOption): void; + /** [UserCryptoManager.getRandomValues(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/crypto/UserCryptoManager.getRandomValues.html) +* +* 需要基础库: `2.17.3` +* +* 在插件中使用:不支持 +* +* 获取密码学安全随机数 +* +* **示例代码** +* +* ```js +wx.getRandomValues({ + length: 6 // 生成 6 个字节长度的随机数, + success: res => { + console.log(wx.arrayBufferToBase64(res.randomValues)) // 转换为 base64 字符串后打印 + } +}) +``` */ + getRandomValues(option: GetRandomValuesOption): void; + } + interface VideoContext { + /** [VideoContext.exitBackgroundPlayback()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.exitBackgroundPlayback.html) + * + * 需要基础库: `2.14.3` + * + * 在插件中使用:支持 + * + * 退出后台音频播放模式。 */ + exitBackgroundPlayback(): void; + /** [VideoContext.exitCasting()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.exitCasting.html) + * + * 需要基础库: `2.32.0` + * + * 在插件中使用:支持 + * + * 退出投屏。仅支持在 tap 事件回调内调用。 */ + exitCasting(): void; + /** [VideoContext.exitFullScreen()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.exitFullScreen.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 退出全屏 */ + exitFullScreen(): void; + /** [VideoContext.exitPictureInPicture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.exitPictureInPicture.html) + * + * 在插件中使用:支持 + * + * 退出小窗,该方法可在任意页面调用 */ + exitPictureInPicture(option?: ExitPictureInPictureOption): void; + /** [VideoContext.hideStatusBar()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.hideStatusBar.html) + * + * 需要基础库: `2.1.0` + * + * 在插件中使用:支持 + * + * 隐藏状态栏,仅在iOS全屏下有效 */ + hideStatusBar(): void; + /** [VideoContext.pause()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.pause.html) + * + * 在插件中使用:支持 + * + * 暂停视频 */ + pause(): void; + /** [VideoContext.play()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.play.html) + * + * 在插件中使用:支持 + * + * 播放视频 */ + play(): void; + /** [VideoContext.playbackRate(number rate)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.playbackRate.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 设置倍速播放 */ + playbackRate( + /** 倍率,支持 0.5/0.8/1.0/1.25/1.5,2.6.3 起支持 2.0 倍速 */ + rate: number + ): void; + /** [VideoContext.reconnectCasting()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.reconnectCasting.html) + * + * 需要基础库: `2.32.0` + * + * 在插件中使用:支持 + * + * 重连投屏设备。仅支持在 tap 事件回调内调用。 */ + reconnectCasting(): void; + /** [VideoContext.requestBackgroundPlayback()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.requestBackgroundPlayback.html) + * + * 需要基础库: `2.14.3` + * + * 在插件中使用:支持 + * + * 进入后台音频播放模式。 */ + requestBackgroundPlayback(): void; + /** [VideoContext.requestFullScreen(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.requestFullScreen.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:支持 + * + * 进入全屏。若有自定义内容需在全屏时展示,需将内容节点放置到 video 节点内。 */ + requestFullScreen(option: VideoContextRequestFullScreenOption): void; + /** [VideoContext.seek(number position)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.seek.html) + * + * 在插件中使用:支持 + * + * 跳转到指定位置 */ + seek( + /** 跳转到的位置,单位 s */ + position: number + ): void; + /** [VideoContext.sendDanmu(Object data)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.sendDanmu.html) + * + * 在插件中使用:支持 + * + * 发送弹幕 */ + sendDanmu( + /** 弹幕内容 */ + data: Danmu + ): void; + /** [VideoContext.showStatusBar()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.showStatusBar.html) + * + * 需要基础库: `2.1.0` + * + * 在插件中使用:支持 + * + * 显示状态栏,仅在iOS全屏下有效 */ + showStatusBar(): void; + /** [VideoContext.startCasting()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.startCasting.html) + * + * 需要基础库: `2.32.0` + * + * 在插件中使用:支持 + * + * 开始投屏, 拉起半屏搜索设备。仅支持在 tap 事件回调内调用。 */ + startCasting(): void; + /** [VideoContext.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.stop.html) + * + * 需要基础库: `1.7.0` + * + * 在插件中使用:支持 + * + * 停止视频 */ + stop(): void; + /** [VideoContext.switchCasting()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.switchCasting.html) + * + * 需要基础库: `2.32.0` + * + * 在插件中使用:支持 + * + * 切换投屏设备。仅支持在 tap 事件回调内调用。 */ + switchCasting(): void; + } + interface VideoDecoder { + /** [Object VideoDecoder.getFrameData()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.getFrameData.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 获取下一帧的解码数据 */ + getFrameData(): FrameDataOptions; + /** [Promise VideoDecoder.remove()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.remove.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 移除解码器 */ + remove(): Promise<any>; + /** [Promise VideoDecoder.seek(number position)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.seek.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 跳到某个时间点解码 */ + seek( + /** 跳转的解码位置,单位 ms */ + position: number + ): Promise<any>; + /** [Promise VideoDecoder.start(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.start.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 开始解码 */ + start(option: VideoDecoderStartOption): Promise<any>; + /** [Promise VideoDecoder.stop()](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.stop.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 停止解码 */ + stop(): Promise<any>; + /** [VideoDecoder.off(string eventName, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.off.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 取消监听录制事件。当对应事件触发时,该回调函数不再执行 */ + off( + /** 事件名 */ + eventName: string, + /** 事件触发时执行的回调函数 */ + 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` + * + * 在插件中使用:支持 + * + * 注册监听录制事件的回调函数。当对应事件触发时,回调函数会被执行 */ + on( + /** 事件名 + * + * 参数 eventName 可选值: + * - 'start': 开始事件。返回 {width, height}; + * - 'stop': 结束事件。; + * - 'seek': seek 完成事件。; + * - 'bufferchange': 缓冲区变化事件。; + * - 'ended': 解码结束事件。; */ + eventName: 'start' | 'stop' | 'seek' | 'bufferchange' | 'ended', + /** 事件触发时执行的回调函数 */ + callback: (...args: any[]) => any + ): void; + } + interface VirtualPaymentError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | -1 | | 支付失败 | + * | -2 | | 支付取消 | + * | -4 | | 风控拦截 | + * | -5 | | 开通签约结果未知 | + * | -15001 | | 参数错误,具体原因见err_msg | + * | -15002 | | outTradeNo重复使用,请换新单号重试 | + * | -15003 | | 系统错误 | + * | -15004 | | currencyType错误,目前只能填CNY | + * | -15005 | | 用户态签名signature错误 | + * | -15006 | | 支付签名paySig错误 | + * | -15007 | | session_key过期 | + * | -15008 | | 二级商户进件未完成 | + * | -15009 | | 代币未发布 | + * | -15010 | | 道具productId未发布 | + * | -15011 | | 现网版本的env只能是0,不能填1(沙盒环境) | + * | -15012 | | 调用米大师失败导致关单,请换新单号重试 | + * | -15013 | | goodsPrice道具价格错误 | + * | -15014 | | 道具发布不到五分钟,禁止下单 | + * | -15015 | | 代币发布不到五分钟,禁止下单 | + * | -15016 | | signData格式有问题 | */ errMsg: string; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | -1 | | 支付失败 | + * | -2 | | 支付取消 | + * | -4 | | 风控拦截 | + * | -5 | | 开通签约结果未知 | + * | -15001 | | 参数错误,具体原因见err_msg | + * | -15002 | | outTradeNo重复使用,请换新单号重试 | + * | -15003 | | 系统错误 | + * | -15004 | | currencyType错误,目前只能填CNY | + * | -15005 | | 用户态签名signature错误 | + * | -15006 | | 支付签名paySig错误 | + * | -15007 | | session_key过期 | + * | -15008 | | 二级商户进件未完成 | + * | -15009 | | 代币未发布 | + * | -15010 | | 道具productId未发布 | + * | -15011 | | 现网版本的env只能是0,不能填1(沙盒环境) | + * | -15012 | | 调用米大师失败导致关单,请换新单号重试 | + * | -15013 | | goodsPrice道具价格错误 | + * | -15014 | | 道具发布不到五分钟,禁止下单 | + * | -15015 | | 代币发布不到五分钟,禁止下单 | + * | -15016 | | signData格式有问题 | */ errCode: number; + } + interface WifiError { + /** 错误信息 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 0 | ok | 正常 | + * | 12000 | not init | 未先调用 `startWifi` 接口 | + * | 12001 | system not support | 当前系统不支持相关能力 | + * | 12002 | password error Wi-Fi | 密码错误 | + * | 12003 | connection timeout | 连接超时, 仅 Android 支持 | + * | 12004 | duplicate request | 重复连接 Wi-Fi | + * | 12005 | wifi not turned on | Android 特有,未打开 Wi-Fi 开关 | + * | 12006 | gps not turned on | Android 特有,未打开 GPS 定位开关 | + * | 12007 | user denied | 用户拒绝授权链接 Wi-Fi | + * | 12008 | invalid SSID | 无效 SSID | + * | 12009 | system config err | 系统运营商配置拒绝连接 Wi-Fi | + * | 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; + /** 错误码 + * + * | 错误码 | 错误信息 | 说明 | + * | - | - | - | + * | 0 | ok | 正常 | + * | 12000 | not init | 未先调用 `startWifi` 接口 | + * | 12001 | system not support | 当前系统不支持相关能力 | + * | 12002 | password error Wi-Fi | 密码错误 | + * | 12003 | connection timeout | 连接超时, 仅 Android 支持 | + * | 12004 | duplicate request | 重复连接 Wi-Fi | + * | 12005 | wifi not turned on | Android 特有,未打开 Wi-Fi 开关 | + * | 12006 | gps not turned on | Android 特有,未打开 GPS 定位开关 | + * | 12007 | user denied | 用户拒绝授权链接 Wi-Fi | + * | 12008 | invalid SSID | 无效 SSID | + * | 12009 | system config err | 系统运营商配置拒绝连接 Wi-Fi | + * | 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; + } + interface Worklet { + /** Easing 模块实现了常见的动画缓动函数(动画效果参考 https://easings.net/ ),可从 [wx.worklet](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/wx.worklet.html) 对象中读取。 +* +* **** +* +* ## 示例代码 +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/f94TCOmg7JFH) +* +* ### 预置动画函数 +* +* * [Easing.bounce](#Easing.bounce) 反弹动画 +* * [Easing.ease](#Easing.ease) 惯性动画 +* * [Easing.elastic](#Easing.elastic) 弹性动画 +* +* ### 标准缓动函数 +* +* * [Easing.linear](#Easing.linear) 线性 +* * [Easing.quad](#Easing.quad) 二次方 +* * [Easing.cubic](#Easing.cubic) 三次方 +* * [Easing.poly](#Easing.poly) 实现其它幂函数 +* +* ### 其它数学函数 +* +* * [Easing.bezier](#Easing.bezier) 三次贝塞尔曲线 +* * [Easing.circle](#Easing.circle) 圆形曲线 +* * [Easing.sin](#Easing.sin) 正弦函数 +* * [Easing.exp](#Easing.exp) 指数函数 +* +* ### 缓动方式 +* +* 以上效果均有三种缓动方式 +* +* * [Easing.in](#in) 正向执行缓动函数 +* * [Easing.out](#out) 反向执行缓动函数 +* * [Easing.inOut](#inout) 前半程正向,后半程反向 +* 以 `sin` 函数为例,其中 `Easing.in(Easing.sin)` 和直接使用 `Easing.sin` 效果相同。 +* +* 1. `Easing.in(Easing.sin)` 动画效果参考 https://easings.net/#easeInSine +* 2. `Easing.out(Easing.sin)` 动画效果参考 https://easings.net/#easeOutSine +* 3. `Easing.inOut(Easing.sin)` 动画效果参考 https://easings.net/#easeInOutSine +* +* ### Easing.bounce +* +* 简单的反弹效果,[动画效果参考](https://easings.net/#easeInBounce) +* +* ```js +Easing.bounce(t) +``` +* +* ### Easing.ease +* +* 简单的惯性动画,[动画效果参考](https://cubic-bezier.com/#.42,0,1,1) +* +* ```js +Easing.ease(t) +``` +* +* ### Easing.elastic +* +* 简单的弹性动画,类似弹簧来回摆动,高阶函数。默认弹性为 1,会稍微超出一次。弹性为 0 时 不会过冲。[动画效果参考](https://easings.net/#easeInElastic) +* +* ```js +Easing.elastic(bounciness = 1) +``` +* +* ### Easing.linear +* +* 线性函数,f(t) = t,[动画效果参考](https://cubic-bezier.com/#0,0,1,1) +* +* ```js +Easing.linear(t) +``` +* ### Easing.quad +* +* 二次方函数,f(t) = t * t,[动画效果参考](https://easings.net/#easeInQuad) +* +* ```js +Easing.quad(t) +``` +* +* ### Easing.cubic +* +* 立方函数,f(t) = t * t * t,[动画效果参考](https://easings.net/#easeInCubic) +* +* ```js +Easing.cubic(t) +``` +* +* ### Easing.poly +* +* 高阶函数,返回幂函数 +* +* poly(4): [动画效果参考](https://easings.net/#easeInQuart) +* +* poly(5): [动画效果参考](https://easings.net/#easeInQuint) +* +* ```js +Easing.poly(n) +``` +* +* ### Easing.bezier +* +* 三次贝塞尔曲线,效果同 css `transition-timing-function` +* +* 调试参数可借助 [可视化工具](https://cubic-bezier.com/) +* +* ```js +Easing.bezier(x1, y1, x2, y2) +``` +* +* ### Easing.circle +* +* 圆形曲线,[动画效果参考](https://easings.net/#easeInCirc) +* +* ```js +Easing.circle(t) +``` +* +* ### Easing.sin +* +* 正弦函数,[动画效果参考](https://easings.net/#easeInSine) +* +* ```js +Easing.sin(t) +``` +* +* ### Easing.exp +* +* 指数函数,[动画效果参考](https://easings.net/#easeInExpo) +* +* ```js +Easing.exp(t) +``` +* +* ### Easing.in +* +* 正向运行 `easing function`,高阶函数。 +* +* ```js +Easing.in(easing) +``` +* +* ### Easing.out +* +* 反向运行 `easing function`,高阶函数。 +* +* ```js +Easing.out(easing) +``` +* +* ### Easing.inOut +* +* 前半程正向,后半程反向,高阶函数。 +* +* ```js +Easing.inOut(easing) +``` */ + Easing: WorkletEasing; + /** [AnimationObject worklet.decay(Object options, function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/animation/worklet.decay.html) +* +* 在插件中使用:不支持 +* +* 基于滚动衰减的动画。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/zaI8sgmw7lGW) +* +* ```html +* <pan-gesture-handler onGestureEvent="handlepan"> +* <view class="circle"></view> +* </pan-gesture-handler> +* ``` +* +* ```js +const { shared, decay } = wx.worklet +Page({ + onLoad() { + this._offset = shared(0); + this.applyAnimatedStyle('.circle', () => { + 'worklet'; + return { + transform: `translateX(${this._offset.value}px)` + }; + }); + }, + handlepan(evt) { + 'worklet'; + if (evt.state === GestureState.ACTIVE) { + this._offset.value += evt.deltaX; + } else if (evt.state === GestureState.END) { + this._offset.value = decay({ + velocity: evt.velocityX, + clamp: [-200, 200], + }, + () => { + 'worklet' + console.info('@@@ decay finish') + } + ); + } + } +}); +``` */ + decay( + /** 动画配置 */ + options: DecayOption, + /** 动画完成回调。动画被取消时,返回 fasle,正常完成时返回 true。 */ + 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) + * + * 在插件中使用:不支持 + * + * 延迟执行动画。 */ + delay( + /** 动画开始前等待的时间,单位:毫秒。 */ + delayMS: number, + /** 动画对象。 */ + 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) + * + * 在插件中使用:不支持 + * + * 重复执行动画。 */ + repeat( + /** 动画对象 */ + animation: AnimationObject, + /** 重复次数。为负值时一直循环,直到被取消动画。 */ + numberOfReps?: number, + /** 反向运行动画,每周期结束动画由尾到头运行。该字段仅对 timing 和 spring 返回的动画对象生效。 */ + reverse?: boolean, + /** 动画完成回调。动画被取消时,返回 fasle,正常完成时返回 true。 */ + 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) + * + * 在插件中使用:不支持 + * + * 组合动画序列,依次执行传入的动画。 */ + sequence( + /** 动画对象 */ + 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) + * + * 在插件中使用:不支持 + * + * 基于物理的动画。 */ + spring( + /** 目标值 */ + toValue: number | string, + /** 动画配置 */ + options: SpringOption, + /** 动画完成回调。动画被取消时,返回 fasle,正常完成时返回 true。 */ + 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) + * + * 在插件中使用:不支持 + * + * 基于时间的动画。 */ + timing( + /** 目标值 */ + toValue: number, + /** 动画配置 */ + options: TimingOption, + /** 动画完成回调。动画被取消时,返回 fasle,正常完成时返回 true。 */ + callback: (...args: any[]) => any + ): AnimationObject; + /** [DerivedValue worklet.derived(WorkletFunction updaterWorklet)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/base/worklet.derived.html) + * + * 在插件中使用:不支持 + * + * 衍生值 `DerivedValue`,可基于已有的 `SharedValue` 生成其它共享变量。 */ + derived( + /** worklet 函数类型,该函数被立即执行,返回值作为 DerivedValue 的初始值。当函数内捕获的 SharedValue 类型值发生变化时,updaterWorklet 被驱动执行,返回值用于更新 DerivedValue。可类比 computed 计算属性进行理解。 */ + updaterWorklet: WorkletFunction + ): DerivedValue; + /** [SharedValue worklet.shared(any initialValue)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/base/worklet.shared.html) + * + * 在插件中使用:不支持 + * + * 创建共享变量 `SharedValue`,用于跨线程共享数据和驱动动画。 */ + shared( + /** 初始值,可通过 `.value` 属性进行读取和修改。类型可以是 `number | string | bool | null | undefined | Object | Array | Function`。 */ + initialValue: any + ): SharedValue; + /** [function worklet.runOnJS(function fn)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/worklet/tool-function/worklet.runOnJS.html) + * + * 在插件中使用:不支持 + * + * `worklet` 函数运行在 `UI` 线程时,捕获的外部函数可能为 `worklet` 类型或普通函数,为了更明显的对其区分,要求必须使用 `runOnJS` 调回 `JS` 线程的普通函数。 + * 有这样的要求是因为,调用其它 `worklet` 函数时是同步调用,但在 `UI` 线程执行 `JS` 线程的函数只能是异步,开发者容易混淆,试图同步获取 `JS` 线程的返回值。 */ + runOnJS( + /** 未声明为 worklet 类型的普通函数。 */ + 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) + * + * 在插件中使用:不支持 + * + * 在 UI 线程执行 worklet 函数。 */ + runOnUI( + /** worklet 类型函数。 */ + 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) + * + * 在插件中使用:不支持 + * + * 取消由 `SharedValue` 驱动的动画。 */ + cancelAnimation( + /** 共享变量。 */ + SharedValue: SharedValue + ): void; + } + interface Wx { + /** [Array.<any> wx.batchGetStorageSync(Array.<string> keyList)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.batchGetStorageSync.html) +* +* 需要基础库: `2.25.0` +* +* 在插件中使用:不支持 +* +* 从本地缓存中同步批量获取指定 key 的内容。 +* +* **示例代码** +* +* ```js +try { + var valueList = wx.batchGetStorageSync(['key']) + if (valueList) { + // Do something with return value + } +} catch (e) { + // Do something when catch error +} +``` +* +* **** +* +* 对于多个key的读取, 批量读取在性能上优于多次getStorageSync读取 */ + batchGetStorageSync( + /** 本地缓存中指定的 key 数组 */ + keyList: string[] + ): any[]; + /** [ArrayBuffer wx.base64ToArrayBuffer(string base64)](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.base64ToArrayBuffer.html) + * + * 需要基础库: `1.1.0` + * + * 在插件中使用:支持 + * @deprecated 基础库版本 [2.4.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃 + * + * 将 Base64 字符串转成 ArrayBuffer 对象 */ + base64ToArrayBuffer( + /** 要转化成 ArrayBuffer 对象的 Base64 字符串 */ + base64: string + ): ArrayBuffer; + /** [Object wx.getAccountInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html) +* +* 需要基础库: `2.2.2` +* +* 在插件中使用:需要基础库 `2.2.2` +* +* 获取当前账号信息。线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。 +* +* **示例代码** +* +* ```js +const accountInfo = wx.getAccountInfoSync(); +console.log(accountInfo.miniProgram.appId) // 小程序 appId +console.log(accountInfo.plugin.appId) // 插件 appId +console.log(accountInfo.plugin.version) // 插件版本号, 'a.b.c' 这样的形式 +``` */ + getAccountInfoSync(): AccountInfo; + /** [Object wx.getAppAuthorizeSetting()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppAuthorizeSetting.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 获取微信APP授权设置 +* +* **示例代码** +* +* ```js +const appAuthorizeSetting = wx.getAppAuthorizeSetting() + +console.log(appAuthorizeSetting.albumAuthorized) +console.log(appAuthorizeSetting.bluetoothAuthorized) +console.log(appAuthorizeSetting.cameraAuthorized) +console.log(appAuthorizeSetting.locationAuthorized) +console.log(appAuthorizeSetting.locationReducedAccuracy) +console.log(appAuthorizeSetting.microphoneAuthorized) +console.log(appAuthorizeSetting.notificationAlertAuthorized) +console.log(appAuthorizeSetting.notificationAuthorized) +console.log(appAuthorizeSetting.notificationBadgeAuthorized) +console.log(appAuthorizeSetting.notificationSoundAuthorized) +console.log(appAuthorizeSetting.phoneCalendarAuthorized) +``` +* +* **返回值说明** +* +* `'authorized'` 表示已经获得授权,无需再次请求授权; +* `'denied'` 表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户[打开系统设置](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html),在设置页中打开权限) +* `'non determined'` 表示尚未请求授权,会在微信下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) */ + getAppAuthorizeSetting(): AppAuthorizeSetting; + /** [Object wx.getAppBaseInfo()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getAppBaseInfo.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 获取微信APP基础信息 +* +* **示例代码** +* +* ```js +const appBaseInfo = wx.getAppBaseInfo() + +console.log(appBaseInfo.SDKVersion) +console.log(appBaseInfo.enableDebug) +console.log(appBaseInfo.host) +console.log(appBaseInfo.language) +console.log(appBaseInfo.version) +console.log(appBaseInfo.theme) +``` */ + 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; + /** [Object wx.getDeviceInfo()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getDeviceInfo.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 获取设备基础信息 +* +* **示例代码** +* +* ```js +const deviceInfo = wx.getDeviceInfo() + +console.log(deviceInfo.abi) +console.log(deviceInfo.benchmarkLevel) +console.log(deviceInfo.brand) +console.log(deviceInfo.model) +console.log(deviceInfo.platform) +console.log(deviceInfo.system) +``` */ + getDeviceInfo(): DeviceInfo; + /** [Object wx.getEnterOptionsSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getEnterOptionsSync.html) + * + * 需要基础库: `2.9.4` + * + * 在插件中使用:需要基础库 `2.9.4` + * + * 获取本次小程序启动时的参数。如果当前是冷启动,则返回值与 [`App.onLaunch`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onLaunch-Object-object) 的回调参数一致;如果当前是热启动,则返回值与 [`App.onShow`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onShow-Object-object) 一致。 + * + * **返回有效 referrerInfo 的场景** + * + * | 场景值 | 场景 | appId含义 | + * | ------ | ------------------------------- | ---------- | + * | 1020 | 公众号 profile 页相关小程序列表 | 来源公众号 | + * | 1035 | 公众号自定义菜单 | 来源公众号 | + * | 1036 | App 分享消息卡片 | 来源App | + * | 1037 | 小程序打开小程序 | 来源小程序 | + * | 1038 | 从另一个小程序返回 | 来源小程序 | + * | 1043 | 公众号模板消息 | 来源公众号 | + * + * **不同 apiCategory 场景下的 API 限制** + * + * `X` 表示 API 被限制无法使用;不在表格中的 API 不限制。 + * + * | | default | nativeFunctionalized | browseOnly | embedded | + * |-|-|-|-|-| + * |navigateToMiniProgram | | `X` | `X` | | + * |openSetting | | | `X` | | + * |<button open-type="share"> | | `X` | `X` | `X` | + * |<button open-type="feedback"> | | | `X` | | + * |<button open-type="open-setting">| | | `X` | | + * |openEmbeddedMiniProgram | | `X` | `X` | `X` | + * + * **注意** + * + * 部分版本在无 `referrerInfo` 的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。 */ + getEnterOptionsSync(): LaunchOptionsApp; + /** [Object wx.getExptInfoSync(Array.<string> keys)](https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.getExptInfoSync.html) + * + * 需要基础库: `2.17.0` + * + * 在插件中使用:不支持 + * + * 给定实验参数数组,获取对应的实验参数值 + * + * **提示** + * + * 假设实验参数有 `color`, `size` + * 调用 wx.getExptInfoSync() 会返回 `{color:'#fff',size:20}` 类似的结果 + * 而 wx.getExptInfoSync(['color']) 则只会返回 `{color:'#fff'}` */ + getExptInfoSync( + /** 实验参数数组,不填则获取所有实验参数 */ + keys?: string[] + ): IAnyObject; + /** [Object wx.getExtConfigSync()](https://developers.weixin.qq.com/miniprogram/dev/api/ext/wx.getExtConfigSync.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:不支持 +* +* [wx.getExtConfig](https://developers.weixin.qq.com/miniprogram/dev/api/ext/wx.getExtConfig.html) 的同步版本。 +* +* **Tips** +* +* 1. 本接口暂时无法通过 [wx.canIUse](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.canIUse.html) 判断是否兼容,开发者需要自行判断 [wx.getExtConfigSync](https://developers.weixin.qq.com/miniprogram/dev/api/ext/wx.getExtConfigSync.html) 是否存在来兼容 +* +* **** +* +* ```js +let extConfig = wx.getExtConfigSync? wx.getExtConfigSync(): {} +console.log(extConfig) +``` */ + getExtConfigSync(): IAnyObject; + /** [Object wx.getLaunchOptionsSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getLaunchOptionsSync.html) + * + * 需要基础库: `2.1.2` + * + * 在插件中使用:需要基础库 `2.9.4` + * + * 获取小程序启动时的参数。与 [`App.onLaunch`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onlaunchobject-object) 的回调参数一致。 + * + * **返回有效 referrerInfo 的场景** + * + * | 场景值 | 场景 | appId含义 | + * | ------ | ------------------------------- | ---------- | + * | 1020 | 公众号 profile 页相关小程序列表 | 来源公众号 | + * | 1035 | 公众号自定义菜单 | 来源公众号 | + * | 1036 | App 分享消息卡片 | 来源App | + * | 1037 | 小程序打开小程序 | 来源小程序 | + * | 1038 | 从另一个小程序返回 | 来源小程序 | + * | 1043 | 公众号模板消息 | 来源公众号 | + * | 1069 | 移动应用 | 来源App | + * + * **不同 apiCategory 场景下的 API 限制** + * + * `X` 表示 API 被限制无法使用;不在表格中的 API 不限制。 + * + * | | default | nativeFunctionalized | browseOnly | embedded | + * |-|-|-|-|-| + * |navigateToMiniProgram | | `X` | `X` | | + * |openSetting | | | `X` | | + * |<button open-type="share"> | | `X` | `X` | `X` | + * |<button open-type="feedback"> | | | `X` | | + * |<button open-type="open-setting">| | | `X` | | + * |openEmbeddedMiniProgram | | `X` | `X` | `X` | + * + * **注意** + * + * 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。 */ + getLaunchOptionsSync(): LaunchOptionsApp; + /** [Object wx.getMenuButtonBoundingClientRect()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/menu/wx.getMenuButtonBoundingClientRect.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。 +* +* **示例代码** +* +* ```js +const res = wx.getMenuButtonBoundingClientRect() + +console.log(res.width) +console.log(res.height) +console.log(res.top) +console.log(res.right) +console.log(res.bottom) +console.log(res.left) +``` */ + getMenuButtonBoundingClientRect(): ClientRect; + /** [Object wx.getSkylineInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSkylineInfoSync.html) + * + * 需要基础库: `2.26.2` + * + * 在插件中使用:需要基础库 `2.26.2` + * + * 获取当前运行环境对于 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的支持情况 */ + getSkylineInfoSync(): SkylineInfo; + /** [Object wx.getStorageInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageInfoSync.html) +* +* 在插件中使用:不支持 +* +* [wx.getStorageInfo](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageInfo.html) 的同步版本 +* +* **示例代码** +* +* ```js +wx.getStorageInfo({ + success (res) { + console.log(res.keys) + console.log(res.currentSize) + console.log(res.limitSize) + } +}) +``` +* +* ```js +try { + const res = wx.getStorageInfoSync() + console.log(res.keys) + console.log(res.currentSize) + console.log(res.limitSize) +} catch (e) { + // Do something when catch error +} +``` */ + getStorageInfoSync(): GetStorageInfoSyncOption; + /** [Object wx.getSystemInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoSync.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* [wx.getSystemInfo](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfo.html) 的同步版本 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/WkUCgXmS7mqO) +* +* ```js +wx.getSystemInfo({ + success (res) { + console.log(res.model) + console.log(res.pixelRatio) + console.log(res.windowWidth) + console.log(res.windowHeight) + console.log(res.language) + console.log(res.version) + console.log(res.platform) + } +}) +``` +* +* ```js +try { + const res = wx.getSystemInfoSync() + console.log(res.model) + console.log(res.pixelRatio) + console.log(res.windowWidth) + console.log(res.windowHeight) + console.log(res.language) + console.log(res.version) + console.log(res.platform) +} catch (e) { + // Do something when catch error +} +``` */ + getSystemInfoSync(): SystemInfo; + /** [Object wx.getSystemSetting()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemSetting.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 获取设备设置 +* +* **示例代码** +* +* ```js +const systemSetting = wx.getSystemSetting() + +console.log(systemSetting.bluetoothEnabled) +console.log(systemSetting.deviceOrientation) +console.log(systemSetting.locationEnabled) +console.log(systemSetting.wifiEnabled) +``` */ + getSystemSetting(): SystemSetting; + /** [Object wx.getWindowInfo()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getWindowInfo.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 获取窗口信息 +* +* **示例代码** +* +* ```js +const windowInfo = wx.getWindowInfo() + +console.log(windowInfo.pixelRatio) +console.log(windowInfo.screenWidth) +console.log(windowInfo.screenHeight) +console.log(windowInfo.windowWidth) +console.log(windowInfo.windowHeight) +console.log(windowInfo.statusBarHeight) +console.log(windowInfo.safeArea) +console.log(windowInfo.screenTop) +``` */ + getWindowInfo(): WindowInfo; + /** [Promise<string> wx.getRendererUserAgent(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getRendererUserAgent.html) +* +* 需要基础库: `2.26.3` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 获取 Webview 小程序的 UserAgent +* +* **示例代码** +* +* ```js +// v2.30.4 前,仅支持 promise 风格调用 +wx.getRendererUserAgent().then(userAgent => console.log(userAgent)) +// v2.30.4 起,除 promise 风格调用外,也支持 invoke 风格使用 +wx.getRendererUserAgent({ + success(res) { console.log(res.userAgent) } +}) +``` */ + getRendererUserAgent(option?: GetRendererUserAgentOption): Promise<string>; + /** [[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; + /** [[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` + * @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) 替换 + * + * 创建 [audio](https://developers.weixin.qq.com/miniprogram/dev/component/audio.html) 上下文 [AudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioContext.html) 对象。 */ + createAudioContext( + /** [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; + /** [[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` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 获取**全局唯一**的背景音频管理器。 + * 小程序切入后台,如果音频处于播放状态,可以继续播放。但是后台状态不能通过调用API操纵音频的播放状态。 + * + * 从微信客户端6.7.2版本开始,若需要在小程序切后台后继续播放音频,需要在 [app.json](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html) 中配置 `requiredBackgroundModes` 属性。开发版和体验版上可以直接生效,正式版还需通过审核。 */ + 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` +* +* 在插件中使用:不支持 +* +* 创建缓存管理器 +* +* **示例代码** +* +* <a href="https://github.com/wechat-miniprogram/miniprogram-offline-demo" target="_blank">查看完整示例代码</a> +* +* ```js +const cacheManager = createCacheManager() +cacheManager.addRule(/https:\/\/(?:.*)/ig) // 表示所有 https 请求都匹配 + +cacheManager.on('request', evt => { + // 在弱网时接收到 wx.request 请求 + return new Promise((resolve, reject) => { + const matchRes = cm.match(evt) + if (matchRes && matchRes.data) { + // 有缓存,返回 + resolve(matchRes.data) + } else { + // 没缓存,抛错 + reject({ errMsg: 'no cache' }) + } + }) +}) +``` */ + 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` + * + * 在插件中使用:需要基础库 `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; + /** [[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` + * @deprecated 基础库版本 [2.9.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [Canvas](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/Canvas.html) 替换 + * + * 创建 canvas 的绘图上下文 [CanvasContext](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.html) 对象 */ + createCanvasContext( + /** 要获取上下文的 [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; + /** [[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` +* +* 下载文件资源到本地。客户端直接发起一个 HTTPS GET 请求,返回文件的本地临时路径 (本地路径),单次下载允许的最大文件为 200MB。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 +* +* 注意:请在服务端响应的 header 中指定合理的 `Content-Type` 字段,以保证客户端正确处理文件类型。 +* +* **示例代码** +* +* ```js +wx.downloadFile({ + url: 'https://example.com/audio/123', //仅为示例,并非真实的资源 + success (res) { + // 只要服务器有响应数据,就会把响应内容写入文件并进入 success 回调,业务需要自行判断是否下载到了想要的内容 + if (res.statusCode === 200) { + wx.playVoice({ + filePath: res.tempFilePath + }) + } + } +}) +``` */ + 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` + * + * 在插件中使用:需要基础库 `2.19.2` + * + * 获取全局唯一的文件管理器 */ + 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` +* +* 在插件中使用:需要基础库 `2.30.0` +* +* 创建 AI 推理 Session。使用前可参考[AI指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/inference/tutorial.html) +* +* **示例代码** +* +* ```js +// 创建会话,加载模型 +const session = wx.createInferenceSession({ + model: `${wx.env.USER_DATA_PATH}/MNIST.onnx`, + precisionLevel: 4, + typicalShape:{input1:[1, 3, 224, 224], input2:[1, 1, 224, 224]}, //除非使用动态轴,一般不用显式指定 + allowNPU: false, + allowQuantize: false +}) + +// 监听error事件 +session.onError(err => { + console.error(err) +}) + +// 监听模型加载完成事件 +session.onLoad(() => { + // 运行推理 + // 其中input1, input2, output0 必须与使用的onnx模型中实际的输入输出名字完全一致,不可随意填写。 + // 模型输入输出信息可以通过Netron 打开onnx模型看到 + session.run({ + input1: { + type: 'float32', + data: new Float32Array(3 * 224 * 224).buffer, + shape: [1, 3, 224, 224] // NCHW 顺序 + }, + // 多个input的添加方法,假设第二个input需要数据类型为uint8 + input2: { + type: 'uint8', + data: new Uint8Array(224 * 224).buffer, + shape: [1, 1, 224, 224] + }, + }).then(res => { + console.log(res.output0) + }) +}) + +// 销毁Session +// session完成创建后可以多次调用run进行推理,直到调用`session.destroy()`释放相关内存。 + +// 销毁会话 +session.destroy() +``` */ + 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` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 创建内部 [audio](https://developers.weixin.qq.com/miniprogram/dev/component/audio.html) 上下文 [InnerAudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.html) 对象。 +* +* **示例代码** +* +* ```js +const innerAudioContext = wx.createInnerAudioContext({ + useWebAudioImplement: false // 是否使用 WebAudio 作为底层音频驱动,默认关闭。对于短音频、播放频繁的音频建议开启此选项,开启后将获得更优的性能表现。由于开启此选项后也会带来一定的内存增长,因此对于长音频建议关闭此选项 +}) +innerAudioContext.src = 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E061FF02C31F716658E5C81F5594D561F2E88B854E81CAAB7806D5E4F103E55D33C16F3FAC506D1AB172DE8600B37E43FAD&fromtag=46' + +innerAudioContext.play() // 播放 + +innerAudioContext.pause() // 暂停 + +innerAudioContext.stop() // 停止 +``` */ + 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` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 创建并返回一个 IntersectionObserver 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createIntersectionObserver([options])` 来代替。 + * + * **示例代码** + * + * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/LAbMxkmI7F2A) */ + createIntersectionObserver( + /** 自定义组件实例 */ + component: IAnyObject, + /** 选项 */ + 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` + * + * 在插件中使用:需要基础库 `2.8.1` + * + * 创建插屏广告组件。请通过 [wx.getSystemInfoSync()](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoSync.html) 返回对象的 SDKVersion 判断基础库版本号后再使用该 API。每次调用该方法创建插屏广告都会返回一个全新的实例(小程序端的插屏广告实例不允许跨页面使用)。 */ + 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` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 创建 [live-player](https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html) 上下文 [LivePlayerContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/live/LivePlayerContext.html) 对象。建议使用 [wx.createSelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createSelectorQuery.html) 获取 context 对象。 */ + createLivePlayerContext( + /** [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; + /** [[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` + * + * 在插件中使用:需要基础库 `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; + /** [[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` +* +* 在插件中使用:不支持 +* +* 获取日志管理器对象。 +* +* **示例代码** +* +* ```js +const logger = wx.getLogManager({level: 1}) +logger.log({str: 'hello world'}, 'basic log', 100, [1, 2, 3]) +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; + /** [[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` + * + * 创建 [map](https://developers.weixin.qq.com/miniprogram/dev/component/map.html) 上下文 [MapContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/map/MapContext.html) 对象。建议使用 [wx.createSelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createSelectorQuery.html) 获取 context 对象。 */ + createMapContext( + /** [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; + /** [[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` +* +* 在插件中使用:支持 +* +* 创建媒体音频播放器对象 [MediaAudioPlayer](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/MediaAudioPlayer.html) 对象,可用于播放视频解码器 [VideoDecoder](https://developers.weixin.qq.com/miniprogram/dev/api/media/video-decoder/VideoDecoder.html) 输出的音频。 +* +* **示例代码** +* +* ```js + // 创建视频解码器,具体参数见 createVideoDecoder 文档 + const videoDecoder = wx.createVideoDecoder() + // 创建媒体音频播放器 + const mediaAudioPlayer = wx.createMediaAudioPlayer() + // 启动视频解码器 + videoDecoder.start() + // 启动播放器 + mediaAudioPlayer.start().then(() => { + // 添加播放器音频来源 + mediaAudioPlayer.addAudioSource(videoDecoder).then(res => { + videoDecoder.getFrameData() // 建议在 requestAnimationFrame 里获取每一帧视频数据 + console.log(res) + }) + + // 移除播放器音频来源 + mediaAudioPlayer.removeAudioSource(videoDecoder).then() + // 停止播放器 + mediaAudioPlayer.stop().then() + // 销毁播放器 + mediaAudioPlayer.destroy().then() + // 设置播放器音量 + mediaAudioPlayer.volume = 0.5 + }) +``` +* +* **完整demo(小游戏)** +* +* - https://developers.weixin.qq.com/s/SF2duHmb7MjI */ + 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` + * + * 在插件中使用:需要基础库 `2.10.0` + * + * 创建音视频处理容器,最终可将容器中的轨道合成一个视频 */ + 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` +* +* 在插件中使用:需要基础库 `2.11.0` +* +* 创建 WebGL 画面录制器,可逐帧录制在 WebGL 上渲染的画面并导出视频文件 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/MCz3kPmC7zpa) +* +* **低版本异步接口兼容** +* +* 对基础库 2.16.1 版本前的 mediaRecorder,所有的接口都没有返回 Promise 对象,若需要兼容低版本,则可采用如下方式的写法: +* ```javascript +// 启动 mediaRecorder +await new Promise(resolve => { + recorder.on('start', resolve) + recorder.start() +}) + +// 逐帧绘制 +while (frames--) { + await new Promise(resolve => recorder.requestFrame(resolve)) + render() +} + +// 绘制完成,生成视频 +const {tempFilePath} = await new Promise(resolve => { + recorder.on('stop', resolve) + recorder.stop() +}) +``` */ + 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; + /** [[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` + * + * 在插件中使用:需要基础库 `2.11.2` + * + * 获取 NFC 实例 + * + * **示例代码** + * + * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/1WsbDwmb75ig) */ + 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` + * + * 在插件中使用:需要基础库 `2.16.1` + * + * 创建离屏 canvas 实例 + * + * **离屏 Canvas 类型不可混用** + * + * 由于 webgl canvas 和 2d canvas 的底层实现方式不同,因此必须要在调用 `wx.createOffscreenCanvas` 时提前指定类型。 + * + * 指定类型后,离屏 canvas `getContext(type)` 调用不允许混用,如不能对 webgl canvas 调用 `getContext('2d')`。 + * + * 同样的,不同类型 canvas 调用 `createImage` 创建的图片对象也不支持混用,使用时请注意尽量使用 canvas 自身的 `createImage` 创建图片对象。 + * + * **与 MediaRecorder 结合** + * + * 离屏 webgl canvas 支持作为参数传递给 [`wx.createMediaRecorder`](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/wx.createMediaRecorder.html), 离屏 2d canvas 暂不支持。 + * + * **旧版 createOffscreenCanvas** + * + * 旧版函数签名为 `wx.createOffscreenCanvas(width: number, height: number, this: object): OffscreenCanvas`,从基础库 2.7.0 开始支持 + * + * 从基础库 2.16.1 开始改为 `wx.createOffscreenCanvas(options: object): OffscreenCanvas`,向下兼容旧版入参。 + * 但需注意旧版入参只能创建 webgl 类型,如需创建 2d 类型则必须使用新版。 */ + createOffscreenCanvas( + /** 画布宽度 */ + width: number, + /** 画布高度 */ + height: number, + /** 在自定义组件下,当前组件实例的 this */ + 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` + * + * 在插件中使用:需要基础库 `2.16.1` + * + * 创建离屏 canvas 实例 + * + * **离屏 Canvas 类型不可混用** + * + * 由于 webgl canvas 和 2d canvas 的底层实现方式不同,因此必须要在调用 `wx.createOffscreenCanvas` 时提前指定类型。 + * + * 指定类型后,离屏 canvas `getContext(type)` 调用不允许混用,如不能对 webgl canvas 调用 `getContext('2d')`。 + * + * 同样的,不同类型 canvas 调用 `createImage` 创建的图片对象也不支持混用,使用时请注意尽量使用 canvas 自身的 `createImage` 创建图片对象。 + * + * **与 MediaRecorder 结合** + * + * 离屏 webgl canvas 支持作为参数传递给 [`wx.createMediaRecorder`](https://developers.weixin.qq.com/miniprogram/dev/api/media/media-recorder/wx.createMediaRecorder.html), 离屏 2d canvas 暂不支持。 + * + * **旧版 createOffscreenCanvas** + * + * 旧版函数签名为 `wx.createOffscreenCanvas(width: number, height: number, this: object): OffscreenCanvas`,从基础库 2.7.0 开始支持 + * + * 从基础库 2.16.1 开始改为 `wx.createOffscreenCanvas(options: object): OffscreenCanvas`,向下兼容旧版入参。 + * 但需注意旧版入参只能创建 webgl 类型,如需创建 2d 类型则必须使用新版。 */ + 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` +* +* 在插件中使用:支持 +* +* 获取当前小程序性能相关的信息。关于小程序启动性能优化的更多内容,请参考[启动性能指南](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/tips/start.html)。 +* +* **** +* +* 目前支持获取以下几类性能指标,具体内容请参考 [PerformanceEntry](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/PerformanceEntry.html): +* +* | 指标类型(entryType) | 指标名称 | 最低版本 | +* | ------------------- | ---------------- | ------ | +* | 路由(navigation) | route: 路由性能 | | +* | 路由(navigation) | appLaunch: 小程序启动耗时 | | +* | 渲染(render) | firstRender: 页面首次渲染耗时 | | +* | 渲染(render) | firstPaint: 页面首次绘制 | <2.21.2> | +* | 渲染(render) | firstContentfulPaint: 页面首次内容绘制 | <2.21.2> | +* | 渲染(render) | largestContentfulPaint: 页面最大内容绘制 | <2.23.1> | +* | 脚本(script) | evaluateScript: 注入脚本耗时 | | +* | 包加载(loadPackage)| downloadPackage: 代码包下载耗时 | <2.24.0> | +* | 资源(resource) | resourceTiming: 视图层资源加载耗时 | <2.24.0> | +* +* **示例代码** +* +* ```js +const performance = wx.getPerformance() +const observer = performance.createObserver((entryList) => { + console.log(entryList.getEntries()) +}) +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; + /** [[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` +* +* 在插件中使用:不支持 +* +* 触发分包预下载。 +* +* **示例代码** +* +* ```js +// 首先要在 app.json / game.json 中配置workers作为分包 +{ + "workers": { + "path": "myWorkersFolder", + "isSubpackage": true // true 表示把 worker 打包为分包。默认 false。填 false 时等同于 { "workers": "workers" } + } +} +``` +* ```js +// 然后调用 wx.preDownloadSubpackage 下载 worker 分包,下载成功后才可以创建 worker +var task = wx.preDownloadSubpackage({ + packageType: "workers", + success(res) { + console.log("load worker success", res) + wx.createWorker("myWorkersFolder/request/index.js") // 创建 worker。 如果 worker 分包没下载完就调 createWorker 的话将报错 + }, + fail(res) { + console.log("load worker fail", res) + } +}) + +task.onProgressUpdate(res => { + console.log(res.progress) // 可通过 onProgressUpdate 接口监听下载进度 + console.log(res.totalBytesWritten) + console.log(res.totalBytesExpectedToWrite) +}) +``` */ + 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` +* +* 在插件中使用:需要基础库 `2.16.0` +* +* 获取实时日志管理器对象。 +* +* **示例代码** +* +* ```js +// 小程序端 +const logger = wx.getRealtimeLogManager() +logger.info({str: 'hello world'}, 'info log', 100, [1, 2, 3]) +logger.error({str: 'hello world'}, 'error log', 100, [1, 2, 3]) +logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3]) + +// 插件端,基础库 2.16.0 版本后支持,只允许采用 key-value 的新格式上报 +const logManager = wx.getRealtimeLogManager() +const logger = logManager.tag('plugin-log1') +logger.info('key1', 'value1') +logger.error('key2', {str: 'value2'}) +logger.warn('key3', 'value3') +``` */ + 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` + * + * 在插件中使用:需要基础库 `1.9.94` + * + * 获取**全局唯一**的录音管理器 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` +* +* 发起 HTTPS 网络请求。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 +* +* **data 参数说明** +* +* 最终发送给服务器的数据是 String 类型,如果传入的 data 不是 String 类型,会被转换成 String 。转换规则如下: +* - 对于 `GET` 方法的数据,会将数据转换成 query string(`encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...`) +* - 对于 `POST` 方法且 `header['content-type']` 为 `application/json` 的数据,会对数据进行 JSON 序列化 +* - 对于 `POST` 方法且 `header['content-type']` 为 `application/x-www-form-urlencoded` 的数据,会将数据转换成 query string `(encodeURIComponent(k)=encodeURIComponent(v)&encodeURIComponent(k)=encodeURIComponent(v)...)` +* +* **示例代码** +* +* ```js +wx.request({ + url: 'example.php', //仅为示例,并非真实的接口地址 + data: { + x: '', + y: '' + }, + header: { + 'content-type': 'application/json' // 默认值 + }, + success (res) { + console.log(res.data) + } +}) +``` */ + request< + T extends string | IAnyObject | ArrayBuffer = + | string + | IAnyObject + | ArrayBuffer + >( + option: RequestOption<T> + ): 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` + * + * 在插件中使用:需要基础库 `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; + /** [[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` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 返回一个 SelectorQuery 对象实例。在自定义组件或包含自定义组件的页面中,应使用 `this.createSelectorQuery()` 来代替。 +* +* **示例代码** +* +* ```js +const query = wx.createSelectorQuery() +query.select('#the-id').boundingClientRect() +query.selectViewport().scrollOffset() +query.exec(function(res){ + res[0].top // #the-id节点的上边界坐标 + res[1].scrollTop // 显示区域的竖直滚动位置 +}) +``` */ + 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` +* +* @warning **推荐使用 [SocketTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控,同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** +* +* 创建一个 WebSocket 连接。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 +* +* **并发数** +* +* - 1.7.0 及以上版本,最多可以同时存在 5 个 WebSocket 连接。 +* - 1.7.0 以下版本,一个小程序同时只能有一个 WebSocket 连接,如果当前已存在一个 WebSocket 连接,会自动关闭该连接,并重新创建一个 WebSocket 连接。 +* +* **示例代码** +* +* ```js +wx.connectSocket({ + url: 'wss://example.qq.com', + header:{ + 'content-type': 'application/json' + }, + protocols: ['protocol1'] +}) +``` */ + 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` + * + * 在插件中使用:支持 + * + * 创建一个 TCP Socket 实例。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 + * + * **连接限制** + * + * - 允许与局域网内的非本机 IP 通信 + * - 允许与配置过的服务器域名通信,详见[相关说明](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; + /** [[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` + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 创建一个 UDP Socket 实例。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 */ + 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` + * + * 在插件中使用:不支持 + * + * 获取**全局唯一**的版本更新管理器,用于管理小程序更新。关于小程序的更新机制,可以查看[运行机制](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/operating-mechanism.html)文档。 + * + * **示例代码** + * + * [示例代码](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#示例代码) */ + 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` +* +* 将本地资源上传到服务器。客户端发起一个 HTTPS POST 请求,其中 `content-type` 为 `multipart/form-data`。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 +* +* **示例代码** +* +* ```js +wx.chooseImage({ + success (res) { + const tempFilePaths = res.tempFilePaths + wx.uploadFile({ + url: 'https://example.weixin.qq.com/upload', //仅为示例,非真实的接口地址 + filePath: tempFilePaths[0], + name: 'file', + formData: { + 'user': 'test' + }, + success (res){ + const data = res.data + //do something + } + }) + } +}) +``` */ + 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` + * + * 在插件中使用:不支持 + * + * 获取用户加密模块 */ + 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` +* +* 在插件中使用:需要基础库 `2.20.0` +* +* 创建 vision kit 会话对象。 +* +* **示例代码** +* +* v1 版本:[VisionKit基础能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/visionkit-basic) +* v2 版本:[VisionKit-v2基础能力使用参考](https://github.com/wechat-miniprogram/miniprogram-demo/tree/master/miniprogram/packageAPI/pages/ar/visionkit-basic-v2) +* ```js +// 以下 demo 以 v2 为例 +// 创建 session 对象 +const ssession = wx.createVKSession({ + track: { + plane: {mode: 3}, + }, + version: 'v2', + gl, // WebGLRenderingContext +}) + +// 逐帧分析 +const onFrame = timestamp => { + // 开发者可以自己控制帧率 + const frame = session.getVKFrame(canvasWidth, canvasHeight) + if (frame) { + // 分析完毕,可以拿到帧对象 + doRender(frame) + } + + session.requestAnimationFrame(onFrame) +} +session.start(err => { + if (!err) session.requestAnimationFrame(onFrame) +}) + +// 渲染函数 +const doRender = frame => { + // ... +} +``` */ + 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` + * + * 创建 [video](https://developers.weixin.qq.com/miniprogram/dev/component/video.html) 上下文 [VideoContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/VideoContext.html) 对象。建议使用 [wx.createSelectorQuery](https://developers.weixin.qq.com/miniprogram/dev/api/wxml/wx.createSelectorQuery.html) 获取 context 对象。 */ + createVideoContext( + /** [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; + /** [[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` + * + * 在插件中使用:需要基础库 `2.11.0` + * + * 创建视频解码器,可逐帧获取解码后的数据 */ + 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` + * + * 在插件中使用:不支持 + * + * 创建 WebAudio 上下文。 */ + 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` +* +* 在插件中使用:需要基础库 `2.18.1` +* +* 创建一个 Worker 线程 +* +* **示例代码** +* +* ```js +// 创建普通worker +wx.createWorker('workers/index.js') +``` +* ```js +function createNewWorker() { + const worker = wx.createWorker('workers/index.js', { + useExperimentalWorker: true + }) + // 监听worker被系统回收事件 + worker.onProcessKilled(() => { + // 重新创建一个worker + createNewWorker() + }) +} +// 创建实验worker +createNewWorker() +``` */ + createWorker( + /** worker 入口文件的**绝对路径** */ + scriptPath: string, + /** 可选参数 */ + options?: CreateWorkerOption + ): Worker; + /** [any wx.getStorageSync(string key)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageSync.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 从本地缓存中同步获取指定 key 的内容。 +* +* **注意** +* +* storage 应只用来进行数据的持久化存储,不应用于运行时的数据传递或全局状态管理。启动过程中过多的同步读写存储,会显著影响启动耗时。 +* +* **示例代码** +* +* ```js +try { + var value = wx.getStorageSync('key') + if (value) { + // Do something with return value + } +} catch (e) { + // Do something when catch error +} +``` */ + getStorageSync<T = any>( + /** 本地缓存中指定的 key */ + key: string + ): T; + /** [boolean wx.canIUse(string schema)](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.canIUse.html) +* +* 需要基础库: `1.1.1` +* +* 在插件中使用:不支持 +* +* 判断小程序的API,回调,参数,组件等是否在当前版本可用。 +* +* **参数说明** +* +* - `${API}` 代表 API 名字 +* - `${method}` 代表调用方式,有效值为return, success, object, callback +* - `${param}` 代表参数或者返回值 +* - `${option}` 代表参数的可选值或者返回值的属性 +* - `${component}` 代表组件名字 +* - `${attribute}` 代表组件属性 +* - `${option}` 代表组件属性的可选值 +* +* **示例代码** +* +* ```js +// 对象的属性或方法 +wx.canIUse('console.log') +wx.canIUse('CameraContext.onCameraFrame') +wx.canIUse('CameraFrameListener.start') +wx.canIUse('Image.src') + +// wx接口参数、回调或者返回值 +wx.canIUse('openBluetoothAdapter') +wx.canIUse('getSystemInfoSync.return.safeArea.left') +wx.canIUse('getSystemInfo.success.screenWidth') +wx.canIUse('showToast.object.image') +wx.canIUse('onCompassChange.callback.direction') +wx.canIUse('request.object.method.GET') + +// 组件的属性 +wx.canIUse('live-player') +wx.canIUse('text.selectable') +wx.canIUse('button.open-type.contact') +``` */ + canIUse( + /** 使用 `${API}.${method}.${param}.${option}` 或者 `${component}.${attribute}.${option}` 方式来调用 */ + schema: string + ): boolean; + /** [boolean wx.checkIsPictureInPictureActive()](https://developers.weixin.qq.com/miniprogram/dev/api/ui/window/wx.checkIsPictureInPictureActive.html) + * + * 需要基础库: `2.29.2` + * + * 在插件中使用:不支持 + * + * 返回当前是否存在小窗播放(小窗在 video/live-player/live-pusher 下可用) */ + checkIsPictureInPictureActive(): boolean; + /** [boolean wx.isVKSupport(string version)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.isVKSupport.html) +* +* 需要基础库: `2.22.0` +* +* 在插件中使用:需要基础库 `2.22.0` +* +* 判断支持版本 +* +* **示例代码** +* +* ```js +const isSupportV2 = wx.isVKSupport('v2') +``` */ + isVKSupport( + /** 参数 version 可选值: + * - 'v1': 旧版本; + * - 'v2': v2 版本,目前只有 iOS 基础库 2.22.0 以上支持; */ + version: 'v1' | 'v2' + ): boolean; + /** [number wx.getApiCategory()](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.getApiCategory.html) + * + * 需要基础库: `2.33.0` + * + * 在插件中使用:不支持 + * + * 获取当前 API 类别 + * + * **不同 apiCategory 场景下的 API 限制** + * + * `X` 表示 API 被限制无法使用;不在表格中的 API 不限制。 + * + * | | default | nativeFunctionalized | browseOnly | embedded | + * |-|-|-|-|-| + * |navigateToMiniProgram | | `X` | `X` | | + * |openSetting | | | `X` | | + * |<button open-type="share"> | | `X` | `X` | `X` | + * |<button open-type="feedback"> | | | `X` | | + * |<button open-type="open-setting">| | | `X` | | + * |openEmbeddedMiniProgram | | `X` | `X` | `X` | */ + getApiCategory(): number; + /** [string wx.arrayBufferToBase64(ArrayBuffer arrayBuffer)](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.arrayBufferToBase64.html) + * + * 需要基础库: `1.1.0` + * + * 在插件中使用:支持 + * @deprecated 基础库版本 [2.4.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃 + * + * 将 ArrayBuffer 对象转成 Base64 字符串 */ + arrayBufferToBase64( + /** 要转换成 Base64 字符串的 ArrayBuffer 对象 */ + arrayBuffer: ArrayBuffer + ): string; + /** [string wx.createBufferURL(ArrayBuffer|TypedArray buffer)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.createBufferURL.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 根据传入的 buffer 创建一个唯一的 URL 存在内存中 */ + createBufferURL( + /** 需要存入内存的二进制数据 */ + buffer: + | ArrayBuffer + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array + ): string; + /** [wx.addCard(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/card/wx.addCard.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:不支持 +* +* 批量添加卡券。只有通过 [认证](https://developers.weixin.qq.com/miniprogram/product/renzheng.html) 的小程序或文化互动类目的小游戏才能使用。更多文档请参考 [微信卡券接口文档](https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1490190158&version=1&lang=zh_CN&platform=2)。 +* +* **cardExt 说明** +* +* cardExt 是卡券的扩展参数,其值是一个 JSON 字符串。 +* +* **示例代码** +* +* ```js +wx.addCard({ + cardList: [ + { + cardId: '', + cardExt: '{"code": "", "openid": "", "timestamp": "", "signature":""}' + }, { + cardId: '', + cardExt: '{"code": "", "openid": "", "timestamp": "", "signature":""}' + } + ], + success (res) { + console.log(res.cardList) // 卡券添加结果 + } +}) +``` */ + addCard<T extends AddCardOption = AddCardOption>( + option: T + ): PromisifySuccessResult<T, AddCardOption>; + /** [wx.addFileToFavorites(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/favorites/wx.addFileToFavorites.html) + * + * 需要基础库: `2.16.1` + * + * 在插件中使用:不支持 + * + * 收藏文件 */ + addFileToFavorites< + T extends AddFileToFavoritesOption = AddFileToFavoritesOption + >( + option: T + ): PromisifySuccessResult<T, AddFileToFavoritesOption>; + /** [wx.addPhoneCalendar(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/calendar/wx.addPhoneCalendar.html) + * + * 需要基础库: `2.15.0` + * + * 在插件中使用:不支持 + * + * 向系统日历添加事件 */ + addPhoneCalendar<T extends AddPhoneCalendarOption = AddPhoneCalendarOption>( + option: T + ): PromisifySuccessResult<T, AddPhoneCalendarOption>; + /** [wx.addPhoneContact(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/contact/wx.addPhoneContact.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 添加手机通讯录联系人。用户可以选择将该表单以「新增联系人」或「添加到已有联系人」的方式,写入手机系统通讯录。 */ + addPhoneContact<T extends AddPhoneContactOption = AddPhoneContactOption>( + option: T + ): PromisifySuccessResult<T, AddPhoneContactOption>; + /** [wx.addPhoneRepeatCalendar(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/calendar/wx.addPhoneRepeatCalendar.html) + * + * 需要基础库: `2.15.0` + * + * 在插件中使用:不支持 + * + * 向系统日历添加重复事件 */ + addPhoneRepeatCalendar< + T extends AddPhoneRepeatCalendarOption = AddPhoneRepeatCalendarOption + >( + option: T + ): PromisifySuccessResult<T, AddPhoneRepeatCalendarOption>; + /** [wx.addVideoToFavorites(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/favorites/wx.addVideoToFavorites.html) + * + * 需要基础库: `2.16.1` + * + * 在插件中使用:不支持 + * + * 收藏视频 */ + addVideoToFavorites< + T extends AddVideoToFavoritesOption = AddVideoToFavoritesOption + >( + option: T + ): PromisifySuccessResult<T, AddVideoToFavoritesOption>; + /** [wx.authPrivateMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.authPrivateMessage.html) +* +* 需要基础库: `2.13.0` +* +* 在插件中使用:不支持 +* +* 验证私密消息。用法详情见 [小程序私密消息使用指南](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share/private-message.html) +* +* **示例代码** +* +* ```js +wx.authPrivateMessage({ + shareTicket: 'xxxxxx', + success(res) { + console.log('authPrivateMessage success', res) + // res + // { + // errMsg: 'authPrivateMessage:ok' + // valid: true + // iv: 'xxxx', + // encryptedData: 'xxxxxx' + // } + }, + fail(res) { + console.log('authPrivateMessage fail', res) + } +}) +``` */ + 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` +* +* 在插件中使用:不支持 +* +* 提前向用户发起授权请求。调用后会立刻弹窗询问用户是否同意授权小程序使用某项功能或获取用户的某些数据,但不会实际调用对应接口。如果用户之前已经同意授权,则不会出现弹窗,直接返回成功。更多用法详见 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)。 +* > 小程序插件可以使用 [wx.authorizeForMiniProgram](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorizeForMiniProgram.html) +* +* **示例代码** +* +* ```js +// 可以通过 wx.getSetting 先查询一下用户是否授权了 "scope.record" 这个 scope +wx.getSetting({ + success(res) { + if (!res.authSetting['scope.record']) { + wx.authorize({ + scope: 'scope.record', + success () { + // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问 + wx.startRecord() + } + }) + } + } +}) +``` */ + authorize<T extends AuthorizeOption = AuthorizeOption>( + option: T + ): PromisifySuccessResult<T, AuthorizeOption>; + /** [wx.authorizeForMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorizeForMiniProgram.html) +* +* 需要基础库: `2.14.4` +* +* 在插件中使用:需要基础库 `2.14.4` +* +* **仅小程序插件中能调用该接口**,用法同 [wx.authorize](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/authorize/wx.authorize.html)。目前仅支持三种 scope(见下) +* +* **示例代码** +* +* ```js +wx.authorizeForMiniProgram({ + scope: 'scope.record', + success () { + // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问 + wx.startRecord() + } +}) +``` */ + authorizeForMiniProgram(option: AuthorizeForMiniProgramOption): void; + /** [wx.batchGetStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.batchGetStorage.html) +* +* 需要基础库: `2.25.0` +* +* 在插件中使用:不支持 +* +* 从本地缓存中异步批量获取指定 key 的内容。 +* +* **示例代码** +* +* ```js +wx.batchGetStorage({ + keyList: ['key'], + success (res) { + console.log(res) + } +}) +``` */ + batchGetStorage<T extends BatchGetStorageOption = BatchGetStorageOption>( + option: T + ): PromisifySuccessResult<T, BatchGetStorageOption>; + /** [wx.batchSetStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.batchSetStorage.html) +* +* 需要基础库: `2.25.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 将数据批量存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。 +* +* **示例代码** +* +* ```js +wx.setStorage({ + key:"key", + data:"value" +}) +``` +* +* ```js +// 开启加密存储 +wx.batchSetStorage({ + kvList: [{ + key: 'key', + value: 'value', + }], +}) +``` */ + batchSetStorage<T extends BatchSetStorageOption = BatchSetStorageOption>( + option: T + ): PromisifySuccessResult<T, BatchSetStorageOption>; + /** [wx.batchSetStorageSync(Array.<Object> kvList)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.batchSetStorageSync.html) +* +* 需要基础库: `2.25.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 将数据批量存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。 +* +* **示例代码** +* +* ```js +try { + wx.batchSetStorageSync([{key: 'key', value: 'value'}]) +} catch (e) { } +``` */ + 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` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取 canvas 区域隐含的像素数据。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/yufmRjmZ7W8f) +* +* ```js +wx.canvasGetImageData({ + canvasId: 'myCanvas', + x: 0, + y: 0, + width: 100, + height: 100, + success(res) { + console.log(res.width) // 100 + console.log(res.height) // 100 + console.log(res.data instanceof Uint8ClampedArray) // true + console.log(res.data.length) // 100 * 100 * 4 + } +}) +``` */ + canvasGetImageData< + T extends CanvasGetImageDataOption = CanvasGetImageDataOption + >( + option: T, + /** 在自定义组件下,当前组件实例的this,以操作组件内 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件 */ + component?: Component.TrivialInstance | Page.TrivialInstance + ): PromisifySuccessResult<T, CanvasGetImageDataOption>; + /** [wx.canvasPutImageData(Object object, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasPutImageData.html) + * + * 需要基础库: `1.9.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 将像素数据绘制到画布。在自定义组件下,第二个参数传入自定义组件实例 this,以操作组件内 <canvas> 组件 */ + canvasPutImageData< + T extends CanvasPutImageDataOption = CanvasPutImageDataOption + >( + option: T, + /** 在自定义组件下,当前组件实例的this,以操作组件内 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件 */ + component?: Component.TrivialInstance | Page.TrivialInstance + ): PromisifySuccessResult<T, CanvasPutImageDataOption>; + /** [wx.canvasToTempFilePath(Object object, Object this)](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasToTempFilePath.html) + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 把当前画布指定区域的内容导出生成指定大小的图片。在 `draw()` 回调里调用该方法才能保证图片导出成功。暂不支持离屏 canvas。 */ + canvasToTempFilePath< + T extends CanvasToTempFilePathOption = CanvasToTempFilePathOption + >( + option: T, + /** 在自定义组件下,当前组件实例的this,以操作组件内 [canvas](https://developers.weixin.qq.com/miniprogram/dev/component/canvas.html) 组件 */ + component?: Component.TrivialInstance | Page.TrivialInstance + ): PromisifySuccessResult<T, CanvasToTempFilePathOption>; + /** [wx.checkIsAddedToMyMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/my-miniprogram/wx.checkIsAddedToMyMiniProgram.html) + * + * 需要基础库: `2.29.1` + * + * 在插件中使用:不支持 + * + * 检查小程序是否被添加至 「我的小程序」 */ + checkIsAddedToMyMiniProgram( + option: CheckIsAddedToMyMiniProgramOption + ): void; + /** [wx.checkIsOpenAccessibility(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/accessibility/wx.checkIsOpenAccessibility.html) + * + * 需要基础库: `2.13.0` + * + * 在插件中使用:不支持 + * + * 检测是否开启视觉无障碍功能。 */ + checkIsOpenAccessibility< + T extends CheckIsOpenAccessibilityOption = CheckIsOpenAccessibilityOption + >( + option?: T + ): PromisifySuccessResult<T, CheckIsOpenAccessibilityOption>; + /** [wx.checkIsSoterEnrolledInDevice(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/soter/wx.checkIsSoterEnrolledInDevice.html) +* +* 需要基础库: `1.6.0` +* +* 在插件中使用:不支持 +* +* 获取设备内是否录入如指纹等生物信息的接口 +* +* **示例代码** +* +* ```js +wx.checkIsSoterEnrolledInDevice({ + checkAuthMode: 'fingerPrint', + success(res) { + console.log(res.isEnrolled) + } +}) +``` */ + checkIsSoterEnrolledInDevice< + T extends + CheckIsSoterEnrolledInDeviceOption = CheckIsSoterEnrolledInDeviceOption + >( + option: T + ): PromisifySuccessResult<T, CheckIsSoterEnrolledInDeviceOption>; + /** [wx.checkIsSupportSoterAuthentication(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/soter/wx.checkIsSupportSoterAuthentication.html) +* +* 需要基础库: `1.5.0` +* +* 在插件中使用:不支持 +* +* 获取本机支持的 SOTER 生物认证方式 +* +* **示例代码** +* +* ```js +wx.checkIsSupportSoterAuthentication({ + success(res) { + // res.supportMode = [] 不具备任何被SOTER支持的生物识别方式 + // res.supportMode = ['fingerPrint'] 只支持指纹识别 + // res.supportMode = ['fingerPrint', 'facial'] 支持指纹识别和人脸识别 + } +}) +``` */ + checkIsSupportSoterAuthentication< + T extends + CheckIsSupportSoterAuthenticationOption = CheckIsSupportSoterAuthenticationOption + >( + option?: T + ): PromisifySuccessResult<T, CheckIsSupportSoterAuthenticationOption>; + /** [wx.checkSession(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.checkSession.html) +* +* 在插件中使用:不支持 +* +* 检查登录态是否过期。 +* 通过 wx.login 接口获得的用户登录态拥有一定的时效性。用户越久未使用小程序,用户登录态越有可能失效。反之如果用户一直在使用小程序,则用户登录态一直保持有效。具体时效逻辑由微信维护,对开发者透明。开发者只需要调用 wx.checkSession 接口检测当前用户登录态是否有效。 +* +* 登录态过期后开发者可以再调用 wx.login 获取新的用户登录态。调用成功说明当前 session_key 未过期,调用失败说明 session_key 已过期。 +* +* **示例代码** +* +* ```js +wx.checkSession({ + success () { + //session_key 未过期,并且在本生命周期一直有效 + }, + fail () { + // session_key 已经失效,需要重新执行登录流程 + wx.login() //重新登录 + } +}) +``` */ + checkSession<T extends CheckSessionOption = CheckSessionOption>( + option?: T + ): PromisifySuccessResult<T, CheckSessionOption>; + /** [wx.chooseAddress(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/address/wx.chooseAddress.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.16.1` +* +* 获取用户收货地址。调起用户编辑收货地址原生界面,并在编辑完成后返回用户选择的地址。 +* ## 使用方法 +* 自 2022 年 7 月 14 日后发布的小程序,若使用该接口,需要在 app.json 中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。[具体规则见公告](https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01) +* ## 申请开通 +* 暂只针对具备与地理位置强相关的使用场景的小程序开放,在小程序管理后台,「开发」-「开发管理」-「接口设置」中自助开通该接口权限。 +* 接口权限申请入口将于2022年3月11日开始内测,于3月31日全量上线。并从4月18日开始,在代码审核环节将检测该接口是否已完成开通,如未开通,将在代码提审环节进行拦截。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/024hHnmd772y) +* ```js +wx.chooseAddress({ + success (res) { + console.log(res.userName) + console.log(res.postalCode) + console.log(res.provinceName) + console.log(res.cityName) + console.log(res.countyName) + console.log(res.detailInfo) + console.log(res.nationalCode) + console.log(res.telNumber) + } +}) +``` */ + chooseAddress<T extends ChooseAddressOption = ChooseAddressOption>( + option?: T + ): PromisifySuccessResult<T, ChooseAddressOption>; + /** [wx.chooseContact(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/contact/wx.chooseContact.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 拉起手机通讯录,选择联系人。 */ + chooseContact(option?: ChooseContactOption): void; + /** [wx.chooseImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseImage.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [2.21.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.chooseMedia](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html) 替换 +* +* 从本地相册选择图片或使用相机拍照。 +* +* **** +* +* ```js +wx.chooseImage({ + count: 1, + sizeType: ['original', 'compressed'], + sourceType: ['album', 'camera'], + success (res) { + // tempFilePath可以作为img标签的src属性显示图片 + const tempFilePaths = res.tempFilePaths + } +}) +``` */ + chooseImage<T extends ChooseImageOption = ChooseImageOption>( + option?: T + ): PromisifySuccessResult<T, ChooseImageOption>; + /** [wx.chooseInvoice(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoice.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:需要基础库 `2.16.1` + * + * 选择用户已有的发票。 + * + * **通过 cardId 和 encryptCode 获得报销发票的信息** + * + * 请参考[微信电子发票文档](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=21517918939oae3U)中,「查询报销发票信息」部分。 + * 其中 `access_token` 的获取请参考[auth.getAccessToken](#)文档 */ + chooseInvoice<T extends ChooseInvoiceOption = ChooseInvoiceOption>( + option?: T + ): PromisifySuccessResult<T, ChooseInvoiceOption>; + /** [wx.chooseInvoiceTitle(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/invoice/wx.chooseInvoiceTitle.html) +* +* 需要基础库: `1.5.0` +* +* 在插件中使用:需要基础库 `2.16.1` +* +* 选择用户的发票抬头。当前小程序必须关联一个公众号,且这个公众号是完成了[微信认证](https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1496554031_RD4xe)的,才能调用 chooseInvoiceTitle。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/GJ4S9nmQ7x2E) +* +* ```js +wx.chooseInvoiceTitle({ + success(res) {} +}) +``` */ + chooseInvoiceTitle< + T extends ChooseInvoiceTitleOption = ChooseInvoiceTitleOption + >( + option?: T + ): PromisifySuccessResult<T, ChooseInvoiceTitleOption>; + /** [wx.chooseLicensePlate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/license-plate/wx.chooseLicensePlate.html) + * + * 需要基础库: `2.19.0` + * + * 在插件中使用:不支持 + * + * 选择车牌号 */ + chooseLicensePlate< + T extends ChooseLicensePlateOption = ChooseLicensePlateOption + >( + option?: T + ): PromisifySuccessResult<T, ChooseLicensePlateOption>; + /** [wx.chooseLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.chooseLocation.html) + * + * 在插件中使用:需要基础库 `1.9.6` + * + * @warning **为确保选择地理位置接口的合理使用,位置接口调整参考 [选择地理位置接口调整公告](https://developers.weixin.qq.com/community/develop/doc/0006e45df2cac030e6edf367c56001)** + * + * 打开地图选择位置。 + * ## 使用方法 + * 自 2022 年 7 月 14 日后发布的小程序,若使用该接口,需要在 app.json 中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。[具体规则见公告](https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01) + * ## 申请开通 + * 暂只针对具备与地理位置强相关的使用场景的小程序开放,在小程序管理后台,「开发」-「开发管理」-「接口设置」中自助开通该接口权限。 + * 接口权限申请入口将于2022年3月11日开始内测,于3月31日全量上线。并从4月18日开始,在代码审核环节将检测该接口是否已完成开通,如未开通,将在代码提审环节进行拦截。 + * + * **示例** + * + * ![](https://res.wx.qq.com/op_res/WDFC8aB4FI8rJ9oEmbYfbH_Fl3EIv91471YVxezVfLRESkUuCgfODZcbOoyteKU4j-OLZa2EFKY9BDPd3g-tfg#width:260px) */ + chooseLocation<T extends ChooseLocationOption = ChooseLocationOption>( + option: T + ): PromisifySuccessResult<T, ChooseLocationOption>; + /** [wx.chooseMedia(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html) +* +* 需要基础库: `2.10.0` +* +* 在插件中使用:需要基础库 `2.11.1` +* +* 拍摄或从手机相册中选择图片或视频。 +* +* **示例代码** +* +* ```js +wx.chooseMedia({ + count: 9, + mediaType: ['image','video'], + sourceType: ['album', 'camera'], + maxDuration: 30, + camera: 'back', + success(res) { + console.log(res.tempFiles.tempFilePath) + console.log(res.tempFiles.size) + } +}) +``` */ + chooseMedia<T extends ChooseMediaOption = ChooseMediaOption>( + option: T + ): PromisifySuccessResult<T, ChooseMediaOption>; + /** [wx.chooseMessageFile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.chooseMessageFile.html) +* +* 需要基础库: `2.5.0` +* +* 在插件中使用:不支持 +* +* 从客户端会话选择文件。 +* +* **** +* +* ```js +wx.chooseMessageFile({ + count: 10, + type: 'image', + success (res) { + // tempFilePath可以作为img标签的src属性显示图片 + const tempFilePaths = res.tempFiles + } +}) +``` */ + chooseMessageFile< + T extends ChooseMessageFileOption = ChooseMessageFileOption + >( + option: T + ): PromisifySuccessResult<T, ChooseMessageFileOption>; + /** [wx.choosePoi(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.choosePoi.html) + * + * 在插件中使用:不支持 + * + * @warning **为确保选择地理位置接口的合理使用,位置接口调整参考 [选择地理位置接口调整公告](https://developers.weixin.qq.com/community/develop/doc/0006e45df2cac030e6edf367c56001)** + * + * 打开POI列表选择位置,支持模糊定位(精确到市)和精确定位混选。 + * ## 使用方法 + * 自 2022 年 7 月 14 日后发布的小程序,若使用该接口,需要在 app.json 中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。[具体规则见公告](https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01) + * ## 申请开通 + * 暂只针对具备与地理位置强相关的使用场景的小程序开放,在小程序管理后台,「开发」-「开发管理」-「接口设置」中自助开通该接口权限。 + * 接口权限申请入口将于2022年3月11日开始内测,于3月31日全量上线。并从4月18日开始,在代码审核环节将检测该接口是否已完成开通,如未开通,将在代码提审环节进行拦截。 + * + * **示例** + * + * ![](https://res.wx.qq.com/op_res/lzDsNyBNifLczyLX0ms7ZpPQysgAgdhrQTGzzTQPiXkAB2HJIf1Slvl4rnN9I1q0AT3xqoGTg98jMsNexDLbbA#width:260px) */ + choosePoi<T extends ChoosePoiOption = ChoosePoiOption>( + option: T + ): PromisifySuccessResult<T, ChoosePoiOption>; + /** [wx.chooseVideo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseVideo.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [2.21.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.chooseMedia](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html) 替换 +* +* 拍摄视频或从手机相册中选视频。 +* +* **示例代码** +* +* ```js +wx.chooseVideo({ + sourceType: ['album','camera'], + maxDuration: 60, + camera: 'back', + success(res) { + console.log(res.tempFilePath) + } +}) +``` */ + chooseVideo<T extends ChooseVideoOption = ChooseVideoOption>( + option: T + ): PromisifySuccessResult<T, ChooseVideoOption>; + /** [wx.clearStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorage.html) +* +* 在插件中使用:不支持 +* +* 清理本地数据缓存。 +* +* **示例代码** +* +* ```js +wx.clearStorage() +``` +* +* ```js +try { + wx.clearStorageSync() +} catch(e) { + // Do something when catch error +} +``` */ + clearStorage<T extends ClearStorageOption = ClearStorageOption>( + option?: T + ): PromisifySuccessResult<T, ClearStorageOption>; + /** [wx.clearStorageSync()](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorageSync.html) +* +* 在插件中使用:不支持 +* +* [wx.clearStorage](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorage.html) 的同步版本 +* +* **示例代码** +* +* ```js +wx.clearStorage() +``` +* +* ```js +try { + wx.clearStorageSync() +} catch(e) { + // Do something when catch error +} +``` */ + clearStorageSync(): void; + /** [wx.closeBLEConnection(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.closeBLEConnection.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 断开与蓝牙低功耗设备的连接。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.closeBLEConnection({ + deviceId, + success (res) { + console.log(res) + } +}) +``` */ + closeBLEConnection< + T extends CloseBLEConnectionOption = CloseBLEConnectionOption + >( + option: T + ): PromisifySuccessResult<T, CloseBLEConnectionOption>; + /** [wx.closeBluetoothAdapter(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.closeBluetoothAdapter.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 关闭蓝牙模块。调用该方法将断开所有已建立的连接并释放系统资源。建议在使用蓝牙流程后,与 [wx.openBluetoothAdapter](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.openBluetoothAdapter.html) 成对调用。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.closeBluetoothAdapter({ + success (res) { + console.log(res) + } +}) +``` */ + closeBluetoothAdapter< + T extends CloseBluetoothAdapterOption = CloseBluetoothAdapterOption + >( + option?: T + ): PromisifySuccessResult<T, CloseBluetoothAdapterOption>; + /** [wx.closeSocket(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.closeSocket.html) +* +* 在插件中使用:不支持 +* +* @warning **推荐使用 [SocketTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控,同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** +* +* 关闭 WebSocket 连接。 +* +* **示例代码** +* +* ```js +wx.connectSocket({ + url: 'test.php' +}) + +//注意这里有时序问题, +//如果 wx.connectSocket 还没回调 wx.onSocketOpen,而先调用 wx.closeSocket,那么就做不到关闭 WebSocket 的目的。 +//必须在 WebSocket 打开期间调用 wx.closeSocket 才能关闭。 +wx.onSocketOpen(function() { + wx.closeSocket() +}) + +wx.onSocketClose(function(res) { + console.log('WebSocket 已关闭!') +}) +``` */ + closeSocket<T extends CloseSocketOption = CloseSocketOption>( + option?: T + ): PromisifySuccessResult<T, CloseSocketOption>; + /** [wx.compressImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.compressImage.html) +* +* 需要基础库: `2.4.0` +* +* 在插件中使用:需要基础库 `2.12.0` +* +* 压缩图片接口,可选压缩质量 +* +* **示例代码** +* +* ```js +wx.compressImage({ + src: '', // 图片路径 + quality: 80 // 压缩质量 +}) +``` */ + compressImage<T extends CompressImageOption = CompressImageOption>( + option: T + ): PromisifySuccessResult<T, CompressImageOption>; + /** [wx.compressVideo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.compressVideo.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:需要基础库 `2.11.1` + * + * 压缩视频接口。开发者可指定压缩质量 `quality` 进行压缩。当需要更精细的控制时,可指定 `bitrate`、`fps`、和 `resolution`,当 `quality` 传入时,这三个参数将被忽略。原视频的相关信息可通过 [getVideoInfo](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.getVideoInfo.html) 获取。 */ + compressVideo<T extends CompressVideoOption = CompressVideoOption>( + option: T + ): PromisifySuccessResult<T, CompressVideoOption>; + /** [wx.connectWifi(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.connectWifi.html) +* +* 需要基础库: `1.6.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 连接 Wi-Fi。若已知 Wi-Fi 信息,可以直接利用该接口连接。仅 Android 与 iOS 11 以上版本支持。 +* +* **示例代码** +* +* ```js +wx.connectWifi({ + SSID: '', + password: '', + success (res) { + console.log(res.errMsg) + } +}) +``` +* +* **注意** +* +* - Android 微信客户端 7.0.22 以上版本,connectWifi 的实现在 Android 10 及以上的手机无法生效,对于 Android 10 及以上版本,设备连接 wifi 之后,(受系统能力限制)其他进程无法使用当前连接的 wifi ;即连接上的 wifi 只对当前小程序有效,如果想要对整个系统生效,需要配置 maunal 来连接 wifi。 +* - iOS 系统底层没有给开发者提供因 wifi 密码错误而连接失败的事件,但用户可以收到密码错误的系统弹窗。建议开发者通过 onWifiConnected 事件来判断 wifi 是否连接成功;即设置定时器,若超时后仍没有 onWifiConnected 事件,则认定此次 wifi 连接无效。 +* - Android / iOS 在系统已经连上目标 wifi 的情况下,小程序再次连接目标 wifi,此时无论输入的密码是否正确,系统都会默认此次连接成功,且没有 onWifiConnected 事件。 +* - onWifiConnected 事件可能会返回空对象,此时代表 wifi 断开连接,开发者可忽略这种情况。 */ + connectWifi<T extends ConnectWifiOption = ConnectWifiOption>( + option: T + ): PromisifySuccessResult<T, ConnectWifiOption>; + /** [wx.createBLEConnection(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 连接蓝牙低功耗设备。 +* +* 若小程序在之前已有搜索过某个蓝牙设备,并成功建立连接,可直接传入之前搜索获取的 deviceId 直接尝试连接该设备,无需再次进行搜索操作。 +* +* **注意** +* +* - 请保证尽量成对的调用 [wx.createBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 和 [wx.closeBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.closeBLEConnection.html) 接口。安卓如果重复调用 [wx.createBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 创建连接,有可能导致系统持有同一设备多个连接的实例,导致调用 `closeBLEConnection` 的时候并不能真正的断开与设备的连接。 +* - 蓝牙连接随时可能断开,建议监听 [wx.onBLEConnectionStateChange](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.onBLEConnectionStateChange.html) 回调事件,当蓝牙设备断开时按需执行重连操作 +* - 若对未连接的设备或已断开连接的设备调用数据读写操作的接口,会返回 10006 错误,建议进行重连操作。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.createBLEConnection({ + deviceId, + success (res) { + console.log(res) + } +}) +``` */ + createBLEConnection< + T extends CreateBLEConnectionOption = CreateBLEConnectionOption + >( + option: T + ): PromisifySuccessResult<T, CreateBLEConnectionOption>; + /** [wx.createBLEPeripheralServer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/wx.createBLEPeripheralServer.html) + * + * 需要基础库: `2.10.3` + * + * 在插件中使用:需要基础库 `2.22.1` + * + * 建立本地作为蓝牙低功耗外围设备的服务端,可创建多个。 */ + createBLEPeripheralServer< + T extends + CreateBLEPeripheralServerOption = CreateBLEPeripheralServerOption + >( + option?: T + ): PromisifySuccessResult<T, CreateBLEPeripheralServerOption>; + /** [wx.cropImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.cropImage.html) +* +* 需要基础库: `2.26.0` +* +* 在插件中使用:不支持 +* +* 裁剪图片接口 +* +* **示例代码** +* +* ```js +wx.cropImage({ + src: '', // 图片路径 + cropScale: '16:9', // 裁剪比例 +}) +``` */ + cropImage(option: CropImageOption): void; + /** [wx.disableAlertBeforeUnload(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.disableAlertBeforeUnload.html) + * + * 需要基础库: `2.12.0` + * + * 在插件中使用:不支持 + * + * 关闭小程序页面返回询问对话框。 */ + disableAlertBeforeUnload(option?: DisableAlertBeforeUnloadOption): void; + /** [wx.editImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.editImage.html) +* +* 需要基础库: `2.22.0` +* +* 在插件中使用:不支持 +* +* 编辑图片接口 +* +* **示例代码** +* +* ```js +wx.editImage({ + src: '', // 图片路径 +}) +``` */ + editImage(option: EditImageOption): void; + /** [wx.enableAlertBeforeUnload(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.enableAlertBeforeUnload.html) + * + * 需要基础库: `2.12.0` + * + * 在插件中使用:不支持 + * + * 开启小程序页面返回询问对话框。 + * + * ## 弹窗条件 + * * 当用户在小程序内非首页页面/最底层页 + * * 官方导航栏上的的返回 + * * 全屏模式下自绘返回键 + * * android 系统 back 键时 + * + * ## 注意事项 + * * 手势滑动返回时不做拦截 + * * 在任何场景下,此功能都不应拦住用户退出小程序的行为 + * + * **示例代码** + * + * [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/MTPm9Cmh7VfT) */ + enableAlertBeforeUnload(option: EnableAlertBeforeUnloadOption): void; + /** [wx.exitMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.exitMiniProgram.html) + * + * 需要基础库: `2.17.3` + * + * 在插件中使用:需要基础库 `2.30.1` + * + * 退出当前小程序。必须有点击行为才能调用成功。 */ + exitMiniProgram<T extends ExitMiniProgramOption = ExitMiniProgramOption>( + option?: T + ): PromisifySuccessResult<T, ExitMiniProgramOption>; + /** [wx.exitVoIPChat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.exitVoIPChat.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:需要基础库 `2.9.0` + * + * 退出(销毁)实时语音通话 */ + exitVoIPChat<T extends ExitVoIPChatOption = ExitVoIPChatOption>( + option?: T + ): PromisifySuccessResult<T, ExitVoIPChatOption>; + /** [wx.faceDetect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/face/wx.faceDetect.html) + * + * 需要基础库: `2.18.0` + * + * 在插件中使用:需要基础库 `2.21.3` + * + * @warning **该接口已停止维护,推荐使用 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 代替** + * + * 人脸检测,使用前需要通过 wx.initFaceDetect 进行一次初始化,推荐使用相机接口返回的帧数据。本接口不再维护,请使用 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 接口代替。详情参考[人脸检测指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/face.html) + * + * **** + * + * ### 特别说明 + * 若小程序人脸识别功能涉及采集、存储用户生物特征(如人脸照片或视频、身份证和手持身份证、身份证照和免冠照等),此类型服务需使用[微信原生人脸识别接口](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; + /** [wx.getAvailableAudioSources(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.getAvailableAudioSources.html) + * + * 需要基础库: `2.1.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 获取当前支持的音频输入源 */ + getAvailableAudioSources< + T extends GetAvailableAudioSourcesOption = GetAvailableAudioSourcesOption + >( + option?: T + ): PromisifySuccessResult<T, GetAvailableAudioSourcesOption>; + /** [wx.getBLEDeviceCharacteristics(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEDeviceCharacteristics.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取蓝牙低功耗设备某个服务中所有特征 (characteristic)。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.getBLEDeviceCharacteristics({ + // 这里的 deviceId 需要已经通过 wx.createBLEConnection 与对应设备建立链接 + deviceId, + // 这里的 serviceId 需要在 wx.getBLEDeviceServices 接口中获取 + serviceId, + success (res) { + console.log('device getBLEDeviceCharacteristics:', res.characteristics) + } +}) +``` */ + getBLEDeviceCharacteristics< + T extends + GetBLEDeviceCharacteristicsOption = GetBLEDeviceCharacteristicsOption + >( + option: T + ): PromisifySuccessResult<T, GetBLEDeviceCharacteristicsOption>; + /** [wx.getBLEDeviceRSSI(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEDeviceRSSI.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:需要基础库 `2.11.0` + * + * 获取蓝牙低功耗设备的信号强度 (Received Signal Strength Indication, RSSI)。 */ + getBLEDeviceRSSI<T extends GetBLEDeviceRSSIOption = GetBLEDeviceRSSIOption>( + option: T + ): PromisifySuccessResult<T, GetBLEDeviceRSSIOption>; + /** [wx.getBLEDeviceServices(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEDeviceServices.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取蓝牙低功耗设备所有服务 (service)。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.getBLEDeviceServices({ + // 这里的 deviceId 需要已经通过 wx.createBLEConnection 与对应设备建立连接 + deviceId, + success (res) { + console.log('device services:', res.services) + } +}) +``` */ + getBLEDeviceServices< + T extends GetBLEDeviceServicesOption = GetBLEDeviceServicesOption + >( + option: T + ): PromisifySuccessResult<T, GetBLEDeviceServicesOption>; + /** [wx.getBLEMTU(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.getBLEMTU.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.20.1` +* +* 获取蓝牙低功耗的最大传输单元。需在 [wx.createBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 调用成功后调用。 +* +* **注意** +* +* - 小程序中 MTU 为 ATT_MTU,包含 Op-Code 和 Attribute Handle 的长度,实际可以传输的数据长度为 `ATT_MTU - 3` +* - iOS 系统中 MTU 为固定值;安卓系统中,MTU 会在系统协商成功之后发生改变,建议使用 [wx.onBLEMTUChange](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.onBLEMTUChange.html) 监听。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.getBLEMTU({ + deviceId: '', + writeType: 'write', + success (res) { + console.log(res) + } +}) +``` */ + getBLEMTU<T extends GetBLEMTUOption = GetBLEMTUOption>( + option: T + ): PromisifySuccessResult<T, GetBLEMTUOption>; + /** [wx.getBackgroundAudioPlayerState(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioPlayerState.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [1.2.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 替换 +* +* 获取后台音乐播放状态。 +* +* **示例代码** +* +* ```js +wx.getBackgroundAudioPlayerState({ + success (res) { + const status = res.status + const dataUrl = res.dataUrl + const currentPosition = res.currentPosition + const duration = res.duration + const downloadPercent = res.downloadPercent + } +}) +``` */ + getBackgroundAudioPlayerState< + T extends + GetBackgroundAudioPlayerStateOption = GetBackgroundAudioPlayerStateOption + >( + option?: T + ): PromisifySuccessResult<T, GetBackgroundAudioPlayerStateOption>; + /** [wx.getBackgroundFetchData(object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/background-fetch/wx.getBackgroundFetchData.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 拉取 backgroundFetch 客户端缓存数据。 + * 当调用接口时,若当次请求未结束,会先返回本地的旧数据(之前打开小程序时请求的),如果本地没有旧数据,安卓上会返回fail,不会等待请求完成,iOS上会返回success但fetchedData为空,也不会等待请求完成。 */ + getBackgroundFetchData< + T extends GetBackgroundFetchDataOption = GetBackgroundFetchDataOption + >( + option: T + ): PromisifySuccessResult<T, GetBackgroundFetchDataOption>; + /** [wx.getBackgroundFetchToken(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/background-fetch/wx.getBackgroundFetchToken.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 获取设置过的自定义登录态。若无,则返回 fail。 */ + getBackgroundFetchToken< + T extends GetBackgroundFetchTokenOption = GetBackgroundFetchTokenOption + >( + option?: T + ): PromisifySuccessResult<T, GetBackgroundFetchTokenOption>; + /** [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<T extends GetBatteryInfoOption = GetBatteryInfoOption>( + option?: T + ): PromisifySuccessResult<T, GetBatteryInfoOption>; + /** [wx.getBeacons(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.getBeacons.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 获取所有已搜索到的 Beacon 设备 */ + getBeacons<T extends GetBeaconsOption = GetBeaconsOption>( + option?: T + ): PromisifySuccessResult<T, GetBeaconsOption>; + /** [wx.getBluetoothAdapterState(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getBluetoothAdapterState.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取本机蓝牙适配器状态。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.getBluetoothAdapterState({ + success (res) { + console.log(res) + } +}) +``` */ + getBluetoothAdapterState< + T extends GetBluetoothAdapterStateOption = GetBluetoothAdapterStateOption + >( + option?: T + ): PromisifySuccessResult<T, GetBluetoothAdapterStateOption>; + /** [wx.getBluetoothDevices(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getBluetoothDevices.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取在蓝牙模块生效期间所有搜索到的蓝牙设备。包括已经和本机处于连接状态的设备。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* +* ```js +// ArrayBuffer转16进度字符串示例 +function ab2hex(buffer) { + var hexArr = Array.prototype.map.call( + new Uint8Array(buffer), + function(bit) { + return ('00' + bit.toString(16)).slice(-2) + } + ) + return hexArr.join(''); +} +wx.getBluetoothDevices({ + success: function (res) { + console.log(res) + if (res.devices[0]) { + console.log(ab2hex(res.devices[0].advertisData)) + } + } +}) +``` +* +* **注意** +* +* - 该接口获取到的设备列表为**蓝牙模块生效期间所有搜索到的蓝牙设备**,若在蓝牙模块使用流程结束后未及时调用 [wx.closeBluetoothAdapter](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.closeBluetoothAdapter.html) 释放资源,会存在调用该接口会返回之前的蓝牙使用流程中搜索到的蓝牙设备,可能设备已经不在用户身边,无法连接。 */ + getBluetoothDevices< + T extends GetBluetoothDevicesOption = GetBluetoothDevicesOption + >( + option?: T + ): PromisifySuccessResult<T, GetBluetoothDevicesOption>; + /** [wx.getChannelsLiveInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.getChannelsLiveInfo.html) + * + * 需要基础库: `2.15.0` + * + * 在插件中使用:不支持 + * + * 获取视频号直播信息 */ + 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` + * + * 在插件中使用:不支持 + * + * 获取视频号直播预告信息 */ + 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` + * + * 在插件中使用:不支持 + * + * 获取视频号直播卡片/视频卡片的分享来源,仅当卡片携带了分享信息、同时用户已授权该小程序获取视频号分享信息且启动场景值为 1177、1184、1195、1208 时可用。 */ + getChannelsShareKey(option?: GetChannelsShareKeyOption): void; + /** [wx.getClipboardData(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.getClipboardData.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取系统剪贴板的内容 +* +* **示例代码** +* +* ```js +wx.getClipboardData({ + success (res){ + console.log(res.data) + } +}) +``` */ + getClipboardData<T extends GetClipboardDataOption = GetClipboardDataOption>( + option?: T + ): PromisifySuccessResult<T, GetClipboardDataOption>; + /** [wx.getCommonConfig(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.getCommonConfig.html) +* +* 需要基础库: `2.33.0` +* +* 在插件中使用:不支持 +* +* 给定实验参数数组,获取对应的实验参数值。 +* +* **示例代码** +* +* ```js + wx.getCommonConfig({ + keys:["key1", "key2"], + mode: 0, + success: (res)=>{ + console.log("success") + console.log(res) + }, + fail: (res)=>{ + console.log("fail") + console.log(res) + }}) +``` */ + getCommonConfig(option: GetCommonConfigOption): void; + /** [wx.getConnectedBluetoothDevices(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getConnectedBluetoothDevices.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 根据主服务 UUID 获取已连接的蓝牙设备。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.getConnectedBluetoothDevices({ + services: ['FEE7'], + success (res) { + console.log(res) + } +}) +``` */ + getConnectedBluetoothDevices< + T extends + GetConnectedBluetoothDevicesOption = GetConnectedBluetoothDevicesOption + >( + option: T + ): PromisifySuccessResult<T, GetConnectedBluetoothDevicesOption>; + /** [wx.getConnectedWifi(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getConnectedWifi.html) + * + * 需要基础库: `1.6.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 获取已连接中的 Wi-Fi 信息。 */ + getConnectedWifi<T extends GetConnectedWifiOption = GetConnectedWifiOption>( + option: T + ): PromisifySuccessResult<T, GetConnectedWifiOption>; + /** [wx.getDeviceVoIPList(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/device-voip/wx.getDeviceVoIPList.html) +* +* 需要基础库: `2.30.3` +* +* 在插件中使用:不支持 +* +* 查询当前用户授权的音视频通话设备(组)信息 +* +* **示例代码** +* +* ```js +wx.getDeviceVoIPList({ + success(res) { + console.log(res) + }, + fail(res) { + console.log(res) + } +}) +``` */ + getDeviceVoIPList(option?: GetDeviceVoIPListOption): void; + /** [wx.getExtConfig(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ext/wx.getExtConfig.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:不支持 +* +* 获取[第三方平台](https://developers.weixin.qq.com/miniprogram/dev/devtools/ext.html)自定义的数据字段。 +* +* **Tips** +* +* 1. 本接口暂时无法通过 [wx.canIUse](https://developers.weixin.qq.com/miniprogram/dev/api/base/wx.canIUse.html) 判断是否兼容,开发者需要自行判断 [wx.getExtConfig](https://developers.weixin.qq.com/miniprogram/dev/api/ext/wx.getExtConfig.html) 是否存在来兼容 +* +* **** +* +* ```js +if (wx.getExtConfig) { + wx.getExtConfig({ + success (res) { + console.log(res.extConfig) + } + }) +} +``` */ + getExtConfig<T extends GetExtConfigOption = GetExtConfigOption>( + option?: T + ): PromisifySuccessResult<T, GetExtConfigOption>; + /** [wx.getFuzzyLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getFuzzyLocation.html) +* +* 需要基础库: `2.25.0` +* +* 在插件中使用:支持 +* +* 获取当前的模糊地理位置。 +* ## 使用方法 +* 自 2022 年 7 月 14 日后发布的小程序,若使用该接口,需要在 app.json 中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。[具体规则见公告](https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01) +* ## 申请开通 +* 暂只针对具备与地理位置强相关的使用场景的小程序开放,在小程序管理后台,「开发」-「开发管理」-「接口设置」中自助开通该接口权限。 从2022年7月14日开始在代码审核环节将检测该接口是否已完成开通,如未开通,将在代码提审环节进行拦截。 +* +* **示例代码** +* +* ```js + wx.getFuzzyLocation({ + type: 'wgs84', + success (res) { + const latitude = res.latitude + const longitude = res.longitude + } +}) + ``` */ + 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` +* +* 在插件中使用:不支持 +* +* 获取微信群聊场景下的小程序启动信息。群聊场景包括群聊小程序消息卡片、群待办、群工具。可用于获取当前群的 opengid。 +* ## 注意事项 +* - 基础库 v2.10.4 开始支持获取群工具小程序启动信息 +* - 基础库 v2.17.3 开始支持获取群聊小程序消息卡片、群待办小程序启动信息 +* +* **示例代码** +* +* ```js +wx.getGroupEnterInfo({ + success(res) { + // res + { + errMsg: 'getGroupEnterInfo:ok', + encryptedData: '', + iv: '' + } + }, + fail() { + + } +}) +``` +* +* 敏感数据有两种获取方式,一是使用 [加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) 。 +* 获取得到的开放数据为以下 json 结构(其中 opengid 为当前群的唯一标识): +* +* ```json +{ + "opengid": "OPENGID" +} +``` +* +* **Tips** +* +* - 如需要展示群名称,小程序可以使用[开放数据组件](https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html) +* - 小游戏可以通过 `wx.getGroupInfo` 接口获取群名称 */ + 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` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 判断当前设备是否支持 HCE 能力。 +* +* **示例代码** +* +* ```js +wx.getHCEState({ + success (res) { + console.log(res.errCode) + } +}) +``` */ + getHCEState<T extends GetHCEStateOption = GetHCEStateOption>( + option?: T + ): PromisifySuccessResult<T, GetHCEStateOption>; + /** [wx.getImageInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.getImageInfo.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取图片信息。网络图片需先配置download域名才能生效。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/Kd47Sbmr6yYu) +* +* ```js +wx.getImageInfo({ + src: 'images/a.jpg', + success (res) { + console.log(res.width) + console.log(res.height) + } +}) + +wx.chooseImage({ + success (res) { + wx.getImageInfo({ + src: res.tempFilePaths[0], + success (res) { + console.log(res.width) + console.log(res.height) + } + }) + } +}) +``` */ + getImageInfo<T extends GetImageInfoOption = GetImageInfoOption>( + option: T + ): PromisifySuccessResult<T, GetImageInfoOption>; + /** [wx.getInferenceEnvInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/inference/wx.getInferenceEnvInfo.html) +* +* 需要基础库: `2.30.1` +* +* 在插件中使用:需要基础库 `2.30.1` +* +* 获取通用AI推理引擎版本。使用前可参考[AI指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/inference/tutorial.html) +* +* **示例代码** +* +* ```js +// 获取通用AI推理引擎版本 +wx.getInferenceEnvInfo({ + complete: (res) => { + console.log(res.ver) + console.log(res.errMsg) + }, +}) +``` */ + getInferenceEnvInfo(option?: GetInferenceEnvInfoOption): void; + /** [wx.getLocalIPAddress(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.getLocalIPAddress.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 获取局域网IP地址 +* +* **示例代码** +* +* ```js +wx.getLocalIPAddress({ + success (res) { + const localip = res.localip + } +}) +``` */ + getLocalIPAddress(option: GetLocalIPAddressOption): void; + /** [wx.getLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取当前的地理位置、速度。当用户离开小程序后,此接口无法调用。开启高精度定位,接口耗时会增加,可指定 highAccuracyExpireTime 作为超时时间。地图相关使用的坐标格式应为 gcj02。 +* 高频率调用会导致耗电,如有需要可使用持续定位接口 `wx.onLocationChange`。 +* 基础库 `2.17.0` 版本起 `wx.getLocation` 增加调用频率限制,[相关公告](https://developers.weixin.qq.com/community/develop/doc/000aee91a98d206bc6dbe722b51801)。 +* +* ## 使用方法 +* 自 2022 年 7 月 14 日后发布的小程序,若使用该接口,需要在 app.json 中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。[具体规则见公告](https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01) +* +* ## 申请开通 +* 暂只针对如下类目的小程序开放,需要先通过类目审核,再在小程序管理后台,「开发」-「开发管理」-「接口设置」中自助开通该接口权限。 +* 接口权限申请入口将于2022年3月11日开始内测,于3月31日全量上线。并从4月18日开始,在代码审核环节将检测该接口是否已完成开通,如未开通,将在代码提审环节进行拦截。 +* +* ### 国内主体开放类目 +* +* | 一级类目/主体类型 | 二级类目 | 应用场景 | +* | -------------- | -------| -------- | +* | 电商平台 | / | 售卖商品线下发货、线下收货服务 | +* | 商家自营 | / | 提供售卖商品线下发货、线下收货服务、线下商超导览、导航服务 | +* | 医疗服务 | 公立医疗机构、三级私立医疗机构、其他私立医疗机构、就医服务、其他医学健康服务、药品(非处方药)销售、非处方药销售平台、医疗器械生产企业、医疗器械自营、医疗器械经营销售平台、互联网医院血液、干细胞服务、临床试验 | 1、实际物品/药品接收服务 2、基于地理位置取号并现场报到、附近医院导航等服务 | +* | 交通服务 | / | 代驾服务、租车网点导航等相关服务 | +* | 生活服务 | / | 上门服务作业等线下场景 | +* | 物流服务 | 收件/派件、查件、邮政、装卸搬运、快递柜、货物运输 | 快递/货物收发服务 | +* | 餐饮服务 | 点餐平台、外卖平台、餐饮服务场所/餐饮服务管理企业 | 线下送餐服务 | +* | 工具 | 天气、信息查询、办公、设备管理 | 与地理位置相关的服务,比如潮汐查询、海拔查询、天气查询、智能穿戴、智能门禁、与地理位置相关的打卡服务等 | +* | 金融 | 银行、非金融机构自营小额贷款/融资担保/商业保理、保险 | 提供线下网点预约、基于地理位置取号并现场报到、附近网点导航等服务 | +* | 旅游 | 景区服务、住宿服务 | 提供景区导航、导览服务、酒店导航服务 | +* | 汽车服务 | 维修保养、汽车用品、汽车经销商/4S店、汽车厂商、汽车预售、二手车 | 提供汽车售卖、维保洗美服务、查找附近的维修点/洗车网点等导航服务 | +* | IT科技 | 基础电信运营商、电信业务代理商 | 提供运营商线下网点的预约、基于地理位置取号并现场报到、网点导航等服务 | +* | 房地产服务 | 物业管理、房屋中介、房屋装修 | 提供房地产开发商及物业公司门店导览导航服务 | +* | 政务民生 | / | 提供政务单位相关业务 | +* | 政府主体账号 | / | 提供政务单位相关业务 | +* +* ### 海外主体开放类目 +* +* | 一级类目/主体类型 | 二级类目 | 应用场景 | +* | -------------- | -------| -------- | +* | 出行与交通 | / | 代驾服务、租车网点导航等相关服务 | +* | 快递业与邮政 | / | 快递/货物收发服务 | +* | 餐饮 | / | 线下送餐服务 | +* | 电商平台 | / | 售卖商品线下发货、线下收货服务 | +* | 出行与交通 | / | 代驾服务、租车网点导航等相关服务 | +* | 跨境电商 | / | 提供售卖商品线下发货、收货服务、线下商超导览、导航服务 | +* | 本地服务 | 服装/鞋/箱包、玩具、家电/数码/手机、美妆/洗护、珠宝/饰品/眼镜/钟表、运动/户外/乐器、鲜花/园艺/工艺品、家居/家饰/家纺、办公/文具、机械/电子器件、酒、食品、百货、超市/便利店、宠物食品/用品 | 提供售卖商品线下发货、线下收货服务、线下商超导览、导航服务 | +* | 生活服务 | 家政、外送 | 上门服务作业等线下场景 | +* +* **示例代码** +* +* ```js + wx.getLocation({ + type: 'wgs84', + success (res) { + const latitude = res.latitude + const longitude = res.longitude + const speed = res.speed + const accuracy = res.accuracy + } +}) + ``` +* +* **注意** +* +* - `2.17.0 起 `wx.getLocation` 增加调用频率限制,[相关公告](https://developers.weixin.qq.com/community/develop/doc/000aee91a98d206bc6dbe722b51801) +* - 工具中定位模拟使用IP定位,可能会有一定误差。且工具目前仅支持 gcj02 坐标。 +* - 使用第三方服务进行逆地址解析时,请确认第三方服务默认的坐标系,正确进行坐标转换。 */ + getLocation<T extends GetLocationOption = GetLocationOption>( + option: T + ): PromisifySuccessResult<T, GetLocationOption>; + /** [wx.getNetworkType(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.getNetworkType.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取网络类型 +* +* **示例代码** +* +* ```js +wx.getNetworkType({ + success (res) { + const networkType = res.networkType + } +}) +``` */ + getNetworkType<T extends GetNetworkTypeOption = GetNetworkTypeOption>( + option?: T + ): PromisifySuccessResult<T, GetNetworkTypeOption>; + /** [wx.getPrivacySetting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/privacy/wx.getPrivacySetting.html) +* +* 需要基础库: `2.32.3` +* +* 在插件中使用:不支持 +* +* 查询隐私授权情况。隐私合规开发指南详情可见[《小程序隐私协议开发指南》](https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html) +* +* **示例代码** +* +* ```html +* // page.wxml +* <view wx:if="{{showPrivacy}}"> +* <view>隐私弹窗内容....</view> +* <button id="agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button> +* </view> +* ``` +* ```js +Page({ + data: { + showPrivacy: false + }, + onLoad() { + wx.getPrivacySetting({ + success: res => { + console.log(res) // 返回结果为: res = { needAuthorization: true/false, privacyContractName: '《xxx隐私保护指引》' } + if (res.needAuthorization) { + // 需要弹出隐私协议 + this.setData({ + showPrivacy: true + }) + } else { + // 用户已经同意过隐私协议,所以不需要再弹出隐私协议,也能调用隐私接口 + } + }, + fail: () => {}, + complete() => {} + }) + }, + handleAgreePrivacyAuthorization() { + // 用户同意隐私协议事件回调 + // 用户点击了同意,之后所有隐私接口和组件都可以调用了 + // wx.getUserProfile() + // wx.chooseMedia() + // wx.getClipboardData() + // wx.startRecord() + } +}) +``` +* +* **完整示例demo** +* +* demo1: 演示使用 `wx.getPrivacySetting` 和 `<button open-type="agreePrivacyAuthorization">` 在首页处理隐私弹窗逻辑 +* [https://developers.weixin.qq.com/s/gi71sGm67hK0](https://developers.weixin.qq.com/s/gi71sGm67hK0) +* +* demo2: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `<button open-type="agreePrivacyAuthorization">` 在多个页面处理隐私弹窗逻辑,同时演示了如何处理多个隐私接口同时调用。 +* [https://developers.weixin.qq.com/s/4X7yyGmQ7EKp](https://developers.weixin.qq.com/s/4X7yyGmQ7EKp) +* +* demo3: 演示 `wx.onNeedPrivacyAuthorization`、`wx.requirePrivacyAuthorize`、`<button open-type="agreePrivacyAuthorization">` 和 `<input type="nickname">` 组件如何结合使用 +* [https://developers.weixin.qq.com/s/jX7xWGmA7UKa](https://developers.weixin.qq.com/s/jX7xWGmA7UKa) +* +* demo4: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `<button open-type="agreePrivacyAuthorization">` 在多个 tabBar 页面处理隐私弹窗逻辑。 +* [https://developers.weixin.qq.com/s/g6BWZGmt7XK9](https://developers.weixin.qq.com/s/g6BWZGmt7XK9) */ + getPrivacySetting(option: GetPrivacySettingOption): void; + /** [wx.getRandomValues(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/crypto/wx.getRandomValues.html) +* +* 需要基础库: `2.15.0` +* +* 在插件中使用:不支持 +* +* 获取密码学安全随机数 +* +* **示例代码** +* +* ```js +wx.getRandomValues({ + length: 6 // 生成 6 个字节长度的随机数, + success: res => { + console.log(wx.arrayBufferToBase64(res.randomValues)) // 转换为 base64 字符串后打印 + } +}) +``` */ + getRandomValues<T extends GetRandomValuesOption = GetRandomValuesOption>( + option: T + ): PromisifySuccessResult<T, GetRandomValuesOption>; + /** [wx.getScreenBrightness(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenBrightness.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 获取屏幕亮度 + * + * **说明** + * + * - 若安卓系统设置中开启了自动调节亮度功能,则屏幕亮度会根据光线自动调整,该接口仅能获取自动调节亮度之前的值,而非实时的亮度值。 */ + getScreenBrightness< + T extends GetScreenBrightnessOption = GetScreenBrightnessOption + >( + option?: T + ): PromisifySuccessResult<T, GetScreenBrightnessOption>; + /** [wx.getScreenRecordingState(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.getScreenRecordingState.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 查询用户是否在录屏。 + * + * **示例代码** + * + * ```js + * wx.getScreenRecordingState({ + * success: function (res) { + * console.log(res.state) + * }, + * }) */ + getScreenRecordingState(option?: GetScreenRecordingStateOption): void; + /** [wx.getSelectedTextRange(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.getSelectedTextRange.html) +* +* 需要基础库: `2.7.0` +* +* 在插件中使用:不支持 +* +* 在input、textarea等focus之后,获取输入框的光标位置。注意:只有在focus的时候调用此接口才有效。 +* +* **示例代码** +* +* ```js +wx.getSelectedTextRange({ + complete: res => { + console.log('getSelectedTextRange res', res.start, res.end) + } +}) +``` */ + getSelectedTextRange< + T extends GetSelectedTextRangeOption = GetSelectedTextRangeOption + >( + option?: T + ): PromisifySuccessResult<T, GetSelectedTextRangeOption>; + /** [wx.getSetting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/wx.getSetting.html) +* +* 需要基础库: `1.2.0` +* +* 在插件中使用:需要基础库 `2.6.3` +* +* 在插件中使用时,接口有以下不同: +* - `withSubscriptions` 无效(插件暂无订阅消息) +* - 返回值中的 `authSetting` 字段中是插件的权限(如用户信息功能页授权) +* - [2.14.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起返回值中有 `miniprogramAuthSetting` 字段,内容等于当前小程序 `getSetting` 的结果(不含订阅状态) +* +* 获取用户的当前设置。**返回值中只会出现小程序已经向用户请求过的[权限](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)**。 +* +* **示例代码** +* +* ```js +wx.getSetting({ + success (res) { + console.log(res.authSetting) + // res.authSetting = { + // "scope.userInfo": true, + // "scope.userLocation": true + // } + } +}) +``` +* +* ```js +wx.getSetting({ + withSubscriptions: true, + success (res) { + console.log(res.authSetting) + // res.authSetting = { + // "scope.userInfo": true, + // "scope.userLocation": true + // } + console.log(res.subscriptionsSetting) + // res.subscriptionsSetting = { + // mainSwitch: true, // 订阅消息总开关 + // itemSettings: { // 每一项开关 + // SYS_MSG_TYPE_INTERACTIVE: 'accept', // 小游戏系统订阅消息 + // SYS_MSG_TYPE_RANK: 'accept' + // zun-LzcQyW-edafCVvzPkK4de2Rllr1fFpw2A_x0oXE: 'reject', // 普通一次性订阅消息 + // ke_OZC_66gZxALLcsuI7ilCJSP2OJ2vWo2ooUPpkWrw: 'ban', + // } + // } + } +}) +``` */ + getSetting<T extends GetSettingOption = GetSettingOption>( + option?: T + ): PromisifySuccessResult<T, GetSettingOption>; + /** [wx.getShareInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.getShareInfo.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 获取转发详细信息 +* +* **示例代码** +* +* 敏感数据获取方式 [加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) 。 +* 获取得到的开放数据为以下 json 结构(其中 openGId 为当前群的唯一标识): +* +* ```json +{ + "openGId": "OPENGID" +} +``` +* +* **Tips** +* +* - 如需要展示群名称,小程序可以使用 [开放数据组件](https://developers.weixin.qq.com/miniprogram/dev/component/open-data.html) +* - 小游戏可以通过 [`wx.getGroupInfo`](#) 接口获取群名称 */ + getShareInfo<T extends GetShareInfoOption = GetShareInfoOption>( + option: T + ): PromisifySuccessResult<T, GetShareInfoOption>; + /** [wx.getSkylineInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSkylineInfo.html) + * + * 需要基础库: `2.26.2` + * + * 在插件中使用:需要基础库 `2.26.2` + * + * 获取当前运行环境对于 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的支持情况 */ + getSkylineInfo(option?: GetSkylineInfoOption): void; + /** [wx.getStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorage.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 从本地缓存中异步获取指定 key 的内容。 +* +* **示例代码** +* +* ```js +wx.getStorage({ + key: 'key', + success (res) { + console.log(res.data) + } +}) +``` +* +* ```js +// 开启加密存储 +wx.setStorage({ + key: "key", + data: "value", + encrypt: true, // 若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true + success() { + wx.getStorage({ + key: "key", + encrypt: true, // 若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true + success(res) { + console.log(res.data) + } + }) + } +}) +``` */ + getStorage<T = any, U extends GetStorageOption<T> = GetStorageOption<T>>( + option: U + ): PromisifySuccessResult<U, GetStorageOption<T>>; + /** [wx.getStorageInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.getStorageInfo.html) +* +* 在插件中使用:不支持 +* +* 异步获取当前storage的相关信息。 +* +* **示例代码** +* +* ```js +wx.getStorageInfo({ + success (res) { + console.log(res.keys) + console.log(res.currentSize) + console.log(res.limitSize) + } +}) +``` +* +* ```js +try { + const res = wx.getStorageInfoSync() + console.log(res.keys) + console.log(res.currentSize) + console.log(res.limitSize) +} catch (e) { + // Do something when catch error +} +``` */ + getStorageInfo<T extends GetStorageInfoOption = GetStorageInfoOption>( + option?: T + ): PromisifySuccessResult<T, GetStorageInfoOption>; + /** [wx.getSystemInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfo.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 获取系统信息。**由于历史原因,wx.getSystemInfo 是异步的调用格式,但是是同步返回,需要异步获取系统信息请使用 [wx.getSystemInfoAsync](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoAsync.html)。** +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/WkUCgXmS7mqO) +* +* ```js +wx.getSystemInfo({ + success (res) { + console.log(res.model) + console.log(res.pixelRatio) + console.log(res.windowWidth) + console.log(res.windowHeight) + console.log(res.language) + console.log(res.version) + console.log(res.platform) + } +}) +``` +* +* ```js +try { + const res = wx.getSystemInfoSync() + console.log(res.model) + console.log(res.pixelRatio) + console.log(res.windowWidth) + console.log(res.windowHeight) + console.log(res.language) + console.log(res.version) + console.log(res.platform) +} catch (e) { + // Do something when catch error +} +``` */ + getSystemInfo<T extends GetSystemInfoOption = GetSystemInfoOption>( + option?: T + ): PromisifySuccessResult<T, GetSystemInfoOption>; + /** [wx.getSystemInfoAsync(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.getSystemInfoAsync.html) +* +* 需要基础库: `2.14.1` +* +* 在插件中使用:不支持 +* +* 异步获取系统信息。需要一定的微信客户端版本支持,在不支持的客户端上,会使用同步实现来返回。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/WkUCgXmS7mqO) +* +* ```js +wx.getSystemInfoAsync({ + success (res) { + console.log(res.model) + console.log(res.pixelRatio) + console.log(res.windowWidth) + console.log(res.windowHeight) + console.log(res.language) + console.log(res.version) + console.log(res.platform) + } +}) +``` */ + getSystemInfoAsync(option?: GetSystemInfoAsyncOption): void; + /** [wx.getUserInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html) +* +* 在插件中使用:需要基础库 `2.3.1` +* +* 在插件中使用时,需要在用户信息功能页中获得用户授权或满足一定条件后调用。否则将返回 fail。详见 [用户信息功能页](https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages/user-info.html) +* +* @warning **用户头像昵称获取规则已调整,参考 [用户信息接口调整说明](https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801)、[小程序用户头像昵称获取规则调整公告](https://developers.weixin.qq.com/community/develop/doc/00022c683e8a80b29bed2142b56c01)** +* +* 获取用户信息。 +* +* **示例代码** +* +* ```js +// 必须是在用户已经授权的情况下调用 +wx.getUserInfo({ + success: function(res) { + var userInfo = res.userInfo + var nickName = userInfo.nickName + var avatarUrl = userInfo.avatarUrl + var gender = userInfo.gender //性别 0:未知、1:男、2:女 + var province = userInfo.province + var city = userInfo.city + var country = userInfo.country + } +}) +``` +* +* 敏感数据有两种获取方式: +* 1. 使用 [加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) +* 2. 使用 [云调用直接获取开放数据](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#云调用直接获取开放数据) +* 获取得到的开放数据为以下 json 结构: +* +* ```json +{ + "openId": "OPENID", + "nickName": "NICKNAME", + "gender": GENDER, + "city": "CITY", + "province": "PROVINCE", + "country": "COUNTRY", + "avatarUrl": "AVATARURL", + "unionId": "UNIONID", + "watermark": { + "appid":"APPID", + "timestamp":TIMESTAMP + } +} +``` +* +* **小程序用户信息组件示例代码** +* +* ```html +* <!-- 如果只是展示用户头像昵称,可以使用 <open-data /> 组件 --> +* <open-data type="userAvatarUrl"></open-data> +* <open-data type="userNickName"></open-data> +* <!-- 需要使用 button 来授权登录 --> +* <button wx:if="{{canIUse}}" open-type="getUserInfo" bindgetuserinfo="bindGetUserInfo">授权登录</button> +* <view wx:else>请升级微信版本</view> +* ``` +* +* ```js +Page({ + data: { + canIUse: wx.canIUse('button.open-type.getUserInfo') + }, + onLoad: function() { + // 查看是否授权 + wx.getSetting({ + success (res){ + if (res.authSetting['scope.userInfo']) { + // 已经授权,可以直接调用 getUserInfo 获取头像昵称 + wx.getUserInfo({ + success: function(res) { + console.log(res.userInfo) + } + }) + } + } + }) + }, + bindGetUserInfo (e) { + console.log(e.detail.userInfo) + } +}) +``` */ + getUserInfo<T extends GetUserInfoOption = GetUserInfoOption>( + option: T + ): PromisifySuccessResult<T, GetUserInfoOption>; + /** [wx.getUserProfile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html) +* +* 需要基础库: `2.10.4` +* +* 在插件中使用:不支持 +* +* @warning **用户头像昵称获取规则已调整,参考 [小程序用户头像昵称获取规则调整公告](https://developers.weixin.qq.com/community/develop/doc/00022c683e8a80b29bed2142b56c01)** +* +* 获取用户信息。页面产生点击事件(例如 `button` 上 `bindtap` 的回调中)后才可调用,每次请求都会弹出授权窗口,用户同意后返回 `userInfo`。该接口用于替换 `wx.getUserInfo`,详见 [用户信息接口调整说明](https://developers.weixin.qq.com/community/develop/doc/000cacfa20ce88df04cb468bc52801?highLine=login)。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/tsJaq2mP7Mp4) +* +* **Bug & Tip** +* +* 1. `tip`:仅小程序中 `wx.getUserInfo` 接口进行调整,小游戏中不受影响; +* 2. `tip`:开发者工具中仅 2.10.4 及以上版本可访问 `wx.getUserProfile` 接口,在真机上可参考示例代码进行判断,无需根据版本号或者 `canIUse` 进行条件。 +* 3. `tip`:`wx.getUserProfile` 返回的加密数据中不包含 `openId` 和 `unionId` 字段。 +* 4. `bug`:开发者工具中 `2.10.4`~`2.16.1` 基础库版本通过 `<button open-type="getUserInfo">` 会返回真实数据,真机上此区间会按照公告返回匿名数据。 +* +* ```html +* <view class="container"> +* <view class="userinfo"> +* <block wx:if="{{!hasUserInfo}}"> +* <button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button> +* <button wx:else open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button> +* </block> +* <block wx:else> +* <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image> +* <text class="userinfo-nickname">{{userInfo.nickName}}</text> +* </block> +* </view> +* </view> +* ``` +* +* ```js +Page({ + data: { + userInfo: {}, + hasUserInfo: false, + canIUseGetUserProfile: false, + }, + onLoad() { + if (wx.getUserProfile) { + this.setData({ + canIUseGetUserProfile: true + }) + } + }, + getUserProfile(e) { + // 推荐使用wx.getUserProfile获取用户信息,开发者每次通过该接口获取用户个人信息均需用户确认 + // 开发者妥善保管用户快速填写的头像昵称,避免重复弹窗 + wx.getUserProfile({ + desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写 + success: (res) => { + this.setData({ + userInfo: res.userInfo, + hasUserInfo: true + }) + } + }) + }, + getUserInfo(e) { + // 不推荐使用getUserInfo获取用户信息,预计自2021年4月13日起,getUserInfo将不再弹出弹窗,并直接返回匿名的用户个人信息 + this.setData({ + userInfo: e.detail.userInfo, + hasUserInfo: true + }) + }, +}) +``` */ + getUserProfile<T extends GetUserProfileOption = GetUserProfileOption>( + option: T + ): PromisifySuccessResult<T, GetUserProfileOption>; + /** [wx.getVideoInfo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.getVideoInfo.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:支持 + * + * 获取视频详细信息。 */ + getVideoInfo<T extends GetVideoInfoOption = GetVideoInfoOption>( + option: T + ): PromisifySuccessResult<T, GetVideoInfoOption>; + /** [wx.getWeRunData(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/werun/wx.getWeRunData.html) +* +* 需要基础库: `1.2.0` +* +* 在插件中使用:不支持 +* +* 获取用户过去三十一天微信运动步数。需要先调用 [wx.login](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) 接口。步数信息会在用户主动进入小程序时更新。 +* +* **示例代码** +* +* ```js +wx.getWeRunData({ + success (res) { + // 拿 encryptedData 到开发者后台解密开放数据 + const encryptedData = res.encryptedData + // 或拿 cloudID 通过云调用直接获取开放数据 + const cloudID = res.cloudID + } +}) +``` +* +* **开放数据 JSON 结构** +* +* 敏感数据有两种获取方式,一是使用 [加密数据解密算法](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/signature.html#加密数据解密算法) 。 +* 获取得到的开放数据为以下 json 结构: +* +* ```json +{ + "stepInfoList": [ + { + "timestamp": 1445866601, + "step": 100 + }, + { + "timestamp": 1445876601, + "step": 120 + } + ] +} +``` +* +* stepInfoList 中,每一项结构如下: +* +* | 属性 | 类型 | 说明 | +* | --- | ---- | --- | +* | timestamp | number | 时间戳,表示数据对应的时间 | +* | step | number | 微信运动步数 | */ + getWeRunData<T extends GetWeRunDataOption = GetWeRunDataOption>( + option?: T + ): PromisifySuccessResult<T, GetWeRunDataOption>; + /** [wx.getWifiList(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.getWifiList.html) + * + * 需要基础库: `1.6.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 请求获取 Wi-Fi 列表。`wifiList` 数据会在 [onGetWifiList](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onGetWifiList.html) 注册的回调中返回。 **Android 调用前需要 [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html) scope.userLocation。** + * + * iOS 上将跳转到系统设置中的微信设置页,需要用户手动进入「无线局域网」设置页,并在系统扫描到设备后,小程序才能收到 onGetWifiList 回调。Android 不会跳转。 + * + * **注意** + * + * 因系统问题,本方法在 iOS 11.0 及 11.1 两个版本失效。但在 iOS 11.2 中已修复。 */ + getWifiList<T extends GetWifiListOption = GetWifiListOption>( + option?: T + ): PromisifySuccessResult<T, GetWifiListOption>; + /** [wx.hideHomeButton(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideHomeButton.html) + * + * 需要基础库: `2.8.3` + * + * 在插件中使用:不支持 + * + * 隐藏返回首页按钮。微信7.0.7版本起,当用户打开的小程序最底层页面是非首页时,默认展示“返回首页”按钮,开发者可在页面 onShow 中调用 hideHomeButton 进行隐藏。 */ + hideHomeButton<T extends HideHomeButtonOption = HideHomeButtonOption>( + option?: T + ): PromisifySuccessResult<T, HideHomeButtonOption>; + /** [wx.hideKeyboard(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.hideKeyboard.html) +* +* 需要基础库: `2.8.2` +* +* 在插件中使用:不支持 +* +* 在input、textarea等focus拉起键盘之后,手动调用此接口收起键盘 +* +* **示例代码** +* +* ```js +wx.hideKeyboard({ + complete: res => { + console.log('hideKeyboard res', res) + } +}) +``` */ + hideKeyboard<T extends HideKeyboardOption = HideKeyboardOption>( + option?: T + ): PromisifySuccessResult<T, HideKeyboardOption>; + /** [wx.hideLoading(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.hideLoading.html) + * + * 需要基础库: `1.1.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 隐藏 loading 提示框 */ + hideLoading<T extends HideLoadingOption = HideLoadingOption>( + option?: T + ): PromisifySuccessResult<T, HideLoadingOption>; + /** [wx.hideNavigationBarLoading(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.hideNavigationBarLoading.html) + * + * 在插件中使用:需要基础库 `2.1.0` + * + * 在插件中使用时,只能在当前插件的页面中调用 + * + * 在当前页面隐藏导航条加载动画 */ + hideNavigationBarLoading< + T extends HideNavigationBarLoadingOption = HideNavigationBarLoadingOption + >( + option?: T + ): PromisifySuccessResult<T, HideNavigationBarLoadingOption>; + /** [wx.hideShareMenu(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.hideShareMenu.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 隐藏当前页面的转发按钮 +* +* **** +* +* ## 注意事项 +* - "shareAppMessage"表示“发送给朋友”按钮,"shareTimeline"表示“分享到朋友圈”按钮 +* - 隐藏“发送给朋友”按钮时必须同时隐藏“分享到朋友圈”按钮,隐藏“分享到朋友圈”按钮时则允许不隐藏“发送给朋友”按钮 +* +* **示例代码** +* +* ```js +wx.hideShareMenu({ + menus: ['shareAppMessage', 'shareTimeline'] +}) +``` */ + hideShareMenu<T extends HideShareMenuOption = HideShareMenuOption>( + option?: T + ): PromisifySuccessResult<T, HideShareMenuOption>; + /** [wx.hideTabBar(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBar.html) + * + * 需要基础库: `1.9.0` + * + * 在插件中使用:不支持 + * + * 隐藏 tabBar */ + hideTabBar<T extends HideTabBarOption = HideTabBarOption>( + option: T + ): PromisifySuccessResult<T, HideTabBarOption>; + /** [wx.hideTabBarRedDot(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBarRedDot.html) + * + * 需要基础库: `1.9.0` + * + * 在插件中使用:不支持 + * + * 隐藏 tabBar 某一项的右上角的红点 */ + hideTabBarRedDot<T extends HideTabBarRedDotOption = HideTabBarRedDotOption>( + option: T + ): PromisifySuccessResult<T, HideTabBarRedDotOption>; + /** [wx.hideToast(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.hideToast.html) + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 隐藏消息提示框 */ + hideToast<T extends HideToastOption = HideToastOption>( + option?: T + ): PromisifySuccessResult<T, HideToastOption>; + /** [wx.initFaceDetect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/face/wx.initFaceDetect.html) + * + * 需要基础库: `2.18.0` + * + * 在插件中使用:需要基础库 `2.21.3` + * + * @warning **该接口已停止维护,推荐使用 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 代替** + * + * 初始化人脸检测。本接口不再维护,请使用 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 接口代替。详情参考[人脸检测指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/face.html) + * + * **** + * + * ### 特别说明 + * 若小程序人脸识别功能涉及采集、存储用户生物特征(如人脸照片或视频、身份证和手持身份证、身份证照和免冠照等),此类型服务需使用[微信原生人脸识别接口](https://developers.weixin.qq.com/community/develop/doc/000442d352c1202bd498ecb105c00d?highline=%E4%BA%BA%E8%84%B8%E6%A0%B8%E8%BA%AB)。 */ + initFaceDetect(option?: InitFaceDetectOption): void; + /** [wx.isBluetoothDevicePaired(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.isBluetoothDevicePaired.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:需要基础库 `2.19.1` + * + * 查询蓝牙设备是否配对,仅安卓支持。 */ + isBluetoothDevicePaired< + T extends IsBluetoothDevicePairedOption = IsBluetoothDevicePairedOption + >( + option: T + ): PromisifySuccessResult<T, IsBluetoothDevicePairedOption>; + /** [wx.join1v1Chat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.join1v1Chat.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:不支持 + * + * 加入(创建)双人通话。 */ + join1v1Chat(option: Join1v1ChatOption): void; + /** [wx.joinVoIPChat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.joinVoIPChat.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:需要基础库 `2.9.0` + * + * 加入 (创建) 实时语音通话,更多信息可见 [实时语音指南](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/voip-chat.html)。调用前需要用户授权 `scope.record`,若房间类型为视频房间需要用户授权 `scope.camera`。 */ + joinVoIPChat<T extends JoinVoIPChatOption = JoinVoIPChatOption>( + option: T + ): PromisifySuccessResult<T, JoinVoIPChatOption>; + /** [wx.loadFontFace(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/font/wx.loadFontFace.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 动态加载网络字体,文件地址需为下载类型。[2.10.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html)起支持全局生效,需在 `app.js` 中调用。 +* +* 注意: +* 1. 字体文件返回的 contet-type 参考 [font](https://www.iana.org/assignments/media-types/media-types.xhtml#font),格式不正确时会解析失败。 +* 2. 字体链接必须是https(ios不支持http) +* 3. 字体链接必须是同源下的,或开启了cors支持,小程序的域名是`servicewechat.com` +* 4. 工具里提示 Faild to load font可以忽略 +* 5. [2.10.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 以前仅在调用页面生效。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/b6Zrajm67R2x) +* ```js +wx.loadFontFace({ + family: 'Bitstream Vera Serif Bold', + source: 'url("https://sungd.github.io/Pacifico.ttf")', + success: console.log +}) +``` */ + loadFontFace<T extends LoadFontFaceOption = LoadFontFaceOption>( + option: T + ): PromisifySuccessResult<T, LoadFontFaceOption>; + /** [wx.login(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.login.html) +* +* 在插件中使用:需要基础库 `2.3.1` +* +* 在插件中使用时,需要在用户信息功能页中获得用户授权或满足一定条件后调用。否则将返回 fail。详见 [用户信息功能页](https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages/user-info.html) +* +* 调用接口获取登录凭证(code)。通过凭证进而换取用户登录态信息,包括用户在当前小程序的唯一标识(openid)、微信开放平台账号下的唯一标识(unionid,若当前小程序已绑定到微信开放平台账号)及本次登录的会话密钥(session_key)等。用户数据的加解密通讯需要依赖会话密钥完成。 +* +* **示例代码** +* +* ```js +wx.login({ + success (res) { + if (res.code) { + //发起网络请求 + wx.request({ + url: 'https://example.com/onLogin', + data: { + code: res.code + } + }) + } else { + console.log('登录失败!' + res.errMsg) + } + } +}) +``` */ + login<T extends LoginOption = LoginOption>( + option?: T + ): PromisifySuccessResult<T, LoginOption>; + /** [wx.makeBluetoothPair(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.makeBluetoothPair.html) + * + * 需要基础库: `2.12.0` + * + * 在插件中使用:需要基础库 `2.12.0` + * + * 蓝牙配对接口,仅安卓支持。 + * + * 通常情况下(需要指定 `pin` 码或者密码时)系统会接管配对流程,直接调用 [wx.createBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 即可。该接口只应当在开发者不想让用户手动输入 `pin` 码且真机验证确认可以正常生效情况下用。 */ + makeBluetoothPair< + T extends MakeBluetoothPairOption = MakeBluetoothPairOption + >( + option: T + ): PromisifySuccessResult<T, MakeBluetoothPairOption>; + /** [wx.makePhoneCall(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/phone/wx.makePhoneCall.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 拨打电话 +* +* **示例代码** +* +* ```js +wx.makePhoneCall({ + phoneNumber: '1340000' //仅为示例,并非真实的电话号码 +}) +``` */ + makePhoneCall<T extends MakePhoneCallOption = MakePhoneCallOption>( + option: T + ): PromisifySuccessResult<T, MakePhoneCallOption>; + /** [wx.navigateBack(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html) + * + * 在插件中使用:需要基础库 `2.1.0` + * + * 在插件中使用时,只能在当前插件的页面中调用 + * + * 关闭当前页面,返回上一页面或多级页面。可通过 [getCurrentPages](https://developers.weixin.qq.com/miniprogram/dev/reference/api/getCurrentPages.html) 获取当前的页面栈,决定需要返回几层。 */ + navigateBack<T extends NavigateBackOption = NavigateBackOption>( + option?: T + ): PromisifySuccessResult<T, NavigateBackOption>; + /** [wx.navigateBackMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.navigateBackMiniProgram.html) +* +* 需要基础库: `1.3.0` +* +* 在插件中使用:不支持 +* +* 返回到上一个小程序。只有在当前小程序是被其他小程序打开时可以调用成功 +* +* 注意:**微信客户端 iOS 6.5.9,Android 6.5.10 及以上版本支持** +* +* **示例代码** +* +* ```js +wx.navigateBackMiniProgram({ + extraData: { + foo: 'bar' + }, + success(res) { + // 返回成功 + } +}) +``` */ + navigateBackMiniProgram< + T extends NavigateBackMiniProgramOption = NavigateBackMiniProgramOption + >( + option: T + ): PromisifySuccessResult<T, NavigateBackMiniProgramOption>; + /** [wx.navigateTo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html) +* +* 在插件中使用:需要基础库 `2.2.2` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 保留当前页面,跳转到应用内的某个页面。但是不能跳到 tabbar 页面。使用 [wx.navigateBack](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateBack.html) 可以返回到原页面。小程序中页面栈最多十层。 +* +* **示例代码** +* +* ```js +wx.navigateTo({ + url: 'test?id=1', + events: { + // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 + acceptDataFromOpenedPage: function(data) { + console.log(data) + }, + someEvent: function(data) { + console.log(data) + } + ... + }, + success: function(res) { + // 通过eventChannel向被打开页面传送数据 + res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' }) + } +}) +``` +* +* ```javascript +//test.js +Page({ + onLoad: function(option){ + console.log(option.query) + const eventChannel = this.getOpenerEventChannel() + eventChannel.emit('acceptDataFromOpenedPage', {data: 'test'}); + eventChannel.emit('someEvent', {data: 'test'}); + // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 + eventChannel.on('acceptDataFromOpenerPage', function(data) { + console.log(data) + }) + } +}) +``` */ + navigateTo<T extends NavigateToOption = NavigateToOption>( + option: T + ): PromisifySuccessResult<T, NavigateToOption>; + /** [wx.navigateToMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.navigateToMiniProgram.html) +* +* 需要基础库: `1.3.0` +* +* 在插件中使用:需要基础库 `2.18.1` +* +* 打开另一个小程序 +* +* **使用限制** +* +* ##### 需要用户触发跳转 +* 从 2.3.0 版本开始,若用户未点击小程序页面任意位置,则开发者将无法调用此接口自动跳转至其他小程序。 +* ##### 需要用户确认跳转 +* 从 2.3.0 版本开始,在跳转至其他小程序前,将统一增加弹窗,询问是否跳转,用户确认后才可以跳转其他小程序。如果用户点击取消,则回调 `fail cancel`。 +* ##### 无需声明跳转名单,不限跳转数量(众测中) +* 1. 从2020年4月24日起,使用跳转其他小程序功能将无需在全局配置中声明跳转名单,调用此接口时将不再校验所跳转的 AppID 是否在 navigateToMiniProgramAppIdList 中。 +* 2. 从2020年4月24日起,跳转其他小程序将不再受数量限制,使用此功能时请注意遵守运营规范。 +* +* **运营规范** +* +* 平台将坚决打击小程序盒子等互推行为,使用此功能时请严格遵守[《微信小程序平台运营规范》](https://developers.weixin.qq.com/miniprogram/product/#_5-10-%E4%BA%92%E6%8E%A8%E8%A1%8C%E4%B8%BA),若发现小程序违反运营规范将被下架处理。 +* +* **关于调试** +* +* - 在开发者工具上调用此 API 并不会真实的跳转到另外的小程序,但是开发者工具会校验本次调用跳转是否成功。[详情](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#跳转小程序调试支持) +* - 开发者工具上支持被跳转的小程序处理接收参数的调试。[详情](https://developers.weixin.qq.com/miniprogram/dev/devtools/different.html#跳转小程序调试支持) +* +* **示例代码** +* +* ```js +wx.navigateToMiniProgram({ + appId: '', + path: 'page/index/index?id=123', + extraData: { + foo: 'bar' + }, + envVersion: 'develop', + success(res) { + // 打开成功 + } +}) +``` */ + navigateToMiniProgram< + T extends NavigateToMiniProgramOption = NavigateToMiniProgramOption + >( + option: T + ): PromisifySuccessResult<T, NavigateToMiniProgramOption>; + /** [wx.nextTick(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/custom-component/wx.nextTick.html) +* +* 需要基础库: `2.2.3` +* +* 在插件中使用:需要基础库 `2.7.1` +* +* 延迟一部分操作到下一个时间片再执行。(类似于 setTimeout) +* +* **说明** +* +* 因为自定义组件中的 setData 和 triggerEvent 等接口本身是同步的操作,当这几个接口被连续调用时,都是在一个同步流程中执行完的,因此若逻辑不当可能会导致出错。 +* +* 一个极端的案例:当父组件的 setData 引发了子组件的 triggerEvent,进而使得父组件又进行了一次 setData,期间有通过 wx:if 语句对子组件进行卸载,就有可能引发奇怪的错误,所以对于不需要在一个同步流程内完成的逻辑,可以使用此接口延迟到下一个时间片再执行。 +* +* **示例代码** +* +* ```js +Component({ + doSth() { + this.setData({ number: 1 }) // 直接在当前同步流程中执行 + + wx.nextTick(() => { + this.setData({ number: 3 }) // 在当前同步流程结束后,下一个时间片执行 + }) + + this.setData({ number: 2 }) // 直接在当前同步流程中执行 + } +}) +``` */ + nextTick(callback: (...args: any[]) => any): void; + /** [wx.notifyBLECharacteristicValueChange(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.notifyBLECharacteristicValueChange.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 启用蓝牙低功耗设备特征值变化时的 notify 功能,订阅特征。注意:必须设备的特征支持 notify 或者 indicate 才可以成功调用。 +* +* 另外,必须先启用 [wx.notifyBLECharacteristicValueChange](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.notifyBLECharacteristicValueChange.html) 才能监听到设备 `characteristicValueChange` 事件 +* +* **注意** +* +* - 订阅操作成功后需要设备主动更新特征的 value,才会触发 [wx.onBLECharacteristicValueChange](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.onBLECharacteristicValueChange.html) 回调。 +* - 安卓平台上,在本接口调用成功后立即调用 [wx.writeBLECharacteristicValue](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.writeBLECharacteristicValue.html) 接口,在部分机型上会发生 10008 系统错误 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.notifyBLECharacteristicValueChange({ + state: true, // 启用 notify 功能 + // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接 + deviceId, + // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取 + serviceId, + // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取 + characteristicId, + success (res) { + console.log('notifyBLECharacteristicValueChange success', res.errMsg) + } +}) +``` */ + notifyBLECharacteristicValueChange< + T extends + NotifyBLECharacteristicValueChangeOption = NotifyBLECharacteristicValueChangeOption + >( + option: T + ): PromisifySuccessResult<T, NotifyBLECharacteristicValueChangeOption>; + /** [wx.offAccelerometerChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.offAccelerometerChange.html) +* +* 需要基础库: `2.9.3` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除加速度数据事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onAccelerometerChange(listener) +wx.offAccelerometerChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offAccelerometerChange( + /** onAccelerometerChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffAccelerometerChangeCallback + ): void; + /** [wx.offApiCategoryChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.offApiCategoryChange.html) +* +* 需要基础库: `2.33.0` +* +* 在插件中使用:不支持 +* +* 移除 API 类别变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onApiCategoryChange(listener) +wx.offApiCategoryChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offApiCategoryChange( + /** onApiCategoryChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffApiCategoryChangeCallback + ): void; + /** [wx.offAppHide(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppHide.html) +* +* 需要基础库: `2.1.2` +* +* 在插件中使用:不支持 +* +* 移除小程序切后台事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onAppHide(listener) +wx.offAppHide(listener) // 需传入与监听时同一个的函数对象 +``` */ + offAppHide( + /** onAppHide 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffAppHideCallback + ): void; + /** [wx.offAppShow(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAppShow.html) +* +* 需要基础库: `2.1.2` +* +* 在插件中使用:不支持 +* +* 移除小程序切前台事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onAppShow(listener) +wx.offAppShow(listener) // 需传入与监听时同一个的函数对象 +``` */ + offAppShow( + /** onAppShow 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffAppShowCallback + ): void; + /** [wx.offAudioInterruptionBegin(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAudioInterruptionBegin.html) +* +* 需要基础库: `2.6.2` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 移除音频因为受到系统占用而被中断开始事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onAudioInterruptionBegin(listener) +wx.offAudioInterruptionBegin(listener) // 需传入与监听时同一个的函数对象 +``` */ + offAudioInterruptionBegin( + /** onAudioInterruptionBegin 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffAudioInterruptionBeginCallback + ): void; + /** [wx.offAudioInterruptionEnd(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offAudioInterruptionEnd.html) +* +* 需要基础库: `2.6.2` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 移除音频中断结束事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onAudioInterruptionEnd(listener) +wx.offAudioInterruptionEnd(listener) // 需传入与监听时同一个的函数对象 +``` */ + offAudioInterruptionEnd( + /** onAudioInterruptionEnd 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffAudioInterruptionEndCallback + ): void; + /** [wx.offBLECharacteristicValueChange()](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.offBLECharacteristicValueChange.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除蓝牙低功耗设备的特征值变化事件的全部监听函数 +* +* **示例代码** +* +* ```js +wx.offBLECharacteristicValueChange() +``` */ + offBLECharacteristicValueChange(): void; + /** [wx.offBLEConnectionStateChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.offBLEConnectionStateChange.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除蓝牙低功耗连接状态改变事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onBLEConnectionStateChange(listener) +wx.offBLEConnectionStateChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offBLEConnectionStateChange( + /** onBLEConnectionStateChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffBLEConnectionStateChangeCallback + ): void; + /** [wx.offBLEMTUChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.offBLEMTUChange.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.20.1` +* +* 移除蓝牙低功耗的最大传输单元变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onBLEMTUChange(listener) +wx.offBLEMTUChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offBLEMTUChange( + /** onBLEMTUChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffBLEMTUChangeCallback + ): void; + /** [wx.offBLEPeripheralConnectionStateChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/wx.offBLEPeripheralConnectionStateChanged.html) +* +* 需要基础库: `2.10.3` +* +* 在插件中使用:需要基础库 `2.22.1` +* +* 移除当前外围设备被连接或断开连接事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onBLEPeripheralConnectionStateChanged(listener) +wx.offBLEPeripheralConnectionStateChanged(listener) // 需传入与监听时同一个的函数对象 +``` */ + offBLEPeripheralConnectionStateChanged( + /** onBLEPeripheralConnectionStateChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffBLEPeripheralConnectionStateChangedCallback + ): void; + /** [wx.offBeaconServiceChange()](https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.offBeaconServiceChange.html) +* +* 需要基础库: `2.8.1` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除 Beacon 服务状态变化事件的全部监听函数 +* +* **示例代码** +* +* ```js +wx.offBeaconServiceChange() +``` */ + offBeaconServiceChange(): void; + /** [wx.offBeaconUpdate()](https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.offBeaconUpdate.html) +* +* 需要基础库: `2.8.1` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除 Beacon 设备更新事件的全部监听函数 +* +* **示例代码** +* +* ```js +wx.offBeaconUpdate() +``` */ + offBeaconUpdate(): void; + /** [wx.offBluetoothAdapterStateChange()](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.offBluetoothAdapterStateChange.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除蓝牙适配器状态变化事件的全部监听函数 +* +* **示例代码** +* +* ```js +wx.offBluetoothAdapterStateChange() +``` */ + offBluetoothAdapterStateChange(): void; + /** [wx.offBluetoothDeviceFound()](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.offBluetoothDeviceFound.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除搜索到新设备的事件的全部监听函数 +* +* **示例代码** +* +* ```js +wx.offBluetoothDeviceFound() +``` */ + offBluetoothDeviceFound(): void; + /** [wx.offCompassChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.offCompassChange.html) +* +* 需要基础库: `2.9.3` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除罗盘数据变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onCompassChange(listener) +wx.offCompassChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offCompassChange( + /** onCompassChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffCompassChangeCallback + ): void; + /** [wx.offCopyUrl()](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.offCopyUrl.html) + * + * 需要基础库: `2.14.3` + * + * 在插件中使用:不支持 + * + * 移除用户点击右上角菜单的「复制链接」按钮时触发的事件的全部监听函数 */ + offCopyUrl(): void; + /** [wx.offDeviceMotionChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.offDeviceMotionChange.html) +* +* 需要基础库: `2.9.3` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除设备方向变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onDeviceMotionChange(listener) +wx.offDeviceMotionChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offDeviceMotionChange( + /** onDeviceMotionChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffDeviceMotionChangeCallback + ): void; + /** [wx.offEmbeddedMiniProgramHeightChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.offEmbeddedMiniProgramHeightChange.html) +* +* 需要基础库: `2.33.0` +* +* 在插件中使用:不支持 +* +* 移除半屏小程序可视高度变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onEmbeddedMiniProgramHeightChange(listener) +wx.offEmbeddedMiniProgramHeightChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offEmbeddedMiniProgramHeightChange( + /** onEmbeddedMiniProgramHeightChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffEmbeddedMiniProgramHeightChangeCallback + ): void; + /** [wx.offError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offError.html) +* +* 需要基础库: `2.1.2` +* +* 在插件中使用:不支持 +* +* 移除小程序错误事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onError(listener) +wx.offError(listener) // 需传入与监听时同一个的函数对象 +``` */ + offError( + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: WxOffErrorCallback + ): void; + /** [wx.offGetWifiList(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offGetWifiList.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除获取到 Wi-Fi 列表数据事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onGetWifiList(listener) +wx.offGetWifiList(listener) // 需传入与监听时同一个的函数对象 +``` */ + offGetWifiList( + /** onGetWifiList 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffGetWifiListCallback + ): void; + /** [wx.offGyroscopeChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.offGyroscopeChange.html) +* +* 需要基础库: `2.9.3` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除陀螺仪数据变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onGyroscopeChange(listener) +wx.offGyroscopeChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offGyroscopeChange( + /** onGyroscopeChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffGyroscopeChangeCallback + ): void; + /** [wx.offHCEMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc-hce/wx.offHCEMessage.html) +* +* 需要基础库: `2.8.1` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除接收 NFC 设备消息事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onHCEMessage(listener) +wx.offHCEMessage(listener) // 需传入与监听时同一个的函数对象 +``` */ + offHCEMessage( + /** onHCEMessage 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffHCEMessageCallback + ): void; + /** [wx.offKeyboardHeightChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.offKeyboardHeightChange.html) +* +* 需要基础库: `2.9.2` +* +* 在插件中使用:不支持 +* +* 移除键盘高度变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onKeyboardHeightChange(listener) +wx.offKeyboardHeightChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offKeyboardHeightChange( + /** onKeyboardHeightChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffKeyboardHeightChangeCallback + ): void; + /** [wx.offLazyLoadError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offLazyLoadError.html) +* +* 需要基础库: `2.24.3` +* +* 在插件中使用:不支持 +* +* 移除小程序异步组件加载失败事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onLazyLoadError(listener) +wx.offLazyLoadError(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLazyLoadError( + /** onLazyLoadError 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLazyLoadErrorCallback + ): void; + /** [wx.offLocalServiceDiscoveryStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.offLocalServiceDiscoveryStop.html) +* +* 需要基础库: `2.4.0` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 移除 mDNS 服务停止搜索的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onLocalServiceDiscoveryStop(listener) +wx.offLocalServiceDiscoveryStop(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLocalServiceDiscoveryStop( + /** onLocalServiceDiscoveryStop 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLocalServiceDiscoveryStopCallback + ): void; + /** [wx.offLocalServiceFound(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.offLocalServiceFound.html) +* +* 需要基础库: `2.4.0` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 移除 mDNS 服务发现的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onLocalServiceFound(listener) +wx.offLocalServiceFound(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLocalServiceFound( + /** onLocalServiceFound 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLocalServiceFoundCallback + ): void; + /** [wx.offLocalServiceLost(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.offLocalServiceLost.html) +* +* 需要基础库: `2.4.0` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 移除 mDNS 服务离开的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onLocalServiceLost(listener) +wx.offLocalServiceLost(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLocalServiceLost( + /** onLocalServiceLost 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLocalServiceLostCallback + ): void; + /** [wx.offLocalServiceResolveFail(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.offLocalServiceResolveFail.html) +* +* 需要基础库: `2.4.0` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 移除 mDNS 服务解析失败的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onLocalServiceResolveFail(listener) +wx.offLocalServiceResolveFail(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLocalServiceResolveFail( + /** onLocalServiceResolveFail 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLocalServiceResolveFailCallback + ): void; + /** [wx.offLocationChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChange.html) +* +* 需要基础库: `2.8.1` +* +* 在插件中使用:不支持 +* +* 移除实时地理位置变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onLocationChange(listener) +wx.offLocationChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLocationChange( + /** onLocationChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLocationChangeCallback + ): void; + /** [wx.offLocationChangeError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.offLocationChangeError.html) +* +* 需要基础库: `2.19.5` +* +* 在插件中使用:不支持 +* +* 移除持续定位接口返回失败时触发。的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onLocationChangeError(listener) +wx.offLocationChangeError(listener) // 需传入与监听时同一个的函数对象 +``` */ + offLocationChangeError( + /** onLocationChangeError 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffLocationChangeErrorCallback + ): void; + /** [wx.offMemoryWarning(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/memory/wx.offMemoryWarning.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:不支持 +* +* 移除内存不足告警事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onMemoryWarning(listener) +wx.offMemoryWarning(listener) // 需传入与监听时同一个的函数对象 +``` */ + offMemoryWarning( + /** onMemoryWarning 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffMemoryWarningCallback + ): void; + /** [wx.offNetworkStatusChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkStatusChange.html) +* +* 需要基础库: `2.9.3` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除网络状态变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onNetworkStatusChange(listener) +wx.offNetworkStatusChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offNetworkStatusChange( + /** onNetworkStatusChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffNetworkStatusChangeCallback + ): void; + /** [wx.offNetworkWeakChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.offNetworkWeakChange.html) +* +* 需要基础库: `2.21.0` +* +* 在插件中使用:不支持 +* +* 移除弱网状态变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onNetworkWeakChange(listener) +wx.offNetworkWeakChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offNetworkWeakChange( + /** onNetworkWeakChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffNetworkWeakChangeCallback + ): void; + /** [wx.offPageNotFound(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offPageNotFound.html) +* +* 需要基础库: `2.1.2` +* +* 在插件中使用:不支持 +* +* 移除小程序要打开的页面不存在事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onPageNotFound(listener) +wx.offPageNotFound(listener) // 需传入与监听时同一个的函数对象 +``` */ + offPageNotFound( + /** onPageNotFound 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffPageNotFoundCallback + ): void; + /** [wx.offScreenRecordingStateChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offScreenRecordingStateChanged.html) +* +* 需要基础库: `2.24.0` +* +* 在插件中使用:不支持 +* +* 移除用户录屏事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onScreenRecordingStateChanged(listener) +wx.offScreenRecordingStateChanged(listener) // 需传入与监听时同一个的函数对象 +``` */ + offScreenRecordingStateChanged( + /** onScreenRecordingStateChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffScreenRecordingStateChangedCallback + ): void; + /** [wx.offThemeChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offThemeChange.html) +* +* 需要基础库: `2.11.0` +* +* 在插件中使用:不支持 +* +* 移除系统主题改变事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onThemeChange(listener) +wx.offThemeChange(listener) // 需传入与监听时同一个的函数对象 +``` */ + offThemeChange( + /** onThemeChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffThemeChangeCallback + ): void; + /** [wx.offUnhandledRejection(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.offUnhandledRejection.html) +* +* 需要基础库: `2.10.0` +* +* 在插件中使用:不支持 +* +* 移除未处理的 Promise 拒绝事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onUnhandledRejection(listener) +wx.offUnhandledRejection(listener) // 需传入与监听时同一个的函数对象 +``` */ + offUnhandledRejection( + /** onUnhandledRejection 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffUnhandledRejectionCallback + ): void; + /** [wx.offUserCaptureScreen(function callback)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.offUserCaptureScreen.html) + * + * 需要基础库: `2.9.3` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 在插件中使用时,只能在当前插件的页面中调用 + * + * 用户主动截屏事件。取消事件监听。 */ + offUserCaptureScreen( + /** 用户主动截屏事件的回调函数 */ + callback?: (...args: any[]) => any + ): void; + /** [wx.offVoIPChatInterrupted(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.offVoIPChatInterrupted.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除被动断开实时语音通话事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onVoIPChatInterrupted(listener) +wx.offVoIPChatInterrupted(listener) // 需传入与监听时同一个的函数对象 +``` */ + offVoIPChatInterrupted( + /** onVoIPChatInterrupted 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffVoIPChatInterruptedCallback + ): void; + /** [wx.offVoIPChatMembersChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.offVoIPChatMembersChanged.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除实时语音通话成员在线状态变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onVoIPChatMembersChanged(listener) +wx.offVoIPChatMembersChanged(listener) // 需传入与监听时同一个的函数对象 +``` */ + offVoIPChatMembersChanged( + /** onVoIPChatMembersChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffVoIPChatMembersChangedCallback + ): void; + /** [wx.offVoIPChatSpeakersChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.offVoIPChatSpeakersChanged.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除实时语音通话成员通话状态变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onVoIPChatSpeakersChanged(listener) +wx.offVoIPChatSpeakersChanged(listener) // 需传入与监听时同一个的函数对象 +``` */ + offVoIPChatSpeakersChanged( + /** onVoIPChatSpeakersChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffVoIPChatSpeakersChangedCallback + ): void; + /** [wx.offVoIPChatStateChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.offVoIPChatStateChanged.html) +* +* 需要基础库: `2.16.0` +* +* 在插件中使用:不支持 +* +* 移除房间状态变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onVoIPChatStateChanged(listener) +wx.offVoIPChatStateChanged(listener) // 需传入与监听时同一个的函数对象 +``` */ + offVoIPChatStateChanged( + /** onVoIPChatStateChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffVoIPChatStateChangedCallback + ): void; + /** [wx.offVoIPVideoMembersChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.offVoIPVideoMembersChanged.html) +* +* 需要基础库: `2.11.0` +* +* 在插件中使用:不支持 +* +* 移除实时语音通话成员视频状态变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onVoIPVideoMembersChanged(listener) +wx.offVoIPVideoMembersChanged(listener) // 需传入与监听时同一个的函数对象 +``` */ + offVoIPVideoMembersChanged( + /** onVoIPVideoMembersChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffVoIPVideoMembersChangedCallback + ): void; + /** [wx.offWifiConnected(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offWifiConnected.html) +* +* 需要基础库: `2.9.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 移除连接上 Wi-Fi 的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onWifiConnected(listener) +wx.offWifiConnected(listener) // 需传入与监听时同一个的函数对象 +``` */ + offWifiConnected( + /** onWifiConnected 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffWifiConnectedCallback + ): void; + /** [wx.offWifiConnectedWithPartialInfo(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.offWifiConnectedWithPartialInfo.html) +* +* 需要基础库: `2.22.0` +* +* 在插件中使用:需要基础库 `2.22.1` +* +* 移除连接上 Wi-Fi 的事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onWifiConnectedWithPartialInfo(listener) +wx.offWifiConnectedWithPartialInfo(listener) // 需传入与监听时同一个的函数对象 +``` */ + offWifiConnectedWithPartialInfo( + /** onWifiConnectedWithPartialInfo 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffWifiConnectedWithPartialInfoCallback + ): void; + /** [wx.offWindowResize(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/window/wx.offWindowResize.html) +* +* 需要基础库: `2.3.0` +* +* 在插件中使用:不支持 +* +* 移除窗口尺寸变化事件的监听函数 +* +* **示例代码** +* +* ```js +const listener = function (res) { console.log(res) } + +wx.onWindowResize(listener) +wx.offWindowResize(listener) // 需传入与监听时同一个的函数对象 +``` */ + offWindowResize( + /** onWindowResize 传入的监听函数。不传此参数则移除所有监听函数。 */ + listener?: OffWindowResizeCallback + ): void; + /** [wx.onAccelerometerChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.onAccelerometerChange.html) +* +* 在插件中使用:不支持 +* +* 监听加速度数据事件。频率根据 [wx.startAccelerometer()](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html) 的 interval 参数, 接口调用后会自动开始监听。 +* +* **示例代码** +* +* ```js +wx.onAccelerometerChange(callback) +``` */ + onAccelerometerChange( + /** 加速度数据事件的监听函数 */ + listener: OnAccelerometerChangeCallback + ): void; + /** [wx.onApiCategoryChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/life-cycle/wx.onApiCategoryChange.html) +* +* 需要基础库: `2.33.0` +* +* 在插件中使用:不支持 +* +* 监听 API 类别变化事件 +* +* **不同 apiCategory 场景下的 API 限制** +* +* `X` 表示 API 被限制无法使用;不在表格中的 API 不限制。 +* +* | | default | nativeFunctionalized | browseOnly | embedded | +* |-|-|-|-|-| +* |navigateToMiniProgram | | `X` | `X` | | +* |openSetting | | | `X` | | +* |<button open-type="share"> | | `X` | `X` | `X` | +* |<button open-type="feedback"> | | | `X` | | +* |<button open-type="open-setting">| | | `X` | | +* |openEmbeddedMiniProgram | | `X` | `X` | `X` | +* +* **示例代码** +* +* ```js +const func = function (res) { + console.log(res.apiCategory) +} +wx.onApiCategoryChange(func) +// 取消监听 +wx.offApiCategoryChange(func) +``` */ + onApiCategoryChange( + /** API 类别变化事件的监听函数 */ + listener: OnApiCategoryChangeCallback + ): void; + /** [wx.onAppHide(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppHide.html) + * + * 需要基础库: `2.1.2` + * + * 在插件中使用:不支持 + * + * 监听小程序切后台事件。该事件与 [`App.onHide`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onhide) 的回调时机一致。 */ + onAppHide( + /** 小程序切后台事件的监听函数 */ + listener: OnAppHideCallback + ): void; + /** [wx.onAppShow(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAppShow.html) + * + * 需要基础库: `2.1.2` + * + * 在插件中使用:不支持 + * + * 监听小程序切前台事件。该事件与 [`App.onShow`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onshowobject-object) 的回调参数一致。 + * + * **返回有效 referrerInfo 的场景** + * + * | 场景值 | 场景 | appId含义 | + * | ------ | ------------------------------- | ---------- | + * | 1020 | 公众号 profile 页相关小程序列表 | 来源公众号 | + * | 1035 | 公众号自定义菜单 | 来源公众号 | + * | 1036 | App 分享消息卡片 | 来源App | + * | 1037 | 小程序打开小程序 | 来源小程序 | + * | 1038 | 从另一个小程序返回 | 来源小程序 | + * | 1043 | 公众号模板消息 | 来源公众号 | + * + * **不同 apiCategory 场景下的 API 限制** + * + * `X` 表示 API 被限制无法使用;不在表格中的 API 不限制。 + * + * | | default | nativeFunctionalized | browseOnly | embedded | + * |-|-|-|-|-| + * |navigateToMiniProgram | | `X` | `X` | | + * |openSetting | | | `X` | | + * |<button open-type="share"> | | `X` | `X` | `X` | + * |<button open-type="feedback"> | | | `X` | | + * |<button open-type="open-setting">| | | `X` | | + * |openEmbeddedMiniProgram | | `X` | `X` | `X` | + * + * **注意** + * + * 部分版本在无`referrerInfo`的时候会返回 `undefined`,建议使用 `options.referrerInfo && options.referrerInfo.appId` 进行判断。 */ + onAppShow( + /** 小程序切前台事件的监听函数 */ + listener: OnAppShowCallback + ): void; + /** [wx.onAudioInterruptionBegin(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAudioInterruptionBegin.html) + * + * 需要基础库: `2.6.2` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 监听音频因为受到系统占用而被中断开始事件。以下场景会触发此事件:闹钟、电话、FaceTime 通话、微信语音聊天、微信视频聊天、有声广告开始播放、实名认证页面弹出等。此事件触发后,小程序内所有音频会暂停。 */ + onAudioInterruptionBegin( + /** 音频因为受到系统占用而被中断开始事件的监听函数 */ + listener: OnAudioInterruptionBeginCallback + ): void; + /** [wx.onAudioInterruptionEnd(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onAudioInterruptionEnd.html) + * + * 需要基础库: `2.6.2` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 监听音频中断结束事件。在收到 onAudioInterruptionBegin 事件之后,小程序内所有音频会暂停,收到此事件之后才可再次播放成功 */ + onAudioInterruptionEnd( + /** 音频中断结束事件的监听函数 */ + listener: OnAudioInterruptionEndCallback + ): void; + /** [wx.onBLECharacteristicValueChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.onBLECharacteristicValueChange.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 监听蓝牙低功耗设备的特征值变化事件。必须先调用 [wx.notifyBLECharacteristicValueChange](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.notifyBLECharacteristicValueChange.html) 接口才能接收到设备推送的 notification。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* +* ```js +// ArrayBuffer转16进制字符串示例 +function ab2hex(buffer) { + let hexArr = Array.prototype.map.call( + new Uint8Array(buffer), + function(bit) { + return ('00' + bit.toString(16)).slice(-2) + } + ) + return hexArr.join(''); +} +wx.onBLECharacteristicValueChange(function(res) { + console.log(`characteristic ${res.characteristicId} has changed, now is ${res.value}`) + console.log(ab2hex(res.value)) +}) +``` */ + onBLECharacteristicValueChange( + /** 蓝牙低功耗设备的特征值变化事件的监听函数 */ + listener: OnBLECharacteristicValueChangeCallback + ): void; + /** [wx.onBLEConnectionStateChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.onBLEConnectionStateChange.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 监听蓝牙低功耗连接状态改变事件。包括开发者主动连接或断开连接,设备丢失,连接异常断开等等 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.onBLEConnectionStateChange(function(res) { + // 该方法回调中可以用于处理连接意外断开等异常情况 + console.log(`device ${res.deviceId} state has changed, connected: ${res.connected}`) +}) +``` */ + onBLEConnectionStateChange( + /** 蓝牙低功耗连接状态改变事件的监听函数 */ + listener: OnBLEConnectionStateChangeCallback + ): void; + /** [wx.onBLEMTUChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.onBLEMTUChange.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.20.1` +* +* 监听蓝牙低功耗的最大传输单元变化事件(仅安卓触发)。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.onBLEMTUChange(function (res) { + console.log('bluetooth mtu is', res.mtu) +}) +``` */ + onBLEMTUChange( + /** 蓝牙低功耗的最大传输单元变化事件的监听函数 */ + listener: OnBLEMTUChangeCallback + ): void; + /** [wx.onBLEPeripheralConnectionStateChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/wx.onBLEPeripheralConnectionStateChanged.html) + * + * 需要基础库: `2.10.3` + * + * 在插件中使用:需要基础库 `2.22.1` + * + * 监听当前外围设备被连接或断开连接事件 */ + onBLEPeripheralConnectionStateChanged( + /** 当前外围设备被连接或断开连接事件的监听函数 */ + listener: OnBLEPeripheralConnectionStateChangedCallback + ): void; + /** [wx.onBackgroundAudioPause(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.onBackgroundAudioPause.html) + * + * 在插件中使用:不支持 + * @deprecated 基础库版本 [1.2.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 替换 + * + * 监听音乐暂停事件。 */ + onBackgroundAudioPause( + /** 音乐暂停事件的监听函数 */ + listener: OnBackgroundAudioPauseCallback + ): void; + /** [wx.onBackgroundAudioPlay(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.onBackgroundAudioPlay.html) + * + * 在插件中使用:不支持 + * @deprecated 基础库版本 [1.2.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 替换 + * + * 监听音乐播放事件。 */ + onBackgroundAudioPlay( + /** 音乐播放事件的监听函数 */ + listener: OnBackgroundAudioPlayCallback + ): void; + /** [wx.onBackgroundAudioStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.onBackgroundAudioStop.html) + * + * 在插件中使用:不支持 + * @deprecated 基础库版本 [1.2.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 替换 + * + * 监听音乐停止事件。 */ + onBackgroundAudioStop( + /** 音乐停止事件的监听函数 */ + listener: OnBackgroundAudioStopCallback + ): void; + /** [wx.onBackgroundFetchData(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/background-fetch/wx.onBackgroundFetchData.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 监听收到 backgroundFetch 数据事件。如果监听时请求已经完成,则事件不会触发。建议和 [wx.getBackgroundFetchData](https://developers.weixin.qq.com/miniprogram/dev/api/storage/background-fetch/wx.getBackgroundFetchData.html) 配合使用 */ + onBackgroundFetchData( + /** 收到 backgroundFetch 数据事件的监听函数 */ + listener: OnBackgroundFetchDataCallback + ): void; + /** [wx.onBeaconServiceChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.onBeaconServiceChange.html) +* +* 需要基础库: `1.2.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 监听 Beacon 服务状态变化事件,仅能注册一个监听 +* +* **示例代码** +* +* ```js +wx.onBeaconServiceChange(res => { + console.log(res.available, res.discovering) +}) +``` */ + onBeaconServiceChange( + /** Beacon 服务状态变化事件的监听函数 */ + listener: OnBeaconServiceChangeCallback + ): void; + /** [wx.onBeaconUpdate(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.onBeaconUpdate.html) +* +* 需要基础库: `1.2.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 监听 Beacon 设备更新事件,仅能注册一个监听 +* +* **示例代码** +* +* ```js +wx.onBeaconUpdate(res => { + console.log(res.beacons) +}) +``` */ + onBeaconUpdate( + /** Beacon 设备更新事件的监听函数 */ + listener: OnBeaconUpdateCallback + ): void; + /** [wx.onBluetoothAdapterStateChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.onBluetoothAdapterStateChange.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 监听蓝牙适配器状态变化事件 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.onBluetoothAdapterStateChange(function (res) { + console.log('adapterState changed, now is', res) +}) +``` */ + onBluetoothAdapterStateChange( + /** 蓝牙适配器状态变化事件的监听函数 */ + listener: OnBluetoothAdapterStateChangeCallback + ): void; + /** [wx.onBluetoothDeviceFound(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.onBluetoothDeviceFound.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 监听搜索到新设备的事件 +* +* **注意** +* +* - 若在 [wx.onBluetoothDeviceFound](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.onBluetoothDeviceFound.html) 回调了某个设备,则此设备会添加到 [wx.getBluetoothDevices](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.getBluetoothDevices.html) 接口获取到的数组中。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* +* ```js +// ArrayBuffer转16进度字符串示例 +function ab2hex(buffer) { + var hexArr = Array.prototype.map.call( + new Uint8Array(buffer), + function(bit) { + return ('00' + bit.toString(16)).slice(-2) + } + ) + return hexArr.join(''); +} +wx.onBluetoothDeviceFound(function(res) { + var devices = res.devices; + console.log('new device list has founded') + console.dir(devices) + console.log(ab2hex(devices[0].advertisData)) +}) +``` +* +* **注意** +* +* - 蓝牙设备在被搜索到时,系统返回的 `name` 字段一般为广播包中的 `LocalName` 字段中的设备名称,而如果与蓝牙设备建立连接,系统返回的 `name` 字段会改为从蓝牙设备上获取到的 `GattName`。若需要动态改变设备名称并展示,建议使用 `localName` 字段。 +* - 安卓下部分机型需要有位置权限才能搜索到设备,需留意是否开启了位置权限 */ + onBluetoothDeviceFound( + /** 搜索到新设备的事件的监听函数 */ + listener: OnBluetoothDeviceFoundCallback + ): void; + /** [wx.onCompassChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.onCompassChange.html) + * + * 在插件中使用:不支持 + * + * 监听罗盘数据变化事件。频率:5 次/秒,接口调用后会自动开始监听,可使用 wx.stopCompass 停止监听。 + * + * **accuracy 在 iOS/Android 的差异** + * + * 由于平台差异,accuracy 在 iOS/Android 的值不同。 + * + * - iOS:accuracy 是一个 number 类型的值,表示相对于磁北极的偏差。0 表示设备指向磁北,90 表示指向东,180 表示指向南,依此类推。 + * - Android:accuracy 是一个 string 类型的枚举值。 + * + * | 值 | 说明 | + * | --------------- | -------------------------------------------------------------------------------------- | + * | high | 高精度 | + * | medium | 中等精度 | + * | low | 低精度 | + * | no-contact | 不可信,传感器失去连接 | + * | unreliable | 不可信,原因未知 | + * | unknow ${value} | 未知的精度枚举值,即该 Android 系统此时返回的表示精度的 value 不是一个标准的精度枚举值 | */ + onCompassChange( + /** 罗盘数据变化事件的监听函数 */ + listener: OnCompassChangeCallback + ): void; + /** [wx.onCopyUrl(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.onCopyUrl.html) + * + * 需要基础库: `2.14.3` + * + * 在插件中使用:不支持 + * + * 监听用户点击右上角菜单的「复制链接」按钮时触发的事件。本接口为 Beta 版本,暂只在 Android 平台支持。 */ + onCopyUrl( + /** 用户点击右上角菜单的「复制链接」按钮时触发的事件的监听函数 */ + listener: OnCopyUrlCallback + ): void; + /** [wx.onDeviceMotionChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.onDeviceMotionChange.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:不支持 + * + * 监听设备方向变化事件。频率根据 [wx.startDeviceMotionListening()](https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.startDeviceMotionListening.html) 的 interval 参数。可以使用 [wx.stopDeviceMotionListening()](https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.stopDeviceMotionListening.html) 停止监听。 */ + onDeviceMotionChange( + /** 设备方向变化事件的监听函数 */ + listener: OnDeviceMotionChangeCallback + ): void; + /** [wx.onEmbeddedMiniProgramHeightChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.onEmbeddedMiniProgramHeightChange.html) +* +* 需要基础库: `2.33.0` +* +* 在插件中使用:不支持 +* +* 监听半屏小程序可视高度变化事件 +* +* **示例代码** +* +* ```js +const func = function (res) { + console.log(res.height) + console.log(res.initialHeight) +} +wx.onEmbeddedMiniProgramHeightChange(func) +// 取消监听 +wx.offEmbeddedMiniProgramHeightChange(func) +``` */ + onEmbeddedMiniProgramHeightChange( + /** 半屏小程序可视高度变化事件的监听函数 */ + listener: OnEmbeddedMiniProgramHeightChangeCallback + ): void; + /** [wx.onError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onError.html) + * + * 需要基础库: `2.1.2` + * + * 在插件中使用:不支持 + * + * 监听小程序错误事件。如脚本错误或 API 调用报错等。该事件与 [`App.onError`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onerrorstring-error) 的回调时机与参数一致。 */ + onError( + /** 小程序错误事件的监听函数 */ + listener: WxOnErrorCallback + ): void; + /** [wx.onGetWifiList(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onGetWifiList.html) + * + * 需要基础库: `1.6.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 监听获取到 Wi-Fi 列表数据事件 */ + onGetWifiList( + /** 获取到 Wi-Fi 列表数据事件的监听函数 */ + listener: OnGetWifiListCallback + ): void; + /** [wx.onGyroscopeChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.onGyroscopeChange.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 监听陀螺仪数据变化事件。频率根据 [wx.startGyroscope()](https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.startGyroscope.html) 的 interval 参数。可以使用 [wx.stopGyroscope()](https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.stopGyroscope.html) 停止监听。 */ + onGyroscopeChange( + /** 陀螺仪数据变化事件的监听函数 */ + listener: OnGyroscopeChangeCallback + ): void; + /** [wx.onHCEMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc-hce/wx.onHCEMessage.html) + * + * 需要基础库: `1.7.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 监听接收 NFC 设备消息事件。仅能注册一个监听 */ + onHCEMessage( + /** 接收 NFC 设备消息事件的监听函数 */ + listener: OnHCEMessageCallback + ): void; + /** [wx.onKeyboardHeightChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.onKeyboardHeightChange.html) +* +* 需要基础库: `2.7.0` +* +* 在插件中使用:不支持 +* +* 监听键盘高度变化事件 +* +* **示例代码** +* +* ```js +wx.onKeyboardHeightChange(res => { + console.log(res.height) +}) +``` */ + onKeyboardHeightChange( + /** 键盘高度变化事件的监听函数 */ + listener: OnKeyboardHeightChangeCallback + ): void; + /** [wx.onLazyLoadError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onLazyLoadError.html) + * + * 需要基础库: `2.24.3` + * + * 在插件中使用:不支持 + * + * 监听小程序异步组件加载失败事件。 + * + * **注意** + * + * - 加载异步组件通常需要下载分包,若分包下载超时,则会触发 errMsg 为 "loadSubpackage: timeout" 的回调,默认超时等待时间为 5 秒。 + * - 可以通过第二个参数指定超时时间(单位:ms),该设置全局有效,多次指定超时时间则覆盖前面。 + * - 分包确认下载失败时,会再次触发 errMsg 为 "loadSubpackage: fail" 的回调。 + * - 若在页面中使用该接口进行监听,请确保在必要时手动调用 offLazyLoadError 取消监听,以避免非预期的内存泄漏。 */ + onLazyLoadError( + /** 小程序异步组件加载失败事件的监听函数 */ + listener: OnLazyLoadErrorCallback + ): void; + /** [wx.onLocalServiceDiscoveryStop(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.onLocalServiceDiscoveryStop.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 监听 mDNS 服务停止搜索的事件 */ + onLocalServiceDiscoveryStop( + /** mDNS 服务停止搜索的事件的监听函数 */ + listener: OnLocalServiceDiscoveryStopCallback + ): void; + /** [wx.onLocalServiceFound(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.onLocalServiceFound.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 监听 mDNS 服务发现的事件 */ + onLocalServiceFound( + /** mDNS 服务发现的事件的监听函数 */ + listener: OnLocalServiceFoundCallback + ): void; + /** [wx.onLocalServiceLost(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.onLocalServiceLost.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 监听 mDNS 服务离开的事件 */ + onLocalServiceLost( + /** mDNS 服务离开的事件的监听函数 */ + listener: OnLocalServiceLostCallback + ): void; + /** [wx.onLocalServiceResolveFail(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.onLocalServiceResolveFail.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 监听 mDNS 服务解析失败的事件 */ + onLocalServiceResolveFail( + /** mDNS 服务解析失败的事件的监听函数 */ + listener: OnLocalServiceResolveFailCallback + ): void; + /** [wx.onLocationChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChange.html) +* +* 需要基础库: `2.8.1` +* +* 在插件中使用:不支持 +* +* 监听实时地理位置变化事件,需结合 [wx.startLocationUpdateBackground](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdateBackground.html)、[wx.startLocationUpdate](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdate.html)使用。 +* +* ## 使用方法 +* 自 2022 年 7 月 14 日后发布的小程序,若使用该接口,需要在 app.json 中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。[具体规则见公告](https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01) +* +* ## 申请开通 +* 暂只针对如下类目的小程序开放,需要先通过类目审核,再在小程序管理后台,「开发」-「开发管理」-「接口设置」中自助开通该接口权限。 +* 接口权限申请入口将于2022年3月11日开始内测,于3月31日全量上线。并从4月18日开始,在代码审核环节将检测该接口是否已完成开通,如未开通,将在代码提审环节进行拦截。 +* +* ### 国内主体开放类目 +* +* | 一级类目/主体类型 | 二级类目 | 应用场景 | +* | -------------- | -------| -------- | +* | 电商平台 | / | 售卖商品线下发货、收货、送货服务 | +* | 商家自营 | / | 提供售卖商品线下发货、收货、送货服务、线下商超导览、导航服务 | +* | 医疗服务 | 公立医疗机构、三级私立医疗机构、其他私立医疗机构、就医服务、其他医学健康服务、药品(非处方药)销售、非处方药销售平台、医疗器械生产企业、医疗器械自营、医疗器械经营销售平台、互联网医院血液、干细胞服务、临床试验 | 1、实际物品/药品接收服务 2、基于地理位置取号并现场报到、附近医院导航等服务 | +* | 交通服务 | / | 代驾服务、租车网点导航等相关服务 | +* | 生活服务 | / | 上门服务作业等线下场景 | +* | 物流服务 | 收件/派件、查件、邮政、装卸搬运、快递柜、货物运输 | 快递/货物收发服务 | +* | 餐饮服务 | 点餐平台、外卖平台 | 线下送餐服务 | +* | 工具 | 天气、信息查询 | 与地理位置相关的服务,比如潮汐查询、海拔查询、天气查询等 | +* | 金融 | 保险 | 提供线下网点预约、基于地理位置取号并现场报到、附近网点导航等服务 | +* | 旅游 | 景区服务 | 提供景区导航、导览服务 | +* | 政务民生 | / | 提供政务单位相关业务 | +* | 政府主体账号 | / | 提供政务单位相关业务 | +* +* ### 海外主体开放类目 +* | 一级类目/主体类型 | 二级类目 | 应用场景 | +* | -------------- | -------| -------- | +* | 出行与交通 | / | 代驾服务、租车网点导航等相关服务 | +* | 快递业与邮政 | / | 快递/货物收发服务 | +* | 餐饮 | / | 线下送餐服务 | +* | 电商平台 | / | 售卖商品线下发货、线下收货服务 | +* | 出行与交通 | / | 代驾服务、租车网点导航等相关服务 | +* | 跨境电商 | / | 提供售卖商品线下发货、收货服务、线下商超导览、导航服务 | +* | 本地服务 | 服装/鞋/箱包、玩具、家电/数码/手机、美妆/洗护、珠宝/饰品/眼镜/钟表、运动/户外/乐器、鲜花/园艺/工艺品、家居/家饰/家纺、办公/文具、机械/电子器件、酒、食品、百货/超市/便利店、宠物食品/用品 | 提供售卖商品线下发货、线下收货服务、线下商超导览、导航服务 | +* | 生活服务 | 家政、外送 | 上门服务作业等线下场景 | +* +* **示例代码** +* +* ```js + const _locationChangeFn = function(res) { + console.log('location change', res) + } + wx.onLocationChange(_locationChangeFn) + wx.offLocationChange(_locationChangeFn) +``` */ + onLocationChange( + /** 实时地理位置变化事件的监听函数 */ + listener: OnLocationChangeCallback + ): void; + /** [wx.onLocationChangeError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.onLocationChangeError.html) + * + * 需要基础库: `2.19.5` + * + * 在插件中使用:不支持 + * + * 监听持续定位接口返回失败时触发。 */ + onLocationChangeError( + /** 的监听函数 */ + listener: OnLocationChangeErrorCallback + ): void; + /** [wx.onMemoryWarning(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/memory/wx.onMemoryWarning.html) + * + * 需要基础库: `2.0.2` + * + * 在插件中使用:不支持 + * + * 监听内存不足告警事件。 + * + * 当 iOS/Android 向小程序进程发出内存警告时,触发该事件。触发该事件不意味小程序被杀,大部分情况下仅仅是告警,开发者可在收到通知后回收一些不必要资源避免进一步加剧内存紧张。 + * + * **示例代码** + * + * ```js + * wx.onMemoryWarning(function () { + * console.log('onMemoryWarningReceive') + * }) + * `` */ + onMemoryWarning( + /** 内存不足告警事件的监听函数 */ + listener: OnMemoryWarningCallback + ): void; + /** [wx.onNeedPrivacyAuthorization(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/privacy/wx.onNeedPrivacyAuthorization.html) +* +* 需要基础库: `2.32.3` +* +* 在插件中使用:不支持 +* +* 监听隐私接口需要用户授权事件。当需要用户进行隐私授权时会触发。触发该事件时,开发者需要弹出隐私协议说明,并在用户同意或拒绝授权后调用回调接口 resolve 进行上报。隐私合规开发指南详情可见[《小程序隐私协议开发指南》](https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html) +* +* **** +* +* ## 回调参数 +* +* ### function resolve +* +* resolve 是 onNeedPrivacyAuthorization 的回调参数,是一个接口函数, 调用 resolve 将上报用户的隐私授权状态并继续执行原隐私接口,例如:resolve({ buttonId:'disagree-btn', event:'agree' })。其中 buttonId 为隐私同意授权按钮的id,为确保用户有同意的操作,基础库在 resolve 被调用后,会去检查对应的同意按钮是否被点击过。 +* +* **** +* +* ## resolve 接口参数 +* +* | 属性 | 类型 | 是否必填 | 说明 | +* | ---- | ---- | ---- | ---- | +* | event | string | 是 | 用户操作类型 | +* | buttonId | string | 是 | 同意授权按钮的id (仅event=agree时必填) | +* +* ### event 合法值 +* +* | event | 说明 | +* | ---- | ---- | +* | exposureAuthorization | 自定义隐私弹窗曝光 | +* | agree | 用户同意隐私授权 | +* | disagree | 用户拒绝隐私授权 | +* +* **** +* +* ## 具体说明: +* +* - 1. 什么时候会触发 onNeedPrivacyAuthorization 事件? +* - 1. 调用隐私相关接口(比如 wx.getUserProfile、wx.getClipboardData)和组件(比如 `<button open-type="getPhoneNumber"></button>`),并且用户还未同意过隐私协议时 +* - 2. 调用 wx.requirePrivacyAuthorize 接口来模拟隐私接口调用,并且用户还未同意过隐私协议时 +* - 3. 如果用户已经同意过隐私协议,则不会再触发 onNeedPrivacyAuthorization 事件 +* - 2. 当触发 onNeedPrivacyAuthorization 事件时,触发该事件的隐私接口或组件会处于 pending 状态,等待用户授权后才会继续执行,此时开发者需要弹出自定义隐私弹窗,并在用户点击同意后调用回调接口 resolve 进行上报,上报后,触发该事件的隐私接口(比如 wx.getUserInfo、wx.getClipboardData)才会继续执行。 +* - 3. wx.onNeedPrivacyAuthorization 是覆盖式注册监听,若重复注册监听,则只有最后一次注册会生效。 +* +* **示例代码** +* +* ```html +* // page.wxml +* <view wx:if="{{showPrivacy}}"> +* <view>隐私弹窗内容....</view> +* <button id="agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button> +* </view> +* ``` +* ```js +// page.js +Page({ + data: { + showPrivacy: false + }, + onLoad() { + wx.onNeedPrivacyAuthorization(resolve => { + // 需要用户同意隐私授权时 + // 弹出开发者自定义的隐私授权弹窗 + this.setData({ + showPrivacy: true + }) + this.resolvePrivacyAuthorization = resolve + }) + + wx.getUserProfile({ + success: console.log, + fail: console.error + }) + }, + handleAgreePrivacyAuthorization() { + // 用户点击同意按钮后 + this.resolvePrivacyAuthorization({ buttonId: 'agree-btn', event: 'agree' }) + // 用户点击同意后,开发者调用 resolve({ buttonId: 'agree-btn', event: 'agree' }) 告知平台用户已经同意,参数传同意按钮的id。为确保用户有同意的操作,基础库在 resolve 被调用后,会去检查对应的同意按钮有没有被点击过。检查通过后,相关隐私接口会继续调用 + // 用户点击拒绝后,开发者调用 resolve({ event:'disagree' }) 告知平台用户已经拒绝 + } +}) +``` +* +* **完整示例demo** +* +* demo1: 演示使用 `wx.getPrivacySetting` 和 `<button open-type="agreePrivacyAuthorization">` 在首页处理隐私弹窗逻辑 +* [https://developers.weixin.qq.com/s/gi71sGm67hK0](https://developers.weixin.qq.com/s/gi71sGm67hK0) +* +* demo2: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `<button open-type="agreePrivacyAuthorization">` 在多个页面处理隐私弹窗逻辑,同时演示了如何处理多个隐私接口同时调用。 +* [https://developers.weixin.qq.com/s/4X7yyGmQ7EKp](https://developers.weixin.qq.com/s/4X7yyGmQ7EKp) +* +* demo3: 演示 `wx.onNeedPrivacyAuthorization`、`wx.requirePrivacyAuthorize`、`<button open-type="agreePrivacyAuthorization">` 和 `<input type="nickname">` 组件如何结合使用 +* [https://developers.weixin.qq.com/s/jX7xWGmA7UKa](https://developers.weixin.qq.com/s/jX7xWGmA7UKa) +* +* demo4: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `<button open-type="agreePrivacyAuthorization">` 在多个 tabBar 页面处理隐私弹窗逻辑。 +* [https://developers.weixin.qq.com/s/g6BWZGmt7XK9](https://developers.weixin.qq.com/s/g6BWZGmt7XK9) */ + onNeedPrivacyAuthorization( + /** 隐私接口需要用户授权事件的监听函数 */ + listener: OnNeedPrivacyAuthorizationCallback + ): void; + /** [wx.onNetworkStatusChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.onNetworkStatusChange.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:支持 +* +* 监听网络状态变化事件 +* +* **示例代码** +* +* ```js +wx.onNetworkStatusChange(function (res) { + console.log(res.isConnected) + console.log(res.networkType) +}) +``` */ + onNetworkStatusChange( + /** 网络状态变化事件的监听函数 */ + listener: OnNetworkStatusChangeCallback + ): void; + /** [wx.onNetworkWeakChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/network/wx.onNetworkWeakChange.html) +* +* 需要基础库: `2.21.0` +* +* 在插件中使用:不支持 +* +* 监听弱网状态变化事件 +* +* **示例代码** +* +* ```js +wx.onNetworkWeakChange(function (res) { + console.log(res.weakNet) + console.log(res.networkType) +}) +// 取消监听 +wx.offNetworkWeakChange() +``` */ + onNetworkWeakChange( + /** 弱网状态变化事件的监听函数 */ + listener: OnNetworkWeakChangeCallback + ): void; + /** [wx.onPageNotFound(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onPageNotFound.html) + * + * 需要基础库: `2.1.2` + * + * 在插件中使用:不支持 + * + * 监听小程序要打开的页面不存在事件。该事件与 [`App.onPageNotFound`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onpagenotfoundobject-object) 的回调时机一致。 + * + * **注意** + * + * - 开发者可以在回调中进行页面重定向,但必须在回调中**同步**处理,异步处理(例如 `setTimeout` 异步执行)无效。 + * - 若开发者没有调用 [wx.onPageNotFound](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onPageNotFound.html) 绑定监听,也没有声明 `App.onPageNotFound`,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。 + * - 如果回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再第二次回调。 */ + onPageNotFound( + /** 小程序要打开的页面不存在事件的监听函数 */ + listener: OnPageNotFoundCallback + ): void; + /** [wx.onScreenRecordingStateChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.onScreenRecordingStateChanged.html) + * + * 需要基础库: `2.24.0` + * + * 在插件中使用:不支持 + * + * 监听用户录屏事件。 */ + onScreenRecordingStateChanged( + /** 用户录屏事件的监听函数 */ + listener: OnScreenRecordingStateChangedCallback + ): void; + /** [wx.onSocketClose(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.onSocketClose.html) + * + * 在插件中使用:不支持 + * + * @warning **推荐使用 [SocketTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控,同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** + * + * 监听 WebSocket 连接关闭事件。 */ + onSocketClose( + /** WebSocket 连接关闭事件的监听函数 */ + listener: OnSocketCloseCallback + ): void; + /** [wx.onSocketError(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.onSocketError.html) + * + * 在插件中使用:不支持 + * + * @warning **推荐使用 [SocketTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控,同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** + * + * 监听 WebSocket 错误事件。 */ + onSocketError( + /** WebSocket 错误事件的监听函数 */ + listener: OnSocketErrorCallback + ): void; + /** [wx.onSocketMessage(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.onSocketMessage.html) + * + * 在插件中使用:不支持 + * + * @warning **推荐使用 [SocketTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控,同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** + * + * 监听 WebSocket 接收到服务器的消息事件。 */ + onSocketMessage( + /** WebSocket 接收到服务器的消息事件的监听函数 */ + listener: OnSocketMessageCallback + ): void; + /** [wx.onSocketOpen(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.onSocketOpen.html) + * + * 在插件中使用:不支持 + * + * @warning **推荐使用 [SocketTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控,同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** + * + * 监听 WebSocket 连接打开事件。 */ + onSocketOpen( + /** WebSocket 连接打开事件的监听函数 */ + listener: OnSocketOpenCallback + ): void; + /** [wx.onThemeChange(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onThemeChange.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 监听系统主题改变事件。该事件与 [`App.onThemeChange`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onThemeChange-Object-object) 的回调时机一致。 + * + * **注意** + * + * - 只有在全局配置"darkmode": true时才会触发此事件。 */ + onThemeChange( + /** 系统主题改变事件的监听函数 */ + listener: OnThemeChangeCallback + ): void; + /** [wx.onUnhandledRejection(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html) + * + * 需要基础库: `2.10.0` + * + * 在插件中使用:不支持 + * + * 监听未处理的 Promise 拒绝事件。该事件与 [`App.onUnhandledRejection`](https://developers.weixin.qq.com/miniprogram/dev/reference/api/App.html#onUnhandledRejection-Object-object) 的回调时机与参数一致。 + * + * **注意** + * + * - 所有的 unhandledRejection 都可以被这一监听捕获,但只有 Error 类型的才会在小程序后台触发报警。 */ + onUnhandledRejection( + /** 未处理的 Promise 拒绝事件的监听函数 */ + listener: OnUnhandledRejectionCallback + ): void; + /** [wx.onUserCaptureScreen(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.onUserCaptureScreen.html) +* +* 需要基础库: `1.4.0` +* +* 在插件中使用:不支持 +* +* 监听用户主动截屏事件。用户使用系统截屏按键截屏时触发,只能注册一个监听 +* +* **示例代码** +* +* ```js +wx.onUserCaptureScreen(function (res) { + console.log('用户截屏了') +}) +``` */ + onUserCaptureScreen( + /** 用户主动截屏事件的监听函数 */ + listener: OnUserCaptureScreenCallback + ): void; + /** [wx.onVoIPChatInterrupted(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.onVoIPChatInterrupted.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 监听被动断开实时语音通话事件。包括小游戏切入后端时断开 */ + onVoIPChatInterrupted( + /** 被动断开实时语音通话事件的监听函数 */ + listener: OnVoIPChatInterruptedCallback + ): void; + /** [wx.onVoIPChatMembersChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.onVoIPChatMembersChanged.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 监听实时语音通话成员在线状态变化事件。有成员加入/退出通话时触发回调 */ + onVoIPChatMembersChanged( + /** 实时语音通话成员在线状态变化事件的监听函数 */ + listener: OnVoIPChatMembersChangedCallback + ): void; + /** [wx.onVoIPChatSpeakersChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.onVoIPChatSpeakersChanged.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 监听实时语音通话成员通话状态变化事件。有成员开始/停止说话时触发回调 */ + onVoIPChatSpeakersChanged( + /** 实时语音通话成员通话状态变化事件的监听函数 */ + listener: OnVoIPChatSpeakersChangedCallback + ): void; + /** [wx.onVoIPChatStateChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.onVoIPChatStateChanged.html) + * + * 需要基础库: `2.16.0` + * + * 在插件中使用:不支持 + * + * 监听房间状态变化事件。 */ + onVoIPChatStateChanged( + /** 房间状态变化事件的监听函数 */ + listener: OnVoIPChatStateChangedCallback + ): void; + /** [wx.onVoIPVideoMembersChanged(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.onVoIPVideoMembersChanged.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:不支持 + * + * 监听实时语音通话成员视频状态变化事件。 */ + onVoIPVideoMembersChanged( + /** 实时语音通话成员视频状态变化事件的监听函数 */ + listener: OnVoIPVideoMembersChangedCallback + ): void; + /** [wx.onWifiConnected(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onWifiConnected.html) + * + * 需要基础库: `1.6.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 监听连接上 Wi-Fi 的事件 */ + onWifiConnected( + /** 连接上 Wi-Fi 的事件的监听函数 */ + listener: OnWifiConnectedCallback + ): void; + /** [wx.onWifiConnectedWithPartialInfo(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.onWifiConnectedWithPartialInfo.html) + * + * 需要基础库: `2.22.0` + * + * 在插件中使用:需要基础库 `2.22.1` + * + * 监听连接上 Wi-Fi 的事件 */ + onWifiConnectedWithPartialInfo( + /** 连接上 Wi-Fi 的事件的监听函数 */ + listener: OnWifiConnectedWithPartialInfoCallback + ): void; + /** [wx.onWindowResize(function listener)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/window/wx.onWindowResize.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:不支持 + * + * 监听窗口尺寸变化事件 */ + onWindowResize( + /** 窗口尺寸变化事件的监听函数 */ + listener: OnWindowResizeCallback + ): void; + /** [wx.openAppAuthorizeSetting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openAppAuthorizeSetting.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 跳转系统微信授权管理页 +* +* **示例代码** +* +* ```js +wx.openAppAuthorizeSetting({ + success (res) { + console.log(res) + } +}) +``` */ + openAppAuthorizeSetting< + T extends OpenAppAuthorizeSettingOption = OpenAppAuthorizeSettingOption + >( + option?: T + ): PromisifySuccessResult<T, OpenAppAuthorizeSettingOption>; + /** [wx.openBluetoothAdapter(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.openBluetoothAdapter.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 初始化蓝牙模块。iOS 上开启主机/从机(外围设备)模式时需分别调用一次,并指定对应的 `mode`。 +* +* **object.fail 回调函数返回的 state 参数(仅 iOS)** +* +* | 状态码 | 说明 | +* | ------ | ------ | +* | 0 | 未知 | +* | 1 | 重置中 | +* | 2 | 不支持 | +* | 3 | 未授权 | +* | 4 | 未开启 | +* +* **注意** +* +* - 其他蓝牙相关 API 必须在 [wx.openBluetoothAdapter](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.openBluetoothAdapter.html) 调用之后使用。否则 API 会返回错误(errCode=10000)。 +* - 在用户蓝牙开关未开启或者手机不支持蓝牙功能的情况下,调用 [wx.openBluetoothAdapter](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.openBluetoothAdapter.html) 会返回错误(errCode=10001),表示手机蓝牙功能不可用。此时小程序蓝牙模块已经初始化完成,可通过 [wx.onBluetoothAdapterStateChange](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.onBluetoothAdapterStateChange.html) 监听手机蓝牙状态的改变,也可以调用蓝牙模块的所有API。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.openBluetoothAdapter({ + success (res) { + console.log(res) + } +}) +``` */ + openBluetoothAdapter< + T extends OpenBluetoothAdapterOption = OpenBluetoothAdapterOption + >( + option?: T + ): PromisifySuccessResult<T, OpenBluetoothAdapterOption>; + /** [wx.openCard(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/card/wx.openCard.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:不支持 +* +* 查看微信卡包中的卡券。只有通过 [认证](https://developers.weixin.qq.com/miniprogram/product/renzheng.html) 的小程序或文化互动类目的小游戏才能使用。更多文档请参考 [微信卡券接口文档](https://mp.weixin.qq.com/cgi-bin/announce?action=getannouncement&key=1490190158&version=1&lang=zh_CN&platform=2)。 +* +* **示例代码** +* +* ```js +wx.openCard({ + cardList: [{ + cardId: '', + code: '' + }, { + cardId: '', + code: '' + }], + success (res) { } +}) +``` */ + openCard<T extends OpenCardOption = OpenCardOption>( + option: T + ): PromisifySuccessResult<T, OpenCardOption>; + /** [wx.openChannelsActivity(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsActivity.html) + * + * 需要基础库: `2.19.2` + * + * 在插件中使用:不支持 + * + * 打开视频号视频 */ + openChannelsActivity(option: OpenChannelsActivityOption): void; + /** [wx.openChannelsEvent(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsEvent.html) + * + * 需要基础库: `2.21.0` + * + * 在插件中使用:不支持 + * + * 打开视频号活动页 */ + openChannelsEvent(option: OpenChannelsEventOption): void; + /** [wx.openChannelsLive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsLive.html) + * + * 需要基础库: `2.15.0` + * + * 在插件中使用:不支持 + * + * 打开视频号直播 */ + openChannelsLive(option: OpenChannelsLiveOption): void; + /** [wx.openChannelsUserProfile(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.openChannelsUserProfile.html) + * + * 需要基础库: `2.21.2` + * + * 在插件中使用:不支持 + * + * 打开视频号主页 */ + openChannelsUserProfile(option: OpenChannelsUserProfileOption): void; + /** [wx.openCustomerServiceChat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/service-chat/wx.openCustomerServiceChat.html) +* +* 需要基础库: `2.19.0` +* +* 在插件中使用:不支持 +* +* 打开微信客服,页面产生点击事件(例如 button 上 bindtap 的回调中)后才可调用。了解更多信息,可以参考[微信客服介绍](https://work.weixin.qq.com/kf/)。 +* +* **示例代码** +* +* ```js +wx.openCustomerServiceChat({ + extInfo: {url: ''}, + corpId: '', + success(res) {} +}) +``` */ + openCustomerServiceChat(option: OpenCustomerServiceChatOption): void; + /** [wx.openDocument(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.openDocument.html) + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 新开页面打开文档。微信客户端 `7.0.12` 版本前默认显示右上角菜单按钮,之后的版本默认不显示,需主动传入 `showMenu`。 */ + openDocument<T extends OpenDocumentOption = OpenDocumentOption>( + option: T + ): PromisifySuccessResult<T, OpenDocumentOption>; + /** [wx.openEmbeddedMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.openEmbeddedMiniProgram.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:需要基础库 `2.26.2` + * + * 打开半屏小程序。接入指引请参考 [半屏小程序能力](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/openEmbeddedMiniProgram.html)。 */ + openEmbeddedMiniProgram< + T extends OpenEmbeddedMiniProgramOption = OpenEmbeddedMiniProgramOption + >( + option: T + ): PromisifySuccessResult<T, OpenEmbeddedMiniProgramOption>; + /** [wx.openLocation(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.openLocation.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 使用微信内置地图查看位置 +* +* **示例代码** +* +* ```js + wx.getLocation({ + type: 'gcj02', //返回可以用于wx.openLocation的经纬度 + success (res) { + const latitude = res.latitude + const longitude = res.longitude + wx.openLocation({ + latitude, + longitude, + scale: 18 + }) + } +}) + ``` */ + openLocation<T extends OpenLocationOption = OpenLocationOption>( + option: T + ): PromisifySuccessResult<T, OpenLocationOption>; + /** [wx.openPrivacyContract(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/privacy/wx.openPrivacyContract.html) +* +* 需要基础库: `2.32.3` +* +* 在插件中使用:不支持 +* +* 跳转至隐私协议页面。隐私合规开发指南详情可见[《小程序隐私协议开发指南》](https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html) +* +* **示例代码** +* +* ```js +wx.openPrivacyContract({ + success: () => {}, // 打开成功 + fail: () => {}, // 打开失败 + complete() => {} +}) +``` +* +* **完整示例demo** +* +* demo1: 演示使用 `wx.getPrivacySetting` 和 `<button open-type="agreePrivacyAuthorization">` 在首页处理隐私弹窗逻辑 +* [https://developers.weixin.qq.com/s/gi71sGm67hK0](https://developers.weixin.qq.com/s/gi71sGm67hK0) +* +* demo2: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `<button open-type="agreePrivacyAuthorization">` 在多个页面处理隐私弹窗逻辑,同时演示了如何处理多个隐私接口同时调用。 +* [https://developers.weixin.qq.com/s/4X7yyGmQ7EKp](https://developers.weixin.qq.com/s/4X7yyGmQ7EKp) +* +* demo3: 演示 `wx.onNeedPrivacyAuthorization`、`wx.requirePrivacyAuthorize`、`<button open-type="agreePrivacyAuthorization">` 和 `<input type="nickname">` 组件如何结合使用 +* [https://developers.weixin.qq.com/s/jX7xWGmA7UKa](https://developers.weixin.qq.com/s/jX7xWGmA7UKa) +* +* demo4: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `<button open-type="agreePrivacyAuthorization">` 在多个 tabBar 页面处理隐私弹窗逻辑。 +* [https://developers.weixin.qq.com/s/g6BWZGmt7XK9](https://developers.weixin.qq.com/s/g6BWZGmt7XK9) */ + openPrivacyContract(option: OpenPrivacyContractOption): void; + /** [wx.openSetting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/wx.openSetting.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.10.3` +* +* 调起客户端小程序设置界面,返回用户设置的操作结果。**设置界面只会出现小程序已经向用户请求过的[权限](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html)**。 +* +* **** +* +* - 注意:[2.3.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,用户发生点击行为后,才可以跳转打开设置页,管理授权信息。[详情](https://developers.weixin.qq.com/community/develop/doc/000cea2305cc5047af5733de751008) +* +* **示例代码** +* +* ```js +wx.openSetting({ + success (res) { + console.log(res.authSetting) + // res.authSetting = { + // "scope.userInfo": true, + // "scope.userLocation": true + // } + } +}) +``` */ + openSetting<T extends OpenSettingOption = OpenSettingOption>( + option?: T + ): PromisifySuccessResult<T, OpenSettingOption>; + /** [wx.openSingleStickerView(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/sticker/wx.openSingleStickerView.html) +* +* 需要基础库: `3.0.1` +* +* 在插件中使用:不支持 +* +* 打开单个表情 +* +* **示例代码** +* +* ```js +wx.openSingleStickerView({ + url: '', + success(res) {} +}) +``` */ + openSingleStickerView(option: OpenSingleStickerViewOption): void; + /** [wx.openStickerIPView(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/sticker/wx.openStickerIPView.html) +* +* 需要基础库: `3.0.1` +* +* 在插件中使用:不支持 +* +* 打开表情IP合辑 +* +* **示例代码** +* +* ```js +wx.openStickerIPView({ + url: '', + success(res) {} +}) +``` */ + openStickerIPView(option: OpenStickerIPViewOption): void; + /** [wx.openStickerSetView(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/sticker/wx.openStickerSetView.html) +* +* 需要基础库: `3.0.1` +* +* 在插件中使用:不支持 +* +* 打开表情专辑 +* +* **示例代码** +* +* ```js +wx.openStickerSetView({ + url: '', + success(res) {} +}) +``` */ + openStickerSetView(option: OpenStickerSetViewOption): void; + /** [wx.openSystemBluetoothSetting(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/system/wx.openSystemBluetoothSetting.html) +* +* 需要基础库: `2.20.1` +* +* 在插件中使用:需要基础库 `2.21.3` +* +* 跳转系统蓝牙设置页。仅支持安卓。 +* +* **示例代码** +* +* ```js +wx.openSystemBluetoothSetting({ + success (res) { + console.log(res) + } +}) +``` */ + openSystemBluetoothSetting< + T extends + OpenSystemBluetoothSettingOption = OpenSystemBluetoothSettingOption + >( + option?: T + ): PromisifySuccessResult<T, OpenSystemBluetoothSettingOption>; + /** [wx.openVideoEditor(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.openVideoEditor.html) + * + * 需要基础库: `2.12.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 打开视频编辑器 */ + openVideoEditor(option: OpenVideoEditorOption): void; + /** [wx.pageScrollTo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/wx.pageScrollTo.html) +* +* 需要基础库: `1.4.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 将页面滚动到目标位置,支持选择器和滚动距离两种方式定位 +* +* **selector 语法** +* +* selector类似于 CSS 的选择器,但仅支持下列语法。 +* +* + ID选择器:#the-id +* + class选择器(可以连续指定多个):.a-class.another-class +* + 子元素选择器:.the-parent > .the-child +* + 后代选择器:.the-ancestor .the-descendant +* + 跨自定义组件的后代选择器:.the-ancestor >>> .the-descendant +* + 多选择器的并集:#a-node, .some-other-nodes +* +* **示例代码** +* +* ```js +wx.pageScrollTo({ + scrollTop: 0, + duration: 300 +}) +``` */ + pageScrollTo<T extends PageScrollToOption = PageScrollToOption>( + option: T + ): PromisifySuccessResult<T, PageScrollToOption>; + /** [wx.pauseBackgroundAudio(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.pauseBackgroundAudio.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [1.2.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 替换 +* +* 暂停播放音乐。 +* +* **示例代码** +* +* ```js +wx.pauseBackgroundAudio() +``` */ + pauseBackgroundAudio< + T extends PauseBackgroundAudioOption = PauseBackgroundAudioOption + >( + option?: T + ): PromisifySuccessResult<T, PauseBackgroundAudioOption>; + /** [wx.pauseVoice(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.pauseVoice.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @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) 替换 +* +* 暂停正在播放的语音。再次调用 [wx.playVoice](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.playVoice.html) 播放同一个文件时,会从暂停处开始播放。如果想从头开始播放,需要先调用 [wx.stopVoice](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.stopVoice.html)。 +* +* **示例代码** +* +* ```js +wx.startRecord({ + success (res) { + const tempFilePath = res.tempFilePath + wx.playVoice({ + filePath: tempFilePath + }) + + setTimeout(() => { wx.pauseVoice() }, 5000) + } +}) +``` */ + pauseVoice<T extends PauseVoiceOption = PauseVoiceOption>( + option?: T + ): PromisifySuccessResult<T, PauseVoiceOption>; + /** [wx.playBackgroundAudio(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.playBackgroundAudio.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [1.2.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 替换 +* +* 使用后台播放器播放音乐。对于微信客户端来说,只能同时有一个后台音乐在播放。当用户离开小程序后,音乐将暂停播放;当用户在其他小程序占用了音乐播放器,原有小程序内的音乐将停止播放。 +* +* **示例代码** +* +* ```js +wx.playBackgroundAudio({ + dataUrl: '', + title: '', + coverImgUrl: '' +}) +``` */ + playBackgroundAudio< + T extends PlayBackgroundAudioOption = PlayBackgroundAudioOption + >( + option: T + ): PromisifySuccessResult<T, PlayBackgroundAudioOption>; + /** [wx.playVoice(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.playVoice.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @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) 替换 +* +* 开始播放语音。同时只允许一个语音文件正在播放,如果前一个语音文件还没播放完,将中断前一个语音播放。 +* +* **示例代码** +* +* ```js +wx.startRecord({ + success (res) { + const tempFilePath = res.tempFilePath + wx.playVoice({ + filePath: tempFilePath, + complete () { } + }) + } +}) +``` */ + playVoice<T extends PlayVoiceOption = PlayVoiceOption>( + option: T + ): PromisifySuccessResult<T, PlayVoiceOption>; + /** [wx.pluginLogin(Object args)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/wx.pluginLogin.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:需要基础库 `2.20.1` + * + * __该接口仅在小程序插件中可调用__,调用接口获得插件用户标志凭证(code)。插件可以此凭证换取用于识别用户的标识 openpid。用户不同、宿主小程序不同或插件不同的情况下,该标识均不相同,即当且仅当同一个用户在同一个宿主小程序中使用同一个插件时,openpid 才会相同。 */ + pluginLogin(args?: PluginLoginOption): void; + /** [wx.preloadAssets(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.preloadAssets.html) +* +* 需要基础库: `2.22.1` +* +* 在插件中使用:不支持 +* +* 为视图层预加载媒体资源文件, 目前支持:font,image +* +* **示例代码** +* +* ```js +wx.preloadAssets({ + data: [ + { + type: 'image', + src: imgUrl, + }, + ], + success(resp) { + console.log('preloadAssets success', resp) + }, + fail(err) { + console.log('preloadAssets fail', err) + }, +}) +``` +* +* **** +* +* - 开发过程中,可在开发者工具network面板查看预加载情况。 */ + preloadAssets(option: PreloadAssetsOption): void; + /** [wx.preloadSkylineView(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.preloadSkylineView.html) + * + * 需要基础库: `2.24.7` + * + * 在插件中使用:需要基础库 `2.24.7` + * + * 预加载下个页面所需要的 [Skyline](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 运行环境。 */ + preloadSkylineView(option?: PreloadSkylineViewOption): void; + /** [wx.preloadWebview(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.preloadWebview.html) + * + * 需要基础库: `2.15.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 预加载下个页面的 WebView。参见[预加载下个页面的时机](https://developers.weixin.qq.com/miniprogram/dev/framework/performance/tips/runtime_nav.html#_2-4-控制预加载下个页面的时机) */ + preloadWebview(option?: PreloadWebviewOption): void; + /** [wx.previewImage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.previewImage.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 在新页面中全屏预览图片。预览的过程中用户可以进行保存图片、发送给朋友等操作。 +* +* **支持长按识别的码** +* +* | 类型 | 说明 | 最低版本 | +* |------|------| -------| +* | 小程序码 | | +* | 微信个人码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | +* | 企业微信个人码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | +* | 普通群码 | 指仅包含微信用户的群,不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | +* | 互通群码 | 指既有微信用户也有企业微信用户的群,不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | +* | 公众号二维码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | +* +* **示例代码** +* +* ```js +wx.previewImage({ + current: '', // 当前显示图片的http链接 + urls: [] // 需要预览的图片http链接列表 +}) +``` */ + previewImage<T extends PreviewImageOption = PreviewImageOption>( + option: T + ): PromisifySuccessResult<T, PreviewImageOption>; + /** [wx.previewMedia(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.previewMedia.html) + * + * 需要基础库: `2.12.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 预览图片和视频。 + * + * **支持长按识别的码** + * + * | 类型 | 说明 | 最低版本 | + * |------|------| -------| + * | 小程序码 | | + * | 微信个人码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + * | 企业微信个人码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + * | 普通群码 | 指仅包含微信用户的群,不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + * | 互通群码 | 指既有微信用户也有企业微信用户的群,不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | + * | 公众号二维码 | 不支持小游戏 | [2.18.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) | */ + previewMedia<T extends PreviewMediaOption = PreviewMediaOption>( + option: T + ): PromisifySuccessResult<T, PreviewMediaOption>; + /** [wx.reLaunch(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.reLaunch.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.3.1` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 关闭所有页面,打开到应用内的某个页面 +* +* **示例代码** +* +* ```js +wx.reLaunch({ + url: 'test?id=1' +}) +``` +* +* ```html +* // test +* Page({ +* onLoad (option) { +* console.log(option.query) +* } +* }) +* ``` */ + reLaunch<T extends ReLaunchOption = ReLaunchOption>( + option: T + ): PromisifySuccessResult<T, ReLaunchOption>; + /** [wx.readBLECharacteristicValue(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.readBLECharacteristicValue.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 读取蓝牙低功耗设备特征值的二进制数据。注意:必须设备的特征支持 read 才可以成功调用。 +* +* **注意** +* +* - 并行调用多次会存在读失败的可能性。 +* - 接口读取到的信息需要在 [wx.onBLECharacteristicValueChange](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.onBLECharacteristicValueChange.html) 方法注册的回调中获取。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +// 必须在这里的回调才能获取 +wx.onBLECharacteristicValueChange(function(characteristic) { + console.log('characteristic value comed:', characteristic) +}) + +wx.readBLECharacteristicValue({ + // 这里的 deviceId 需要已经通过 createBLEConnection 与对应设备建立链接 + deviceId, + // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取 + serviceId, + // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取 + characteristicId, + success (res) { + console.log('readBLECharacteristicValue:', res.errCode) + } +}) +``` */ + readBLECharacteristicValue< + T extends + ReadBLECharacteristicValueOption = ReadBLECharacteristicValueOption + >( + option: T + ): PromisifySuccessResult<T, ReadBLECharacteristicValueOption>; + /** [wx.redirectTo(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.redirectTo.html) +* +* 在插件中使用:需要基础库 `2.2.2` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 关闭当前页面,跳转到应用内的某个页面。但是不允许跳转到 tabbar 页面。 +* +* **示例代码** +* +* ```js +wx.redirectTo({ + url: 'test?id=1' +}) +``` */ + redirectTo<T extends RedirectToOption = RedirectToOption>( + option: T + ): PromisifySuccessResult<T, RedirectToOption>; + /** [wx.removeStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.removeStorage.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 从本地缓存中移除指定 key。 +* +* **示例代码** +* +* ```js +wx.removeStorage({ + key: 'key', + success (res) { + console.log(res) + } +}) +``` +* +* ```js +try { + wx.removeStorageSync('key') +} catch (e) { + // Do something when catch error +} +``` */ + removeStorage<T extends RemoveStorageOption = RemoveStorageOption>( + option: T + ): PromisifySuccessResult<T, RemoveStorageOption>; + /** [wx.removeStorageSync(string key)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.removeStorageSync.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* [wx.removeStorage](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.removeStorage.html) 的同步版本 +* +* **示例代码** +* +* ```js +wx.removeStorage({ + key: 'key', + success (res) { + console.log(res) + } +}) +``` +* +* ```js +try { + wx.removeStorageSync('key') +} catch (e) { + // Do something when catch error +} +``` */ + removeStorageSync( + /** 本地缓存中指定的 key */ + key: string + ): void; + /** [wx.removeTabBarBadge(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.removeTabBarBadge.html) + * + * 需要基础库: `1.9.0` + * + * 在插件中使用:不支持 + * + * 移除 tabBar 某一项右上角的文本 */ + removeTabBarBadge< + T extends RemoveTabBarBadgeOption = RemoveTabBarBadgeOption + >( + option: T + ): PromisifySuccessResult<T, RemoveTabBarBadgeOption>; + /** [wx.reportAnalytics(string eventName, Object data)](https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.reportAnalytics.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 在插件中使用时,可以被正常调用,但目前不会进行统计展示 +* @deprecated 基础库版本 [2.31.1](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃 +* +* 自定义分析数据上报接口。使用前,需要在小程序管理后台自定义分析中新建事件,配置好事件名与字段。 +* +* **示例代码** +* +* ```js +wx.reportAnalytics('purchase', { + price: 120, + color: 'red' +}) +``` */ + reportAnalytics( + /** 事件名 */ + eventName: string, + /** 上报的自定义数据,key 为配置中的字段名,value 为上报的数据。 */ + data: IAnyObject + ): void; + /** [wx.reportEvent(string eventId, object data)](https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.reportEvent.html) + * + * 需要基础库: `2.14.4` + * + * 在插件中使用:不支持 + * + * 事件上报 */ + reportEvent( + /** 在 mp 实验系统中设置的事件英文名 */ + eventId: string, + /** 可被 JSON.stringify 的对象,将一起上报至系统 */ + data?: IAnyObject + ): void; + /** [wx.reportMonitor(string name, number value)](https://developers.weixin.qq.com/miniprogram/dev/api/data-analysis/wx.reportMonitor.html) +* +* 需要基础库: `2.0.1` +* +* 在插件中使用:不支持 +* +* 自定义业务数据监控上报接口。 +* +* **使用说明** +* +* 使用前,需要在「小程序管理后台-运维中心-性能监控-业务数据监控」中新建监控事件,配置监控描述与告警类型。每一个监控事件对应唯一的监控ID,开发者最多可以创建128个监控事件。 +* +* **示例代码** +* +* ```js +wx.reportMonitor('1', 1) +``` */ + reportMonitor( + /** 监控ID,在「小程序管理后台」新建数据指标后获得 */ + name: string, + /** 上报数值,经处理后会在「小程序管理后台」上展示每分钟的上报总量 */ + value: number + ): void; + /** [wx.reportPerformance(Number id, Number value, String|Array dimensions)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.reportPerformance.html) +* +* 需要基础库: `2.9.2` +* +* 在插件中使用:需要基础库 `2.9.3` +* +* 小程序测速上报。使用前,需要在小程序管理后台配置。 +* +* **示例代码** +* +* ```js +wx.reportPerformance(1101, 680) +wx.reportPerformance(1101, 680, 'custom') +``` */ + reportPerformance( + /** 指标 id */ + id: number, + /** 需要上报的数值 */ + value: number, + /** 自定义维度 (选填) */ + dimensions?: string | any[] + ): void; + /** [wx.requestDeviceVoIP(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/device-voip/wx.requestDeviceVoIP.html) +* +* 需要基础库: `2.27.3` +* +* 在插件中使用:不支持 +* +* 请求用户授权与设备(组)间进行音视频通话。 +* +* **示例代码** +* +* ```js +// 授权单台设备 +wx.requestDeviceVoIP({ + sn: 'xxxx', + snTicket: 'xxxxx', + modelId: 'xxx', + deviceName: 'xxx', + success(res) { + console.log(res) + }, + fail(res) { + console.log(res) + } +}) + +// 批量授权(授权设备组) +wx.requestDeviceVoIP({ + isGroup: true, + groupId: '设备组 ID', + success(res) { + console.log(res) + }, + fail(res) { + console.log(res) + } +}) +``` */ + requestDeviceVoIP(option: RequestDeviceVoIPOption): void; + /** [wx.requestOrderPayment(Object args)](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestOrderPayment.html) + * + * 需要基础库: `2.16.0` + * + * 在插件中使用:不支持 + * + * 仅接入了[自定义版交易组件](https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/Introduction2)的小程序需要使用,普通小程序可直接使用 [`wx.requestPayment`](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestPayment.html)。 + * + * **前置检查** + * + * 接入自定义版交易组件之后,若要发起微信支付,请先查询[需要校验的场景](https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/API/order/check_scene)。 + * 在需要校验的场景中,发起微信支付时,必须使用该接口,需要按照要求传入相关的[订单信息](https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent2/API/order/add_order)进行校验,校验通过后用户才可以完成当前订单的支付,非需要校验的场景则可以按照商家要求自行选择传入订单信息或不传入。 */ + requestOrderPayment< + T extends RequestOrderPaymentOption = RequestOrderPaymentOption + >( + args: T + ): PromisifySuccessResult<T, RequestOrderPaymentOption>; + /** [wx.requestPayment(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestPayment.html) +* +* 在插件中使用:不支持 +* +* 发起微信支付。调用前需在[小程序微信公众平台](https://mp.weixin.qq.com/) -功能-微信支付入口申请接入微信支付。了解更多信息,可以参考 [微信支付开发文档](https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pages/api.shtml): +* - [开发指引](https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter2_3.shtml) +* - [下单接口](https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter3_2.shtml) +* - [支付接口](https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/pay/transactions/chapter3_12.shtml) +* - 旧版本 (v2) +* - [开发指引](https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=7_3&index=1) +* - [支付接口](https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=7_7&index=3) +* +* 如果使用[云开发](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/basis/getting-started.html),则 `wx.requestPayment` 所需参数可以通过云开发微信支付统一下单接口免鉴权获取、并可免证书、免签名的安全调用微信支付服务端接口、及接收异步支付结果回调,详见[云开发微信支付](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/wechatpay/wechatpay.html)。 +* +* **示例代码** +* +* ```js +wx.requestPayment({ + timeStamp: '', + nonceStr: '', + package: '', + signType: 'MD5', + paySign: '', + success (res) { }, + fail (res) { } +}) +``` +* +* 注:如果服务端有使用云开发,可以通过云开发微信支付[统一下单](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/open/pay/CloudPay.unifiedOrder.html)接口免鉴权获取以上所需所有参数,示例: +* +* ```js +// 云函数代码 +const cloud = require('wx-server-sdk') +cloud.init({ + env: cloud.DYNAMIC_CURRENT_ENV +}) + +exports.main = async (event, context) => { + const res = await cloud.cloudPay.unifiedOrder({ + "body" : "小秋TIT店-超市", + "outTradeNo" : "1217752501201407033233368018", + "spbillCreateIp" : "127.0.0.1", + "subMchId" : "1900009231", + "totalFee" : 1, + "envId": "test-f0b102", + "functionName": "pay_cb" + }) + return res +} + +// 小程序代码 +wx.cloud.callFunction({ + name: '函数名', + data: { + // ... + }, + success: res => { + const payment = res.result.payment + wx.requestPayment({ + ...payment, + success (res) { + console.log('pay success', res) + }, + fail (err) { + console.error('pay fail', err) + } + }) + }, + fail: console.error, +}) +``` */ + requestPayment<T extends RequestPaymentOption = RequestPaymentOption>( + option: T + ): PromisifySuccessResult<T, RequestPaymentOption>; + /** [wx.requestPluginPayment(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestPluginPayment.html) +* +* 需要基础库: `2.22.1` +* +* 在插件中使用:需要基础库 `2.22.1` +* +* 插件中发起支付。 +* +* **Tip** +* +* 1. `tip`: 小程序与插件绑定在同一个open平台账号上且小程序与插件均为open账号的同主体/关联主体时,调用此接口将直接拉起支付收银台。 +* 1. `tip`: 这个接口本身可以在开发者工具中使用,但功能页的跳转目前不支持在开发者工具中调试,请在真机上测试。 +* 1. `tip`: 跳转支付功能页需要在 `app.json` 中配置 `"functionalPages": true` +* +* **示例代码** +* +* 具体用法及参数说明可参考 [插件支付文档](https://developers.weixin.qq.com/miniprogram/dev/framework/plugin/functional-pages/request-payment.html) +* ```js +wx.requestPluginPayment({ + version: 'release', + fee: 1, + paymentArgs: {}, + currencyType: 'CNY', + success (res) { }, + fail (res) { } +}) +``` */ + requestPluginPayment(option: RequestPluginPaymentOption): void; + /** [wx.requestSubscribeDeviceMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/subscribe-message/wx.requestSubscribeDeviceMessage.html) +* +* 需要基础库: `2.20.0` +* +* 在插件中使用:不支持 +* +* 订阅设备消息接口,调用后弹出授权框,用户同意后会允许开发者给用户发送订阅模版消息。当用户点击“允许”按钮时,模板消息会被添加到用户的小程序设置页,通过 wx.getSetting 接口可获取用户对相关模板消息的订阅状态。 +* +* **错误码** +* +* | errCode | errMsg | 说明 | +* | ------- | ------------------------------------------------------ | -------------------------------------------------------------- | +* | 10001 | TmplIds can't be empty | tmplIds 为空 | +* | 10004 | Invalid template id | tmplId 参数类型错误 | +* | 20001 | No template data return, verify the template id exist | tmplId 为空 | +* | 20003 | Templates count out of max bounds | tmplId 数量超过上限 | +* | 19720726 | check sn_ticket fail | snTicket 不合法 | +* | 19720727 | sn_ticket expire | snTicket 过期 | +* | 19720728 | err_not_found_tid | tmplId 不存在 | +* | 19720736 | template_id do not match model_id | modelId 类型与 tmplId 类型不符 | +* +* **示例代码** +* +* ```js +wx.requestSubscribeDeviceMessage({ + tmplIds: ['xxxxx'], + sn: 'xxxx', + snTicket: 'xxxxx', + modelId: 'xxx', + success(res) { + console.log(res) + }, + fail(res) { + console.log(res) + } +}) +``` */ + requestSubscribeDeviceMessage< + T extends + RequestSubscribeDeviceMessageOption = RequestSubscribeDeviceMessageOption + >( + option: T + ): PromisifySuccessResult<T, RequestSubscribeDeviceMessageOption>; + /** [wx.requestSubscribeMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/subscribe-message/wx.requestSubscribeMessage.html) +* +* 需要基础库: `2.4.4` +* +* 在插件中使用:不支持 +* +* 调起客户端小程序订阅消息界面,返回用户订阅消息的操作结果。当用户勾选了订阅面板中的“总是保持以上选择,不再询问”时,模板消息会被添加到用户的小程序设置页,通过 [wx.getSetting](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/wx.getSetting.html) 接口可获取用户对相关模板消息的订阅状态。 +* +* ## 注意事项 +* - 一次性模板 id 和永久模板 id 不可同时使用。 +* - 低版本基础库2.4.4~2.8.3 已支持订阅消息接口调用,仅支持传入一个一次性 tmplId / 永久 tmplId。 +* - [2.8.2](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,用户发生点击行为或者发起支付回调后,才可以调起订阅消息界面。 +* - [2.10.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,开发版和体验版小程序将禁止使用模板消息 formId。 +* - 一次授权调用里,每个tmplId对应的模板标题不能存在相同的,若出现相同的,只保留一个。 +* - [2.10.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 版本开始,支持订阅语音消息提醒,[详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/subscribe-message.html) +* +* **错误码** +* +* | errCode | errMsg | 说明 | +* | ------- | ------------------------------------------------------ | -------------------------------------------------------------- | +* | 10001 | TmplIds can't be empty | 参数传空了 | +* | 10002 | Request list fail | 网络问题,请求消息列表失败 | +* | 10003 | Request subscribe fail | 网络问题,订阅请求发送失败 | +* | 10004 | Invalid template id | 参数类型错误 | +* | 10005 | Cannot show subscribe message UI | 无法展示 UI,一般是小程序这个时候退后台了导致的 | +* | 20001 | No template data return, verify the template id exist | 没有模板数据,一般是模板 ID 不存在 或者和模板类型不对应 导致的 | +* | 20002 | Templates type must be same | 模板消息类型 既有一次性的又有永久的 | +* | 20003 | Templates count out of max bounds | 模板消息数量超过上限 | +* | 20004 | The main switch is switched off | 用户关闭了主开关,无法进行订阅 | +* | 20005 | This mini program was banned from subscribing messages | 小程序被禁封 | +* | 20013 | Reject DeviceMsg Template | 不允许通过该接口订阅设备消息 | +* +* **示例代码** +* +* ```js +wx.requestSubscribeMessage({ + tmplIds: [''], + success (res) { } +}) +``` */ + requestSubscribeMessage< + T extends RequestSubscribeMessageOption = RequestSubscribeMessageOption + >( + option: T + ): PromisifySuccessResult<T, RequestSubscribeMessageOption>; + /** [wx.requestVirtualPayment(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/payment/wx.requestVirtualPayment.html) +* +* 需要基础库: `2.27.3` +* +* 在插件中使用:不支持 +* +* 发起米大师虚拟支付 +* +* **** +* +* ## 注意事项: +* +* - 1. 目前只有 >= v2.27.3 的基础库支持该接口,后续将对更多低版本基础库支持该接口。因此建议开发者这样判断:当前用户的基础库版本 >= v2.27.3 时可以直接用 wx.requestVirtualPayment,小于 v2.27.3 时,用 wx.canIUse('requestVirtualPayment') 来判断接口是否可用。具体判断方法可参考示例代码。 +* +* **示例代码** +* +* ```js +function compareVersion(_v1, _v2) { + if (typeof _v1 !== 'string' || typeof _v2 !== 'string') return 0 + + const v1 = _v1.split('.') + const v2 = _v2.split('.') + const len = Math.max(v1.length, v2.length) + + while (v1.length < len) { + v1.push('0') + } + while (v2.length < len) { + v2.push('0') + } + + for (let i = 0; i < len; i++) { + const num1 = parseInt(v1[i], 10) + const num2 = parseInt(v2[i], 10) + + if (num1 > num2) { + return 1 + } else if (num1 < num2) { + return -1 + } + } + + return 0 +} + +const SDKVersion = wx.getSystemInfoSync().SDKVersion + +if (compareVersion(SDKVersion, '2.27.3') >= 0 || wx.canIUse('requestVirtualPayment')) { + wx.requestVirtualPayment({ + signData: JSON.stringify({ + offerId: '123', + buyQuantity: 1, + env: 0, + currencyType: 'CNY', + platform: 'android', + productId: 'testproductId', + goodsPrice: 10, + outTradeNo: 'xxxxxx', + attach: 'testdata', + }), + paySig: 'd0b8bbccbe109b11549bcfd6602b08711f46600965253a949cd6a2b895152f9d', + signature: 'd0b8bbccbe109b11549bcfd6602b08711f46600965253a949cd6a2b895152f9d', + mode: 'short_series_goods', + success(res) { + console.log('requestVirtualPayment success', res) + }, + fail({ errMsg, errCode }) { + console.error(errMsg, errCode) + }, + }) +} else { + console.log('当前用户的客户端版本不支持 wx.requestVirtualPayment') +} +``` */ + requestVirtualPayment(option: RequestVirtualPaymentOption): void; + /** [wx.requirePrivacyAuthorize(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/privacy/wx.requirePrivacyAuthorize.html) +* +* 需要基础库: `2.32.3` +* +* 在插件中使用:不支持 +* +* 模拟隐私接口调用,并触发隐私弹窗逻辑。隐私合规开发指南详情可见[《小程序隐私协议开发指南》](https://developers.weixin.qq.com/miniprogram/dev/framework/user-privacy/PrivacyAuthorize.html) +* +* **** +* +* ## 具体说明: +* +* 调用 wx.requirePrivacyAuthorize() 时: +* +* - 1. 如果用户之前已经同意过隐私授权,会立即返回success回调,不会触发 wx.onNeedPrivacyAuthorization 事件。 +* - 2. 如果用户之前没有授权过,并且开发者注册了 [wx.onNeedPrivacyAuthorization()](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/privacy/wx.onNeedPrivacyAuthorization.html) 事件监听,就会立即触发 wx.onNeedPrivacyAuthorization 事件,然后开发者在 onNeedPrivacyAuthorization 回调中弹出自定义隐私授权弹窗,用户点了同意后开发者调用 wx.onNeedPrivacyAuthorization 的回调接口 resolve({ event: 'agree', buttonId: 'agree-btn' }),会触发 requirePrivacyAuthorize 的 success 回调。开发者调用 wx.onNeedPrivacyAuthorization 的回调接口 resolve({ event: 'disagree' }) 的话,会触发 requirePrivacyAuthorize 的 fail 回调。 +* - 3. 基于上述特性,开发者可以在调用任何真实隐私接口之前调用 wx.requirePrivacyAuthorize 接口来模拟隐私接口调用,并触发隐私弹窗逻辑。 +* +* **示例代码** +* +* ```html +* // page.wxml +* <view wx:if="{{showPrivacy}}"> +* <view>隐私弹窗内容....</view> +* <button id="agree-btn" open-type="agreePrivacyAuthorization" bindagreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button> +* </view> +* ``` +* ```js +// page.js +Page({ + data: { + showPrivacy: false + }, + onLoad() { + wx.onNeedPrivacyAuthorization(resolve => { + // 需要用户同意隐私授权时 + // 弹出开发者自定义的隐私授权弹窗 + this.setData({ + showPrivacy: true + }) + this.resolvePrivacyAuthorization = resolve + }) + + wx.requirePrivacyAuthorize({ + success: () => { + // 用户同意授权 + // 继续小程序逻辑 + }, + fail: () => {}, // 用户拒绝授权 + complete: () => {} + }) + }, + handleAgreePrivacyAuthorization() { + // 用户点击同意按钮后 + this.resolvePrivacyAuthorization({ buttonId: 'agree-btn', event: 'agree' }) + } +}) +``` +* +* **完整示例demo** +* +* demo1: 演示使用 `wx.getPrivacySetting` 和 `<button open-type="agreePrivacyAuthorization">` 在首页处理隐私弹窗逻辑 +* [https://developers.weixin.qq.com/s/gi71sGm67hK0](https://developers.weixin.qq.com/s/gi71sGm67hK0) +* +* demo2: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `<button open-type="agreePrivacyAuthorization">` 在多个页面处理隐私弹窗逻辑,同时演示了如何处理多个隐私接口同时调用。 +* [https://developers.weixin.qq.com/s/4X7yyGmQ7EKp](https://developers.weixin.qq.com/s/4X7yyGmQ7EKp) +* +* demo3: 演示 `wx.onNeedPrivacyAuthorization`、`wx.requirePrivacyAuthorize`、`<button open-type="agreePrivacyAuthorization">` 和 `<input type="nickname">` 组件如何结合使用 +* [https://developers.weixin.qq.com/s/jX7xWGmA7UKa](https://developers.weixin.qq.com/s/jX7xWGmA7UKa) +* +* demo4: 演示使用 `wx.onNeedPrivacyAuthorization` 和 `<button open-type="agreePrivacyAuthorization">` 在多个 tabBar 页面处理隐私弹窗逻辑。 +* [https://developers.weixin.qq.com/s/g6BWZGmt7XK9](https://developers.weixin.qq.com/s/g6BWZGmt7XK9) */ + requirePrivacyAuthorize(option: RequirePrivacyAuthorizeOption): void; + /** [wx.reserveChannelsLive(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/channels/wx.reserveChannelsLive.html) + * + * 需要基础库: `2.19.0` + * + * 在插件中使用:不支持 + * + * 预约视频号直播 */ + reserveChannelsLive(option: ReserveChannelsLiveOption): void; + /** [wx.restartMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.restartMiniProgram.html) + * + * 需要基础库: `3.0.1` + * + * 在插件中使用:不支持 + * + * 重启当前小程序 */ + restartMiniProgram(option: RestartMiniProgramOption): void; + /** [wx.revokeBufferURL(string url)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.revokeBufferURL.html) + * + * 需要基础库: `2.14.0` + * + * 在插件中使用:不支持 + * + * 根据 URL 销毁存在内存中的数据 */ + revokeBufferURL( + /** 需要销毁的二进制数据 URL */ + url: string + ): void; + /** [wx.saveFileToDisk(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.saveFileToDisk.html) +* +* 需要基础库: `2.11.0` +* +* 在插件中使用:需要基础库 `2.15.0` +* +* 保存文件系统的文件到用户磁盘,仅在 PC 端支持 +* +* **示例代码** +* +* ```js +wx.saveFileToDisk({ + filePath: `${wx.env.USER_DATA_PATH}/hello.txt`, + success(res) { + console.log(res) + }, + fail(res) { + console.error(res) + } +}) +``` */ + saveFileToDisk(option: SaveFileToDiskOption): void; + /** [wx.saveImageToPhotosAlbum(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/image/wx.saveImageToPhotosAlbum.html) +* +* 需要基础库: `1.2.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 保存图片到系统相册。 +* +* **示例代码** +* +* ```js +wx.saveImageToPhotosAlbum({ + success(res) { } +}) +``` */ + saveImageToPhotosAlbum< + T extends SaveImageToPhotosAlbumOption = SaveImageToPhotosAlbumOption + >( + option: T + ): PromisifySuccessResult<T, SaveImageToPhotosAlbumOption>; + /** [wx.saveVideoToPhotosAlbum(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.saveVideoToPhotosAlbum.html) +* +* 需要基础库: `1.2.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 保存视频到系统相册。支持mp4视频格式。 +* +* **示例代码** +* +* ```js +wx.saveVideoToPhotosAlbum({ + filePath: 'wxfile://xxx', + success (res) { + console.log(res.errMsg) + } +}) +``` */ + saveVideoToPhotosAlbum< + T extends SaveVideoToPhotosAlbumOption = SaveVideoToPhotosAlbumOption + >( + option: T + ): PromisifySuccessResult<T, SaveVideoToPhotosAlbumOption>; + /** [wx.scanCode(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/scan/wx.scanCode.html) +* +* 需要基础库: `1.0.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 调起客户端扫码界面进行扫码 +* +* **示例代码** +* +* ```js +// 允许从相机和相册扫码 +wx.scanCode({ + success (res) { + console.log(res) + } +}) + +// 只允许从相机扫码 +wx.scanCode({ + onlyFromCamera: true, + success (res) { + console.log(res) + } +}) +``` */ + scanCode<T extends ScanCodeOption = ScanCodeOption>( + option: T + ): PromisifySuccessResult<T, ScanCodeOption>; + /** [wx.seekBackgroundAudio(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.seekBackgroundAudio.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [1.2.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 替换 +* +* 控制音乐播放进度。 +* +* **示例代码** +* +* ```js +wx.seekBackgroundAudio({ + position: 30 +}) +``` */ + seekBackgroundAudio< + T extends SeekBackgroundAudioOption = SeekBackgroundAudioOption + >( + option: T + ): PromisifySuccessResult<T, SeekBackgroundAudioOption>; + /** [wx.sendHCEMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc-hce/wx.sendHCEMessage.html) +* +* 需要基础库: `1.7.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 发送 NFC 消息。仅在安卓系统下有效。 +* +* **示例代码** +* +* ```js +const buffer = new ArrayBuffer(1) +const dataView = new DataView(buffer) +dataView.setUint8(0, 0) + +wx.startHCE({ + success (res) { + wx.onHCEMessage(function(res) { + if (res.messageType === 1) { + wx.sendHCEMessage({data: buffer}) + } + }) + } +}) +``` */ + sendHCEMessage<T extends SendHCEMessageOption = SendHCEMessageOption>( + option: T + ): PromisifySuccessResult<T, SendHCEMessageOption>; + /** [wx.sendSms(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/sms/wx.sendSms.html) + * + * 需要基础库: `2.25.0` + * + * 在插件中使用:不支持 + * + * 拉起手机发送短信界面。 */ + sendSms(option: SendSmsOption): void; + /** [wx.sendSocketMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/wx.sendSocketMessage.html) +* +* 在插件中使用:不支持 +* +* @warning **推荐使用 [SocketTask](https://developers.weixin.qq.com/miniprogram/dev/api/network/websocket/SocketTask.html) 的方式去管理 webSocket 链接,每一条链路的生命周期都更加可控,同时存在多个 webSocket 的链接的情况下使用 wx 前缀的方法可能会带来一些和预期不一致的情况。** +* +* 通过 WebSocket 连接发送数据。需要先 wx.connectSocket,并在 wx.onSocketOpen 回调之后才能发送。 +* +* **示例代码** +* +* ```js +let socketOpen = false +let socketMsgQueue = [] +wx.connectSocket({ + url: 'test.php' +}) + +wx.onSocketOpen(function(res) { + socketOpen = true + for (let i = 0; i < socketMsgQueue.length; i++){ + sendSocketMessage(socketMsgQueue[i]) + } + socketMsgQueue = [] +}) + +function sendSocketMessage(msg) { + if (socketOpen) { + wx.sendSocketMessage({ + data:msg + }) + } else { + socketMsgQueue.push(msg) + } +} +``` */ + sendSocketMessage< + T extends SendSocketMessageOption = SendSocketMessageOption + >( + option: T + ): PromisifySuccessResult<T, SendSocketMessageOption>; + /** [wx.setBLEMTU(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.setBLEMTU.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:需要基础库 `2.11.0` + * + * 协商设置蓝牙低功耗的最大传输单元 (Maximum Transmission Unit, MTU)。需在 [wx.createBLEConnection](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.createBLEConnection.html) 调用成功后调用。仅安卓系统 5.1 以上版本有效,iOS 因系统限制不支持。 */ + setBLEMTU<T extends SetBLEMTUOption = SetBLEMTUOption>( + option: T + ): PromisifySuccessResult<T, SetBLEMTUOption>; + /** [wx.setBackgroundColor(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/background/wx.setBackgroundColor.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:需要基础库 `2.4.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 动态设置窗口的背景色 +* +* **示例代码** +* +* ```js +wx.setBackgroundColor({ + backgroundColor: '#ffffff', // 窗口的背景色为白色 +}) + +wx.setBackgroundColor({ + backgroundColorTop: '#ffffff', // 顶部窗口的背景色为白色 + backgroundColorBottom: '#ffffff', // 底部窗口的背景色为白色 +}) +``` */ + setBackgroundColor< + T extends SetBackgroundColorOption = SetBackgroundColorOption + >( + option: T + ): PromisifySuccessResult<T, SetBackgroundColorOption>; + /** [wx.setBackgroundFetchToken(object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/background-fetch/wx.setBackgroundFetchToken.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 设置自定义登录态,在周期性拉取数据时带上,便于第三方服务器验证请求合法性 */ + setBackgroundFetchToken< + T extends SetBackgroundFetchTokenOption = SetBackgroundFetchTokenOption + >( + option: T + ): PromisifySuccessResult<T, SetBackgroundFetchTokenOption>; + /** [wx.setBackgroundTextStyle(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/background/wx.setBackgroundTextStyle.html) +* +* 需要基础库: `2.1.0` +* +* 在插件中使用:需要基础库 `2.4.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 动态设置下拉背景字体、loading 图的样式 +* +* **示例代码** +* +* ```js +wx.setBackgroundTextStyle({ + textStyle: 'dark' // 下拉背景字体、loading 图的样式为dark +}) +``` */ + setBackgroundTextStyle< + T extends SetBackgroundTextStyleOption = SetBackgroundTextStyleOption + >( + option: T + ): PromisifySuccessResult<T, SetBackgroundTextStyleOption>; + /** [wx.setClipboardData(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/clipboard/wx.setClipboardData.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 设置系统剪贴板的内容。调用成功后,会弹出 toast 提示"内容已复制",持续 1.5s +* +* **示例代码** +* +* ```js +wx.setClipboardData({ + data: 'data', + success (res) { + wx.getClipboardData({ + success (res) { + console.log(res.data) // data + } + }) + } +}) +``` */ + setClipboardData<T extends SetClipboardDataOption = SetClipboardDataOption>( + option: T + ): PromisifySuccessResult<T, SetClipboardDataOption>; + /** [wx.setEnable1v1Chat(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.setEnable1v1Chat.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:不支持 + * + * 开启双人通话。设置 `enable` 为 `false` 时,无法接听呼叫。 */ + setEnable1v1Chat(option: SetEnable1v1ChatOption): void; + /** [wx.setEnableDebug(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/debug/wx.setEnableDebug.html) +* +* 需要基础库: `1.4.0` +* +* 在插件中使用:不支持 +* +* 设置是否打开调试开关。此开关对正式版也能生效。 +* +* **示例代码** +* +* ```javascript +// 打开调试 +wx.setEnableDebug({ + enableDebug: true +}) + +// 关闭调试 +wx.setEnableDebug({ + enableDebug: false +}) +``` +* +* **Tips** +* +* - 在正式版打开调试还有一种方法,就是先在开发版或体验版打开调试,再切到正式版就能看到vConsole。 */ + setEnableDebug<T extends SetEnableDebugOption = SetEnableDebugOption>( + option: T + ): PromisifySuccessResult<T, SetEnableDebugOption>; + /** [wx.setInnerAudioOption(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.setInnerAudioOption.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:需要基础库 `2.10.0` + * + * 设置 [InnerAudioContext](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/InnerAudioContext.html) 的播放选项。设置之后对当前小程序全局生效。 + * + * **** + * + * ## 注意事项 + * - 为保证微信整体体验,speakerOn 为 true 时,客户端会忽略 mixWithOthers 参数的内容,强制与其它音频互斥 + * - 不支持在播放音频的过程中切换为扬声器播放,开发者如需切换可以先暂停当前播放的音频并记录下当前暂停的时间点,然后切换后重新从原来暂停的时间点开始播放音频 + * - 目前 wx.setInnerAudioOption 接口不兼容 wx.createWebAudioContext 接口,也不兼容 wx.createInnerAudioContext 开启 useWebAudioImplement 的情况,将在后续版本中支持 */ + setInnerAudioOption<T extends SetInnerAudioOption = SetInnerAudioOption>( + option: T + ): PromisifySuccessResult<T, SetInnerAudioOption>; + /** [wx.setKeepScreenOn(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setKeepScreenOn.html) +* +* 需要基础库: `1.4.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 设置是否保持常亮状态。仅在当前小程序生效,离开小程序后设置失效。 +* +* **示例代码** +* +* ```js +wx.setKeepScreenOn({ + keepScreenOn: true +}) +``` */ + setKeepScreenOn<T extends SetKeepScreenOnOption = SetKeepScreenOnOption>( + option: T + ): PromisifySuccessResult<T, SetKeepScreenOnOption>; + /** [wx.setNavigationBarColor(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.setNavigationBarColor.html) + * + * 需要基础库: `1.4.0` + * + * 在插件中使用:需要基础库 `2.1.0` + * + * 在插件中使用时,只能在当前插件的页面中调用 + * + * 设置页面导航条颜色 */ + setNavigationBarColor< + T extends SetNavigationBarColorOption = SetNavigationBarColorOption + >( + option: T + ): PromisifySuccessResult<T, SetNavigationBarColorOption>; + /** [wx.setNavigationBarTitle(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.setNavigationBarTitle.html) +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 动态设置当前页面的标题 +* +* **示例代码** +* +* ```js +wx.setNavigationBarTitle({ + title: '当前页面' +}) +``` */ + setNavigationBarTitle< + T extends SetNavigationBarTitleOption = SetNavigationBarTitleOption + >( + option: T + ): PromisifySuccessResult<T, SetNavigationBarTitleOption>; + /** [wx.setScreenBrightness(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setScreenBrightness.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 设置屏幕亮度 */ + setScreenBrightness< + T extends SetScreenBrightnessOption = SetScreenBrightnessOption + >( + option: T + ): PromisifySuccessResult<T, SetScreenBrightnessOption>; + /** [wx.setStorage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.setStorage.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 将数据存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。 +* +* **示例代码** +* +* ```js +wx.setStorage({ + key:"key", + data:"value" +}) +``` +* +* ```js +// 开启加密存储 +wx.setStorage({ + key: "key", + data: "value", + encrypt: true, // 若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true + success() { + wx.getStorage({ + key: "key", + encrypt: true, // 若开启加密存储,setStorage 和 getStorage 需要同时声明 encrypt 的值为 true + success(res) { + console.log(res.data) + } + }) + } +}) +``` */ + setStorage<T = any, U extends SetStorageOption<T> = SetStorageOption<T>>( + option: U + ): PromisifySuccessResult<U, SetStorageOption<T>>; + /** [wx.setStorageSync(string key, any data)](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.setStorageSync.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 将数据存储在本地缓存中指定的 key 中。会覆盖掉原来该 key 对应的内容。除非用户主动删除或因存储空间原因被系统清理,否则数据都一直可用。单个 key 允许存储的最大数据长度为 1MB,所有数据存储上限为 10MB。 +* +* **注意** +* +* storage 应只用来进行数据的持久化存储,不应用于运行时的数据传递或全局状态管理。启动过程中过多的同步读写存储,会显著影响启动耗时。 +* +* **示例代码** +* +* ```js +try { + wx.setStorageSync('key', 'value') +} catch (e) { } +``` */ + setStorageSync<T = any>( + /** 本地缓存中指定的 key */ + key: string, + /** 需要存储的内容。只支持原生类型、Date、及能够通过`JSON.stringify`序列化的对象。 */ + data: T + ): void; + /** [wx.setTabBarBadge(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.setTabBarBadge.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:不支持 +* +* 为 tabBar 某一项的右上角添加文本 +* +* **示例代码** +* +* ```js +wx.setTabBarBadge({ + index: 0, + text: '1' +}) +``` */ + setTabBarBadge<T extends SetTabBarBadgeOption = SetTabBarBadgeOption>( + option: T + ): PromisifySuccessResult<T, SetTabBarBadgeOption>; + /** [wx.setTabBarItem(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.setTabBarItem.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:不支持 +* +* 动态设置 tabBar 某一项的内容,`2.7.0` 起图片支持临时文件和网络文件。 +* +* **示例代码** +* +* ```js +wx.setTabBarItem({ + index: 0, + text: 'text', + iconPath: '/path/to/iconPath', + selectedIconPath: '/path/to/selectedIconPath' +}) +``` */ + setTabBarItem<T extends SetTabBarItemOption = SetTabBarItemOption>( + option: T + ): PromisifySuccessResult<T, SetTabBarItemOption>; + /** [wx.setTabBarStyle(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.setTabBarStyle.html) +* +* 需要基础库: `1.9.0` +* +* 在插件中使用:不支持 +* +* 动态设置 tabBar 的整体样式 +* +* **示例代码** +* +* ```js +wx.setTabBarStyle({ + color: '#FF0000', + selectedColor: '#00FF00', + backgroundColor: '#0000FF', + borderStyle: 'white' +}) +``` */ + setTabBarStyle<T extends SetTabBarStyleOption = SetTabBarStyleOption>( + option?: T + ): PromisifySuccessResult<T, SetTabBarStyleOption>; + /** [wx.setTopBarText(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/sticky/wx.setTopBarText.html) +* +* 需要基础库: `1.4.3` +* +* 在插件中使用:不支持 +* @deprecated 基础库版本 [1.9.9](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃 +* +* 动态设置置顶栏文字内容。只有当前小程序被置顶时能生效,如果当前小程序没有被置顶,也能调用成功,但是不会立即生效,只有在用户将这个小程序置顶后才换上设置的文字内容. +* +* **示例代码** +* +* ```js +wx.setTopBarText({ + text: 'hello, world!' +}) +``` +* +* **注意** +* +* - 调用成功后,需间隔 5s 才能再次调用此接口,如果在 5s 内再次调用此接口,会回调 fail,errMsg:"setTopBarText: fail invoke too frequently" */ + setTopBarText<T extends SetTopBarTextOption = SetTopBarTextOption>( + option: T + ): PromisifySuccessResult<T, SetTopBarTextOption>; + /** [wx.setVisualEffectOnCapture(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setVisualEffectOnCapture.html) + * + * 需要基础库: `2.20.1` + * + * 在插件中使用:需要基础库 `2.21.3` + * + * 设置截屏/录屏时屏幕表现,仅支持在 Android 端调用 */ + setVisualEffectOnCapture(option: SetVisualEffectOnCaptureOption): void; + /** [wx.setWifiList(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.setWifiList.html) +* +* 需要基础库: `1.6.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 设置 `wifiList` 中 AP 的相关信息。在 `onGetWifiList` 回调后调用,**iOS特有接口**。 +* +* **注意** +* +* - 该接口只能在 `onGetWifiList` 回调之后才能调用。 +* - 此时客户端会挂起,等待小程序设置 Wi-Fi 信息,请务必尽快调用该接口,若无数据请传入一个空数组。 +* - 有可能随着周边 Wi-Fi 列表的刷新,单个流程内收到多次带有存在重复的 Wi-Fi 列表的回调。 +* +* **示例代码** +* +* ```js +wx.onGetWifiList(function(res) { + if (res.wifiList.length) { + wx.setWifiList({ + wifiList: [{ + SSID: res.wifiList[0].SSID, + BSSID: res.wifiList[0].BSSID, + password: '123456' + }] + }) + } else { + wx.setWifiList({ + wifiList: [] + }) + } +}) +wx.getWifiList() +``` */ + setWifiList<T extends SetWifiListOption = SetWifiListOption>( + option: T + ): PromisifySuccessResult<T, SetWifiListOption>; + /** [wx.setWindowSize(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/window/wx.setWindowSize.html) + * + * 需要基础库: `2.10.1` + * + * 在插件中使用:不支持 + * @deprecated 基础库版本 [2.11.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃 + * + * 设置窗口大小,该接口仅适用于 PC 平台,使用细则请参见指南 */ + setWindowSize(option: SetWindowSizeOption): void; + /** [wx.shareFileMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.shareFileMessage.html) + * + * 需要基础库: `2.16.1` + * + * 在插件中使用:不支持 + * + * 转发文件到聊天 */ + shareFileMessage<T extends ShareFileMessageOption = ShareFileMessageOption>( + option: T + ): PromisifySuccessResult<T, ShareFileMessageOption>; + /** [wx.shareToWeRun(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/werun/wx.shareToWeRun.html) + * + * 在插件中使用:不支持 + * + * 分享数据到微信运动。 */ + shareToWeRun<T extends ShareToWeRunOption = ShareToWeRunOption>( + option: T + ): PromisifySuccessResult<T, ShareToWeRunOption>; + /** [wx.shareVideoMessage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.shareVideoMessage.html) + * + * 需要基础库: `2.16.1` + * + * 在插件中使用:不支持 + * + * 转发视频到聊天 */ + shareVideoMessage< + T extends ShareVideoMessageOption = ShareVideoMessageOption + >( + option: T + ): PromisifySuccessResult<T, ShareVideoMessageOption>; + /** [wx.showActionSheet(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showActionSheet.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 显示操作菜单 +* +* **示例代码** +* +* ```js +wx.showActionSheet({ + itemList: ['A', 'B', 'C'], + success (res) { + console.log(res.tapIndex) + }, + fail (res) { + console.log(res.errMsg) + } +}) +``` +* +* **注意** +* +* - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; +* - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 */ + showActionSheet<T extends ShowActionSheetOption = ShowActionSheetOption>( + option: T + ): PromisifySuccessResult<T, ShowActionSheetOption>; + /** [wx.showLoading(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showLoading.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 显示 loading 提示框。需主动调用 wx.hideLoading 才能关闭提示框 +* +* **示例代码** +* +* ```js +wx.showLoading({ + title: '加载中', +}) + +setTimeout(function () { + wx.hideLoading() +}, 2000) +``` +* +* **注意** +* +* - [wx.showLoading](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showLoading.html) 和 [wx.showToast](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showToast.html) 同时只能显示一个 +* - [wx.showLoading](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showLoading.html) 应与 [wx.hideLoading](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.hideLoading.html) 配对使用 */ + showLoading<T extends ShowLoadingOption = ShowLoadingOption>( + option: T + ): PromisifySuccessResult<T, ShowLoadingOption>; + /** [wx.showModal(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showModal.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 显示模态对话框 +* +* **示例代码** +* +* ```js +wx.showModal({ + title: '提示', + content: '这是一个模态弹窗', + success (res) { + if (res.confirm) { + console.log('用户点击确定') + } else if (res.cancel) { + console.log('用户点击取消') + } + } +}) +``` +* +* **注意** +* +* - Android 6.7.2 以下版本,点击取消或蒙层时,回调 fail, errMsg 为 "fail cancel"; +* - Android 6.7.2 及以上版本 和 iOS 点击蒙层不会关闭模态弹窗,所以尽量避免使用「取消」分支中实现业务逻辑 +* - 自基础库 2.17.1 版本起,支持传入 editable 参数,显示带输入框的弹窗 */ + showModal<T extends ShowModalOption = ShowModalOption>( + option: T + ): PromisifySuccessResult<T, ShowModalOption>; + /** [wx.showNavigationBarLoading(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/navigation-bar/wx.showNavigationBarLoading.html) + * + * 在插件中使用:需要基础库 `2.1.0` + * + * 在插件中使用时,只能在当前插件的页面中调用 + * + * 在当前页面显示导航条加载动画 */ + showNavigationBarLoading< + T extends ShowNavigationBarLoadingOption = ShowNavigationBarLoadingOption + >( + option?: T + ): PromisifySuccessResult<T, ShowNavigationBarLoadingOption>; + /** [wx.showRedPackage(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/redpackage/wx.showRedPackage.html) + * + * 需要基础库: `2.10.0` + * + * 在插件中使用:不支持 + * + * 拉取h5领取红包封面页。获取参考红包封面地址参考 [微信红包封面开发平台](https://cover.weixin.qq.com/cgi-bin/mmcover-bin/readtemplate?t=page/index#/doc?page=introduce)。 */ + showRedPackage<T extends ShowRedPackageOption = ShowRedPackageOption>( + option: T + ): PromisifySuccessResult<T, ShowRedPackageOption>; + /** [wx.showShareImageMenu(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareImageMenu.html) + * + * 需要基础库: `2.14.3` + * + * 在插件中使用:需要基础库 `2.16.0` + * + * 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 */ + showShareImageMenu< + T extends ShowShareImageMenuOption = ShowShareImageMenuOption + >( + option: T + ): PromisifySuccessResult<T, ShowShareImageMenuOption>; + /** [wx.showShareMenu(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareMenu.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 显示当前页面的转发按钮 +* +* **** +* +* ## 注意事项 +* - "shareAppMessage"表示“发送给朋友”按钮,"shareTimeline"表示“分享到朋友圈”按钮 +* - 显示“分享到朋友圈”按钮时必须同时显示“发送给朋友”按钮,显示“发送给朋友”按钮时则允许不显示“分享到朋友圈”按钮 +* +* **示例代码** +* +* ```js +wx.showShareMenu({ + withShareTicket: true, + menus: ['shareAppMessage', 'shareTimeline'] +}) +``` */ + showShareMenu<T extends ShowShareMenuOption = ShowShareMenuOption>( + option: T + ): PromisifySuccessResult<T, ShowShareMenuOption>; + /** [wx.showTabBar(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBar.html) + * + * 需要基础库: `1.9.0` + * + * 在插件中使用:不支持 + * + * 显示 tabBar */ + showTabBar<T extends ShowTabBarOption = ShowTabBarOption>( + option: T + ): PromisifySuccessResult<T, ShowTabBarOption>; + /** [wx.showTabBarRedDot(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html) + * + * 需要基础库: `1.9.0` + * + * 在插件中使用:不支持 + * + * 显示 tabBar 某一项的右上角的红点 */ + showTabBarRedDot<T extends ShowTabBarRedDotOption = ShowTabBarRedDotOption>( + option: T + ): PromisifySuccessResult<T, ShowTabBarRedDotOption>; + /** [wx.showToast(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showToast.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 显示消息提示框 +* +* **示例代码** +* +* ```js +wx.showToast({ + title: '成功', + icon: 'success', + duration: 2000 +}) +``` +* +* **注意** +* +* - [wx.showLoading](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showLoading.html) 和 [wx.showToast](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showToast.html) 同时只能显示一个 +* - [wx.showToast](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showToast.html) 应与 [wx.hideToast](https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.hideToast.html) 配对使用 */ + showToast<T extends ShowToastOption = ShowToastOption>( + option: T + ): PromisifySuccessResult<T, ShowToastOption>; + /** [wx.startAccelerometer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.startAccelerometer.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 开始监听加速度数据。 +* +* **示例代码** +* +* ```js +wx.startAccelerometer({ + interval: 'game' +}) +``` +* +* **注意** +* +* - 根据机型性能、当前 CPU 与内存的占用情况,`interval` 的设置与实际 `wx.onAccelerometerChange()` 回调函数的执行频率会有一些出入。 */ + startAccelerometer< + T extends StartAccelerometerOption = StartAccelerometerOption + >( + option?: T + ): PromisifySuccessResult<T, StartAccelerometerOption>; + /** [wx.startBeaconDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.startBeaconDiscovery.html) +* +* 需要基础库: `1.2.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 开始搜索附近的 Beacon 设备 +* +* **示例代码** +* +* ```js +wx.startBeaconDiscovery({ + success(res) { } +}) +``` */ + startBeaconDiscovery< + T extends StartBeaconDiscoveryOption = StartBeaconDiscoveryOption + >( + option: T + ): PromisifySuccessResult<T, StartBeaconDiscoveryOption>; + /** [wx.startBluetoothDevicesDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.startBluetoothDevicesDiscovery.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 开始搜寻附近的蓝牙外围设备。 +* +* **此操作比较耗费系统资源,请在搜索到需要的设备后及时调用 [wx.stopBluetoothDevicesDiscovery](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.stopBluetoothDevicesDiscovery.html) 停止搜索。** +* +* **注意** +* +* - 考虑到蓝牙功能可以间接进行定位,安卓 6.0 及以上版本,无定位权限或定位开关未打开时,无法进行设备搜索。这种情况下,安卓 8.0.16 前,接口调用成功但无法扫描设备;8.0.16 及以上版本,会返回错误。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/m7klFDmZ72i1) +* +* ```js +// 以微信硬件平台的蓝牙智能灯为例,主服务的 UUID 是 FEE7。传入这个参数,只搜索主服务 UUID 为 FEE7 的设备 +wx.startBluetoothDevicesDiscovery({ + services: ['FEE7'], + success (res) { + console.log(res) + } +}) +``` */ + startBluetoothDevicesDiscovery< + T extends + StartBluetoothDevicesDiscoveryOption = StartBluetoothDevicesDiscoveryOption + >( + option: T + ): PromisifySuccessResult<T, StartBluetoothDevicesDiscoveryOption>; + /** [wx.startCompass(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.startCompass.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 开始监听罗盘数据 +* +* **示例代码** +* +* ```js +wx.startCompass() +``` */ + startCompass<T extends StartCompassOption = StartCompassOption>( + option?: T + ): PromisifySuccessResult<T, StartCompassOption>; + /** [wx.startDeviceMotionListening(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.startDeviceMotionListening.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 开始监听设备方向的变化。 */ + startDeviceMotionListening< + T extends + StartDeviceMotionListeningOption = StartDeviceMotionListeningOption + >( + option?: T + ): PromisifySuccessResult<T, StartDeviceMotionListeningOption>; + /** [wx.startGyroscope(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.startGyroscope.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 开始监听陀螺仪数据。 */ + startGyroscope<T extends StartGyroscopeOption = StartGyroscopeOption>( + option?: T + ): PromisifySuccessResult<T, StartGyroscopeOption>; + /** [wx.startHCE(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc-hce/wx.startHCE.html) +* +* 需要基础库: `1.7.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 初始化 NFC 模块。(HCE 模式仅安卓支持) +* +* **示例代码** +* +* ```js +wx.startHCE({ + aid_list: ['F222222222'], + success (res) { + console.log(res.errMsg) + } +}) +``` */ + startHCE<T extends StartHCEOption = StartHCEOption>( + option: T + ): PromisifySuccessResult<T, StartHCEOption>; + /** [wx.startLocalServiceDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.startLocalServiceDiscovery.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 开始搜索局域网下的 mDNS 服务。搜索的结果会通过 wx.onLocalService* 事件返回。 + * + * **注意** + * + * 1. 由于操作系统相关能力变更,iOS 微信客户端 7.0.18 及以上版本无法使用 mDNS 相关接口,安卓版本不受影响 + * 2. wx.startLocalServiceDiscovery 是一个消耗性能的行为,开始 30 秒后会自动 stop 并执行 wx.onLocalServiceDiscoveryStop 注册的回调函数。 + * 3. 在调用 wx.startLocalServiceDiscovery 后,在这次搜索行为停止后才能发起下次 wx.startLocalServiceDiscovery。停止本次搜索行为的操作包括调用 wx.stopLocalServiceDiscovery 和 30 秒后系统自动 stop 本次搜索。 */ + startLocalServiceDiscovery< + T extends + StartLocalServiceDiscoveryOption = StartLocalServiceDiscoveryOption + >( + option: T + ): PromisifySuccessResult<T, StartLocalServiceDiscoveryOption>; + /** [wx.startLocationUpdate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdate.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:需要基础库 `2.8.0` + * + * 开启小程序进入前台时接收位置消息。 + * ## 使用方法 + * 自 2022 年 7 月 14 日后发布的小程序,若使用该接口,需要在 app.json 中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。[具体规则见公告](https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01) + * + * ## 申请开通 + * 暂只针对如下类目的小程序开放,需要先通过类目审核,再在小程序管理后台,「开发」-「开发管理」-「接口设置」中自助开通该接口权限。从2022年7月14日开始,在代码审核环节将检测该接口是否已完成开通,如未开通,将在代码提审环节进行拦截。 + * + * ### 国内主体开放类目 + * + * | 一级类目/主体类型 | 二级类目 | 应用场景 | + * | -------------- | -------| -------- | + * | 电商平台 | / | 售卖商品线下发货、收货、送货服务 | + * | 商家自营 | / | 提供售卖商品线下发货、收货、送货服务、线下商超导览、导航服务 | + * | 医疗服务 | 公立医疗机构、三级私立医疗机构、其他私立医疗机构、就医服务、其他医学健康服务、药品(非处方药)销售、非处方药销售平台、医疗器械生产企业、医疗器械自营、医疗器械经营销售平台、互联网医院血液、干细胞服务、临床试验 | 1、实际物品/药品接收服务 2、基于地理位置取号并现场报到、附近医院导航等服务 | + * | 交通服务 | / | 代驾服务、租车网点导航等相关服务 | + * | 生活服务 | / | 上门服务作业等线下场景 | + * | 物流服务 | 收件/派件、查件、邮政、装卸搬运、快递柜、货物运输 | 快递/货物收发服务 | + * | 餐饮服务 | 点餐平台、外卖平台 | 线下送餐服务 | + * | 工具 | 天气、信息查询 | 与地理位置相关的服务,比如潮汐查询、海拔查询、天气查询等 | + * | 金融 | 保险 | 提供线下网点预约、基于地理位置取号并现场报到、附近网点导航等服务 | + * | 旅游 | 景区服务 | 提供景区导航、导览服务 | + * | 政务民生 | / | 提供政务单位相关业务 | + * | 政府主体账号 | / | 提供政务单位相关业务 | + * + * ### 海外主体开放类目 + * | 一级类目/主体类型 | 二级类目 | 应用场景 | + * | -------------- | -------| -------- | + * | 出行与交通 | / | 代驾服务、租车网点导航等相关服务 | + * | 快递业与邮政 | / | 快递/货物收发服务 | + * | 餐饮 | / | 线下送餐服务 | + * | 电商平台 | / | 售卖商品线下发货、线下收货服务 | + * | 出行与交通 | / | 代驾服务、租车网点导航等相关服务 | + * | 跨境电商 | / | 提供售卖商品线下发货、收货服务、线下商超导览、导航服务 | + * | 本地服务 | 服装/鞋/箱包、玩具、家电/数码/手机、美妆/洗护、珠宝/饰品/眼镜/钟表、运动/户外/乐器、鲜花/园艺/工艺品、家居/家饰/家纺、办公/文具、机械/电子器件、酒、食品、百货/超市/便利店、宠物食品/用品 | 提供售卖商品线下发货、线下收货服务、线下商超导览、导航服务 | + * | 生活服务 | 家政、外送 | 上门服务作业等线下场景 | + * + * **注意** + * + * - 获取位置信息需配置[地理位置用途说明](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。 */ + startLocationUpdate< + T extends StartLocationUpdateOption = StartLocationUpdateOption + >( + option: T + ): PromisifySuccessResult<T, StartLocationUpdateOption>; + /** [wx.startLocationUpdateBackground(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.startLocationUpdateBackground.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:不支持 + * + * 开启小程序在前后台时均可接收位置消息,后台包括离开小程序后继续使用微信(微信仍在前台)、离开微信(微信在后台)两个场景,需引导用户开启[授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html#后台定位)。授权以后,小程序在运行中或进入后台均可接受位置消息变化。 + * ## 使用方法 + * 自 2022 年 7 月 14 日后发布的小程序,若使用该接口,需要在 app.json 中进行声明,否则将无法正常使用该接口,2022年7月14日前发布的小程序不受影响。[具体规则见公告](https://developers.weixin.qq.com/community/develop/doc/000a02f2c5026891650e7f40351c01) + * + * ## 申请开通 + * 暂只针对如下类目的小程序开放,需要先通过类目审核,再在小程序管理后台,「开发」-「开发管理」-「接口设置」中自助开通该接口权限。从2022年7月14日开始,在代码审核环节将检测该接口是否已完成开通,如未开通,将在代码提审环节进行拦截。 + * + * ### 国内主体开放类目 + * + * | 一级类目/主体类型 | 二级类目 | 应用场景 | + * | -------------- | -------| -------- | + * | 电商平台 | / | 在小程序内提供线下商超导览、导航服务 | + * | 商家自营 | / | 在小程序内提供线下商超导览、导航服务 | + * | 交通服务 | / | 代驾服务、打车出行、城市共享交通、实时导航服务等 | + * | 生活服务 | 跑腿、共享服务 | 含有B端小程序配送服务,基于地理位置共享工具类服务 | + * | 物流服务 | 收件/派件、查件、邮政、装卸搬运、快递柜、货物运输 | 提供B端小程序快递/货物收发服务 | + * | 餐饮服务 | 点餐平台、外卖平台 | 提供B端小程序餐饮配送服务、线下门店实时导航 | + * | 工具 | 健康管理 | 基于实时地理位置提供身体管理记录等服务 | + * | 旅游 | 景区服务、住宿服务 | 在小程序内提供景区导航、导览服务、酒店导航服务 | + * | 政务民生 | / | 提供政务单位相关业务 | + * | 政府主体账号 | / | 提供政务单位相关业务 | + * + * ### 海外主体开放类目 + * | 一级类目/主体类型 | 二级类目 | 应用场景 | + * | -------------- | -------| -------- | + * | 交通服务 | / | 代驾服务、打车出行、城市共享交通、实时导航服务等 | + * | 生活服务 | 家政、外送 | 含有B端小程序配送服务,基于地理位置导航上门服务 | + * | 快递业与邮政 | / | 提供B端小程序快递/货物收发服务 | + * | 餐饮服务 | 外卖点餐 | 提供B端小程序餐饮配送服务、线下门店实时导航 | + * | 电商平台 | / | 在小程序内提供线下商超导览、导航服务 | + * | 跨境电商 | / | 在小程序内提供线下商超导览、导航服务 | + * | 本地服务 | 服装/鞋/箱包、玩具、家电/数码/手机、美妆/洗护、珠宝/饰品/眼镜/钟表、运动/户外/乐器、鲜花/园艺/工艺品、家居/家饰/家纺、办公/文具、机械/电子器件、酒、食品、百货/超市/便利店、宠物食品/用品 | 在小程序内提供线下商超导览、导航服务 | + * + * **注意** + * + * - 安卓微信7.0.6版本,iOS 7.0.5版本起支持该接口 + * - 需在app.json中配置requiredBackgroundModes: ['location']后使用 + * - 获取位置信息需配置[地理位置用途说明](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#permission)。 */ + startLocationUpdateBackground< + T extends + StartLocationUpdateBackgroundOption = StartLocationUpdateBackgroundOption + >( + option: T + ): PromisifySuccessResult<T, StartLocationUpdateBackgroundOption>; + /** [wx.startPullDownRefresh(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/pull-down-refresh/wx.startPullDownRefresh.html) +* +* 需要基础库: `1.5.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 开始下拉刷新。调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 +* +* **示例代码** +* +* ```js +wx.startPullDownRefresh() +``` */ + startPullDownRefresh< + T extends StartPullDownRefreshOption = StartPullDownRefreshOption + >( + option?: T + ): PromisifySuccessResult<T, StartPullDownRefreshOption>; + /** [wx.startRecord(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.startRecord.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [1.6.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getRecorderManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.getRecorderManager.html) 替换 +* +* 开始录音。当主动调用 [wx.stopRecord](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.stopRecord.html),或者录音超过1分钟时自动结束录音。当用户离开小程序时,此接口无法调用。 +* +* **示例代码** +* +* ```js +wx.startRecord({ + success (res) { + const tempFilePath = res.tempFilePath + } +}) +setTimeout(function () { + wx.stopRecord() // 结束录音 +}, 10000) +``` */ + startRecord<T extends WxStartRecordOption = WxStartRecordOption>( + option?: T + ): PromisifySuccessResult<T, WxStartRecordOption>; + /** [wx.startSoterAuthentication(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/soter/wx.startSoterAuthentication.html) +* +* 需要基础库: `1.5.0` +* +* 在插件中使用:不支持 +* +* 开始 SOTER 生物认证。验证流程请参考[说明](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/bio-auth.html)。 +* +* **resultJSON 说明** +* +* 此数据为设备TEE中,将传入的challenge和TEE内其他安全信息组成的数据进行组装而来的JSON,对下述字段的解释如下表。例子如下: +* | 字段名 | 说明 | +* |---------|-------------------------------------------------------------------------------------------| +* | raw | 调用者传入的challenge | +* | fid | (仅Android支持)本次生物识别认证的生物信息编号(如指纹识别则是指纹信息在本设备内部编号) | +* | counter | 防重放特征参数 | +* | tee_n | TEE名称(如高通或者trustonic等) | +* | tee_v | TEE版本号 | +* | fp_n | 指纹以及相关逻辑模块提供商(如FPC等) | +* | fp_v | 指纹以及相关模块版本号 | +* | cpu_id | 机器唯一识别ID | +* | uid | 概念同Android系统定义uid,即应用程序编号 | +* +* ```json +{ + "raw":"msg", + "fid":"2", + "counter":123, + "tee_n":"TEE Name", + "tee_v":"TEE Version", + "fp_n":"Fingerprint Sensor Name", + "fp_v":"Fingerprint Sensor Version", + "cpu_id":"CPU Id", + "uid":"21" +} +``` +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/q3tCKkmJ7g2e) +* ```js +wx.startSoterAuthentication({ + requestAuthModes: ['fingerPrint'], + challenge: '123456', + authContent: '请用指纹解锁', + success(res) { + } +}) +``` */ + startSoterAuthentication< + T extends StartSoterAuthenticationOption = StartSoterAuthenticationOption + >( + option: T + ): PromisifySuccessResult<T, StartSoterAuthenticationOption>; + /** [wx.startWifi(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.startWifi.html) +* +* 需要基础库: `1.6.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 初始化 Wi-Fi 模块。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/8P7zrkmd7r2n) +* ```js +wx.startWifi({ + success (res) { + console.log(res.errMsg) + } +}) +``` */ + startWifi<T extends StartWifiOption = StartWifiOption>( + option?: T + ): PromisifySuccessResult<T, StartWifiOption>; + /** [wx.stopAccelerometer(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/accelerometer/wx.stopAccelerometer.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 停止监听加速度数据。 +* +* **示例代码** +* +* ```js +wx.stopAccelerometer() +``` */ + stopAccelerometer< + T extends StopAccelerometerOption = StopAccelerometerOption + >( + option?: T + ): PromisifySuccessResult<T, StopAccelerometerOption>; + /** [wx.stopBackgroundAudio(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.stopBackgroundAudio.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [1.2.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getBackgroundAudioManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/background-audio/wx.getBackgroundAudioManager.html) 替换 +* +* 停止播放音乐。 +* +* **示例代码** +* +* ```js +wx.stopBackgroundAudio() +``` */ + stopBackgroundAudio< + T extends StopBackgroundAudioOption = StopBackgroundAudioOption + >( + option?: T + ): PromisifySuccessResult<T, StopBackgroundAudioOption>; + /** [wx.stopBeaconDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/ibeacon/wx.stopBeaconDiscovery.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 停止搜索附近的 Beacon 设备 */ + stopBeaconDiscovery< + T extends StopBeaconDiscoveryOption = StopBeaconDiscoveryOption + >( + option?: T + ): PromisifySuccessResult<T, StopBeaconDiscoveryOption>; + /** [wx.stopBluetoothDevicesDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.stopBluetoothDevicesDiscovery.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 停止搜寻附近的蓝牙外围设备。若已经找到需要的蓝牙设备并不需要继续搜索时,建议调用该接口停止蓝牙搜索。 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +wx.stopBluetoothDevicesDiscovery({ + success (res) { + console.log(res) + } +}) +``` */ + stopBluetoothDevicesDiscovery< + T extends + StopBluetoothDevicesDiscoveryOption = StopBluetoothDevicesDiscoveryOption + >( + option?: T + ): PromisifySuccessResult<T, StopBluetoothDevicesDiscoveryOption>; + /** [wx.stopCompass(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/compass/wx.stopCompass.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 停止监听罗盘数据 +* +* **示例代码** +* +* ```js +wx.stopCompass() +``` */ + stopCompass<T extends StopCompassOption = StopCompassOption>( + option?: T + ): PromisifySuccessResult<T, StopCompassOption>; + /** [wx.stopDeviceMotionListening(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/motion/wx.stopDeviceMotionListening.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 停止监听设备方向的变化。 */ + stopDeviceMotionListening< + T extends + StopDeviceMotionListeningOption = StopDeviceMotionListeningOption + >( + option?: T + ): PromisifySuccessResult<T, StopDeviceMotionListeningOption>; + /** [wx.stopFaceDetect(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ai/face/wx.stopFaceDetect.html) + * + * 需要基础库: `2.18.0` + * + * 在插件中使用:需要基础库 `2.21.3` + * + * @warning **该接口已停止维护,推荐使用 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 代替** + * + * 停止人脸检测。本接口不再维护,请使用 [wx.createVKSession](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/wx.createVKSession.html) 接口代替。详情参考[人脸检测指南文档](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/visionkit/face.html) */ + stopFaceDetect(option?: StopFaceDetectOption): void; + /** [wx.stopGyroscope(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.stopGyroscope.html) + * + * 需要基础库: `2.3.0` + * + * 在插件中使用:需要基础库 `2.9.1` + * + * 停止监听陀螺仪数据。 */ + stopGyroscope<T extends StopGyroscopeOption = StopGyroscopeOption>( + option?: T + ): PromisifySuccessResult<T, StopGyroscopeOption>; + /** [wx.stopHCE(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/nfc-hce/wx.stopHCE.html) +* +* 需要基础库: `1.7.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 关闭 NFC 模块。仅在安卓系统下有效。 +* +* **示例代码** +* +* ```js +wx.stopHCE({ + success (res) { + console.log(res.errMsg) + } +}) +``` */ + stopHCE<T extends StopHCEOption = StopHCEOption>( + option?: T + ): PromisifySuccessResult<T, StopHCEOption>; + /** [wx.stopLocalServiceDiscovery(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/network/mdns/wx.stopLocalServiceDiscovery.html) + * + * 需要基础库: `2.4.0` + * + * 在插件中使用:需要基础库 `2.15.0` + * + * 停止搜索 mDNS 服务 */ + stopLocalServiceDiscovery< + T extends + StopLocalServiceDiscoveryOption = StopLocalServiceDiscoveryOption + >( + option?: T + ): PromisifySuccessResult<T, StopLocalServiceDiscoveryOption>; + /** [wx.stopLocationUpdate(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.stopLocationUpdate.html) + * + * 需要基础库: `2.8.0` + * + * 在插件中使用:需要基础库 `2.8.0` + * + * 关闭监听实时位置变化,前后台都停止消息接收 */ + stopLocationUpdate< + T extends StopLocationUpdateOption = StopLocationUpdateOption + >( + option?: T + ): PromisifySuccessResult<T, StopLocationUpdateOption>; + /** [wx.stopPullDownRefresh(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/ui/pull-down-refresh/wx.stopPullDownRefresh.html) +* +* 需要基础库: `1.5.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 停止当前页面下拉刷新。 +* +* **示例代码** +* +* ```js +Page({ + onPullDownRefresh () { + wx.stopPullDownRefresh() + } +}) +``` */ + stopPullDownRefresh< + T extends StopPullDownRefreshOption = StopPullDownRefreshOption + >( + option?: T + ): PromisifySuccessResult<T, StopPullDownRefreshOption>; + /** [wx.stopRecord(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.stopRecord.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @deprecated 基础库版本 [1.6.0](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.getRecorderManager](https://developers.weixin.qq.com/miniprogram/dev/api/media/recorder/wx.getRecorderManager.html) 替换 +* +* 停止录音。 +* +* **示例代码** +* +* ```js +wx.startRecord({ + success (res) { + const tempFilePath = res.tempFilePath + } +}) +setTimeout(function () { + wx.stopRecord() // 结束录音 +}, 10000) +``` */ + stopRecord<T extends WxStopRecordOption = WxStopRecordOption>( + option?: T + ): PromisifySuccessResult<T, WxStopRecordOption>; + /** [wx.stopVoice(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/wx.stopVoice.html) +* +* 在插件中使用:需要基础库 `1.9.6` +* @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) 替换 +* +* 结束播放语音。 +* +* **示例代码** +* +* ```js +wx.startRecord({ + success (res) { + const tempFilePath = res.tempFilePath + wx.playVoice({ + filePath: tempFilePath, + }) + + setTimeout(() => { wx.stopVoice() }, 5000) + } +}) +``` */ + stopVoice<T extends StopVoiceOption = StopVoiceOption>( + option?: T + ): PromisifySuccessResult<T, StopVoiceOption>; + /** [wx.stopWifi(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/wifi/wx.stopWifi.html) +* +* 需要基础库: `1.6.0` +* +* 在插件中使用:需要基础库 `2.9.1` +* +* 关闭 Wi-Fi 模块。 +* +* **示例代码** +* +* ```js +wx.stopWifi({ + success (res) { + console.log(res.errMsg) + } +}) +``` */ + stopWifi<T extends StopWifiOption = StopWifiOption>( + option?: T + ): PromisifySuccessResult<T, StopWifiOption>; + /** [wx.subscribeVoIPVideoMembers(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.subscribeVoIPVideoMembers.html) + * + * 需要基础库: `2.11.0` + * + * 在插件中使用:需要基础库 `2.11.0` + * + * 订阅视频画面成员。对于视频房间,当成员超过两人时需进行订阅,否则只能看到最先加入房间的两人画面。 */ + subscribeVoIPVideoMembers< + T extends + SubscribeVoIPVideoMembersOption = SubscribeVoIPVideoMembersOption + >( + option: T + ): PromisifySuccessResult<T, SubscribeVoIPVideoMembersOption>; + /** [wx.switchTab(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.switchTab.html) +* +* 在插件中使用:需要基础库 `2.3.1` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 +* +* **示例代码** +* +* ```json +// app.json +{ + "tabBar": { + "list": [{ + "pagePath": "index", + "text": "首页" + },{ + "pagePath": "other", + "text": "其他" + }] + } +} +``` +* +* ```js +wx.switchTab({ + url: '/index' +}) +``` */ + switchTab<T extends SwitchTabOption = SwitchTabOption>( + option: T + ): PromisifySuccessResult<T, SwitchTabOption>; + /** [wx.updateShareMenu(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.updateShareMenu.html) +* +* 需要基础库: `1.2.0` +* +* 在插件中使用:需要基础库 `2.1.0` +* +* 在插件中使用时,只能在当前插件的页面中调用 +* +* 更新转发属性 +* +* **** +* +* ## 注意事项 +* - bug:在iOS上,如果 withShareTicket 传了 true ,同时 isUpdatableMessage 传了 false,会导致 withShareTicket 失效。解决办法:当 withShareTicket 传了 true 的时候,isUpdatableMessage 传 true 或者不传都可以,但不要传 false。如果需要关掉动态消息设置,则另外单独调用一次 wx.updateShareMenu({ isUpdatableMessage: false }) 即可。 +* +* **示例代码** +* +* ```js +wx.updateShareMenu({ + withShareTicket: true, + success () { } +}) +``` +* ```js +// 转发私密消息 +wx.updateShareMenu({ + isPrivateMessage: true, + activityId: 'xxx', + templateInfo: {}, + success () { }, + fail () {} +}) +``` */ + updateShareMenu<T extends UpdateShareMenuOption = UpdateShareMenuOption>( + option: T + ): PromisifySuccessResult<T, UpdateShareMenuOption>; + /** [wx.updateVoIPChatMuteConfig(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.updateVoIPChatMuteConfig.html) + * + * 需要基础库: `2.7.0` + * + * 在插件中使用:需要基础库 `2.9.0` + * + * 更新实时语音静音设置 */ + updateVoIPChatMuteConfig< + T extends UpdateVoIPChatMuteConfigOption = UpdateVoIPChatMuteConfigOption + >( + option: T + ): PromisifySuccessResult<T, UpdateVoIPChatMuteConfigOption>; + /** [wx.updateWeChatApp(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/update/wx.updateWeChatApp.html) + * + * 需要基础库: `2.12.0` + * + * 在插件中使用:需要基础库 `2.12.0` + * + * 更新客户端版本。当判断用户小程序所在客户端版本过低时,可使用该接口跳转到更新微信页面。 */ + updateWeChatApp<T extends UpdateWeChatAppOption = UpdateWeChatAppOption>( + option?: T + ): PromisifySuccessResult<T, UpdateWeChatAppOption>; + /** [wx.vibrateLong(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/vibrate/wx.vibrateLong.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 使手机发生较长时间的振动(400 ms) */ + vibrateLong<T extends VibrateLongOption = VibrateLongOption>( + option?: T + ): PromisifySuccessResult<T, VibrateLongOption>; + /** [wx.vibrateShort(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/vibrate/wx.vibrateShort.html) + * + * 需要基础库: `1.2.0` + * + * 在插件中使用:需要基础库 `1.9.6` + * + * 使手机发生较短时间的振动(15 ms)。仅在 iPhone `7 / 7 Plus` 以上及 Android 机型生效 */ + vibrateShort<T extends VibrateShortOption = VibrateShortOption>( + option: T + ): PromisifySuccessResult<T, VibrateShortOption>; + /** [wx.writeBLECharacteristicValue(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.writeBLECharacteristicValue.html) +* +* 需要基础库: `1.1.0` +* +* 在插件中使用:需要基础库 `1.9.6` +* +* 向蓝牙低功耗设备特征值中写入二进制数据。注意:必须设备的特征支持 write 才可以成功调用。 +* +* **注意** +* +* - 并行调用多次会存在写失败的可能性。 +* - 小程序不会对写入数据包大小做限制,但系统与蓝牙设备会限制蓝牙 4.0 单次传输的数据大小,超过最大字节数后会发生写入错误,建议每次写入不超过 20 字节。 +* - 若单次写入数据过长,iOS 上存在系统不会有任何回调的情况(包括错误回调)。 +* - 安卓平台上,在调用 [wx.notifyBLECharacteristicValueChange](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-ble/wx.notifyBLECharacteristicValueChange.html) 成功后立即调用本接口,在部分机型上会发生 10008 系统错误 +* +* **示例代码** +* +* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/pQU51zmz7a3K) +* ```js +// 向蓝牙设备发送一个0x00的16进制数据 +let buffer = new ArrayBuffer(1) +let dataView = new DataView(buffer) +dataView.setUint8(0, 0) + +wx.writeBLECharacteristicValue({ + // 这里的 deviceId 需要在 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取 + deviceId, + // 这里的 serviceId 需要在 getBLEDeviceServices 接口中获取 + serviceId, + // 这里的 characteristicId 需要在 getBLEDeviceCharacteristics 接口中获取 + characteristicId, + // 这里的value是ArrayBuffer类型 + value: buffer, + success (res) { + console.log('writeBLECharacteristicValue success', res.errMsg) + } +}) +``` */ + writeBLECharacteristicValue< + T extends + WriteBLECharacteristicValueOption = WriteBLECharacteristicValueOption + >( + option: T + ): PromisifySuccessResult<T, WriteBLECharacteristicValueOption>; + /** 小程序云开发 */ + cloud: WxCloud; + /** 文件系统中的用户目录路径 */ + env: { USER_DATA_PATH: string }; + /** 获得 xr-frame 接口系统 */ + getXrFrameSystem(): import('XrFrame').IXrFrameSystem; + /** 需要基础库: `2.29.2` + * + * router 对象,可以通过 `wx.router` 获取。 */ + router: Router; + /** 需要基础库: `2.29.2` + * + * worklet 对象,可以通过 `wx.worklet` 获取。 */ + worklet: Worklet; + } + + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AccessCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type AccessFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type AccessSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddArcCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddArcFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddArcSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddCardCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddCardFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddCardSuccessCallback = (result: AddCardSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddCustomLayerCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddCustomLayerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddCustomLayerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddFileToFavoritesCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type AddFileToFavoritesFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddFileToFavoritesSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddGroundOverlayCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddGroundOverlayFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddGroundOverlaySuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddMarkersCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddMarkersFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddMarkersSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddPhoneCalendarCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddPhoneCalendarFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddPhoneCalendarSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddPhoneContactCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddPhoneContactFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddPhoneContactSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddPhoneRepeatCalendarCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type AddPhoneRepeatCalendarFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type AddPhoneRepeatCalendarSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddServiceCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddServiceFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddServiceSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddVideoToFavoritesCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type AddVideoToFavoritesFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddVideoToFavoritesSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AddVisualLayerCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AddVisualLayerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AddVisualLayerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AppendFileCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type AppendFileFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type AppendFileSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ApplyBlusherStickMakeupCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ApplyBlusherStickMakeupFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type ApplyBlusherStickMakeupSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ApplyEyeBrowMakeupCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ApplyEyeBrowMakeupFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ApplyEyeBrowMakeupSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ApplyEyeShadowMakeupCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ApplyEyeShadowMakeupFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ApplyEyeShadowMakeupSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ApplyFaceContourMakeupCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ApplyFaceContourMakeupFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type ApplyFaceContourMakeupSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ApplyFilterCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ApplyFilterFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ApplyFilterSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ApplyLipStickMakeupCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ApplyLipStickMakeupFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ApplyLipStickMakeupSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ApplyStickerCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ApplyStickerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ApplyStickerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AuthPrivateMessageCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type AuthPrivateMessageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type AuthPrivateMessageSuccessCallback = ( + result: AuthPrivateMessageSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AuthorizeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type AuthorizeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type AuthorizeForMiniProgramCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type AuthorizeForMiniProgramFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type AuthorizeForMiniProgramSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type AuthorizeSuccessCallback = (res: GeneralCallbackResult) => void; + /** 背景音频播放错误事件的监听函数 */ + type BackgroundAudioManagerOnErrorCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type BatchGetStorageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type BatchGetStorageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type BatchGetStorageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type BatchSetStorageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type BatchSetStorageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type BatchSetStorageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type BlurCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type BlurFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type BlurSuccessCallback = (res: GeneralCallbackResult) => void; + /** 回调函数,在执行 `SelectorQuery.exec` 方法后,节点信息会在 `callback` 中返回。 */ + type BoundingClientRectCallback = ( + result: BoundingClientRectCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type CameraContextSetZoomSuccessCallback = ( + result: SetZoomSuccessCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type CameraContextStartRecordSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type CameraContextStopRecordSuccessCallback = ( + result: StopRecordSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CanvasGetImageDataCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type CanvasGetImageDataFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type CanvasGetImageDataSuccessCallback = ( + result: CanvasGetImageDataSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CanvasPutImageDataCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type CanvasPutImageDataFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type CanvasPutImageDataSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CanvasToTempFilePathCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type CanvasToTempFilePathFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type CanvasToTempFilePathSuccessCallback = ( + result: CanvasToTempFilePathSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CheckIsAddedToMyMiniProgramCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type CheckIsAddedToMyMiniProgramFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type CheckIsAddedToMyMiniProgramSuccessCallback = ( + result: CheckIsAddedToMyMiniProgramSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CheckIsOpenAccessibilityCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type CheckIsOpenAccessibilityFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type CheckIsOpenAccessibilitySuccessCallback = ( + option: CheckIsOpenAccessibilitySuccessCallbackOption + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CheckIsSoterEnrolledInDeviceCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type CheckIsSoterEnrolledInDeviceFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type CheckIsSoterEnrolledInDeviceSuccessCallback = ( + result: CheckIsSoterEnrolledInDeviceSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CheckIsSupportSoterAuthenticationCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type CheckIsSupportSoterAuthenticationFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type CheckIsSupportSoterAuthenticationSuccessCallback = ( + result: CheckIsSupportSoterAuthenticationSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CheckSessionCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type CheckSessionFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type CheckSessionSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseAddressCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChooseAddressFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseAddressSuccessCallback = ( + result: ChooseAddressSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseContactCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChooseContactFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseContactSuccessCallback = ( + option: ChooseContactSuccessCallbackOption + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseImageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChooseImageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseImageSuccessCallback = ( + result: ChooseImageSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseInvoiceCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChooseInvoiceFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseInvoiceSuccessCallback = ( + result: ChooseInvoiceSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseInvoiceTitleCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ChooseInvoiceTitleFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseInvoiceTitleSuccessCallback = ( + result: ChooseInvoiceTitleSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseLicensePlateCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ChooseLicensePlateFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseLicensePlateSuccessCallback = ( + result: ChooseLicensePlateSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseLocationCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChooseLocationFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseLocationSuccessCallback = ( + result: ChooseLocationSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseMediaCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChooseMediaFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseMediaSuccessCallback = ( + result: ChooseMediaSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseMessageFileCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChooseMessageFileFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseMessageFileSuccessCallback = ( + result: ChooseMessageFileSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChoosePoiCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChoosePoiFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChoosePoiSuccessCallback = ( + result: ChoosePoiSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ChooseVideoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ChooseVideoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ChooseVideoSuccessCallback = ( + result: ChooseVideoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ClearCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ClearFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ClearFiltersCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ClearFiltersFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ClearFiltersSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ClearMakeupsCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ClearMakeupsFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ClearMakeupsSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ClearStickersCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ClearStickersFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ClearStickersSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ClearStorageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ClearStorageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ClearStorageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ClearSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CloseBLEConnectionCompleteCallback = (res: BluetoothError) => void; + /** 接口调用失败的回调函数 */ + type CloseBLEConnectionFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type CloseBLEConnectionSuccessCallback = (res: BluetoothError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CloseBluetoothAdapterCompleteCallback = (res: BluetoothError) => void; + /** 接口调用失败的回调函数 */ + type CloseBluetoothAdapterFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type CloseBluetoothAdapterSuccessCallback = (res: BluetoothError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CloseSocketCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type CloseSocketFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type CloseSocketSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CompressImageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type CompressImageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type CompressImageSuccessCallback = ( + result: CompressImageSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CompressVideoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type CompressVideoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type CompressVideoSuccessCallback = ( + result: CompressVideoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ConnectCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type ConnectFailCallback = (res: Nfcrwerror) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ConnectSocketCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ConnectSocketFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ConnectSocketSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ConnectSuccessCallback = (res: Nfcrwerror) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ConnectWifiCompleteCallback = (res: WifiError) => void; + /** 接口调用失败的回调函数 */ + type ConnectWifiFailCallback = (res: WifiError) => void; + /** 接口调用成功的回调函数 */ + type ConnectWifiSuccessCallback = (res: WifiError) => void; + /** 回调函数,在执行 `SelectorQuery.exec` 方法后,返回节点信息。 */ + type ContextCallback = (result: ContextCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CopyFileCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type CopyFileFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type CopyFileSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CreateBLEConnectionCompleteCallback = (res: BluetoothError) => void; + /** 接口调用失败的回调函数 */ + type CreateBLEConnectionFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type CreateBLEConnectionSuccessCallback = (res: BluetoothError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CreateBLEPeripheralServerCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type CreateBLEPeripheralServerFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type CreateBLEPeripheralServerSuccessCallback = ( + result: CreateBLEPeripheralServerSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type CropImageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type CropImageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type CropImageSuccessCallback = ( + result: CropImageSuccessCallbackResult + ) => void; + /** 自定义渲染事件处理回调函数 */ + type CustomRendererFrameEventCallback = ( + result: OnCustomRendererEventCallbackResult + ) => void; + /** [路由动画定义函数](#) */ + type CustomRouteBuilder = ( + /** 自定义路由上下文对象 */ + customRouteContext: CustomRouteContext + ) => CustomRouteConfig; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type DisableAlertBeforeUnloadCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type DisableAlertBeforeUnloadFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type DisableAlertBeforeUnloadSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type DownloadFileCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type DownloadFileFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type DownloadFileSuccessCallback = ( + result: DownloadFileSuccessCallbackResult + ) => void; + /** onProgressUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ + type DownloadTaskOffProgressUpdateCallback = ( + result: DownloadTaskOnProgressUpdateListenerResult + ) => void; + /** 下载进度变化事件的监听函数 */ + type DownloadTaskOnProgressUpdateCallback = ( + result: DownloadTaskOnProgressUpdateListenerResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type EditImageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type EditImageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type EditImageSuccessCallback = ( + result: CropImageSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type EnableAlertBeforeUnloadCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type EnableAlertBeforeUnloadFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type EnableAlertBeforeUnloadSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type EraseLinesCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type EraseLinesFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type EraseLinesSuccessCallback = (res: GeneralCallbackResult) => void; + /** 事件监听函数 */ + type EventCallback = ( + /** 触发事件参数 */ + ...args: any + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ExecuteVisualLayerCommandCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ExecuteVisualLayerCommandFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type ExecuteVisualLayerCommandSuccessCallback = ( + result: ExecuteVisualLayerCommandSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ExitCastingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ExitCastingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ExitCastingSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ExitFullScreenCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ExitFullScreenFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ExitFullScreenSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ExitMiniProgramCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ExitMiniProgramFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ExitMiniProgramSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ExitPictureInPictureCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ExitPictureInPictureFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ExitPictureInPictureSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ExitVoIPChatCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ExitVoIPChatFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ExitVoIPChatSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type FaceDetectCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type FaceDetectFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type FaceDetectSuccessCallback = ( + result: FaceDetectSuccessCallbackResult + ) => void; + /** 回调函数 */ + type FieldsCallback = ( + /** 节点的相关信息 */ + res: IAnyObject + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type FileSystemManagerCloseCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type FileSystemManagerCloseFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type FileSystemManagerCloseSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type FromScreenLocationCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type FromScreenLocationFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type FromScreenLocationSuccessCallback = ( + result: GetCenterLocationSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type FstatCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type FstatFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type FstatSuccessCallback = (result: FstatSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type FtruncateCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type FtruncateFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type FtruncateSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetAtqaCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type GetAtqaFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type GetAtqaSuccessCallback = (result: GetAtqaSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetAvailableAudioSourcesCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetAvailableAudioSourcesFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type GetAvailableAudioSourcesSuccessCallback = ( + result: GetAvailableAudioSourcesSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBLEDeviceCharacteristicsCompleteCallback = ( + res: BluetoothError + ) => void; + /** 接口调用失败的回调函数 */ + type GetBLEDeviceCharacteristicsFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type GetBLEDeviceCharacteristicsSuccessCallback = ( + result: GetBLEDeviceCharacteristicsSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBLEDeviceRSSICompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetBLEDeviceRSSIFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetBLEDeviceRSSISuccessCallback = ( + result: GetBLEDeviceRSSISuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBLEDeviceServicesCompleteCallback = (res: BluetoothError) => void; + /** 接口调用失败的回调函数 */ + type GetBLEDeviceServicesFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type GetBLEDeviceServicesSuccessCallback = ( + result: GetBLEDeviceServicesSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBLEMTUCompleteCallback = (res: BluetoothError) => void; + /** 接口调用失败的回调函数 */ + type GetBLEMTUFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type GetBLEMTUSuccessCallback = ( + result: GetBLEMTUSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBackgroundAudioPlayerStateCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetBackgroundAudioPlayerStateFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type GetBackgroundAudioPlayerStateSuccessCallback = ( + result: GetBackgroundAudioPlayerStateSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBackgroundFetchDataCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetBackgroundFetchDataFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type GetBackgroundFetchDataSuccessCallback = ( + result: GetBackgroundFetchDataSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBackgroundFetchTokenCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetBackgroundFetchTokenFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type GetBackgroundFetchTokenSuccessCallback = ( + result: GetBackgroundFetchTokenSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBatteryInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetBatteryInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetBatteryInfoSuccessCallback = ( + result: GetBatteryInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBeaconsCompleteCallback = (res: BeaconError) => void; + /** 接口调用失败的回调函数 */ + type GetBeaconsFailCallback = (res: BeaconError) => void; + /** 接口调用成功的回调函数 */ + type GetBeaconsSuccessCallback = ( + result: GetBeaconsSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBluetoothAdapterStateCompleteCallback = (res: BluetoothError) => void; + /** 接口调用失败的回调函数 */ + type GetBluetoothAdapterStateFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type GetBluetoothAdapterStateSuccessCallback = ( + result: GetBluetoothAdapterStateSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetBluetoothDevicesCompleteCallback = (res: BluetoothError) => void; + /** 接口调用失败的回调函数 */ + type GetBluetoothDevicesFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type GetBluetoothDevicesSuccessCallback = ( + result: GetBluetoothDevicesSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetCenterLocationCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetCenterLocationFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetCenterLocationSuccessCallback = ( + result: GetCenterLocationSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetChannelsLiveInfoCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetChannelsLiveInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetChannelsLiveInfoSuccessCallback = ( + result: GetChannelsLiveInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetChannelsLiveNoticeInfoCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetChannelsLiveNoticeInfoFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type GetChannelsLiveNoticeInfoSuccessCallback = ( + result: GetChannelsLiveNoticeInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetChannelsShareKeyCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetChannelsShareKeyFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetChannelsShareKeySuccessCallback = ( + result: GetChannelsShareKeySuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetClipboardDataCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetClipboardDataFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetClipboardDataSuccessCallback = ( + option: GetClipboardDataSuccessCallbackOption + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetCommonConfigCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetCommonConfigFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetCommonConfigSuccessCallback = ( + result: GetCommonConfigSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetConnectedBluetoothDevicesCompleteCallback = ( + res: BluetoothError + ) => void; + /** 接口调用失败的回调函数 */ + type GetConnectedBluetoothDevicesFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type GetConnectedBluetoothDevicesSuccessCallback = ( + result: GetConnectedBluetoothDevicesSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetConnectedWifiCompleteCallback = (res: WifiError) => void; + /** 接口调用失败的回调函数 */ + type GetConnectedWifiFailCallback = (res: WifiError) => void; + /** 接口调用成功的回调函数 */ + type GetConnectedWifiSuccessCallback = ( + result: GetConnectedWifiSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetContentsCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetContentsFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetContentsSuccessCallback = ( + result: GetContentsSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetDeviceVoIPListCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetDeviceVoIPListFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetDeviceVoIPListSuccessCallback = ( + result: GetDeviceVoIPListSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetExtConfigCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetExtConfigFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetExtConfigSuccessCallback = ( + result: GetExtConfigSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetFileInfoCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type GetFileInfoFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type GetFileInfoSuccessCallback = ( + result: GetFileInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetFuzzyLocationCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetFuzzyLocationFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetFuzzyLocationSuccessCallback = ( + result: GetFuzzyLocationSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetGroupEnterInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetGroupEnterInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetGroupEnterInfoSuccessCallback = ( + result: GetGroupEnterInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetHCEStateCompleteCallback = (res: NFCError) => void; + /** 接口调用失败的回调函数 */ + type GetHCEStateFailCallback = (res: NFCError) => void; + /** 接口调用成功的回调函数 */ + type GetHCEStateSuccessCallback = (res: NFCError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetHistoricalBytesCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type GetHistoricalBytesFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type GetHistoricalBytesSuccessCallback = ( + result: GetHistoricalBytesSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetImageInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetImageInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetImageInfoSuccessCallback = ( + result: GetImageInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetInferenceEnvInfoCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetInferenceEnvInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetInferenceEnvInfoSuccessCallback = ( + result: GetInferenceEnvInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetLatestUserKeyCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetLatestUserKeyFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetLatestUserKeySuccessCallback = ( + result: GetLatestUserKeySuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetLocalIPAddressCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetLocalIPAddressFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetLocalIPAddressSuccessCallback = ( + result: GetLocalIPAddressSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetLocationCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetLocationFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetLocationSuccessCallback = ( + result: GetLocationSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetMaxTransceiveLengthCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type GetMaxTransceiveLengthFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type GetMaxTransceiveLengthSuccessCallback = ( + result: GetMaxTransceiveLengthSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetMaxZoomCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetMaxZoomFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetMaxZoomSuccessCallback = ( + result: GetMaxZoomSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetNetworkTypeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetNetworkTypeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetNetworkTypeSuccessCallback = ( + result: GetNetworkTypeSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetPrivacySettingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetPrivacySettingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetPrivacySettingSuccessCallback = ( + result: GetPrivacySettingSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetRandomValuesCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetRandomValuesFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetRandomValuesSuccessCallback = ( + result: GetRandomValuesSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetRegionCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetRegionFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetRegionSuccessCallback = ( + result: GetRegionSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetRendererUserAgentCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetRendererUserAgentFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetRendererUserAgentSuccessCallback = ( + /** UserAgent */ + userAgent: string + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetRotateCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetRotateFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetRotateSuccessCallback = ( + result: GetRotateSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSakCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type GetSakFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type GetSakSuccessCallback = (result: GetSakSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSavedFileListCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetSavedFileListFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetSavedFileListSuccessCallback = ( + result: GetSavedFileListSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetScaleCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetScaleFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetScaleSuccessCallback = ( + result: GetScaleSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetScreenBrightnessCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetScreenBrightnessFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetScreenBrightnessSuccessCallback = ( + option: GetScreenBrightnessSuccessCallbackOption + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetScreenRecordingStateCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetScreenRecordingStateFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type GetScreenRecordingStateSuccessCallback = ( + result: GetScreenRecordingStateSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSelectedTextRangeCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetSelectedTextRangeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetSelectedTextRangeSuccessCallback = ( + result: GetSelectedTextRangeSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSelectionTextCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetSelectionTextFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetSelectionTextSuccessCallback = ( + result: GetSelectionTextSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSettingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetSettingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetSettingSuccessCallback = ( + result: GetSettingSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetShareInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetShareInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetShareInfoSuccessCallback = ( + result: GetGroupEnterInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSkewCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetSkewFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetSkewSuccessCallback = (result: GetSkewSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSkylineInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetSkylineInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetSkylineInfoSuccessCallback = ( + /** 当前运行环境对于 [Skyline 渲染引擎](https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/introduction.html) 的支持情况 */ + result: SkylineInfo + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetStorageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetStorageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetStorageInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetStorageInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetStorageInfoSuccessCallback = ( + option: GetStorageInfoSuccessCallbackOption + ) => void; + /** 接口调用成功的回调函数 */ + type GetStorageSuccessCallback<T = any> = ( + result: GetStorageSuccessCallbackResult<T> + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSystemInfoAsyncCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type GetSystemInfoAsyncFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetSystemInfoAsyncSuccessCallback = (result: SystemInfo) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetSystemInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetSystemInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetSystemInfoSuccessCallback = (result: SystemInfo) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetUserInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetUserInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetUserInfoSuccessCallback = ( + result: GetUserInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetUserProfileCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetUserProfileFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetUserProfileSuccessCallback = ( + result: GetUserProfileSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetVideoInfoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetVideoInfoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetVideoInfoSuccessCallback = ( + result: GetVideoInfoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetWeRunDataCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type GetWeRunDataFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type GetWeRunDataSuccessCallback = ( + result: GetWeRunDataSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type GetWifiListCompleteCallback = (res: WifiError) => void; + /** 接口调用失败的回调函数 */ + type GetWifiListFailCallback = (res: WifiError) => void; + /** 接口调用成功的回调函数 */ + type GetWifiListSuccessCallback = (res: WifiError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type HideHomeButtonCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type HideHomeButtonFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type HideHomeButtonSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type HideKeyboardCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type HideKeyboardFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type HideKeyboardSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type HideLoadingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type HideLoadingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type HideLoadingSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type HideNavigationBarLoadingCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type HideNavigationBarLoadingFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type HideNavigationBarLoadingSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type HideShareMenuCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type HideShareMenuFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type HideShareMenuSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type HideTabBarCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type HideTabBarFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type HideTabBarRedDotCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type HideTabBarRedDotFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type HideTabBarRedDotSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type HideTabBarSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type HideToastCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type HideToastFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type HideToastSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type IncludePointsCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type IncludePointsFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type IncludePointsSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type InitFaceDetectCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type InitFaceDetectFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type InitFaceDetectSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type InitMarkerClusterCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type InitMarkerClusterFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type InitMarkerClusterSuccessCallback = (res: GeneralCallbackResult) => void; + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + type InnerAudioContextOffErrorCallback = ( + result: InnerAudioContextOnErrorListenerResult + ) => void; + /** 音频播放错误事件的监听函数 */ + type InnerAudioContextOnErrorCallback = ( + result: InnerAudioContextOnErrorListenerResult + ) => void; + type InnerAudioContextOnStopCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type InsertDividerCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type InsertDividerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type InsertDividerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type InsertImageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type InsertImageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type InsertImageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type InsertTextCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type InsertTextFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type InsertTextSuccessCallback = (res: GeneralCallbackResult) => void; + /** 监听相交状态变化的回调函数 */ + type IntersectionObserverObserveCallback = ( + result: IntersectionObserverObserveCallbackResult + ) => void; + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + type InterstitialAdOffErrorCallback = ( + result: InterstitialAdOnErrorListenerResult + ) => void; + /** 插屏错误事件的监听函数 */ + type InterstitialAdOnErrorCallback = ( + result: InterstitialAdOnErrorListenerResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type IsBluetoothDevicePairedCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type IsBluetoothDevicePairedFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type IsBluetoothDevicePairedSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type IsConnectedCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type IsConnectedFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type IsConnectedSuccessCallback = (res: Nfcrwerror) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type Join1v1ChatCompleteCallback = (res: Join1v1ChatError) => void; + /** 接口调用失败的回调函数 */ + type Join1v1ChatFailCallback = (res: Join1v1ChatError) => void; + /** 接口调用成功的回调函数 */ + type Join1v1ChatSuccessCallback = (res: Join1v1ChatError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type JoinVoIPChatCompleteCallback = (res: JoinVoIPChatError) => void; + /** 接口调用失败的回调函数 */ + type JoinVoIPChatFailCallback = (res: JoinVoIPChatError) => void; + /** 接口调用成功的回调函数 */ + type JoinVoIPChatSuccessCallback = ( + result: JoinVoIPChatSuccessCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type LivePlayerContextSnapshotSuccessCallback = ( + result: LivePlayerContextSnapshotSuccessCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type LivePusherContextSetZoomSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type LivePusherContextSnapshotSuccessCallback = ( + result: LivePusherContextSnapshotSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type LoadFontFaceCompleteCallback = ( + result: LoadFontFaceCompleteCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type LoadFontFaceFailCallback = ( + result: LoadFontFaceCompleteCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type LoadFontFaceSuccessCallback = ( + result: LoadFontFaceCompleteCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type LoginCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type LoginFailCallback = (err: RequestFailCallbackErr) => void; + /** 接口调用成功的回调函数 */ + type LoginSuccessCallback = (result: LoginSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type MakeBluetoothPairCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type MakeBluetoothPairFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type MakeBluetoothPairSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type MakePhoneCallCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type MakePhoneCallFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type MakePhoneCallSuccessCallback = (res: GeneralCallbackResult) => void; + /** 监听 media query 状态变化的回调函数 */ + type MediaQueryObserverObserveCallback = ( + result: MediaQueryObserverObserveCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type MkdirCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type MkdirFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type MkdirSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type MoveAlongCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type MoveAlongFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type MoveAlongSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type MoveToLocationCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type MoveToLocationFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type MoveToLocationSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type MuteCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type MuteFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type MuteSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type NavigateBackCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type NavigateBackFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type NavigateBackMiniProgramCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type NavigateBackMiniProgramFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type NavigateBackMiniProgramSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type NavigateBackSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type NavigateToCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type NavigateToFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type NavigateToMiniProgramCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type NavigateToMiniProgramFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type NavigateToMiniProgramSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type NavigateToSuccessCallback = ( + result: NavigateToSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type NdefCloseCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type NdefCloseFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type NdefCloseSuccessCallback = (res: Nfcrwerror) => void; + /** 回调函数,在执行 `SelectorQuery.exec` 方法后,返回节点信息。 */ + type NodeCallback = (result: NodeCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type NotifyBLECharacteristicValueChangeCompleteCallback = ( + res: BluetoothError + ) => void; + /** 接口调用失败的回调函数 */ + type NotifyBLECharacteristicValueChangeFailCallback = ( + res: BluetoothError + ) => void; + /** 接口调用成功的回调函数 */ + type NotifyBLECharacteristicValueChangeSuccessCallback = ( + res: BluetoothError + ) => void; + /** onAccelerometerChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffAccelerometerChangeCallback = (res: GeneralCallbackResult) => void; + /** onApiCategoryChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffApiCategoryChangeCallback = ( + result: OnApiCategoryChangeListenerResult + ) => void; + /** onAppHide 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffAppHideCallback = (res: GeneralCallbackResult) => void; + /** onAppShow 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffAppShowCallback = (res: GeneralCallbackResult) => void; + /** onAudioInterruptionBegin 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffAudioInterruptionBeginCallback = (res: GeneralCallbackResult) => void; + /** onAudioInterruptionEnd 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffAudioInterruptionEndCallback = (res: GeneralCallbackResult) => void; + /** onBLEConnectionStateChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffBLEConnectionStateChangeCallback = ( + result: OnBLEConnectionStateChangeListenerResult + ) => void; + /** onBLEMTUChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffBLEMTUChangeCallback = (result: OnBLEMTUChangeListenerResult) => void; + /** onBLEPeripheralConnectionStateChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffBLEPeripheralConnectionStateChangedCallback = ( + result: OnBLEPeripheralConnectionStateChangedListenerResult + ) => void; + /** onBindWifi 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffBindWifiCallback = (res: GeneralCallbackResult) => void; + /** onCanplay 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffCanplayCallback = (res: GeneralCallbackResult) => void; + /** onCharacteristicReadRequest 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffCharacteristicReadRequestCallback = ( + result: OnCharacteristicReadRequestListenerResult + ) => void; + /** onCharacteristicSubscribed 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffCharacteristicSubscribedCallback = ( + result: OnCharacteristicSubscribedListenerResult + ) => void; + /** onCharacteristicUnsubscribed 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffCharacteristicUnsubscribedCallback = ( + result: OnCharacteristicSubscribedListenerResult + ) => void; + /** onCharacteristicWriteRequest 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffCharacteristicWriteRequestCallback = ( + result: OnCharacteristicWriteRequestListenerResult + ) => void; + /** onChunkReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffChunkReceivedCallback = ( + result: OnChunkReceivedListenerResult + ) => void; + /** onCompassChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffCompassChangeCallback = (res: GeneralCallbackResult) => void; + /** onConnect 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffConnectCallback = (res: GeneralCallbackResult) => void; + /** onDeviceMotionChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffDeviceMotionChangeCallback = (res: GeneralCallbackResult) => void; + /** onDiscovered 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffDiscoveredCallback = (result: OnDiscoveredListenerResult) => void; + /** onEmbeddedMiniProgramHeightChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffEmbeddedMiniProgramHeightChangeCallback = ( + result: OnEmbeddedMiniProgramHeightChangeListenerResult + ) => void; + /** onEnded 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffEndedCallback = (res: GeneralCallbackResult) => void; + /** onGetWifiList 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffGetWifiListCallback = (result: OnGetWifiListListenerResult) => void; + /** onGyroscopeChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffGyroscopeChangeCallback = (res: GeneralCallbackResult) => void; + /** onHCEMessage 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffHCEMessageCallback = (result: OnHCEMessageListenerResult) => void; + /** onHeadersReceived 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffHeadersReceivedCallback = ( + result: OnHeadersReceivedListenerResult + ) => void; + /** onKeyboardHeightChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffKeyboardHeightChangeCallback = ( + result: OnKeyboardHeightChangeListenerResult + ) => void; + /** onLazyLoadError 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffLazyLoadErrorCallback = ( + result: OnLazyLoadErrorListenerResult + ) => void; + /** onListening 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffListeningCallback = (res: GeneralCallbackResult) => void; + /** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffLoadCallback = (res: GeneralCallbackResult) => void; + /** onLocalServiceDiscoveryStop 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffLocalServiceDiscoveryStopCallback = ( + res: GeneralCallbackResult + ) => void; + /** onLocalServiceFound 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffLocalServiceFoundCallback = ( + result: OnLocalServiceFoundListenerResult + ) => void; + /** onLocalServiceLost 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffLocalServiceLostCallback = ( + result: OnLocalServiceLostListenerResult + ) => void; + /** onLocalServiceResolveFail 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffLocalServiceResolveFailCallback = ( + result: OnLocalServiceLostListenerResult + ) => void; + /** onLocationChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffLocationChangeCallback = ( + result: OnLocationChangeListenerResult + ) => void; + /** onLocationChangeError 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffLocationChangeErrorCallback = ( + result: OnLocationChangeErrorListenerResult + ) => void; + /** onMemoryWarning 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffMemoryWarningCallback = ( + result: OnMemoryWarningListenerResult + ) => void; + /** onNetworkStatusChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffNetworkStatusChangeCallback = (res: GeneralCallbackResult) => void; + /** onNetworkWeakChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffNetworkWeakChangeCallback = ( + result: OnNetworkWeakChangeListenerResult + ) => void; + /** onPageNotFound 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffPageNotFoundCallback = (result: OnPageNotFoundListenerResult) => void; + /** onPause 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffPauseCallback = (res: GeneralCallbackResult) => void; + /** onPlay 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffPlayCallback = (res: GeneralCallbackResult) => void; + /** onScreenRecordingStateChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffScreenRecordingStateChangedCallback = ( + result: OnScreenRecordingStateChangedListenerResult + ) => void; + /** onSeeked 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffSeekedCallback = (res: GeneralCallbackResult) => void; + /** onSeeking 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffSeekingCallback = (res: GeneralCallbackResult) => void; + /** onStop 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffStopCallback = (res: GeneralCallbackResult) => void; + /** onThemeChange 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffThemeChangeCallback = (result: OnThemeChangeListenerResult) => void; + /** onTimeUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffTimeUpdateCallback = (res: GeneralCallbackResult) => void; + /** onUnhandledRejection 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffUnhandledRejectionCallback = ( + result: OnUnhandledRejectionListenerResult + ) => void; + /** onVoIPChatInterrupted 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffVoIPChatInterruptedCallback = ( + result: OnVoIPChatInterruptedListenerResult + ) => void; + /** onVoIPChatMembersChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffVoIPChatMembersChangedCallback = ( + result: OnVoIPChatMembersChangedListenerResult + ) => void; + /** onVoIPChatSpeakersChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffVoIPChatSpeakersChangedCallback = ( + result: OnVoIPChatSpeakersChangedListenerResult + ) => void; + /** onVoIPChatStateChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffVoIPChatStateChangedCallback = ( + result: OnVoIPChatStateChangedListenerResult + ) => void; + /** onVoIPVideoMembersChanged 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffVoIPVideoMembersChangedCallback = ( + result: OnVoIPVideoMembersChangedListenerResult + ) => void; + /** onWaiting 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffWaitingCallback = (res: GeneralCallbackResult) => void; + /** onWifiConnected 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffWifiConnectedCallback = ( + result: OnWifiConnectedListenerResult + ) => void; + /** onWifiConnectedWithPartialInfo 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffWifiConnectedWithPartialInfoCallback = ( + result: OnWifiConnectedWithPartialInfoListenerResult + ) => void; + /** onWindowResize 传入的监听函数。不传此参数则移除所有监听函数。 */ + type OffWindowResizeCallback = (result: OnWindowResizeListenerResult) => void; + /** 加速度数据事件的监听函数 */ + type OnAccelerometerChangeCallback = ( + result: OnAccelerometerChangeListenerResult + ) => void; + /** API 类别变化事件的监听函数 */ + type OnApiCategoryChangeCallback = ( + result: OnApiCategoryChangeListenerResult + ) => void; + /** 小程序切后台事件的监听函数 */ + type OnAppHideCallback = (res: GeneralCallbackResult) => void; + /** 小程序切前台事件的监听函数 */ + type OnAppShowCallback = ( + /** 启动参数 */ + options: LaunchOptionsApp + ) => void; + /** 音频因为受到系统占用而被中断开始事件的监听函数 */ + type OnAudioInterruptionBeginCallback = (res: GeneralCallbackResult) => void; + /** 音频中断结束事件的监听函数 */ + type OnAudioInterruptionEndCallback = (res: GeneralCallbackResult) => void; + /** 蓝牙低功耗设备的特征值变化事件的监听函数 */ + type OnBLECharacteristicValueChangeCallback = ( + result: OnBLECharacteristicValueChangeListenerResult + ) => void; + /** 蓝牙低功耗连接状态改变事件的监听函数 */ + type OnBLEConnectionStateChangeCallback = ( + result: OnBLEConnectionStateChangeListenerResult + ) => void; + /** 蓝牙低功耗的最大传输单元变化事件的监听函数 */ + type OnBLEMTUChangeCallback = (result: OnBLEMTUChangeListenerResult) => void; + /** 当前外围设备被连接或断开连接事件的监听函数 */ + type OnBLEPeripheralConnectionStateChangedCallback = ( + result: OnBLEPeripheralConnectionStateChangedListenerResult + ) => void; + /** 音乐暂停事件的监听函数 */ + type OnBackgroundAudioPauseCallback = (res: GeneralCallbackResult) => void; + /** 音乐播放事件的监听函数 */ + type OnBackgroundAudioPlayCallback = (res: GeneralCallbackResult) => void; + /** 音乐停止事件的监听函数 */ + type OnBackgroundAudioStopCallback = (res: GeneralCallbackResult) => void; + /** 收到 backgroundFetch 数据事件的监听函数 */ + type OnBackgroundFetchDataCallback = ( + result: OnBackgroundFetchDataListenerResult + ) => void; + /** Beacon 服务状态变化事件的监听函数 */ + type OnBeaconServiceChangeCallback = ( + result: OnBeaconServiceChangeListenerResult + ) => void; + /** Beacon 设备更新事件的监听函数 */ + type OnBeaconUpdateCallback = (result: OnBeaconUpdateListenerResult) => void; + /** 当一个 socket 绑定当前 wifi 网络成功时触发该事件的监听函数 */ + type OnBindWifiCallback = (res: GeneralCallbackResult) => void; + /** 蓝牙适配器状态变化事件的监听函数 */ + type OnBluetoothAdapterStateChangeCallback = ( + result: OnBluetoothAdapterStateChangeListenerResult + ) => void; + /** 搜索到新设备的事件的监听函数 */ + type OnBluetoothDeviceFoundCallback = ( + result: OnBluetoothDeviceFoundListenerResult + ) => void; + /** 回调函数 */ + type OnCameraFrameCallback = (result: OnCameraFrameCallbackResult) => void; + type OnCanplayCallback = (res: GeneralCallbackResult) => void; + /** 已连接的设备请求读当前外围设备的特征值事件的监听函数 */ + type OnCharacteristicReadRequestCallback = ( + result: OnCharacteristicReadRequestListenerResult + ) => void; + /** 特征订阅事件的监听函数 */ + type OnCharacteristicSubscribedCallback = ( + result: OnCharacteristicSubscribedListenerResult + ) => void; + /** 取消特征订阅事件的监听函数 */ + type OnCharacteristicUnsubscribedCallback = ( + result: OnCharacteristicSubscribedListenerResult + ) => void; + /** 已连接的设备请求写当前外围设备的特征值事件的监听函数 */ + type OnCharacteristicWriteRequestCallback = ( + result: OnCharacteristicWriteRequestListenerResult + ) => void; + /** 向微信后台请求检查更新结果事件的监听函数 */ + type OnCheckForUpdateCallback = ( + result: OnCheckForUpdateListenerResult + ) => void; + /** Transfer-Encoding Chunk Received 事件的监听函数 */ + type OnChunkReceivedCallback = ( + result: OnChunkReceivedListenerResult + ) => void; + /** 罗盘数据变化事件的监听函数 */ + type OnCompassChangeCallback = ( + result: OnCompassChangeListenerResult + ) => void; + /** 当一个 socket 连接成功建立的时候触发该事件的监听函数 */ + type OnConnectCallback = (res: GeneralCallbackResult) => void; + /** 用户点击右上角菜单的「复制链接」按钮时触发的事件的监听函数 */ + type OnCopyUrlCallback = (result: OnCopyUrlListenerResult) => void; + /** 设备方向变化事件的监听函数 */ + type OnDeviceMotionChangeCallback = ( + result: OnDeviceMotionChangeListenerResult + ) => void; + /** 的监听函数 */ + type OnDiscoveredCallback = (result: OnDiscoveredListenerResult) => void; + /** 半屏小程序可视高度变化事件的监听函数 */ + type OnEmbeddedMiniProgramHeightChangeCallback = ( + result: OnEmbeddedMiniProgramHeightChangeListenerResult + ) => void; + type OnEndedCallback = (res: GeneralCallbackResult) => void; + /** 已录制完指定帧大小的文件事件的监听函数 */ + type OnFrameRecordedCallback = ( + result: OnFrameRecordedListenerResult + ) => void; + /** 获取到 Wi-Fi 列表数据事件的监听函数 */ + type OnGetWifiListCallback = (result: OnGetWifiListListenerResult) => void; + /** 陀螺仪数据变化事件的监听函数 */ + type OnGyroscopeChangeCallback = ( + result: OnGyroscopeChangeListenerResult + ) => void; + /** 接收 NFC 设备消息事件的监听函数 */ + type OnHCEMessageCallback = (result: OnHCEMessageListenerResult) => void; + /** HTTP Response Header 事件的监听函数 */ + type OnHeadersReceivedCallback = ( + result: OnHeadersReceivedListenerResult + ) => void; + /** 录音因为受到系统占用而被中断开始事件的监听函数 */ + type OnInterruptionBeginCallback = (res: GeneralCallbackResult) => void; + /** 录音中断结束事件的监听函数 */ + type OnInterruptionEndCallback = (res: GeneralCallbackResult) => void; + /** 键盘高度变化事件的监听函数 */ + type OnKeyboardHeightChangeCallback = ( + result: OnKeyboardHeightChangeListenerResult + ) => void; + /** 小程序异步组件加载失败事件的监听函数 */ + type OnLazyLoadErrorCallback = ( + result: OnLazyLoadErrorListenerResult + ) => void; + /** 开始监听数据包消息的事件的监听函数 */ + type OnListeningCallback = (res: GeneralCallbackResult) => void; + type OnLoadCallback = (res: GeneralCallbackResult) => void; + /** mDNS 服务停止搜索的事件的监听函数 */ + type OnLocalServiceDiscoveryStopCallback = ( + res: GeneralCallbackResult + ) => void; + /** mDNS 服务发现的事件的监听函数 */ + type OnLocalServiceFoundCallback = ( + result: OnLocalServiceFoundListenerResult + ) => void; + /** mDNS 服务离开的事件的监听函数 */ + type OnLocalServiceLostCallback = ( + result: OnLocalServiceLostListenerResult + ) => void; + /** mDNS 服务解析失败的事件的监听函数 */ + type OnLocalServiceResolveFailCallback = ( + result: OnLocalServiceLostListenerResult + ) => void; + /** 实时地理位置变化事件的监听函数 */ + type OnLocationChangeCallback = ( + result: OnLocationChangeListenerResult + ) => void; + /** 的监听函数 */ + type OnLocationChangeErrorCallback = ( + result: OnLocationChangeErrorListenerResult + ) => void; + /** 内存不足告警事件的监听函数 */ + type OnMemoryWarningCallback = ( + result: OnMemoryWarningListenerResult + ) => void; + /** 隐私接口需要用户授权事件的监听函数 */ + type OnNeedPrivacyAuthorizationCallback = ( + res: GeneralCallbackResult + ) => void; + /** 网络状态变化事件的监听函数 */ + type OnNetworkStatusChangeCallback = ( + result: OnNetworkStatusChangeListenerResult + ) => void; + /** 弱网状态变化事件的监听函数 */ + type OnNetworkWeakChangeCallback = ( + result: OnNetworkWeakChangeListenerResult + ) => void; + /** 用户在系统音乐播放面板点击下一曲事件的监听函数 */ + type OnNextCallback = (res: GeneralCallbackResult) => void; + /** WebSocket 连接打开事件的监听函数 */ + type OnOpenCallback = (result: OnOpenListenerResult) => void; + /** 小程序要打开的页面不存在事件的监听函数 */ + type OnPageNotFoundCallback = (result: OnPageNotFoundListenerResult) => void; + type OnPauseCallback = (res: GeneralCallbackResult) => void; + type OnPlayCallback = (res: GeneralCallbackResult) => void; + /** 用户在系统音乐播放面板点击上一曲事件的监听函数 */ + type OnPrevCallback = (res: GeneralCallbackResult) => void; + /** worker线程被系统回收事件的监听函数 */ + type OnProcessKilledCallback = (res: GeneralCallbackResult) => void; + /** 录音继续事件的监听函数 */ + type OnResumeCallback = (res: GeneralCallbackResult) => void; + /** 用户录屏事件的监听函数 */ + type OnScreenRecordingStateChangedCallback = ( + result: OnScreenRecordingStateChangedListenerResult + ) => void; + type OnSeekedCallback = (res: GeneralCallbackResult) => void; + type OnSeekingCallback = (res: GeneralCallbackResult) => void; + /** WebSocket 连接关闭事件的监听函数 */ + type OnSocketCloseCallback = ( + result: SocketTaskOnCloseListenerResult + ) => void; + /** WebSocket 错误事件的监听函数 */ + type OnSocketErrorCallback = (result: GeneralCallbackResult) => void; + /** WebSocket 接收到服务器的消息事件的监听函数 */ + type OnSocketMessageCallback = ( + result: SocketTaskOnMessageListenerResult + ) => void; + /** WebSocket 连接打开事件的监听函数 */ + type OnSocketOpenCallback = (result: OnSocketOpenListenerResult) => void; + /** 录音开始事件的监听函数 */ + type OnStartCallback = (res: GeneralCallbackResult) => void; + /** 系统主题改变事件的监听函数 */ + type OnThemeChangeCallback = (result: OnThemeChangeListenerResult) => void; + type OnTimeUpdateCallback = (res: GeneralCallbackResult) => void; + /** 未处理的 Promise 拒绝事件的监听函数 */ + type OnUnhandledRejectionCallback = ( + result: OnUnhandledRejectionListenerResult + ) => void; + /** 小程序更新失败事件的监听函数 */ + type OnUpdateFailedCallback = (res: GeneralCallbackResult) => void; + /** 小程序有版本更新事件的监听函数 */ + type OnUpdateReadyCallback = (res: GeneralCallbackResult) => void; + /** 用户主动截屏事件的监听函数 */ + type OnUserCaptureScreenCallback = (res: GeneralCallbackResult) => void; + /** 被动断开实时语音通话事件的监听函数 */ + type OnVoIPChatInterruptedCallback = ( + result: OnVoIPChatInterruptedListenerResult + ) => void; + /** 实时语音通话成员在线状态变化事件的监听函数 */ + type OnVoIPChatMembersChangedCallback = ( + result: OnVoIPChatMembersChangedListenerResult + ) => void; + /** 实时语音通话成员通话状态变化事件的监听函数 */ + type OnVoIPChatSpeakersChangedCallback = ( + result: OnVoIPChatSpeakersChangedListenerResult + ) => void; + /** 房间状态变化事件的监听函数 */ + type OnVoIPChatStateChangedCallback = ( + result: OnVoIPChatStateChangedListenerResult + ) => void; + /** 实时语音通话成员视频状态变化事件的监听函数 */ + type OnVoIPVideoMembersChangedCallback = ( + result: OnVoIPVideoMembersChangedListenerResult + ) => void; + /** 音频加载中事件的监听函数 */ + type OnWaitingCallback = (res: GeneralCallbackResult) => void; + /** 连接上 Wi-Fi 的事件的监听函数 */ + type OnWifiConnectedCallback = ( + result: OnWifiConnectedListenerResult + ) => void; + /** 连接上 Wi-Fi 的事件的监听函数 */ + type OnWifiConnectedWithPartialInfoCallback = ( + result: OnWifiConnectedWithPartialInfoListenerResult + ) => void; + /** 窗口尺寸变化事件的监听函数 */ + type OnWindowResizeCallback = (result: OnWindowResizeListenerResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenAppAuthorizeSettingCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenAppAuthorizeSettingFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type OpenAppAuthorizeSettingSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenBluetoothAdapterCompleteCallback = (res: BluetoothError) => void; + /** 接口调用失败的回调函数 */ + type OpenBluetoothAdapterFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type OpenBluetoothAdapterSuccessCallback = (res: BluetoothError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenCardCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenCardFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenCardSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenChannelsActivityCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenChannelsActivityFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenChannelsActivitySuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenChannelsEventCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenChannelsEventFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenChannelsEventSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenChannelsLiveCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenChannelsLiveFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenChannelsLiveSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenChannelsUserProfileCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenChannelsUserProfileFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type OpenChannelsUserProfileSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenCompleteCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenCustomerServiceChatCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenCustomerServiceChatFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type OpenCustomerServiceChatSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenDocumentCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenDocumentFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenDocumentSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenEmbeddedMiniProgramCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenEmbeddedMiniProgramFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type OpenEmbeddedMiniProgramSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenFailCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenLocationCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenLocationFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenLocationSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenMapAppCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenMapAppFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenMapAppSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenPrivacyContractCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenPrivacyContractFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenPrivacyContractSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenSettingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenSettingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenSettingSuccessCallback = ( + result: OpenSettingSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenSingleStickerViewCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenSingleStickerViewFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenSingleStickerViewSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenStickerIPViewCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenStickerIPViewFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenStickerIPViewSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenStickerSetViewCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenStickerSetViewFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenStickerSetViewSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenSuccessCallback = (result: OpenSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenSystemBluetoothSettingCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type OpenSystemBluetoothSettingFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type OpenSystemBluetoothSettingSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type OpenVideoEditorCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type OpenVideoEditorFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type OpenVideoEditorSuccessCallback = ( + result: OpenVideoEditorSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PageScrollToCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PageScrollToFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PageScrollToSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PauseBGMCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PauseBGMFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PauseBGMSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PauseBackgroundAudioCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type PauseBackgroundAudioFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PauseBackgroundAudioSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PauseCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PauseFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PauseSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PauseVoiceCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PauseVoiceFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PauseVoiceSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PlayBGMCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PlayBGMFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PlayBGMSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PlayBackgroundAudioCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type PlayBackgroundAudioFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PlayBackgroundAudioSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PlayCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PlayFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PlaySuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PlayVoiceCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PlayVoiceFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PlayVoiceSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PluginLoginCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PluginLoginFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PluginLoginSuccessCallback = ( + result: PluginLoginSuccessCallbackResult + ) => void; + /** 分包加载进度变化事件的监听函数 */ + type PreDownloadSubpackageTaskOnProgressUpdateCallback = ( + result: PreDownloadSubpackageTaskOnProgressUpdateListenerResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PreloadAssetsCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PreloadAssetsFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PreloadAssetsSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PreloadSkylineViewCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type PreloadSkylineViewFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PreloadSkylineViewSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PreloadWebviewCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PreloadWebviewFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PreloadWebviewSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PreviewImageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PreviewImageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PreviewImageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type PreviewMediaCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type PreviewMediaFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type PreviewMediaSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ReLaunchCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ReLaunchFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ReLaunchSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ReadBLECharacteristicValueCompleteCallback = ( + res: BluetoothError + ) => void; + /** 接口调用失败的回调函数 */ + type ReadBLECharacteristicValueFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type ReadBLECharacteristicValueSuccessCallback = ( + res: BluetoothError + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ReadCompleteCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ReadCompressedFileCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type ReadCompressedFileFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type ReadCompressedFileSuccessCallback = ( + result: ReadCompressedFileSuccessCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ReadFailCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ReadFileCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type ReadFileFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type ReadFileSuccessCallback = ( + result: ReadFileSuccessCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type ReadSuccessCallback = (result: ReadSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ReadZipEntryCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type ReadZipEntryFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type ReadZipEntrySuccessCallback = ( + result: ReadZipEntrySuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ReaddirCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type ReaddirFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type ReaddirSuccessCallback = (result: ReaddirSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ReconnectCastingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ReconnectCastingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ReconnectCastingSuccessCallback = (res: GeneralCallbackResult) => void; + /** 录音结束事件的监听函数 */ + type RecorderManagerOnStopCallback = (result: OnStopListenerResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RedirectToCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RedirectToFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RedirectToSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RedoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RedoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RedoSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveArcCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RemoveArcFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveArcSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveCustomLayerCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RemoveCustomLayerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveCustomLayerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveFormatCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RemoveFormatFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveFormatSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveGroundOverlayCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type RemoveGroundOverlayFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveGroundOverlaySuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveMarkersCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RemoveMarkersFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveMarkersSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveSavedFileCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type RemoveSavedFileFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type RemoveSavedFileSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveServiceCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RemoveServiceFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveServiceSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveStorageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RemoveStorageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveStorageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveTabBarBadgeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RemoveTabBarBadgeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveTabBarBadgeSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RemoveVisualLayerCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RemoveVisualLayerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RemoveVisualLayerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RenameCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type RenameFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type RenameSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestDeviceVoIPCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RequestDeviceVoIPFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RequestDeviceVoIPSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RequestFailCallback = (err: RequestFailCallbackErr) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestFullScreenCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RequestFullScreenFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RequestFullScreenSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestOrderPaymentCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type RequestOrderPaymentFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RequestOrderPaymentSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestPaymentCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type RequestPaymentFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RequestPaymentSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestPictureInPictureCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type RequestPictureInPictureFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type RequestPictureInPictureSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestPluginPaymentCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type RequestPluginPaymentFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RequestPluginPaymentSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestSubscribeDeviceMessageCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type RequestSubscribeDeviceMessageFailCallback = ( + result: RequestSubscribeDeviceMessageFailCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type RequestSubscribeDeviceMessageSuccessCallback = ( + result: RequestSubscribeDeviceMessageSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestSubscribeMessageCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type RequestSubscribeMessageFailCallback = ( + result: RequestSubscribeMessageFailCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type RequestSubscribeMessageSuccessCallback = ( + result: RequestSubscribeMessageSuccessCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type RequestSuccessCallback< + T extends string | IAnyObject | ArrayBuffer = + | string + | IAnyObject + | ArrayBuffer + > = (result: RequestSuccessCallbackResult<T>) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequestVirtualPaymentCompleteCallback = ( + res: VirtualPaymentError + ) => void; + /** 接口调用失败的回调函数 */ + type RequestVirtualPaymentFailCallback = ( + err: RequestVirtualPaymentFailCallbackErr + ) => void; + /** 接口调用成功的回调函数 */ + type RequestVirtualPaymentSuccessCallback = ( + result: RequestVirtualPaymentSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RequirePrivacyAuthorizeCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type RequirePrivacyAuthorizeFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type RequirePrivacyAuthorizeSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RestartMiniProgramCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type RestartMiniProgramFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type RestartMiniProgramSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ResumeBGMCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ResumeBGMFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ResumeBGMSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ResumeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ResumeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ResumeSuccessCallback = (res: GeneralCallbackResult) => void; + /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ + type RewardedVideoAdOffCloseCallback = ( + result: RewardedVideoAdOnCloseListenerResult + ) => void; + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + type RewardedVideoAdOffErrorCallback = ( + result: RewardedVideoAdOnErrorListenerResult + ) => void; + /** 用户点击 `关闭广告` 按钮的事件的监听函数 */ + type RewardedVideoAdOnCloseCallback = ( + result: RewardedVideoAdOnCloseListenerResult + ) => void; + /** 激励视频错误事件的监听函数 */ + type RewardedVideoAdOnErrorCallback = ( + result: RewardedVideoAdOnErrorListenerResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type RmdirCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type RmdirFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type RmdirSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SaveFileCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type SaveFileFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type SaveFileSuccessCallback = ( + result: SaveFileSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SaveFileToDiskCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SaveFileToDiskFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SaveFileToDiskSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SaveImageToPhotosAlbumCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SaveImageToPhotosAlbumFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type SaveImageToPhotosAlbumSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SaveVideoToPhotosAlbumCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SaveVideoToPhotosAlbumFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type SaveVideoToPhotosAlbumSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ScanCodeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ScanCodeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ScanCodeSuccessCallback = ( + result: ScanCodeSuccessCallbackResult + ) => void; + /** 回调函数,在执行 `SelectorQuery.exec` 方法后,节点信息会在 `callback` 中返回。 */ + type ScrollOffsetCallback = (result: ScrollOffsetCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SeekBackgroundAudioCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SeekBackgroundAudioFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SeekBackgroundAudioSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SendCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SendFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SendHCEMessageCompleteCallback = (res: NFCError) => void; + /** 接口调用失败的回调函数 */ + type SendHCEMessageFailCallback = (res: NFCError) => void; + /** 接口调用成功的回调函数 */ + type SendHCEMessageSuccessCallback = (res: NFCError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SendMessageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SendMessageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SendMessageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SendSmsCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SendSmsFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SendSmsSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SendSocketMessageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SendSocketMessageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SendSocketMessageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SendSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetBGMVolumeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetBGMVolumeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetBGMVolumeSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetBLEMTUCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetBLEMTUFailCallback = (result: SetBLEMTUFailCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetBLEMTUSuccessCallback = ( + result: SetBLEMTUSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetBackgroundColorCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SetBackgroundColorFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetBackgroundColorSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetBackgroundFetchTokenCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SetBackgroundFetchTokenFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type SetBackgroundFetchTokenSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetBackgroundTextStyleCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SetBackgroundTextStyleFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type SetBackgroundTextStyleSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetBoundaryCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetBoundaryFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetBoundarySuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetCenterOffsetCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetCenterOffsetFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetCenterOffsetSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetClipboardDataCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetClipboardDataFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetClipboardDataSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetContentsCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetContentsFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetContentsSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetEnable1v1ChatCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetEnable1v1ChatFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetEnable1v1ChatSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetEnableDebugCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetEnableDebugFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetEnableDebugSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetInnerAudioOptionCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SetInnerAudioOptionFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetInnerAudioOptionSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetKeepScreenOnCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetKeepScreenOnFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetKeepScreenOnSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetLocMarkerIconCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetLocMarkerIconFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetLocMarkerIconSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetMICVolumeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetMICVolumeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetMICVolumeSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetNavigationBarColorCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SetNavigationBarColorFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetNavigationBarColorSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetNavigationBarTitleCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SetNavigationBarTitleFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetNavigationBarTitleSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetScreenBrightnessCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SetScreenBrightnessFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetScreenBrightnessSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetStorageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetStorageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetStorageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetTabBarBadgeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetTabBarBadgeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetTabBarBadgeSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetTabBarItemCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetTabBarItemFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetTabBarItemSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetTabBarStyleCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetTabBarStyleFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetTabBarStyleSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetTimeoutCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type SetTimeoutFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type SetTimeoutSuccessCallback = (res: Nfcrwerror) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetTopBarTextCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetTopBarTextFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetTopBarTextSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetVisualEffectOnCaptureCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SetVisualEffectOnCaptureFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type SetVisualEffectOnCaptureSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetWifiListCompleteCallback = (res: WifiError) => void; + /** 接口调用失败的回调函数 */ + type SetWifiListFailCallback = (res: WifiError) => void; + /** 接口调用成功的回调函数 */ + type SetWifiListSuccessCallback = (res: WifiError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetWindowSizeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetWindowSizeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SetWindowSizeSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SetZoomCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SetZoomFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShareFileMessageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShareFileMessageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShareFileMessageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShareToWeRunCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShareToWeRunFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShareToWeRunSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShareVideoMessageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShareVideoMessageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShareVideoMessageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowActionSheetCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShowActionSheetFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowActionSheetSuccessCallback = ( + result: ShowActionSheetSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowLoadingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShowLoadingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowLoadingSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowModalCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShowModalFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowModalSuccessCallback = ( + result: ShowModalSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowNavigationBarLoadingCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ShowNavigationBarLoadingFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type ShowNavigationBarLoadingSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowRedPackageCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShowRedPackageFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowRedPackageSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowShareImageMenuCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type ShowShareImageMenuFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowShareImageMenuSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowShareMenuCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShowShareMenuFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowShareMenuSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowTabBarCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShowTabBarFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowTabBarRedDotCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShowTabBarRedDotFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowTabBarRedDotSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowTabBarSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ShowToastCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ShowToastFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ShowToastSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SnapshotCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SnapshotFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SocketTaskCloseCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SocketTaskCloseFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SocketTaskCloseSuccessCallback = (res: GeneralCallbackResult) => void; + /** WebSocket 连接关闭事件的监听函数 */ + type SocketTaskOnCloseCallback = ( + result: SocketTaskOnCloseListenerResult + ) => void; + /** WebSocket 接收到服务器的消息事件的监听函数 */ + type SocketTaskOnMessageCallback = ( + result: SocketTaskOnMessageListenerResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartAccelerometerCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StartAccelerometerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StartAccelerometerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartAdvertisingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StartAdvertisingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StartAdvertisingSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartBeaconDiscoveryCompleteCallback = (res: BeaconError) => void; + /** 接口调用失败的回调函数 */ + type StartBeaconDiscoveryFailCallback = (res: BeaconError) => void; + /** 接口调用成功的回调函数 */ + type StartBeaconDiscoverySuccessCallback = (res: BeaconError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartBluetoothDevicesDiscoveryCompleteCallback = ( + res: BluetoothError + ) => void; + /** 接口调用失败的回调函数 */ + type StartBluetoothDevicesDiscoveryFailCallback = ( + res: BluetoothError + ) => void; + /** 接口调用成功的回调函数 */ + type StartBluetoothDevicesDiscoverySuccessCallback = ( + res: BluetoothError + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartCastingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StartCastingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StartCastingSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartCompassCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StartCompassFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StartCompassSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartDeviceMotionListeningCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StartDeviceMotionListeningFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type StartDeviceMotionListeningSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartDiscoveryCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type StartDiscoveryFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type StartDiscoverySuccessCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type StartFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartGyroscopeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StartGyroscopeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StartGyroscopeSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartHCECompleteCallback = (res: NFCError) => void; + /** 接口调用失败的回调函数 */ + type StartHCEFailCallback = (res: NFCError) => void; + /** 接口调用成功的回调函数 */ + type StartHCESuccessCallback = (res: NFCError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartLocalServiceDiscoveryCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StartLocalServiceDiscoveryFailCallback = ( + result: StartLocalServiceDiscoveryFailCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type StartLocalServiceDiscoverySuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartLocationUpdateBackgroundCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StartLocationUpdateBackgroundFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type StartLocationUpdateBackgroundSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartLocationUpdateCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StartLocationUpdateFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StartLocationUpdateSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartPreviewCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StartPreviewFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StartPreviewSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartPullDownRefreshCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StartPullDownRefreshFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StartPullDownRefreshSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartRecordCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StartRecordFailCallback = (res: GeneralCallbackResult) => void; + /** 超过录制时长上限时会结束录像并触发此回调,录像异常退出时也会触发此回调 */ + type StartRecordTimeoutCallback = ( + result: StartRecordTimeoutCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartSoterAuthenticationCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StartSoterAuthenticationFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type StartSoterAuthenticationSuccessCallback = ( + result: StartSoterAuthenticationSuccessCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type StartSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StartWifiCompleteCallback = (res: WifiError) => void; + /** 接口调用失败的回调函数 */ + type StartWifiFailCallback = (res: WifiError) => void; + /** 接口调用成功的回调函数 */ + type StartWifiSuccessCallback = (res: WifiError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StatCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type StatFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type StatSuccessCallback = (result: StatSuccessCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopAccelerometerCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopAccelerometerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopAccelerometerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopAdvertisingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopAdvertisingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopAdvertisingSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopBGMCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopBGMFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopBGMSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopBackgroundAudioCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StopBackgroundAudioFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopBackgroundAudioSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopBeaconDiscoveryCompleteCallback = (res: BeaconError) => void; + /** 接口调用失败的回调函数 */ + type StopBeaconDiscoveryFailCallback = (res: BeaconError) => void; + /** 接口调用成功的回调函数 */ + type StopBeaconDiscoverySuccessCallback = (res: BeaconError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopBluetoothDevicesDiscoveryCompleteCallback = ( + res: BluetoothError + ) => void; + /** 接口调用失败的回调函数 */ + type StopBluetoothDevicesDiscoveryFailCallback = ( + res: BluetoothError + ) => void; + /** 接口调用成功的回调函数 */ + type StopBluetoothDevicesDiscoverySuccessCallback = ( + res: BluetoothError + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopCompassCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopCompassFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopCompassSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopDeviceMotionListeningCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StopDeviceMotionListeningFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type StopDeviceMotionListeningSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopDiscoveryCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type StopDiscoveryFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type StopDiscoverySuccessCallback = (res: Nfcrwerror) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopFaceDetectCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopFaceDetectFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopFaceDetectSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopGyroscopeCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopGyroscopeFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopGyroscopeSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopHCECompleteCallback = (res: NFCError) => void; + /** 接口调用失败的回调函数 */ + type StopHCEFailCallback = (res: NFCError) => void; + /** 接口调用成功的回调函数 */ + type StopHCESuccessCallback = (res: NFCError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopLocalServiceDiscoveryCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StopLocalServiceDiscoveryFailCallback = ( + result: StopLocalServiceDiscoveryFailCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type StopLocalServiceDiscoverySuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopLocationUpdateCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StopLocationUpdateFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopLocationUpdateSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopPreviewCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopPreviewFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopPreviewSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopPullDownRefreshCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type StopPullDownRefreshFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopPullDownRefreshSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopRecordCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopRecordFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopVoiceCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type StopVoiceFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type StopVoiceSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type StopWifiCompleteCallback = (res: WifiError) => void; + /** 接口调用失败的回调函数 */ + type StopWifiFailCallback = (res: WifiError) => void; + /** 接口调用成功的回调函数 */ + type StopWifiSuccessCallback = (res: WifiError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SubscribeVoIPVideoMembersCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type SubscribeVoIPVideoMembersFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type SubscribeVoIPVideoMembersSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SwitchCameraCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SwitchCameraFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SwitchCameraSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SwitchCastingCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SwitchCastingFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SwitchCastingSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type SwitchTabCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type SwitchTabFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type SwitchTabSuccessCallback = (res: GeneralCallbackResult) => void; + /** onMessage 传入的监听函数。不传此参数则移除所有监听函数。 */ + type TCPSocketOffMessageCallback = ( + result: TCPSocketOnMessageListenerResult + ) => void; + /** 当接收到数据的时触发该事件的监听函数 */ + type TCPSocketOnMessageCallback = ( + result: TCPSocketOnMessageListenerResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type TakePhotoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type TakePhotoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type TakePhotoSuccessCallback = ( + result: TakePhotoSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type TakeSnapshotCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type TakeSnapshotFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type TakeSnapshotSuccessCallback = ( + result: TakeSnapshotSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ToScreenLocationCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ToScreenLocationFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ToScreenLocationSuccessCallback = ( + result: ToScreenLocationSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type ToggleTorchCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type ToggleTorchFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type ToggleTorchSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type TransceiveCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type TransceiveFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type TransceiveSuccessCallback = ( + result: TransceiveSuccessCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type TranslateMarkerCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type TranslateMarkerFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type TranslateMarkerSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type TruncateCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type TruncateFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type TruncateSuccessCallback = (res: FileError) => void; + /** onClose 传入的监听函数。不传此参数则移除所有监听函数。 */ + type UDPSocketOffCloseCallback = (res: GeneralCallbackResult) => void; + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + type UDPSocketOffErrorCallback = (result: GeneralCallbackResult) => void; + /** onMessage 传入的监听函数。不传此参数则移除所有监听函数。 */ + type UDPSocketOffMessageCallback = ( + result: UDPSocketOnMessageListenerResult + ) => void; + type UDPSocketOnCloseCallback = (res: GeneralCallbackResult) => void; + type UDPSocketOnErrorCallback = (result: GeneralCallbackResult) => void; + /** 收到消息的事件的监听函数 */ + type UDPSocketOnMessageCallback = ( + result: UDPSocketOnMessageListenerResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type UndoCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type UndoFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type UndoSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type UnlinkCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type UnlinkFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type UnlinkSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type UnzipCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type UnzipFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type UnzipSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type UpdateGroundOverlayCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type UpdateGroundOverlayFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type UpdateGroundOverlaySuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type UpdateShareMenuCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type UpdateShareMenuFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type UpdateShareMenuSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type UpdateVoIPChatMuteConfigCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type UpdateVoIPChatMuteConfigFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type UpdateVoIPChatMuteConfigSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type UpdateWeChatAppCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type UpdateWeChatAppFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type UpdateWeChatAppSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type UploadFileCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type UploadFileFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type UploadFileSuccessCallback = ( + result: UploadFileSuccessCallbackResult + ) => void; + /** onProgressUpdate 传入的监听函数。不传此参数则移除所有监听函数。 */ + type UploadTaskOffProgressUpdateCallback = ( + result: UploadTaskOnProgressUpdateListenerResult + ) => void; + /** 上传进度变化事件的监听函数 */ + type UploadTaskOnProgressUpdateCallback = ( + result: UploadTaskOnProgressUpdateListenerResult + ) => void; + /** 开启会话回调 */ + type VKSessionStartCallback = ( + /** 参数 status 可选值: + * - 0: 成功; + * - 2000001: 参数错误; + * - 2003000: 会话不可用; + * - 2000000: 系统错误; + * - 2000002: 设备不支持; + * - 2000003: 系统不支持; + * - 2000004: 设备不支持; + * - 2003001: 未开启系统相机权限; + * - 2003002: 未开启小程序相机权限; */ + status: + | 0 + | 2000001 + | 2003000 + | 2000000 + | 2000002 + | 2000003 + | 2000004 + | 2003001 + | 2003002 + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type VibrateLongCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type VibrateLongFailCallback = (res: GeneralCallbackResult) => void; + /** 接口调用成功的回调函数 */ + type VibrateLongSuccessCallback = (res: GeneralCallbackResult) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type VibrateShortCompleteCallback = (res: GeneralCallbackResult) => void; + /** 接口调用失败的回调函数 */ + type VibrateShortFailCallback = ( + result: VibrateShortFailCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type VibrateShortSuccessCallback = (res: GeneralCallbackResult) => void; + /** 主线程/Worker 线程向当前线程发送的消息的事件的监听函数 */ + type WorkerOnMessageCallback = ( + result: WorkerOnMessageListenerResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type WriteBLECharacteristicValueCompleteCallback = ( + res: BluetoothError + ) => void; + /** 接口调用失败的回调函数 */ + type WriteBLECharacteristicValueFailCallback = (res: BluetoothError) => void; + /** 接口调用成功的回调函数 */ + type WriteBLECharacteristicValueSuccessCallback = ( + res: BluetoothError + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type WriteCharacteristicValueCompleteCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用失败的回调函数 */ + type WriteCharacteristicValueFailCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type WriteCharacteristicValueSuccessCallback = ( + res: GeneralCallbackResult + ) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type WriteCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type WriteFailCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type WriteFileCompleteCallback = (res: FileError) => void; + /** 接口调用失败的回调函数 */ + type WriteFileFailCallback = (res: FileError) => void; + /** 接口调用成功的回调函数 */ + type WriteFileSuccessCallback = (res: FileError) => void; + /** 接口调用结束的回调函数(调用成功、失败都会执行) */ + type WriteNdefMessageCompleteCallback = (res: Nfcrwerror) => void; + /** 接口调用失败的回调函数 */ + type WriteNdefMessageFailCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type WriteNdefMessageSuccessCallback = (res: Nfcrwerror) => void; + /** 接口调用成功的回调函数 */ + type WriteSuccessCallback = (result: WriteSuccessCallbackResult) => void; + /** onError 传入的监听函数。不传此参数则移除所有监听函数。 */ + type WxOffErrorCallback = (res: GeneralCallbackResult) => void; + /** 小程序错误事件的监听函数 */ + type WxOnErrorCallback = ( + /** 错误 */ + message: string, + /** 错误调用堆栈 */ + stack: string + ) => void; + /** 接口调用成功的回调函数 */ + type WxStartRecordSuccessCallback = ( + result: StartRecordSuccessCallbackResult + ) => void; + /** 接口调用成功的回调函数 */ + type WxStopRecordSuccessCallback = (res: GeneralCallbackResult) => void; +} diff --git a/typings/types/wx/lib.wx.app.d.ts b/typings/types/wx/lib.wx.app.d.ts new file mode 100644 index 0000000..064f969 --- /dev/null +++ b/typings/types/wx/lib.wx.app.d.ts @@ -0,0 +1,400 @@ +/*! ***************************************************************************** +Copyright (c) 2023 Tencent, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +***************************************************************************** */ + +declare namespace WechatMiniprogram.App { + type SceneValues = + | 1000 + | 1001 + | 1005 + | 1006 + | 1007 + | 1008 + | 1010 + | 1011 + | 1012 + | 1013 + | 1014 + | 1017 + | 1019 + | 1020 + | 1022 + | 1023 + | 1024 + | 1025 + | 1026 + | 1027 + | 1028 + | 1029 + | 1030 + | 1031 + | 1032 + | 1034 + | 1035 + | 1036 + | 1037 + | 1038 + | 1039 + | 1042 + | 1043 + | 1044 + | 1045 + | 1046 + | 1047 + | 1048 + | 1049 + | 1052 + | 1053 + | 1054 + | 1056 + | 1057 + | 1058 + | 1059 + | 1060 + | 1064 + | 1065 + | 1067 + | 1068 + | 1069 + | 1071 + | 1072 + | 1073 + | 1074 + | 1077 + | 1078 + | 1079 + | 1081 + | 1082 + | 1084 + | 1088 + | 1089 + | 1090 + | 1091 + | 1092 + | 1095 + | 1096 + | 1097 + | 1099 + | 1100 + | 1101 + | 1102 + | 1103 + | 1104 + | 1106 + | 1107 + | 1113 + | 1114 + | 1119 + | 1120 + | 1121 + | 1124 + | 1125 + | 1126 + | 1129 + | 1131 + | 1133 + | 1135 + | 1144 + | 1145 + | 1146 + | 1148 + | 1150 + | 1151 + | 1152 + | 1153 + | 1154 + | 1155 + | 1157 + | 1158 + | 1160 + | 1167 + | 1168 + | 1169 + | 1171 + | 1173 + | 1175 + | 1176 + | 1177 + | 1178 + | 1179 + | 1181 + | 1183 + | 1184 + | 1185 + | 1186 + | 1187 + | 1189 + | 1191 + | 1192 + | 1193 + | 1194 + | 1195 + | 1196 + | 1197 + | 1198 + | 1200 + | 1201 + | 1202 + | 1203 + | 1206 + | 1207 + | 1208 + | 1212 + | 1215 + | 1216 + | 1223 + | 1228 + | 1231; + + interface LaunchShowOption { + /** 打开小程序的路径 */ + path: string; + /** 打开小程序的query */ + query: IAnyObject; + /** 打开小程序的场景值 + * - 1000:其他 + * - 1001:发现栏小程序主入口,「最近使用」列表(基础库 2.2.4 版本起包含「我的小程序」列表) + * - 1005:微信首页顶部搜索框的搜索结果页 + * - 1006:发现栏小程序主入口搜索框的搜索结果页 + * - 1007:单人聊天会话中的小程序消息卡片 + * - 1008:群聊会话中的小程序消息卡片 + * - 1010:收藏夹 + * - 1011:扫描二维码 + * - 1012:长按图片识别二维码 + * - 1013:扫描手机相册中选取的二维码 + * - 1014:小程序订阅消息(与 1107 相同) + * - 1017:前往小程序体验版的入口页 + * - 1019:微信钱包(微信客户端 7.0.0 版本改为支付入口) + * - 1020:公众号 profile 页相关小程序列表(已废弃) + * - 1022:聊天顶部置顶小程序入口(微信客户端 6.6.1 版本起废弃) + * - 1023:安卓系统桌面图标 + * - 1024:小程序 profile 页 + * - 1025:扫描一维码 + * - 1026:发现栏小程序主入口,「附近的小程序」列表 + * - 1027:微信首页顶部搜索框搜索结果页「使用过的小程序」列表 + * - 1028:我的卡包 + * - 1029:小程序中的卡券详情页 + * - 1030:自动化测试下打开小程序 + * - 1031:长按图片识别一维码 + * - 1032:扫描手机相册中选取的一维码 + * - 1034:微信支付完成页 + * - 1035:公众号自定义菜单 + * - 1036:App 分享消息卡片 + * - 1037:小程序打开小程序 + * - 1038:从另一个小程序返回 + * - 1039:摇电视 + * - 1042:添加好友搜索框的搜索结果页 + * - 1043:公众号模板消息 + * - 1044:带 shareTicket 的小程序消息卡片 [详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html) + * - 1045:朋友圈广告 + * - 1046:朋友圈广告详情页 + * - 1047:扫描小程序码 + * - 1048:长按图片识别小程序码 + * - 1049:扫描手机相册中选取的小程序码 + * - 1052:卡券的适用门店列表 + * - 1053:搜一搜的结果页 + * - 1054:顶部搜索框小程序快捷入口(微信客户端版本 6.7.4 起废弃) + * - 1056:聊天顶部音乐播放器右上角菜单 + * - 1057:钱包中的银行卡详情页 + * - 1058:公众号文章 + * - 1059:体验版小程序绑定邀请页 + * - 1060:微信支付完成页(与 1034 相同) + * - 1064:微信首页连 Wi-Fi 状态栏 + * - 1065:URL scheme [详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/url-scheme.html) + * - 1067:公众号文章广告 + * - 1068:附近小程序列表广告(已废弃) + * - 1069:移动应用通过 openSDK 进入微信,打开小程序 + * - 1071:钱包中的银行卡列表页 + * - 1072:二维码收款页面 + * - 1073:客服消息列表下发的小程序消息卡片 + * - 1074:公众号会话下发的小程序消息卡片 + * - 1077:摇周边 + * - 1078:微信连 Wi-Fi 成功提示页 + * - 1079:微信游戏中心 + * - 1081:客服消息下发的文字链 + * - 1082:公众号会话下发的文字链 + * - 1084:朋友圈广告原生页 + * - 1088:会话中查看系统消息,打开小程序 + * - 1089:微信聊天主界面下拉,「最近使用」栏(基础库 2.2.4 版本起包含「我的小程序」栏) + * - 1090:长按小程序右上角菜单唤出最近使用历史 + * - 1091:公众号文章商品卡片 + * - 1092:城市服务入口 + * - 1095:小程序广告组件 + * - 1096:聊天记录,打开小程序 + * - 1097:微信支付签约原生页,打开小程序 + * - 1099:页面内嵌插件 + * - 1100:红包封面详情页打开小程序 + * - 1101:远程调试热更新(开发者工具中,预览 -> 自动预览 -> 编译并预览) + * - 1102:公众号 profile 页服务预览 + * - 1103:发现栏小程序主入口,「我的小程序」列表(基础库 2.2.4 版本起废弃) + * - 1104:微信聊天主界面下拉,「我的小程序」栏(基础库 2.2.4 版本起废弃) + * - 1106:聊天主界面下拉,从顶部搜索结果页,打开小程序 + * - 1107:订阅消息,打开小程序 + * - 1113:安卓手机负一屏,打开小程序(三星) + * - 1114:安卓手机侧边栏,打开小程序(三星) + * - 1119:【企业微信】工作台内打开小程序 + * - 1120:【企业微信】个人资料页内打开小程序 + * - 1121:【企业微信】聊天加号附件框内打开小程序 + * - 1124:扫“一物一码”打开小程序 + * - 1125:长按图片识别“一物一码” + * - 1126:扫描手机相册中选取的“一物一码” + * - 1129:微信爬虫访问 [详情](https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/sitemap.html) + * - 1131:浮窗(8.0 版本起仅包含被动浮窗) + * - 1133:硬件设备打开小程序 [详情](https://developers.weixin.qq.com/doc/oplatform/Miniprogram_Frame/) + * - 1135:小程序 profile 页相关小程序列表,打开小程序 + * - 1144:公众号文章 - 视频贴片 + * - 1145:发现栏 - 发现小程序 + * - 1146:地理位置信息打开出行类小程序 + * - 1148:卡包-交通卡,打开小程序 + * - 1150:扫一扫商品条码结果页打开小程序 + * - 1151:发现栏 - 我的订单 + * - 1152:订阅号视频打开小程序 + * - 1153:“识物”结果页打开小程序 + * - 1154:朋友圈内打开“单页模式” + * - 1155:“单页模式”打开小程序 + * - 1157:服务号会话页打开小程序 + * - 1158:群工具打开小程序 + * - 1160:群待办 + * - 1167:H5 通过开放标签打开小程序 [详情](https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_Open_Tag.html) + * - 1168:移动应用直接运行小程序 + * - 1169:发现栏小程序主入口,各个生活服务入口(例如快递服务、出行服务等) + * - 1171:微信运动记录(仅安卓) + * - 1173:聊天素材用小程序打开 [详情](https://developers.weixin.qq.com/miniprogram/dev/framework/material/support_material.html) + * - 1175:视频号主页商店入口 + * - 1176:视频号直播间主播打开小程序 + * - 1177:视频号直播商品 + * - 1178:在电脑打开手机上打开的小程序 + * - 1179:#话题页打开小程序 + * - 1181:网站应用打开 PC 小程序 + * - 1183:PC 微信 - 小程序面板 - 发现小程序 - 搜索 + * - 1184:视频号链接打开小程序 + * - 1185:群公告 + * - 1186:收藏 - 笔记 + * - 1187:浮窗(8.0 版本起) + * - 1189:表情雨广告 + * - 1191:视频号活动 + * - 1192:企业微信联系人 profile 页 + * - 1193:视频号主页服务菜单打开小程序 + * - 1194:URL Link [详情](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/url-link.html) + * - 1195:视频号主页商品 tab + * - 1196:个人状态打开小程序 + * - 1197:视频号主播从直播间返回小游戏 + * - 1198:视频号开播界面打开小游戏 + * - 1200:视频号广告打开小程序 + * - 1201:视频号广告详情页打开小程序 + * - 1202:企微客服号会话打开小程序卡片 + * - 1203:微信小程序压测工具的请求 + * - 1206:视频号小游戏直播间打开小游戏 + * - 1207:企微客服号会话打开小程序文字链 + * - 1208:聊天打开商品卡片 + * - 1212:青少年模式申请页打开小程序 + * - 1215:广告预约打开小程序 + * - 1216:视频号订单中心打开小程序 + * - 1223:安卓桌面 Widget 打开小程序 + * - 1228:视频号原生广告组件打开小程序 + * - 1231:动态消息提醒入口打开小程序 + */ + scene: SceneValues; + /** shareTicket,详见 [获取更多转发信息]((转发#获取更多转发信息)) */ + shareTicket: string; + /** 当场景为由从另一个小程序或公众号或App打开时,返回此字段 */ + referrerInfo?: ReferrerInfo; + } + + interface PageNotFoundOption { + /** 不存在页面的路径 */ + path: string; + /** 打开不存在页面的 query */ + query: IAnyObject; + /** 是否本次启动的首个页面(例如从分享等入口进来,首个页面是开发者配置的分享页面) */ + isEntryPage: boolean; + } + + interface Option { + /** 生命周期回调—监听小程序初始化 + * + * 小程序初始化完成时触发,全局只触发一次。 + */ + onLaunch(options: LaunchShowOption): void; + /** 生命周期回调—监听小程序显示 + * + * 小程序启动,或从后台进入前台显示时 + */ + onShow(options: LaunchShowOption): void; + /** 生命周期回调—监听小程序隐藏 + * + * 小程序从前台进入后台时 + */ + onHide(): void; + /** 错误监听函数 + * + * 小程序发生脚本错误,或者 api + */ + onError(/** 错误信息,包含堆栈 */ error: string): void; + /** 页面不存在监听函数 + * + * 小程序要打开的页面不存在时触发,会带上页面信息回调该函数 + * + * **注意:** + * 1. 如果开发者没有添加 `onPageNotFound` 监听,当跳转页面不存在时,将推入微信客户端原生的页面不存在提示页面。 + * 2. 如果 `onPageNotFound` 回调中又重定向到另一个不存在的页面,将推入微信客户端原生的页面不存在提示页面,并且不再回调 `onPageNotFound`。 + * + * 最低基础库: 1.9.90 + */ + onPageNotFound(options: PageNotFoundOption): void; + /** + * 小程序有未处理的 Promise 拒绝时触发。也可以使用 [wx.onUnhandledRejection](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html) 绑定监听。注意事项请参考 [wx.onUnhandledRejection](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html)。 + * **参数**:与 [wx.onUnhandledRejection](https://developers.weixin.qq.com/miniprogram/dev/api/base/app/app-event/wx.onUnhandledRejection.html) 一致 + */ + onUnhandledRejection: OnUnhandledRejectionCallback; + /** + * 系统切换主题时触发。也可以使用 wx.onThemeChange 绑定监听。 + * + * 最低基础库: 2.11.0 + */ + onThemeChange: OnThemeChangeCallback; + } + + type Instance<T extends IAnyObject> = Option & T; + type Options<T extends IAnyObject> = Partial<Option> & + T & + ThisType<Instance<T>>; + type TrivialInstance = Instance<IAnyObject>; + + interface Constructor { + <T extends IAnyObject>(options: Options<T>): void; + } + + interface GetAppOption { + /** 在 `App` 未定义时返回默认实现。当App被调用时,默认实现中定义的属性会被覆盖合并到App中。一般用于独立分包 + * + * 最低基础库: 2.2.4 + */ + allowDefault?: boolean; + } + + interface GetApp { + <T extends IAnyObject = IAnyObject>(opts?: GetAppOption): Instance<T>; + } +} + +declare let App: WechatMiniprogram.App.Constructor; +declare let getApp: WechatMiniprogram.App.GetApp; diff --git a/typings/types/wx/lib.wx.behavior.d.ts b/typings/types/wx/lib.wx.behavior.d.ts new file mode 100644 index 0000000..78ec880 --- /dev/null +++ b/typings/types/wx/lib.wx.behavior.d.ts @@ -0,0 +1,68 @@ +/*! ***************************************************************************** +Copyright (c) 2023 Tencent, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +***************************************************************************** */ + +declare namespace WechatMiniprogram.Behavior { + type BehaviorIdentifier = string; + type Instance< + TData extends DataOption, + TProperty extends PropertyOption, + TMethod extends MethodOption, + TCustomInstanceProperty extends IAnyObject = Record<string, never> + > = Component.Instance<TData, TProperty, TMethod, TCustomInstanceProperty>; + type TrivialInstance = Instance<IAnyObject, IAnyObject, IAnyObject>; + type TrivialOption = Options<IAnyObject, IAnyObject, IAnyObject>; + type Options< + TData extends DataOption, + TProperty extends PropertyOption, + TMethod extends MethodOption, + TCustomInstanceProperty extends IAnyObject = Record<string, never> + > = Partial<Data<TData>> & + Partial<Property<TProperty>> & + Partial<Method<TMethod>> & + Partial<OtherOption> & + Partial<Lifetimes> & + ThisType<Instance<TData, TProperty, TMethod, TCustomInstanceProperty>>; + interface Constructor { + < + TData extends DataOption, + TProperty extends PropertyOption, + TMethod extends MethodOption, + TCustomInstanceProperty extends IAnyObject = Record<string, never> + >( + options: Options<TData, TProperty, TMethod, TCustomInstanceProperty> + ): BehaviorIdentifier; + } + + type DataOption = Component.DataOption; + type PropertyOption = Component.PropertyOption; + type MethodOption = Component.MethodOption; + type Data<D extends DataOption> = Component.Data<D>; + type Property<P extends PropertyOption> = Component.Property<P>; + type Method<M extends MethodOption> = Component.Method<M>; + + type DefinitionFilter = Component.DefinitionFilter; + type Lifetimes = Component.Lifetimes; + + type OtherOption = Omit<Component.OtherOption, 'options'>; +} +/** 注册一个 `behavior`,接受一个 `Object` 类型的参数。*/ +declare let Behavior: WechatMiniprogram.Behavior.Constructor; diff --git a/typings/types/wx/lib.wx.cloud.d.ts b/typings/types/wx/lib.wx.cloud.d.ts new file mode 100644 index 0000000..18bf693 --- /dev/null +++ b/typings/types/wx/lib.wx.cloud.d.ts @@ -0,0 +1,975 @@ +/*! ***************************************************************************** +Copyright (c) 2023 Tencent, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +***************************************************************************** */ + +/** + * Common interfaces and types + */ + +interface IAPIError { + errMsg: string; +} + +interface IAPIParam<T = any> { + config?: ICloudConfig; + success?: (res: T) => void; + fail?: (err: IAPIError) => void; + complete?: (val: T | IAPIError) => void; +} + +interface IAPISuccessParam { + errMsg: string; +} + +type IAPICompleteParam = IAPISuccessParam | IAPIError; + +type IAPIFunction<T, P extends IAPIParam<T>> = (param?: P) => Promise<T>; + +interface IInitCloudConfig { + env?: + | string + | { + database?: string; + functions?: string; + storage?: string; + }; + traceUser?: boolean; +} + +interface ICloudConfig { + env?: string; + traceUser?: boolean; +} + +interface IICloudAPI { + init: (config?: IInitCloudConfig) => void; + [api: string]: AnyFunction | IAPIFunction<any, any>; +} + +interface ICloudService { + name: string; + + getAPIs: () => { [name: string]: IAPIFunction<any, any> }; +} + +interface ICloudServices { + [serviceName: string]: ICloudService; +} + +interface ICloudMetaData { + session_id: string; +} + +declare class InternalSymbol {} + +interface AnyObject { + [x: string]: any; +} + +type AnyArray = any[]; + +type AnyFunction = (...args: any[]) => any; + +/** + * extend wx with cloud + */ +interface WxCloud { + init: (config?: ICloudConfig) => void; + + callFunction(param: OQ<ICloud.CallFunctionParam>): void; + callFunction( + param: RQ<ICloud.CallFunctionParam> + ): Promise<ICloud.CallFunctionResult>; + + uploadFile(param: OQ<ICloud.UploadFileParam>): WechatMiniprogram.UploadTask; + uploadFile( + param: RQ<ICloud.UploadFileParam> + ): Promise<ICloud.UploadFileResult>; + + downloadFile( + param: OQ<ICloud.DownloadFileParam> + ): WechatMiniprogram.DownloadTask; + downloadFile( + param: RQ<ICloud.DownloadFileParam> + ): Promise<ICloud.DownloadFileResult>; + + getTempFileURL(param: OQ<ICloud.GetTempFileURLParam>): void; + getTempFileURL( + param: RQ<ICloud.GetTempFileURLParam> + ): Promise<ICloud.GetTempFileURLResult>; + + deleteFile(param: OQ<ICloud.DeleteFileParam>): void; + deleteFile( + param: RQ<ICloud.DeleteFileParam> + ): Promise<ICloud.DeleteFileResult>; + + database: (config?: ICloudConfig) => DB.Database; + + CloudID: ICloud.ICloudIDConstructor; + CDN: ICloud.ICDNConstructor; + + callContainer(param: OQ<ICloud.CallContainerParam>): void; + callContainer( + param: RQ<ICloud.CallContainerParam> + ): Promise<ICloud.CallContainerResult>; + + connectContainer(param: OQ<ICloud.ConnectContainerParam>): void; + connectContainer( + param: RQ<ICloud.ConnectContainerParam> + ): Promise<ICloud.ConnectContainerResult>; +} + +declare namespace ICloud { + interface ICloudAPIParam<T = any> extends IAPIParam<T> { + config?: ICloudConfig; + } + + // === API: callFunction === + type CallFunctionData = AnyObject; + + interface CallFunctionResult extends IAPISuccessParam { + result: AnyObject | string | undefined; + } + + interface CallFunctionParam extends ICloudAPIParam<CallFunctionResult> { + name: string; + data?: CallFunctionData; + slow?: boolean; + } + // === end === + + // === API: container === + type CallContainerData = AnyObject; + + interface CallContainerResult extends IAPISuccessParam { + data: any; + statusCode: number; + header: Record<string, any>; + callID: string; + } + + interface CallContainerParam extends ICloudAPIParam<CallContainerResult> { + path: string; + service?: string; + method?: string; + header?: Record<string, any>; + data?: any; // string, object, ArrayBuffer + dataType?: string; + responseType?: string; + timeout?: number; + verbose?: boolean; + followRedirect?: boolean; + } + + interface ConnectContainerResult extends IAPISuccessParam { + socketTask: WechatMiniprogram.SocketTask; + } + + interface ConnectSocketOptions extends IAPIParam<void> { + header?: Record<string, string>; + protocols?: string[]; + tcpNoDelay?: boolean; + perMessageDeflate?: boolean; + timeout?: number; + } + + type ConnectContainerParam = Omit< + ConnectSocketOptions, + 'success' | 'fail' | 'complete' + > & + ICloudAPIParam<ConnectContainerResult> & { + service: string; + path?: string; + }; + // === end === + + // === API: uploadFile === + interface UploadFileResult extends IAPISuccessParam { + fileID: string; + statusCode: number; + } + + interface UploadFileParam extends ICloudAPIParam<UploadFileResult> { + cloudPath: string; + filePath: string; + header?: AnyObject; + } + // === end === + + // === API: downloadFile === + interface DownloadFileResult extends IAPISuccessParam { + tempFilePath: string; + statusCode: number; + } + + interface DownloadFileParam extends ICloudAPIParam<DownloadFileResult> { + fileID: string; + cloudPath?: string; + } + // === end === + + // === API: getTempFileURL === + interface GetTempFileURLResult extends IAPISuccessParam { + fileList: GetTempFileURLResultItem[]; + } + + interface GetTempFileURLResultItem { + fileID: string; + tempFileURL: string; + maxAge: number; + status: number; + errMsg: string; + } + + interface GetTempFileURLParam extends ICloudAPIParam<GetTempFileURLResult> { + fileList: string[]; + } + // === end === + + // === API: deleteFile === + interface DeleteFileResult extends IAPISuccessParam { + fileList: DeleteFileResultItem[]; + } + + interface DeleteFileResultItem { + fileID: string; + status: number; + errMsg: string; + } + + interface DeleteFileParam extends ICloudAPIParam<DeleteFileResult> { + fileList: string[]; + } + // === end === + + // === API: CloudID === + abstract class CloudID { + constructor(cloudID: string); + } + + interface ICloudIDConstructor { + new (cloudId: string): CloudID; + (cloudId: string): CloudID; + } + // === end === + + // === API: CDN === + abstract class CDN { + target: string | ArrayBuffer | ICDNFilePathSpec; + constructor(target: string | ArrayBuffer | ICDNFilePathSpec); + } + + interface ICDNFilePathSpec { + type: 'filePath'; + filePath: string; + } + + interface ICDNConstructor { + new (options: string | ArrayBuffer | ICDNFilePathSpec): CDN; + (options: string | ArrayBuffer | ICDNFilePathSpec): CDN; + } + // === end === +} + +// === Database === +declare namespace DB { + /** + * The class of all exposed cloud database instances + */ + class Database { + readonly config: ICloudConfig; + readonly command: DatabaseCommand; + readonly Geo: IGeo; + readonly serverDate: () => ServerDate; + readonly RegExp: IRegExpConstructor; + + private constructor(); + + collection(collectionName: string): CollectionReference; + } + + class CollectionReference extends Query { + readonly collectionName: string; + + private constructor(name: string, database: Database); + + doc(docId: string | number): DocumentReference; + + add(options: OQ<IAddDocumentOptions>): void; + add(options: RQ<IAddDocumentOptions>): Promise<IAddResult>; + } + + class DocumentReference { + private constructor(docId: string | number, database: Database); + + field(object: Record<string, any>): this; + + get(options: OQ<IGetDocumentOptions>): void; + get(options?: RQ<IGetDocumentOptions>): Promise<IQuerySingleResult>; + + set(options: OQ<ISetSingleDocumentOptions>): void; + set(options?: RQ<ISetSingleDocumentOptions>): Promise<ISetResult>; + + update(options: OQ<IUpdateSingleDocumentOptions>): void; + update(options?: RQ<IUpdateSingleDocumentOptions>): Promise<IUpdateResult>; + + remove(options: OQ<IRemoveSingleDocumentOptions>): void; + remove(options?: RQ<IRemoveSingleDocumentOptions>): Promise<IRemoveResult>; + + watch(options: IWatchOptions): RealtimeListener; + } + + class RealtimeListener { + // "And Now His Watch Is Ended" + close: () => Promise<void>; + } + + class Query { + where(condition: IQueryCondition): Query; + + orderBy(fieldPath: string, order: string): Query; + + limit(max: number): Query; + + skip(offset: number): Query; + + field(object: Record<string, any>): Query; + + get(options: OQ<IGetDocumentOptions>): void; + get(options?: RQ<IGetDocumentOptions>): Promise<IQueryResult>; + + count(options: OQ<ICountDocumentOptions>): void; + count(options?: RQ<ICountDocumentOptions>): Promise<ICountResult>; + + watch(options: IWatchOptions): RealtimeListener; + } + + interface DatabaseCommand { + eq(val: any): DatabaseQueryCommand; + neq(val: any): DatabaseQueryCommand; + gt(val: any): DatabaseQueryCommand; + gte(val: any): DatabaseQueryCommand; + lt(val: any): DatabaseQueryCommand; + lte(val: any): DatabaseQueryCommand; + in(val: any[]): DatabaseQueryCommand; + nin(val: any[]): DatabaseQueryCommand; + + geoNear(options: IGeoNearCommandOptions): DatabaseQueryCommand; + geoWithin(options: IGeoWithinCommandOptions): DatabaseQueryCommand; + geoIntersects(options: IGeoIntersectsCommandOptions): DatabaseQueryCommand; + + and( + ...expressions: Array<DatabaseLogicCommand | IQueryCondition> + ): DatabaseLogicCommand; + or( + ...expressions: Array<DatabaseLogicCommand | IQueryCondition> + ): DatabaseLogicCommand; + nor( + ...expressions: Array<DatabaseLogicCommand | IQueryCondition> + ): DatabaseLogicCommand; + not(expression: DatabaseLogicCommand): DatabaseLogicCommand; + + exists(val: boolean): DatabaseQueryCommand; + + mod(divisor: number, remainder: number): DatabaseQueryCommand; + + all(val: any[]): DatabaseQueryCommand; + elemMatch(val: any): DatabaseQueryCommand; + size(val: number): DatabaseQueryCommand; + + set(val: any): DatabaseUpdateCommand; + remove(): DatabaseUpdateCommand; + inc(val: number): DatabaseUpdateCommand; + mul(val: number): DatabaseUpdateCommand; + min(val: number): DatabaseUpdateCommand; + max(val: number): DatabaseUpdateCommand; + rename(val: string): DatabaseUpdateCommand; + bit(val: number): DatabaseUpdateCommand; + + push(...values: any[]): DatabaseUpdateCommand; + pop(): DatabaseUpdateCommand; + shift(): DatabaseUpdateCommand; + unshift(...values: any[]): DatabaseUpdateCommand; + addToSet(val: any): DatabaseUpdateCommand; + pull(val: any): DatabaseUpdateCommand; + pullAll(val: any): DatabaseUpdateCommand; + + project: { + slice(val: number | [number, number]): DatabaseProjectionCommand; + }; + + aggregate: { + __safe_props__?: Set<string>; + + abs(val: any): DatabaseAggregateCommand; + add(val: any): DatabaseAggregateCommand; + addToSet(val: any): DatabaseAggregateCommand; + allElementsTrue(val: any): DatabaseAggregateCommand; + and(val: any): DatabaseAggregateCommand; + anyElementTrue(val: any): DatabaseAggregateCommand; + arrayElemAt(val: any): DatabaseAggregateCommand; + arrayToObject(val: any): DatabaseAggregateCommand; + avg(val: any): DatabaseAggregateCommand; + ceil(val: any): DatabaseAggregateCommand; + cmp(val: any): DatabaseAggregateCommand; + concat(val: any): DatabaseAggregateCommand; + concatArrays(val: any): DatabaseAggregateCommand; + cond(val: any): DatabaseAggregateCommand; + convert(val: any): DatabaseAggregateCommand; + dateFromParts(val: any): DatabaseAggregateCommand; + dateToParts(val: any): DatabaseAggregateCommand; + dateFromString(val: any): DatabaseAggregateCommand; + dateToString(val: any): DatabaseAggregateCommand; + dayOfMonth(val: any): DatabaseAggregateCommand; + dayOfWeek(val: any): DatabaseAggregateCommand; + dayOfYear(val: any): DatabaseAggregateCommand; + divide(val: any): DatabaseAggregateCommand; + eq(val: any): DatabaseAggregateCommand; + exp(val: any): DatabaseAggregateCommand; + filter(val: any): DatabaseAggregateCommand; + first(val: any): DatabaseAggregateCommand; + floor(val: any): DatabaseAggregateCommand; + gt(val: any): DatabaseAggregateCommand; + gte(val: any): DatabaseAggregateCommand; + hour(val: any): DatabaseAggregateCommand; + ifNull(val: any): DatabaseAggregateCommand; + in(val: any): DatabaseAggregateCommand; + indexOfArray(val: any): DatabaseAggregateCommand; + indexOfBytes(val: any): DatabaseAggregateCommand; + indexOfCP(val: any): DatabaseAggregateCommand; + isArray(val: any): DatabaseAggregateCommand; + isoDayOfWeek(val: any): DatabaseAggregateCommand; + isoWeek(val: any): DatabaseAggregateCommand; + isoWeekYear(val: any): DatabaseAggregateCommand; + last(val: any): DatabaseAggregateCommand; + let(val: any): DatabaseAggregateCommand; + literal(val: any): DatabaseAggregateCommand; + ln(val: any): DatabaseAggregateCommand; + log(val: any): DatabaseAggregateCommand; + log10(val: any): DatabaseAggregateCommand; + lt(val: any): DatabaseAggregateCommand; + lte(val: any): DatabaseAggregateCommand; + ltrim(val: any): DatabaseAggregateCommand; + map(val: any): DatabaseAggregateCommand; + max(val: any): DatabaseAggregateCommand; + mergeObjects(val: any): DatabaseAggregateCommand; + meta(val: any): DatabaseAggregateCommand; + min(val: any): DatabaseAggregateCommand; + millisecond(val: any): DatabaseAggregateCommand; + minute(val: any): DatabaseAggregateCommand; + mod(val: any): DatabaseAggregateCommand; + month(val: any): DatabaseAggregateCommand; + multiply(val: any): DatabaseAggregateCommand; + neq(val: any): DatabaseAggregateCommand; + not(val: any): DatabaseAggregateCommand; + objectToArray(val: any): DatabaseAggregateCommand; + or(val: any): DatabaseAggregateCommand; + pow(val: any): DatabaseAggregateCommand; + push(val: any): DatabaseAggregateCommand; + range(val: any): DatabaseAggregateCommand; + reduce(val: any): DatabaseAggregateCommand; + reverseArray(val: any): DatabaseAggregateCommand; + rtrim(val: any): DatabaseAggregateCommand; + second(val: any): DatabaseAggregateCommand; + setDifference(val: any): DatabaseAggregateCommand; + setEquals(val: any): DatabaseAggregateCommand; + setIntersection(val: any): DatabaseAggregateCommand; + setIsSubset(val: any): DatabaseAggregateCommand; + setUnion(val: any): DatabaseAggregateCommand; + size(val: any): DatabaseAggregateCommand; + slice(val: any): DatabaseAggregateCommand; + split(val: any): DatabaseAggregateCommand; + sqrt(val: any): DatabaseAggregateCommand; + stdDevPop(val: any): DatabaseAggregateCommand; + stdDevSamp(val: any): DatabaseAggregateCommand; + strcasecmp(val: any): DatabaseAggregateCommand; + strLenBytes(val: any): DatabaseAggregateCommand; + strLenCP(val: any): DatabaseAggregateCommand; + substr(val: any): DatabaseAggregateCommand; + substrBytes(val: any): DatabaseAggregateCommand; + substrCP(val: any): DatabaseAggregateCommand; + subtract(val: any): DatabaseAggregateCommand; + sum(val: any): DatabaseAggregateCommand; + switch(val: any): DatabaseAggregateCommand; + toBool(val: any): DatabaseAggregateCommand; + toDate(val: any): DatabaseAggregateCommand; + toDecimal(val: any): DatabaseAggregateCommand; + toDouble(val: any): DatabaseAggregateCommand; + toInt(val: any): DatabaseAggregateCommand; + toLong(val: any): DatabaseAggregateCommand; + toObjectId(val: any): DatabaseAggregateCommand; + toString(val: any): DatabaseAggregateCommand; + toLower(val: any): DatabaseAggregateCommand; + toUpper(val: any): DatabaseAggregateCommand; + trim(val: any): DatabaseAggregateCommand; + trunc(val: any): DatabaseAggregateCommand; + type(val: any): DatabaseAggregateCommand; + week(val: any): DatabaseAggregateCommand; + year(val: any): DatabaseAggregateCommand; + zip(val: any): DatabaseAggregateCommand; + }; + } + + class DatabaseAggregateCommand {} + + enum LOGIC_COMMANDS_LITERAL { + AND = 'and', + OR = 'or', + NOT = 'not', + NOR = 'nor' + } + + class DatabaseLogicCommand { + and(...expressions: DatabaseLogicCommand[]): DatabaseLogicCommand; + or(...expressions: DatabaseLogicCommand[]): DatabaseLogicCommand; + nor(...expressions: DatabaseLogicCommand[]): DatabaseLogicCommand; + not(expression: DatabaseLogicCommand): DatabaseLogicCommand; + } + + enum QUERY_COMMANDS_LITERAL { + // comparison + EQ = 'eq', + NEQ = 'neq', + GT = 'gt', + GTE = 'gte', + LT = 'lt', + LTE = 'lte', + IN = 'in', + NIN = 'nin', + // geo + GEO_NEAR = 'geoNear', + GEO_WITHIN = 'geoWithin', + GEO_INTERSECTS = 'geoIntersects', + // element + EXISTS = 'exists', + // evaluation + MOD = 'mod', + // array + ALL = 'all', + ELEM_MATCH = 'elemMatch', + SIZE = 'size' + } + + class DatabaseQueryCommand extends DatabaseLogicCommand { + eq(val: any): DatabaseLogicCommand; + neq(val: any): DatabaseLogicCommand; + gt(val: any): DatabaseLogicCommand; + gte(val: any): DatabaseLogicCommand; + lt(val: any): DatabaseLogicCommand; + lte(val: any): DatabaseLogicCommand; + in(val: any[]): DatabaseLogicCommand; + nin(val: any[]): DatabaseLogicCommand; + + exists(val: boolean): DatabaseLogicCommand; + + mod(divisor: number, remainder: number): DatabaseLogicCommand; + + all(val: any[]): DatabaseLogicCommand; + elemMatch(val: any): DatabaseLogicCommand; + size(val: number): DatabaseLogicCommand; + + geoNear(options: IGeoNearCommandOptions): DatabaseLogicCommand; + geoWithin(options: IGeoWithinCommandOptions): DatabaseLogicCommand; + geoIntersects(options: IGeoIntersectsCommandOptions): DatabaseLogicCommand; + } + + enum PROJECTION_COMMANDS_LITERAL { + SLICE = 'slice' + } + + class DatabaseProjectionCommand {} + + enum UPDATE_COMMANDS_LITERAL { + // field + SET = 'set', + REMOVE = 'remove', + INC = 'inc', + MUL = 'mul', + MIN = 'min', + MAX = 'max', + RENAME = 'rename', + // bitwise + BIT = 'bit', + // array + PUSH = 'push', + POP = 'pop', + SHIFT = 'shift', + UNSHIFT = 'unshift', + ADD_TO_SET = 'addToSet', + PULL = 'pull', + PULL_ALL = 'pullAll' + } + + class DatabaseUpdateCommand {} + + class Batch {} + + /** + * A contract that all API provider must adhere to + */ + class APIBaseContract< + PromiseReturn, + CallbackReturn, + Param extends IAPIParam, + Context = any + > { + getContext(param: Param): Context; + + /** + * In case of callback-style invocation, this function will be called + */ + getCallbackReturn(param: Param, context: Context): CallbackReturn; + + getFinalParam<T extends Param>(param: Param, context: Context): T; + + run<T extends Param>(param: T): Promise<PromiseReturn>; + } + + interface IGeoPointConstructor { + new (longitude: number, latitide: number): GeoPoint; + new (geojson: IGeoJSONPoint): GeoPoint; + (longitude: number, latitide: number): GeoPoint; + (geojson: IGeoJSONPoint): GeoPoint; + } + + interface IGeoMultiPointConstructor { + new (points: GeoPoint[] | IGeoJSONMultiPoint): GeoMultiPoint; + (points: GeoPoint[] | IGeoJSONMultiPoint): GeoMultiPoint; + } + + interface IGeoLineStringConstructor { + new (points: GeoPoint[] | IGeoJSONLineString): GeoLineString; + (points: GeoPoint[] | IGeoJSONLineString): GeoLineString; + } + + interface IGeoMultiLineStringConstructor { + new ( + lineStrings: GeoLineString[] | IGeoJSONMultiLineString + ): GeoMultiLineString; + ( + lineStrings: GeoLineString[] | IGeoJSONMultiLineString + ): GeoMultiLineString; + } + + interface IGeoPolygonConstructor { + new (lineStrings: GeoLineString[] | IGeoJSONPolygon): GeoPolygon; + (lineStrings: GeoLineString[] | IGeoJSONPolygon): GeoPolygon; + } + + interface IGeoMultiPolygonConstructor { + new (polygons: GeoPolygon[] | IGeoJSONMultiPolygon): GeoMultiPolygon; + (polygons: GeoPolygon[] | IGeoJSONMultiPolygon): GeoMultiPolygon; + } + + interface IGeo { + Point: IGeoPointConstructor; + MultiPoint: IGeoMultiPointConstructor; + LineString: IGeoLineStringConstructor; + MultiLineString: IGeoMultiLineStringConstructor; + Polygon: IGeoPolygonConstructor; + MultiPolygon: IGeoMultiPolygonConstructor; + } + + interface IGeoJSONPoint { + type: 'Point'; + coordinates: [number, number]; + } + + interface IGeoJSONMultiPoint { + type: 'MultiPoint'; + coordinates: Array<[number, number]>; + } + + interface IGeoJSONLineString { + type: 'LineString'; + coordinates: Array<[number, number]>; + } + + interface IGeoJSONMultiLineString { + type: 'MultiLineString'; + coordinates: Array<Array<[number, number]>>; + } + + interface IGeoJSONPolygon { + type: 'Polygon'; + coordinates: Array<Array<[number, number]>>; + } + + interface IGeoJSONMultiPolygon { + type: 'MultiPolygon'; + coordinates: Array<Array<Array<[number, number]>>>; + } + + type IGeoJSONObject = + | IGeoJSONPoint + | IGeoJSONMultiPoint + | IGeoJSONLineString + | IGeoJSONMultiLineString + | IGeoJSONPolygon + | IGeoJSONMultiPolygon; + + abstract class GeoPoint { + longitude: number; + latitude: number; + + constructor(longitude: number, latitude: number); + + toJSON(): Record<string, any>; + toString(): string; + } + + abstract class GeoMultiPoint { + points: GeoPoint[]; + + constructor(points: GeoPoint[]); + + toJSON(): IGeoJSONMultiPoint; + toString(): string; + } + + abstract class GeoLineString { + points: GeoPoint[]; + + constructor(points: GeoPoint[]); + + toJSON(): IGeoJSONLineString; + toString(): string; + } + + abstract class GeoMultiLineString { + lines: GeoLineString[]; + + constructor(lines: GeoLineString[]); + + toJSON(): IGeoJSONMultiLineString; + toString(): string; + } + + abstract class GeoPolygon { + lines: GeoLineString[]; + + constructor(lines: GeoLineString[]); + + toJSON(): IGeoJSONPolygon; + toString(): string; + } + + abstract class GeoMultiPolygon { + polygons: GeoPolygon[]; + + constructor(polygons: GeoPolygon[]); + + toJSON(): IGeoJSONMultiPolygon; + toString(): string; + } + + type GeoInstance = + | GeoPoint + | GeoMultiPoint + | GeoLineString + | GeoMultiLineString + | GeoPolygon + | GeoMultiPolygon; + + interface IGeoNearCommandOptions { + geometry: GeoPoint; + maxDistance?: number; + minDistance?: number; + } + + interface IGeoWithinCommandOptions { + geometry: GeoPolygon | GeoMultiPolygon; + } + + interface IGeoIntersectsCommandOptions { + geometry: + | GeoPoint + | GeoMultiPoint + | GeoLineString + | GeoMultiLineString + | GeoPolygon + | GeoMultiPolygon; + } + + interface IServerDateOptions { + offset: number; + } + + abstract class ServerDate { + readonly options: IServerDateOptions; + constructor(options?: IServerDateOptions); + } + + interface IRegExpOptions { + regexp: string; + options?: string; + } + + interface IRegExpConstructor { + new (options: IRegExpOptions): RegExp; + (options: IRegExpOptions): RegExp; + } + + abstract class RegExp { + readonly regexp: string; + readonly options: string; + constructor(options: IRegExpOptions); + } + + type DocumentId = string | number; + + interface IDocumentData { + _id?: DocumentId; + [key: string]: any; + } + + type IDBAPIParam = IAPIParam; + + interface IAddDocumentOptions extends IDBAPIParam { + data: IDocumentData; + } + + type IGetDocumentOptions = IDBAPIParam; + + type ICountDocumentOptions = IDBAPIParam; + + interface IUpdateDocumentOptions extends IDBAPIParam { + data: IUpdateCondition; + } + + interface IUpdateSingleDocumentOptions extends IDBAPIParam { + data: IUpdateCondition; + } + + interface ISetDocumentOptions extends IDBAPIParam { + data: IUpdateCondition; + } + + interface ISetSingleDocumentOptions extends IDBAPIParam { + data: IUpdateCondition; + } + + interface IRemoveDocumentOptions extends IDBAPIParam { + query: IQueryCondition; + } + + type IRemoveSingleDocumentOptions = IDBAPIParam; + + interface IWatchOptions { + // server realtime data init & change event + onChange: (snapshot: ISnapshot) => void; + // error while connecting / listening + onError: (error: any) => void; + } + + interface ISnapshot { + id: number; + docChanges: ISingleDBEvent[]; + docs: Record<string, any>; + type?: SnapshotType; + } + + type SnapshotType = 'init'; + + interface ISingleDBEvent { + id: number; + dataType: DataType; + queueType: QueueType; + docId: string; + doc: Record<string, any>; + updatedFields?: Record<string, any>; + removedFields?: string[]; + } + + type DataType = 'init' | 'update' | 'replace' | 'add' | 'remove' | 'limit'; + + type QueueType = 'init' | 'enqueue' | 'dequeue' | 'update'; + + interface IQueryCondition { + [key: string]: any; + } + + type IStringQueryCondition = string; + + interface IQueryResult extends IAPISuccessParam { + data: IDocumentData[]; + } + + interface IQuerySingleResult extends IAPISuccessParam { + data: IDocumentData; + } + + interface IUpdateCondition { + [key: string]: any; + } + + type IStringUpdateCondition = string; + + interface IAddResult extends IAPISuccessParam { + _id: DocumentId; + } + + interface IUpdateResult extends IAPISuccessParam { + stats: { + updated: number; + // created: number, + }; + } + + interface ISetResult extends IAPISuccessParam { + _id: DocumentId; + stats: { + updated: number; + created: number; + }; + } + + interface IRemoveResult extends IAPISuccessParam { + stats: { + removed: number; + }; + } + + interface ICountResult extends IAPISuccessParam { + total: number; + } +} + +type Optional<T> = { [K in keyof T]+?: T[K] }; + +type OQ< + T extends Optional< + Record<'complete' | 'success' | 'fail', (...args: any[]) => any> + > +> = + | (RQ<T> & Required<Pick<T, 'success'>>) + | (RQ<T> & Required<Pick<T, 'fail'>>) + | (RQ<T> & Required<Pick<T, 'complete'>>) + | (RQ<T> & Required<Pick<T, 'success' | 'fail'>>) + | (RQ<T> & Required<Pick<T, 'success' | 'complete'>>) + | (RQ<T> & Required<Pick<T, 'fail' | 'complete'>>) + | (RQ<T> & Required<Pick<T, 'fail' | 'complete' | 'success'>>); + +type RQ< + T extends Optional< + Record<'complete' | 'success' | 'fail', (...args: any[]) => any> + > +> = Pick<T, Exclude<keyof T, 'complete' | 'success' | 'fail'>>; diff --git a/typings/types/wx/lib.wx.component.d.ts b/typings/types/wx/lib.wx.component.d.ts new file mode 100644 index 0000000..ad34a25 --- /dev/null +++ b/typings/types/wx/lib.wx.component.d.ts @@ -0,0 +1,670 @@ +/*! ***************************************************************************** +Copyright (c) 2023 Tencent, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +***************************************************************************** */ + +declare namespace WechatMiniprogram.Component { + type Instance< + TData extends DataOption, + TProperty extends PropertyOption, + TMethod extends Partial<MethodOption>, + TCustomInstanceProperty extends IAnyObject = {}, + TIsPage extends boolean = false + > = InstanceProperties & + InstanceMethods<TData> & + TMethod & + (TIsPage extends true ? Page.ILifetime : {}) & + TCustomInstanceProperty & { + /** 组件数据,**包括内部数据和属性值** */ + data: TData & PropertyOptionToData<TProperty>; + /** 组件数据,**包括内部数据和属性值**(与 `data` 一致) */ + properties: TData & PropertyOptionToData<TProperty>; + }; + type TrivialInstance = Instance< + IAnyObject, + IAnyObject, + IAnyObject, + IAnyObject + >; + type TrivialOption = Options<IAnyObject, IAnyObject, IAnyObject, IAnyObject>; + type Options< + TData extends DataOption, + TProperty extends PropertyOption, + TMethod extends MethodOption, + TCustomInstanceProperty extends IAnyObject = {}, + TIsPage extends boolean = false + > = Partial<Data<TData>> & + Partial<Property<TProperty>> & + Partial<Method<TMethod, TIsPage>> & + Partial<OtherOption> & + Partial<Lifetimes> & + ThisType< + Instance<TData, TProperty, TMethod, TCustomInstanceProperty, TIsPage> + >; + interface Constructor { + < + TData extends DataOption, + TProperty extends PropertyOption, + TMethod extends MethodOption, + TCustomInstanceProperty extends IAnyObject = {}, + TIsPage extends boolean = false + >( + options: Options< + TData, + TProperty, + TMethod, + TCustomInstanceProperty, + TIsPage + > + ): string; + } + type DataOption = Record<string, any>; + type PropertyOption = Record<string, AllProperty>; + type MethodOption = Record<string, Function>; + + interface Data<D extends DataOption> { + /** 组件的内部数据,和 `properties` 一同用于组件的模板渲染 */ + data?: D; + } + interface Property<P extends PropertyOption> { + /** 组件的对外属性,是属性名到属性设置的映射表 */ + properties: P; + } + interface Method<M extends MethodOption, TIsPage extends boolean = false> { + /** 组件的方法,包括事件响应函数和任意的自定义方法,关于事件响应函数的使用,参见 [组件间通信与事件](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/events.html) */ + methods: M & (TIsPage extends true ? Partial<Page.ILifetime> : {}); + } + type PropertyType = + | StringConstructor + | NumberConstructor + | BooleanConstructor + | ArrayConstructor + | ObjectConstructor + | null; + type ValueType<T extends PropertyType> = T extends null + ? any + : T extends StringConstructor + ? string + : T extends NumberConstructor + ? number + : T extends BooleanConstructor + ? boolean + : T extends ArrayConstructor + ? any[] + : T extends ObjectConstructor + ? IAnyObject + : never; + type FullProperty<T extends PropertyType> = { + /** 属性类型 */ + type: T; + /** 属性初始值 */ + value?: ValueType<T>; + /** 属性值被更改时的响应函数 */ + observer?: + | string + | (( + newVal: ValueType<T>, + oldVal: ValueType<T>, + changedPath: Array<string | number> + ) => void); + /** 属性的类型(可以指定多个) */ + optionalTypes?: ShortProperty[]; + }; + type AllFullProperty = + | FullProperty<StringConstructor> + | FullProperty<NumberConstructor> + | FullProperty<BooleanConstructor> + | FullProperty<ArrayConstructor> + | FullProperty<ObjectConstructor> + | FullProperty<null>; + type ShortProperty = + | StringConstructor + | NumberConstructor + | BooleanConstructor + | ArrayConstructor + | ObjectConstructor + | null; + type AllProperty = AllFullProperty | ShortProperty; + type PropertyToData<T extends AllProperty> = T extends ShortProperty + ? ValueType<T> + : FullPropertyToData<Exclude<T, ShortProperty>>; + type FullPropertyToData<T extends AllFullProperty> = ValueType<T['type']>; + // type FullPropertyToData<T extends AllFullProperty> = unknown extends T['value'] ? ValueType<T['type']> : T['value'] + type PropertyOptionToData<P extends PropertyOption> = { + [name in keyof P]: PropertyToData<P[name]>; + }; + + interface InstanceProperties { + /** 组件的文件路径 */ + is: string; + /** 节点id */ + id: string; + /** 节点dataset */ + dataset: Record<string, string>; + } + + interface InstanceMethods<D extends DataOption> { + /** `setData` 函数用于将数据从逻辑层发送到视图层 + *(异步),同时改变对应的 `this.data` 的值(同步)。 + * + * **注意:** + * + * 1. **直接修改 this.data 而不调用 this.setData 是无法改变页面的状态的,还会造成数据不一致**。 + * 1. 仅支持设置可 JSON 化的数据。 + * 1. 单次设置的数据不能超过1024kB,请尽量避免一次设置过多的数据。 + * 1. 请不要把 data 中任何一项的 value 设为 `undefined` ,否则这一项将不被设置并可能遗留一些潜在问题。 + */ + setData( + /** 这次要改变的数据 + * + * 以 `key: value` 的形式表示,将 `this.data` 中的 `key` 对应的值改变成 `value`。 + * + * 其中 `key` 可以以数据路径的形式给出,支持改变数组中的某一项或对象的某个属性,如 `array[2].message`,`a.b.c.d`,并且不需要在 this.data 中预先定义。 + */ + data: Partial<D> & IAnyObject, + /** setData引起的界面更新渲染完毕后的回调函数,最低基础库: `1.5.0` */ + callback?: () => void + ): void; + + /** 检查组件是否具有 `behavior` (检查时会递归检查被直接或间接引入的所有behavior) */ + hasBehavior(behavior: Behavior.BehaviorIdentifier): void; + /** 触发事件,参见组件事件 */ + triggerEvent<DetailType = any>( + name: string, + detail?: DetailType, + options?: TriggerEventOption + ): void; + /** 创建一个 SelectorQuery 对象,选择器选取范围为这个组件实例内 */ + createSelectorQuery(): SelectorQuery; + /** 创建一个 IntersectionObserver 对象,选择器选取范围为这个组件实例内 */ + createIntersectionObserver( + options: CreateIntersectionObserverOption + ): IntersectionObserver; + /** 使用选择器选择组件实例节点,返回匹配到的第一个组件实例对象(会被 `wx://component-export` 影响) */ + selectComponent(selector: string): TrivialInstance; + /** 使用选择器选择组件实例节点,返回匹配到的全部组件实例对象组成的数组 */ + selectAllComponents(selector: string): TrivialInstance[]; + /** + * 选取当前组件节点所在的组件实例(即组件的引用者),返回它的组件实例对象(会被 `wx://component-export` 影响) + * + * 最低基础库版本:[`2.8.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + **/ + selectOwnerComponent(): TrivialInstance; + /** 获取这个关系所对应的所有关联节点,参见 组件间关系 */ + getRelationNodes(relationKey: string): TrivialInstance[]; + /** + * 立刻执行 callback ,其中的多个 setData 之间不会触发界面绘制(只有某些特殊场景中需要,如用于在不同组件同时 setData 时进行界面绘制同步) + * + * 最低基础库版本:[`2.4.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + **/ + groupSetData(callback?: () => void): void; + /** + * 返回当前页面的 custom-tab-bar 的组件实例 + * + * 最低基础库版本:[`2.6.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + **/ + getTabBar(): TrivialInstance; + /** + * 返回页面标识符(一个字符串),可以用来判断几个自定义组件实例是不是在同一个页面内 + * + * 最低基础库版本:[`2.7.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + **/ + getPageId(): string; + /** + * 执行关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) + * + * 最低基础库版本:[`2.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + **/ + animate( + selector: string, + keyFrames: KeyFrame[], + duration: number, + callback?: () => void + ): void; + /** + * 执行关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) + * + * 最低基础库版本:[`2.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + **/ + animate( + selector: string, + keyFrames: ScrollTimelineKeyframe[], + duration: number, + scrollTimeline: ScrollTimelineOption + ): void; + /** + * 清除关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) + * + * 最低基础库版本:[`2.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + **/ + clearAnimation(selector: string, callback: () => void): void; + /** + * 清除关键帧动画,详见[动画](https://developers.weixin.qq.com/miniprogram/dev/framework/view/animation.html) + * + * 最低基础库版本:[`2.9.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + **/ + clearAnimation( + selector: string, + options?: ClearAnimationOptions, + callback?: () => void + ): void; + /** + * 当从另一页面跳转到该页面时,获得与来源页面实例通信当事件通道,详见 [wx.navigateTo]((wx.navigateTo)) + * + * 最低基础库版本:[`2.7.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + getOpenerEventChannel(): EventChannel; + /** + * 获取更新性能统计信息,详见 [获取更新性能统计信息]((custom-component/update-perf-stat)) + * + * + * 最低基础库版本:[`2.12.0`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + setUpdatePerformanceListener<WithDataPath extends boolean = false>( + options: SetUpdatePerformanceListenerOption<WithDataPath>, + callback?: UpdatePerformanceListener<WithDataPath> + ): void; + } + + interface ComponentOptions { + /** + * [启用多slot支持](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#组件wxml的slot) + */ + multipleSlots?: boolean; + /** + * [组件样式隔离](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#组件样式隔离) + */ + addGlobalClass?: boolean; + /** + * [组件样式隔离](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#组件样式隔离) + */ + styleIsolation?: + | 'isolated' + | 'apply-shared' + | 'shared' + | 'page-isolated' + | 'page-apply-shared' + | 'page-shared'; + /** + * [纯数据字段](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/pure-data.html) 是一些不用于界面渲染的 data 字段,可以用于提升页面更新性能。从小程序基础库版本 2.8.2 开始支持。 + */ + pureDataPattern?: RegExp; + /** + * [虚拟化组件节点](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html#%E8%99%9A%E6%8B%9F%E5%8C%96%E7%BB%84%E4%BB%B6%E8%8A%82%E7%82%B9) 使自定义组件内部的第一层节点由自定义组件本身完全决定。从小程序基础库版本 [`2.11.2`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 开始支持 */ + virtualHost?: boolean; + } + + interface TriggerEventOption { + /** 事件是否冒泡 + * + * 默认值: `false` + */ + bubbles?: boolean; + /** 事件是否可以穿越组件边界,为false时,事件将只能在引用组件的节点树上触发,不进入其他任何组件内部 + * + * 默认值: `false` + */ + composed?: boolean; + /** 事件是否拥有捕获阶段 + * + * 默认值: `false` + */ + capturePhase?: boolean; + } + + interface RelationOption { + /** 目标组件的相对关系 */ + type: 'parent' | 'child' | 'ancestor' | 'descendant'; + /** 关系生命周期函数,当关系被建立在页面节点树中时触发,触发时机在组件attached生命周期之后 */ + linked?(target: TrivialInstance): void; + /** 关系生命周期函数,当关系在页面节点树中发生改变时触发,触发时机在组件moved生命周期之后 */ + linkChanged?(target: TrivialInstance): void; + /** 关系生命周期函数,当关系脱离页面节点树时触发,触发时机在组件detached生命周期之后 */ + unlinked?(target: TrivialInstance): void; + /** 如果这一项被设置,则它表示关联的目标节点所应具有的behavior,所有拥有这一behavior的组件节点都会被关联 */ + target?: string; + } + + interface PageLifetimes { + /** 页面生命周期回调—监听页面显示 + * + * 页面显示/切入前台时触发。 + */ + show(): void; + /** 页面生命周期回调—监听页面隐藏 + * + * 页面隐藏/切入后台时触发。 如 `navigateTo` 或底部 `tab` 切换到其他页面,小程序切入后台等。 + */ + hide(): void; + /** 页面生命周期回调—监听页面尺寸变化 + * + * 所在页面尺寸变化时执行 + */ + resize(size: Page.IResizeOption): void; + } + + type DefinitionFilter = <T extends TrivialOption>( + /** 使用该 behavior 的 component/behavior 的定义对象 */ + defFields: T, + /** 该 behavior 所使用的 behavior 的 definitionFilter 函数列表 */ + definitionFilterArr?: DefinitionFilter[] + ) => void; + + interface Lifetimes { + /** 组件生命周期声明对象,组件的生命周期:`created`、`attached`、`ready`、`moved`、`detached` 将收归到 `lifetimes` 字段内进行声明,原有声明方式仍旧有效,如同时存在两种声明方式,则 `lifetimes` 字段内声明方式优先级最高 + * + * 最低基础库: `2.2.3` */ + lifetimes: Partial<{ + /** + * 在组件实例刚刚被创建时执行,注意此时不能调用 `setData` + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + created(): void; + /** + * 在组件实例进入页面节点树时执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + attached(): void; + /** + * 在组件在视图层布局完成后执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + ready(): void; + /** + * 在组件实例被移动到节点树另一个位置时执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + moved(): void; + /** + * 在组件实例被从页面节点树移除时执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + detached(): void; + /** + * 每当组件方法抛出错误时执行 + * + * 最低基础库版本:[`2.4.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + error(err: Error): void; + }>; + /** + * @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义 + * + * 在组件实例刚刚被创建时执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + created(): void; + /** + * @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义 + * + * 在组件实例进入页面节点树时执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + attached(): void; + /** + * @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义 + * + * 在组件在视图层布局完成后执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + ready(): void; + /** + * @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义 + * + * 在组件实例被移动到节点树另一个位置时执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + moved(): void; + /** + * @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义 + * + * 在组件实例被从页面节点树移除时执行 + * + * 最低基础库版本:[`1.6.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + detached(): void; + /** + * @deprecated 旧式的定义方式,基础库 `2.2.3` 起请在 lifetimes 中定义 + * + * 每当组件方法抛出错误时执行 + * + * 最低基础库版本:[`2.4.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + error(err: Error): void; + } + + interface OtherOption { + /** 类似于mixins和traits的组件间代码复用机制,参见 [behaviors](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/behaviors.html) */ + behaviors: Behavior.BehaviorIdentifier[]; + /** + * 组件数据字段监听器,用于监听 properties 和 data 的变化,参见 [数据监听器](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/observer.html) + * + * 最低基础库版本:[`2.6.1`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) + */ + observers: Record<string, (...args: any[]) => any>; + /** 组件间关系定义,参见 [组件间关系](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/lifetimes.html) */ + relations: { + [componentName: string]: RelationOption; + }; + /** 组件接受的外部样式类,参见 [外部样式类](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/wxml-wxss.html) */ + externalClasses?: string[]; + /** 组件所在页面的生命周期声明对象,参见 [组件生命周期](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/lifetimes.html) + * + * 最低基础库版本: [`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) */ + pageLifetimes?: Partial<PageLifetimes>; + /** 一些选项(文档中介绍相关特性时会涉及具体的选项设置,这里暂不列举) */ + options: ComponentOptions; + + /** 定义段过滤器,用于自定义组件扩展,参见 [自定义组件扩展](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/extend.html) + * + * 最低基础库版本: [`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) */ + definitionFilter?: DefinitionFilter; + /** + * 组件自定义导出,当使用 `behavior: wx://component-export` 时,这个定义段可以用于指定组件被 selectComponent 调用时的返回值,参见 [组件间通信与事件](https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/events.html) + * 最低基础库版本: [`2.2.3`](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) */ + export: () => IAnyObject; + } + + interface KeyFrame { + /** 关键帧的偏移,范围[0-1] */ + offset?: number; + /** 动画缓动函数 */ + ease?: string; + /** 基点位置,即 CSS transform-origin */ + transformOrigin?: string; + /** 背景颜色,即 CSS background-color */ + backgroundColor?: string; + /** 底边位置,即 CSS bottom */ + bottom?: number | string; + /** 高度,即 CSS height */ + height?: number | string; + /** 左边位置,即 CSS left */ + left?: number | string; + /** 宽度,即 CSS width */ + width?: number | string; + /** 不透明度,即 CSS opacity */ + opacity?: number | string; + /** 右边位置,即 CSS right */ + right?: number | string; + /** 顶边位置,即 CSS top */ + top?: number | string; + /** 变换矩阵,即 CSS transform matrix */ + matrix?: number[]; + /** 三维变换矩阵,即 CSS transform matrix3d */ + matrix3d?: number[]; + /** 旋转,即 CSS transform rotate */ + rotate?: number; + /** 三维旋转,即 CSS transform rotate3d */ + rotate3d?: number[]; + /** X 方向旋转,即 CSS transform rotateX */ + rotateX?: number; + /** Y 方向旋转,即 CSS transform rotateY */ + rotateY?: number; + /** Z 方向旋转,即 CSS transform rotateZ */ + rotateZ?: number; + /** 缩放,即 CSS transform scale */ + scale?: number[]; + /** 三维缩放,即 CSS transform scale3d */ + scale3d?: number[]; + /** X 方向缩放,即 CSS transform scaleX */ + scaleX?: number; + /** Y 方向缩放,即 CSS transform scaleY */ + scaleY?: number; + /** Z 方向缩放,即 CSS transform scaleZ */ + scaleZ?: number; + /** 倾斜,即 CSS transform skew */ + skew?: number[]; + /** X 方向倾斜,即 CSS transform skewX */ + skewX?: number; + /** Y 方向倾斜,即 CSS transform skewY */ + skewY?: number; + /** 位移,即 CSS transform translate */ + translate?: Array<number | string>; + /** 三维位移,即 CSS transform translate3d */ + translate3d?: Array<number | string>; + /** X 方向位移,即 CSS transform translateX */ + translateX?: number | string; + /** Y 方向位移,即 CSS transform translateY */ + translateY?: number | string; + /** Z 方向位移,即 CSS transform translateZ */ + translateZ?: number | string; + } + interface ClearAnimationOptions { + /** 基点位置,即 CSS transform-origin */ + transformOrigin?: boolean; + /** 背景颜色,即 CSS background-color */ + backgroundColor?: boolean; + /** 底边位置,即 CSS bottom */ + bottom?: boolean; + /** 高度,即 CSS height */ + height?: boolean; + /** 左边位置,即 CSS left */ + left?: boolean; + /** 宽度,即 CSS width */ + width?: boolean; + /** 不透明度,即 CSS opacity */ + opacity?: boolean; + /** 右边位置,即 CSS right */ + right?: boolean; + /** 顶边位置,即 CSS top */ + top?: boolean; + /** 变换矩阵,即 CSS transform matrix */ + matrix?: boolean; + /** 三维变换矩阵,即 CSS transform matrix3d */ + matrix3d?: boolean; + /** 旋转,即 CSS transform rotate */ + rotate?: boolean; + /** 三维旋转,即 CSS transform rotate3d */ + rotate3d?: boolean; + /** X 方向旋转,即 CSS transform rotateX */ + rotateX?: boolean; + /** Y 方向旋转,即 CSS transform rotateY */ + rotateY?: boolean; + /** Z 方向旋转,即 CSS transform rotateZ */ + rotateZ?: boolean; + /** 缩放,即 CSS transform scale */ + scale?: boolean; + /** 三维缩放,即 CSS transform scale3d */ + scale3d?: boolean; + /** X 方向缩放,即 CSS transform scaleX */ + scaleX?: boolean; + /** Y 方向缩放,即 CSS transform scaleY */ + scaleY?: boolean; + /** Z 方向缩放,即 CSS transform scaleZ */ + scaleZ?: boolean; + /** 倾斜,即 CSS transform skew */ + skew?: boolean; + /** X 方向倾斜,即 CSS transform skewX */ + skewX?: boolean; + /** Y 方向倾斜,即 CSS transform skewY */ + skewY?: boolean; + /** 位移,即 CSS transform translate */ + translate?: boolean; + /** 三维位移,即 CSS transform translate3d */ + translate3d?: boolean; + /** X 方向位移,即 CSS transform translateX */ + translateX?: boolean; + /** Y 方向位移,即 CSS transform translateY */ + translateY?: boolean; + /** Z 方向位移,即 CSS transform translateZ */ + translateZ?: boolean; + } + interface ScrollTimelineKeyframe { + composite?: 'replace' | 'add' | 'accumulate' | 'auto'; + easing?: string; + offset?: number | null; + [property: string]: string | number | null | undefined; + } + interface ScrollTimelineOption { + /** 指定滚动元素的选择器(只支持 scroll-view),该元素滚动时会驱动动画的进度 */ + scrollSource: string; + /** 指定滚动的方向。有效值为 horizontal 或 vertical */ + orientation?: string; + /** 指定开始驱动动画进度的滚动偏移量,单位 px */ + startScrollOffset: number; + /** 指定停止驱动动画进度的滚动偏移量,单位 px */ + endScrollOffset: number; + /** 起始和结束的滚动范围映射的时间长度,该时间可用于与关键帧动画里的时间 (duration) 相匹配,单位 ms */ + timeRange: number; + } + + interface SetUpdatePerformanceListenerOption<WithDataPath> { + /** 是否返回变更的 data 字段信息 */ + withDataPaths?: WithDataPath; + } + interface UpdatePerformanceListener<WithDataPath> { + (res: UpdatePerformance<WithDataPath>): void; + } + interface UpdatePerformance<WithDataPath> { + /** 此次更新过程的 ID */ + updateProcessId: number; + /** 对于子更新,返回它所属的更新过程 ID */ + parentUpdateProcessId?: number; + /** 是否是被合并更新,如果是,则 updateProcessId 表示被合并到的更新过程 ID */ + isMergedUpdate: boolean; + /** 此次更新的 data 字段信息,只有 withDataPaths 设为 true 时才会返回 */ + dataPaths: WithDataPath extends true ? string[] : undefined; + /** 此次更新进入等待队列时的时间戳 */ + pendingStartTimestamp: number; + /** 更新运算开始时的时间戳 */ + updateStartTimestamp: number; + /** 更新运算结束时的时间戳 */ + updateEndTimestamp: number; + } +} +/** Component构造器可用于定义组件,调用Component构造器时可以指定组件的属性、数据、方法等。 + * + * * 使用 `this.data` 可以获取内部数据和属性值,但不要直接修改它们,应使用 `setData` 修改。 + * * 生命周期函数无法在组件方法中通过 `this` 访问到。 + * * 属性名应避免以 data 开头,即不要命名成 `dataXyz` 这样的形式,因为在 WXML 中, `data-xyz=""` 会被作为节点 dataset 来处理,而不是组件属性。 + * * 在一个组件的定义和使用时,组件的属性名和 data 字段相互间都不能冲突(尽管它们位于不同的定义段中)。 + * * 从基础库 `2.0.9` 开始,对象类型的属性和 data 字段中可以包含函数类型的子字段,即可以通过对象类型的属性字段来传递函数。低于这一版本的基础库不支持这一特性。 + * * `bug` : 对于 type 为 Object 或 Array 的属性,如果通过该组件自身的 `this.setData` 来改变属性值的一个子字段,则依旧会触发属性 observer ,且 observer 接收到的 `newVal` 是变化的那个子字段的值, `oldVal` 为空, `changedPath` 包含子字段的字段名相关信息。 + */ +declare let Component: WechatMiniprogram.Component.Constructor; diff --git a/typings/types/wx/lib.wx.event.d.ts b/typings/types/wx/lib.wx.event.d.ts new file mode 100644 index 0000000..bf89469 --- /dev/null +++ b/typings/types/wx/lib.wx.event.d.ts @@ -0,0 +1,1436 @@ +/*! ***************************************************************************** +Copyright (c) 2023 Tencent, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +***************************************************************************** */ + +declare namespace WechatMiniprogram { + interface Target<DataSet extends IAnyObject = IAnyObject> { + /** 事件组件的 id */ + id: string; + /** 当前组件的类型 */ + tagName?: string; + /** 事件组件上由 `data-` 开头的自定义属性组成的集合 */ + dataset: DataSet; + /** 距离页面顶部的偏移量 */ + offsetTop: number; + /** 距离页面左边的偏移量 */ + offsetLeft: number; + } + + /** 基础事件参数 */ + interface BaseEvent< + Mark extends IAnyObject = IAnyObject, + CurrentTargetDataset extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = CurrentTargetDataset + > { + /** 事件类型 */ + type: string; + /** 页面打开到触发事件所经过的毫秒数 */ + timeStamp: number; + /** 事件冒泡路径上所有由 `mark:` 开头的自定义属性组成的集合 */ + mark?: Mark; + /** 触发事件的源组件 */ + target: Target<TargetDataset>; + /** 事件绑定的当前组件 */ + currentTarget: Target<CurrentTargetDataset>; + } + + /** 自定义事件 */ + interface CustomEvent< + Detail extends IAnyObject = IAnyObject, + Mark extends IAnyObject = IAnyObject, + CurrentTargetDataset extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = CurrentTargetDataset + > extends BaseEvent<Mark, CurrentTargetDataset, TargetDataset> { + /** 额外的信息 */ + detail: Detail; + } + + /** Touch 对象 */ + interface TouchDetail { + /** 距离页面可显示区域 (屏幕除去导航条) 左上角距离,横向为 X 轴 */ + clientX: number; + /** 距离页面可显示区域 (屏幕除去导航条) 左上角距离,纵向为 Y 轴 */ + clientY: number; + /** 触摸点的标识符 */ + identifier: number; + /** 距离文档左上角的距离,文档的左上角为原点,横向为 X 轴 */ + pageX: number; + /** 距离文档左上角的距离,文档的左上角为原点,纵向为 Y 轴 */ + pageY: number; + } + + /** canvas Touch 对象 */ + interface TouchCanvasDetail { + /** 触摸点的标识符 */ + identifier: number; + /** 距离 Canvas 左上角的距离,Canvas 的左上角为原点 ,横向为X轴 */ + x: number; + /** 距离 Canvas 左上角的距离,Canvas 的左上角为原点 纵向为Y轴 */ + y: number; + } + + /** 触摸事件 */ + interface Touch< + Detail extends IAnyObject = IAnyObject, + T extends TouchDetail | TouchCanvasDetail = TouchDetail, + Mark extends IAnyObject = IAnyObject, + CurrentTargetDataset extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = CurrentTargetDataset + > extends CustomEvent<Detail, Mark, CurrentTargetDataset, TargetDataset> { + /** 触摸事件,当前停留在屏幕中的触摸点信息的数组 */ + touches: T[]; + /** 触摸事件,当前变化的触摸点信息的数组 */ + changedTouches: T[]; + } + + /** 触摸事件响应 */ + type TouchEvent< + Detail extends IAnyObject = IAnyObject, + Mark extends IAnyObject = IAnyObject, + CurrentTargetDataset extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = CurrentTargetDataset + > = Touch<Detail, TouchDetail, Mark, CurrentTargetDataset, TargetDataset>; + + /** canvas 触摸事件响应 */ + interface TouchCanvas< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > extends Touch<never, TouchCanvasDetail, Mark, never, TargetDataset> { + // canvas 中的触摸事件不可冒泡,所以没有 currentTarget。 + currentTarget: never; + } + + /** + * 图片加载成功时触发 + * + * 最低基础库: 2.1.0 + */ + type CoverImageLoad< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 图片宽度 */ + width: number; + /** 图片高度 */ + height: number; + }, + Mark, + TargetDataset + >; + + /** + * 图片加载失败时触发 + * + * 最低基础库: 2.1.0 + */ + type CoverImageError = CustomEvent<GeneralCallbackResult>; + + /** + * 拖动过程中触发的事件,event.detail = {x, y, source} + * + * 最低基础库: 1.9.90 + */ + type MovableViewChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + x: number; + y: number; + /** + * 产生移动的原因 + * + * - `touch` 拖动 + * - `touch-out-of-bounds` 超出移动范围 + * - `out-of-bounds` 超出移动范围后的回弹 + * - `friction` 惯性 + * - `空字符串` setData + */ + source: + | 'touch' + | 'touch-out-of-bounds' + | 'out-of-bounds' + | 'friction' + | ''; + }, + Mark, + TargetDataset + >; + + /** + * 缩放过程中触发的事件 + * + * event.detail = {x, y, scale} + * + * x 和 y 字段在 2.1.0 之后支持 + * + * 最低基础库: 1.9.90 + */ + type MovableViewScale< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 最低基础库: 2.1.0 */ + x: number; + /** 最低基础库: 2.1.0 */ + y: number; + scale: number; + }, + Mark, + TargetDataset + >; + + /** + * 滑动开始事件 (同时开启 enhanced 属性后生效) + * + * detail { scrollTop, scrollLeft } + * + * 最低基础库: 2.12.0 + */ + type ScrollViewDragStart< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + scrollTop: number; + scrollLeft: number; + }, + Mark, + TargetDataset + >; + + /** + * 滑动事件 (同时开启 enhanced 属性后生效) + * + * detail { scrollTop, scrollLeft } + * + * 最低基础库: 2.12.0 + */ + type ScrollViewDragging< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + scrollTop: number; + scrollLeft: number; + }, + Mark, + TargetDataset + >; + + /** + * 滑动结束事件 (同时开启 enhanced 属性后生效) + * + * detail { scrollTop, scrollLeft } + * + * 最低基础库: 2.12.0 + */ + type ScrollViewDragEnd< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + scrollTop: number; + scrollLeft: number; + }, + Mark, + TargetDataset + >; + + /** 滚动到顶部/左边时触发 */ + type ScrollViewScrollToUpper< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + direction: 'top' | 'left'; + }, + Mark, + TargetDataset + >; + + /** 滚动到底部/右边时触发 */ + type ScrollViewScrollToLower< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + direction: 'bottom' | 'right'; + }, + Mark, + TargetDataset + >; + + /** + * 滚动时触发 + * + * event.detail = {scrollLeft, scrollTop, scrollHeight, scrollWidth, deltaX, deltaY} + */ + type ScrollViewScroll< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + scrollLeft: number; + scrollTop: number; + scrollHeight: number; + scrollWidth: number; + deltaX: number; + deltaY: number; + }, + Mark, + TargetDataset + >; + + type ScrollViewRefresherPulling< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent<never, Mark, TargetDataset>; + + type ScrollViewRefresherRefresh< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent<never, Mark, TargetDataset>; + + type ScrollViewRefresherRestore< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent<never, Mark, TargetDataset>; + + type ScrollViewRefresherAbort< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent<never, Mark, TargetDataset>; + + /** + * current 改变时会触发 change 事件 + * + * event.detail = {current, source} + * + * **Tip**: 如果在 bindchange 的事件回调函数中使用 setData 改变 current 值,则有可能导致 setData 被不停地调用,因而通常情况下请在改变 current 值前检测 source 字段来判断是否是由于用户触摸引起。 + */ + type SwiperChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + current: number; + /** + * 表示导致变更的原因 + * + * - `autoplay` 自动播放导致 swiper 变化; + * - `touch` 用户划动引起 swiper 变化; + * - 其它原因将用空字符串表示。 + * + * 最低基础库: 1.4.0 + */ + source: '' | 'autoplay' | 'touch'; + /** 该 swiper-item 的标识符 */ + currentItemId: string; + }, + Mark, + TargetDataset + >; + + /** + * swiper-item 的位置发生改变时会触发 transition 事件 + * + * event.detail = {dx: dx, dy: dy} + * + * 最低基础库: 2.4.3 + */ + type SwiperTransition< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + dx: number; + dy: number; + }, + Mark, + TargetDataset + >; + + /** + * 动画结束时会触发 animationfinish 事件 + * + * 最低基础库: 1.9.0 + */ + type SwiperAnimationFinish< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = SwiperChange<Mark, TargetDataset>; + + /** + * progress 动画完成事件 + * + * 最低基础库 2.4.1 + */ + type ProgressActiveEnd< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + curPercent: number; + }, + Mark, + TargetDataset + >; + + /** + * 用户点击该按钮时,会返回获取到的用户信息,回调的 detail 数据与 `wx. getUserInfo` 返回的一致,`open-type="getUserInfo"` 时有效 + * + * 最低基础库: 1.3.0 + */ + type ButtonGetUserInfo = CustomEvent< + GeneralCallbackResult & GetUserInfoSuccessCallbackResult + >; + + /** + * 客服消息回调,`open-type="contact"` 时有效 + * + * 最低基础库: 1.5.0 + */ + type ButtonContact = CustomEvent<GeneralCallbackResult>; + + /** + * 获取用户手机号回调,`open-type=getPhoneNumber` 时有效 + * + * 最低基础库: 1.2.0 + */ + type ButtonGetPhoneNumber = CustomEvent< + GeneralCallbackResult & + Partial<GetWeRunDataSuccessCallbackResult> & { + code: string; + } + >; + + /** + * 当使用开放能力时,发生错误的回调,`open-type=launchApp` 时有效 + * + * 最低基础库: 1.9.5 + */ + type ButtonError = CustomEvent<GeneralCallbackResult>; + + /** + * 在打开授权设置页后回调,`open-type=openSetting` 时有效 + * + * 最低基础库: 2.0.7 + */ + type ButtonOpenSetting = CustomEvent< + GeneralCallbackResult & OpenSettingSuccessCallbackResult + >; + + /** + * 打开 APP 成功的回调,`open-type=launchApp` 时有效 + * + * 最低基础库: 2.4.4 + */ + type ButtonLaunchApp = CustomEvent<GeneralCallbackResult>; + + /** + * checkbox-group 中选中项发生改变时触发 change 事件 + * + * detail = { value: ['选中的checkbox 的 value 的数组'] } + */ + type CheckboxGroupChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 选中的 checkbox 的 value 的数组 */ + value: string[]; + }, + Mark, + TargetDataset + >; + + /** + * 编辑器初始化完成时触发 + * + * 最低基础库: 2.7.0 + */ + type EditorReady< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent<never, Mark, TargetDataset>; + + /** + * 编辑器聚焦时触发 + * + * event.detail = {html, text, delta} + * + * 最低基础库: 2.7.0 + */ + type EditorFocus< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + html: string; + text: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + delta: any[]; + }, + Mark, + TargetDataset + >; + + /** + * 编辑器失去焦点时触发 + * + * detail = {html, text, delta} + * + * 最低基础库: 2.7.0 + */ + type EditorBlur< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = EditorFocus<Mark, TargetDataset>; + + /** + * 编辑器内容改变时触发 + * + * detail = {html, text, delta} + * + * 最低基础库: 2.7.0 + */ + type EditorInput< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = EditorFocus<Mark, TargetDataset>; + + /** + * 通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式 + * + * 最低基础库: 2.7.0 + */ + type EditorStatusChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + Partial<{ + align: 'left' | 'center' | 'right' | 'justify'; + bold: 'strong'; + italic: 'em'; + underline: true; + strike: 'del'; + lineHeight: string; + letterSpacing: string; + marginTop: string; + marginBottom: string; + fontFamily: string; + fontSize: string; + color: string; + backgroundColor: string; + list: 'checked' | 'unchecked' | 'ordered' | 'bullet'; + indent: number; + header: number; + script: 'sub' | 'super'; + direction: 'rtl'; + }>, + Mark, + TargetDataset + >; + + /** + * 携带 form 中的数据触发 submit 事件 + * + * event.detail = {value : {'name': 'value'} , formId: ''} + */ + type FormSubmit< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + formId?: unknown; + target: Target; + /** 表单中的数据,需要在表单组件中加上 name 来作为 key。 */ + value: IAnyObject; + }, + Mark, + TargetDataset + >; + + /** 表单重置时会触发 reset 事件 */ + type FormReset< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + target: Target; + }, + Mark, + TargetDataset + >; + + /** 键盘输入时触发 + * + * event.detail = {value, cursor, keyCode} + * + * 处理函数可以直接 return 一个字符串,将替换输入框的内容。 + */ + type Input< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 输入框内容 */ + value: string; + /** 光标位置 */ + cursor: number; + /** keyCode 为键值 (目前工具还不支持返回keyCode参数) `2.1.0` 起支持 */ + keyCode?: number; + }, + Mark, + TargetDataset + >; + + /** + * 输入框聚焦时触发 + * + * event.detail = { value, height } + */ + type InputFocus< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 输入框内容 */ + value: string; + /** 键盘高度, 在基础库 `1.9.90` 起支持 */ + height: number; + }, + Mark, + TargetDataset + >; + + /** + * 输入框失去焦点时触发 + * + * event.detail = {value: value} + */ + type InputBlur< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 输入框内容 */ + value: string; + }, + Mark, + TargetDataset + >; + + /** + * 点击完成按钮时触发 + * + * event.detail = {value: value} + */ + type InputConfirm< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 输入框内容 */ + value: string; + }, + Mark, + TargetDataset + >; + + /** + * 键盘高度发生变化的时候触发此事件 + * + * event.detail = {height: height, duration: duration} + * + * **tip**: 键盘高度发生变化,keyboardheightchange 事件可能会多次触发,开发者对于相同的 height 值应该忽略掉 + * + * 最低基础库: `2.7.0` + */ + type InputKeyboardHeightChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 键盘高度 */ + height: number; + duration: number; + }, + Mark, + TargetDataset + >; + + /** + * 取消选择时触发 + * + * 最低基础库: 1.9.90 + */ + type PickerCancel< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent<never, Mark, TargetDataset>; + + /** + * value 改变时触发 change 事件 + * + * event.detail = {value} + * + * 当 mode = region 时 (最低基础库: 1.4.0) + * + * value 改变时触发 change 事件,event.detail = {value, code, postcode},其中字段 code 是统计用区划代码,postcode 是邮政编码 + */ + type PickerChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** + * 当 mode = selector 时, 返回当前选择的 value + * + * 当 mode = multiSelector 时, 返回一个索引数组 + * + * 当 mode = time | date 时, 返回 `"12:01"` | `"2016-09-01"` + * + * 当 mode = region 时, 返回 `["广东省", "广州市", "海珠区"]` + */ + value: string | number[] | [string, string, string]; + /** 统计用区划代码 当 mode = region 时有效 (最低基础库: 1.4.0) */ + code: [string, string, string]; + /** 邮政编码 当 mode = region 时有效 (最低基础库: 1.4.0) */ + postcode: string; + }, + Mark, + TargetDataset + >; + + /** 列改变时触发 当 `mode = multiSelector` 时有效 */ + type PickerColumnChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 修改的列 */ + column: number; + value: number; + }, + Mark, + TargetDataset + >; + + /** + * 滚动选择时触发 change 事件 + * + * event.detail = {value} + */ + type PickerViewChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** value 为数组,表示 picker-view 内的 picker-view-column 当前选择的是第几项 (下标从 0 开始) */ + value: number[]; + }, + Mark, + TargetDataset + >; + + /** + * 当滚动选择开始时候触发事件 + * + * 最低基础库: 2.3.1 + */ + type PickerViewPickStart< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent<never, Mark, TargetDataset>; + + /** + * 当滚动选择结束时候触发事件 + * + * 最低基础库: 2.3.1 + */ + type PickerViewPickEnd< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent<never, Mark, TargetDataset>; + + /** radio-group 切换事件 */ + type RadioGroupChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + /** radio-group 中选中项的 value */ + { + value: string; + }, + Mark, + TargetDataset + >; + + /** + * 完成一次拖动后触发的事件 + * + * event.detail = {value} + */ + type SliderChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** slider 的数值 0 - 100 */ + value: number; + }, + Mark, + TargetDataset + >; + + /** + * 拖动过程中触发的事件 + * + * event.detail = {value} + * + * 最低基础库: 1.7.0 + */ + type SliderChanging< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = SliderChange<Mark, TargetDataset>; + + /** + * checked 改变时触发 change 事件 + * + * event.detail={ value} + */ + type SwitchChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + value: boolean; + }, + Mark, + TargetDataset + >; + + /** + * 输入框聚焦时触发 + * + * event.detail = { value, height },height 为键盘高度 + * + * 在基础库 1.9.90 起支持 + */ + type TextareaFocus< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = InputFocus<Mark, TargetDataset>; + + /** + * 输入框失去焦点时触发 + * + * event.detail = {value, cursor} + * + * **tip**: textarea 的 blur 事件会晚于页面上的 tap 事件,如果需要在 button 的点击事件获取 textarea,可以使用 form 的 bindsubmit。 + */ + type TextareaBlur< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = InputBlur<Mark, TargetDataset>; + + /** + * 输入框行数变化时调用 + * + * event.detail = {height: 0, heightRpx: 0, lineCount: 0} + */ + type TextareaLineChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = CustomEvent< + { + /** 输入框高度(px) */ + height: number; + /** 输入框高度(rpx) */ + heightRpx: number; + /** 行数 */ + lineCount: number; + /** 行高 */ + lineHeight: number; + }, + Mark, + TargetDataset + >; + + /** + * 当键盘输入时,触发 input 事件 + * + * event.detail = {value, cursor, keyCode} + * + * keyCode 为键值,目前工具还不支持返回 keyCode 参数。 + * + * **tip**: 不建议在多行文本上对用户的输入进行修改,所以 **bindinput 处理函数的返回值并不会反映到 textarea 上** + */ + type TextareaInput< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = Input<Mark, TargetDataset>; + + /** + * 点击完成时, 触发 confirm 事件 + * + * event.detail = {value: value} + */ + type TextareaConfirm< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = InputConfirm<Mark, TargetDataset>; + + /** + * 键盘高度发生变化的时候触发此事件 + * + * event.detail = {height: height, duration: duration} + * + * **tip**: 键盘高度发生变化,keyboardheightchange事件可能会多次触发,开发者对于相同的height值应该忽略掉 + * + * 最低基础库: 2.7.0 + */ + type TextareaKeyboardHeightChange< + Mark extends IAnyObject = IAnyObject, + TargetDataset extends IAnyObject = IAnyObject + > = InputKeyboardHeightChange<Mark, TargetDataset>; + + /** + * 功能页返回,且操作成功时触发, detail 格式与具体功能页相关 + * + * 最低基础库: 2.1.0 + */ + type FunctionalNavigatorSuccess<Detail extends IAnyObject = IAnyObject> = + CustomEvent<Detail, never, never>; + + /** + * 功能页返回,且操作失败时触发, detail 格式与具体功能页相关 + * + * 最低基础库: 2.1.0 + */ + type FunctionalNavigatorFail<Detail extends IAnyObject = IAnyObject> = + CustomEvent<Detail, never, never>; + + /** + * 当 `target="miniProgram"` 时有效,跳转小程序成功 + * + * 最低基础库: 2.0.7 + */ + type NavigatorSuccess = CustomEvent; + /** + * 当 `target="miniProgram"` 时有效,跳转小程序失败 + * + * `tips`: 需要用户确认跳转 从 2.3.0 版本开始,在跳转至其他小程序前,将统一增加弹窗,询问是否跳转,用户确认后才可以跳转其他小程序。如果用户点击取消,则回调 fail cancel。 + * + * 最低基础库: 2.0.7 + */ + type NavigatorFail = CustomEvent; + /** + * 当 `target="miniProgram"` 时有效,跳转小程序完成 + * + * 最低基础库: 2.0.7 + */ + type NavigatorComplete = CustomEvent; + + /** + * 当发生错误时触发 error 事件 + * + * detail = {errMsg:MediaError.code} + */ + type AudioError = CustomEvent<{ + /** + * MediaError.code + * + * - 1 获取资源被用户禁止 + * - 2 网络错误 + * - 3 解码错误 + * - 4 不合适资源 + */ + errMsg: 1 | 2 | 3 | 4; + }>; + + /** 当开始/继续播放时触发play事件 */ + type AudioPlay = CustomEvent; + + /** 当暂停播放时触发 pause 事件 */ + type AudioPause = CustomEvent; + + /** + * 当播放进度改变时触发 timeupdate 事件 + * + * detail = {currentTime, duration} + */ + type AudioTimeUpdate = CustomEvent<{ + currentTime: number; + duration: number; + }>; + + /** 当播放到末尾时触发 ended 事件 */ + type AudioEnded = CustomEvent; + + /** 摄像头在非正常终止时触发,如退出后台等情况 */ + type CameraStop = CustomEvent; + + /** 用户不允许使用摄像头时触发 */ + type CameraError = CustomEvent; + + /** + * 相机初始化完成时触发 + * + * 最低基础库: 2.7.0 + */ + type CameraInitDone = CustomEvent; + + /** + * 在扫码识别成功时触发,仅在 mode="scanCode" 时生效 + * + * 最低基础库: 2.1.0 + */ + type CameraScanCode = CustomEvent; + + /** 当错误发生时触发,event.detail = {errMsg} */ + type ImageError = CoverImageError; + /** 当图片载入完毕时触发,event.detail = {height, width} */ + type ImageLoad = CoverImageLoad; + + /** + * 播放状态变化事件,detail = {code} + * + * 最低基础库 1.7.0 + */ + type LivePlayerStateChange = CustomEvent<{ + /** + * 状态码 + * + * - `2001` 已经连接服务器 + * - `2002` 已经连接服务器,开始拉流 + * - `2003` 网络接收到首个视频数据包(IDR) + * - `2004` 视频播放开始 + * - `2005` 视频播放进度 + * - `2006` 视频播放结束 + * - `2007` 视频播放Loading + * - `2008` 解码器启动 + * - `2009` 视频分辨率改变 + * - `-2301` 网络断连,且经多次重连抢救无效,更多重试请自行重启播放 + * - `-2302` 获取加速拉流地址失败 + * - `2101` 当前视频帧解码失败 + * - `2102` 当前音频帧解码失败 + * - `2103` 网络断连, 已启动自动重连 + * - `2104` 网络来包不稳: 可能是下行带宽不足,或由于主播端出流不均匀 + * - `2105` 当前视频播放出现卡顿 + * - `2106` 硬解启动失败,采用软解 + * - `2107` 当前视频帧不连续,可能丢帧 + * - `2108` 当前流硬解第一个I帧失败,SDK自动切软解 + * - `3001` RTMP -DNS解析失败 + * - `3002` RTMP服务器连接失败 + * - `3003` RTMP服务器握手失败 + * - `3005` RTMP 读/写失败 + */ + code: number; + }>; + + /** + * 全屏变化事件,detail = {direction, fullScreen} + * + * 最低基础库 1.7.0 + */ + type LivePlayerFullScreenChange = CustomEvent<{ + direction: 'vertical' | 'horizontal'; + fullScreen: boolean; + }>; + + /** + * 网络状态通知,detail = {info} + * + * 最低基础库 1.9.0 + */ + type LivePlayerNetStatus = CustomEvent<{ + /** + * 网络状态数据 + * + * + * - `videoBitrate` 当前视频编/码器输出的比特率,单位 kbps + * - `audioBitrate` 当前音频编/码器输出的比特率,单位 kbps + * - `videoFPS` 当前视频帧率 + * - `videoGOP` 当前视频 GOP,也就是每两个关键帧(I帧)间隔时长,单位 s + * - `netSpeed` 当前的发送/接收速度 + * - `netJitter` 网络抖动情况,抖动越大,网络越不稳定 + * - `videoWidth` 视频画面的宽度 + * - `videoHeight` 视频画面的高度 + */ + info: + | 'videoBitrate' + | 'audioBitrate' + | 'videoFPS' + | 'videoGOP' + | 'netSpeed' + | 'netJitter' + | 'videoWidth' + | 'videoHeight'; + }>; + + /** + * 状态变化事件,detail = {code} + * + * 最低基础库: 1.7.0 + */ + type LivePusherStateChange = CustomEvent<{ + /** + * 状态码 + * + * - `1001` 已经连接推流服务器 + * - `1002` 已经与服务器握手完毕,开始推流 + * - `1003` 打开摄像头成功 + * - `1004` 录屏启动成功 + * - `1005` 推流动态调整分辨率 + * - `1006` 推流动态调整码率 + * - `1007` 首帧画面采集完成 + * - `1008` 编码器启动 + * - `-1301` 打开摄像头失败 + * - `-1302` 打开麦克风失败 + * - `-1303` 视频编码失败 + * - `-1304` 音频编码失败 + * - `-1305` 不支持的视频分辨率 + * - `-1306` 不支持的音频采样率 + * - `-1307` 网络断连,且经多次重连抢救无效,更多重试请自行重启推流 + * - `-1308` 开始录屏失败,可能是被用户拒绝 + * - `-1309` 录屏失败,不支持的Android系统版本,需要5.0以上的系统 + * - `-1310` 录屏被其他应用打断了 + * - `-1311` Android Mic打开成功,但是录不到音频数据 + * - `-1312` 录屏动态切横竖屏失败 + * - `1101` 网络状况不佳: 上行带宽太小,上传数据受阻 + * - `1102` 网络断连, 已启动自动重连 + * - `1103` 硬编码启动失败,采用软编码 + * - `1104` 视频编码失败 + * - `1105` 新美颜软编码启动失败,采用老的软编码 + * - `1106` 新美颜软编码启动失败,采用老的软编码 + * - `3001` RTMP -DNS解析失败 + * - `3002` RTMP服务器连接失败 + * - `3003` RTMP服务器握手失败 + * - `3004` RTMP服务器主动断开,请检查推流地址的合法性或防盗链有效期 + * - `3005` RTMP 读/写失败 + */ + code: number; + }>; + + /** + * 网络状态通知,detail = {info} + * + * 最低基础库: 1.9.0 + */ + type LivePusherNetStatus = CustomEvent<{ + /** + * 网络状态数据 + * + * -`videoBitrate` 当前视频编/码器输出的比特率,单位 kbps + * -`audioBitrate` 当前音频编/码器输出的比特率,单位 kbps + * -`videoFPS` 当前视频帧率 + * -`videoGOP` 当前视频 GOP,也就是每两个关键帧(I帧)间隔时长,单位 s + * -`netSpeed` 当前的发送/接收速度 + * -`netJitter` 网络抖动情况,抖动越大,网络越不稳定 + * -`videoWidth` 视频画面的宽度 + * -`videoHeight` 视频画面的高度 + */ + info: + | 'videoBitrate' + | 'audioBitrate' + | 'videoFPS' + | 'videoGOP' + | 'netSpeed' + | 'netJitter' + | 'videoWidth' + | 'videoHeight'; + }>; + + /** + * 渲染错误事件,detail = {errMsg, errCode} + * + * `tip`: 开发者工具上暂不支持 live-pusher + * + * 最低基础库: 1.7.4 + */ + type LivePusherError = CustomEvent<{ + errMsg: string; + /** + * 错误码 + * + * - `10001` 用户禁止使用摄像头 + * - `10002` 用户禁止使用录音 + * - `10003` 背景音资源 (BGM) 加载失败 + * - `10004` 等待画面资源 (waiting-image) 加载失败 + */ + errCode: number; + }>; + + /** + * 背景音开始播放时触发 + * + * 最低基础库: 2.4.0 + */ + type LivePusherBgmStart = CustomEvent; + + /** + * 背景音进度变化时触发,detail = {progress, duration} + * + * 最低基础库: 2.4.0 + */ + type LivePusherBgmProgress = CustomEvent<{ + progress: number; + duration: number; + }>; + + /** + * 背景音播放完成时触发 + * + * 最低基础库: 2.4.0 + */ + type LivePusherBgmComplete = CustomEvent; + + /** 当开始/继续播放时触发play事件 */ + type VideoPlay = CustomEvent; + + /** 当暂停播放时触发 pause 事件 */ + type VideoPause = CustomEvent; + + /** 当播放到末尾时触发 ended 事件 */ + type VideoEnded = CustomEvent; + + /** 播放进度变化时触发,event.detail = {currentTime, duration} 。触发频率 250ms 一次 */ + type VideoTimeUpdate = CustomEvent<{ + currentTime: number; + duration: number; + }>; + + /** + * 视频进入和退出全屏时触发,event.detail = {fullScreen, direction} + * + * 最低基础库: 1.4.0 + */ + type VideoFullScreenChange = CustomEvent<{ + fullScreen: boolean; + direction: 'vertical' | 'horizontal'; + }>; + + /** + * 视频出现缓冲时触发 + * + * 最低基础库: 1.7.0 + */ + type VideoWaiting = CustomEvent; + + /** + * 视频播放出错时触发 + * + * 最低基础库: 1.7.0 + */ + type VideoError = CustomEvent; + + /** + * 加载进度变化时触发,只支持一段加载。 + * + * 最低基础库: 2.4.0 + */ + type VideoPregress = CustomEvent<{ + /** 百分比 */ + buffered: number; + }>; + + /** + * 加载进度变化时触发,只支持一段加载。 + * + * 最低基础库: 2.4.0 + */ + type VoipRoomError = CustomEvent; + + /** + * 点击地图时触发 + * + * 2.9.0 起返回经纬度信息 + */ + type MapTap = CustomEvent<{ + /** 经度,最低基础库 2.9.0 */ + longitude: number; + /** 纬度,最低基础库 2.9.0 */ + latitude: number; + }>; + + /** + * 点击标记点时触发 + * + * e.detail = {markerId} + */ + type MarkerTap = CustomEvent<{ + /** 标记点 ID */ + markerId: number; + }>; + + /** + * 点击 label 时触发 + * + * e.detail = {markerId} + * + * 最低基础库: 2.9.0 + */ + type LabelTap = MarkerTap; + + /** + * 点击控件时触发 + * + * e.detail = {controlId} + */ + type ControlTap = CustomEvent<{ + /** 控件 ID */ + controlId: number; + }>; + + /** + * 点击 label 时触发 + * + * e.detail = {markerId} + * + * 最低基础库: 1.2.0 + */ + type CalloutTap = MarkerTap; + + /** + * 在地图渲染更新完成时触发 + * + * 最低基础库: 1.6.0 + */ + type MapUpdated = CustomEvent; + + /** + * 在地图渲染更新完成时触发 + * + * 最低基础库: 1.6.0 + */ + type RegionChange = CustomEvent<{ + /** 旋转程度,最低基础库 2.3.0 */ + rotate: number; + /** 缩放程度,最低基础库 2.3.0 */ + skew: number; + }> & + ( + | { + /** + * 视野变化开始、结束时触发 + * + * 视野变化开始为 `begin` + */ + type: 'begin'; + /** + * 导致视野变化的原因 + * + * - gesture: 用户手势 + * - update: 调用接口导致 + */ + causedBy: 'gesture' | 'update'; + } + | { + /** + * 视野变化结束时触发 + * + * 视野变化结束为 `end` + */ + type: 'end'; + /** + * 导致视野变化的原因 + * + * - drag: 拖动地图导致 + * - scale: 缩放导致 + * - update: 调用接口导致 + */ + causedBy: 'drag' | 'scale' | 'update'; + } + ); + + /** + * 广告加载成功的回调 + * + * 最低基础库: 2.2.1 + */ + type AdLoad = CustomEvent; + + /** + * 广告加载失败的回调,event.detail = {errCode: 1002} + * + * `tip`: 监听到error回调后,开发者可以针对性的处理,比如隐藏广告组件的父容器,以保证用户体验,但不要移除广告组件,否则将无法收到bindload的回调。 + * + * 最低基础库: 2.2.1 + */ + type AdError = CustomEvent<{ + /** + * 错误码 + * + * - `1000` 后端错误调用失败 该项错误不是开发者的异常情况 一般情况下忽略一段时间即可恢复。 + * - `1001` 参数错误 使用方法错误 可以前往developers.weixin.qq.com 确认具体教程 (小程序和小游戏分别有各自的教程,可以在顶部选项中,“设计”一栏的右侧进行切换)。 + * - `1002` 广告单元无效 可能是拼写错误、或者误用了其他APP的广告ID 请重新前往mp.weixin.qq.com确认广告位ID。 + * - `1003` 内部错误 该项错误不是开发者的异常情况 一般情况下忽略一段时间即可恢复。 + * - `1004` 无适合的广告 广告不是每一次都会出现,这次没有出现可能是由于该用户不适合浏览广告 属于正常情况,且开发者需要针对这种情况做形态上的兼容。 + * - `1005` 广告组件审核中 你的广告正在被审核,无法展现广告 请前往mp.weixin.qq.com确认审核状态,且开发者需要针对这种情况做形态上的兼容。 + * - `1006` 广告组件被驳回 你的广告审核失败,无法展现广告 请前往mp.weixin.qq.com确认审核状态,且开发者需要针对这种情况做形态上的兼容。 + * - `1007` 广告组件被驳回 你的广告能力已经被封禁,封禁期间无法展现广告 请前往mp.weixin.qq.com确认小程序广告封禁状态。 + * - `1008` 广告单元已关闭 该广告位的广告能力已经被关闭 请前往mp.weixin.qq.com重新打开对应广告位的展现。 + */ + errCode: number; + }>; + + /** + * 广告关闭的回调 + * + * 最低基础库: 2.6.5 + */ + type AdClose = CustomEvent; + + /** + * 网页向小程序 postMessage 时,会在特定时机 (小程序后退、组件销毁、分享) 触发并收到消息。e.detail = { data } + * + * 最低基础库: 1.6.4 + */ + type WebviewMessage = CustomEvent<{ + /** 多次 postMessage 的参数组成的数组 */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any + data: any[]; + }>; + + /** + * 网页加载成功时候触发此事件。e.detail = { src } + * + * 最低基础库: 1.6.4 + */ + type WebviewLoad = CustomEvent<{ + src: string; + }>; + + /** + * 网页加载失败的时候触发此事件。e.detail = { src } + * + * 最低基础库: 1.6.4 + */ + type WebviewError = CustomEvent<{ + src: string; + }>; +} diff --git a/typings/types/wx/lib.wx.page.d.ts b/typings/types/wx/lib.wx.page.d.ts new file mode 100644 index 0000000..5d2d00e --- /dev/null +++ b/typings/types/wx/lib.wx.page.d.ts @@ -0,0 +1,272 @@ +/*! ***************************************************************************** +Copyright (c) 2023 Tencent, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +***************************************************************************** */ + +declare namespace WechatMiniprogram.Page { + type Instance< + TData extends DataOption, + TCustom extends CustomOption + > = OptionalInterface<ILifetime> & + InstanceProperties & + InstanceMethods<TData> & + Data<TData> & + TCustom; + type Options< + TData extends DataOption, + TCustom extends CustomOption + > = (TCustom & + Partial<Data<TData>> & + Partial<ILifetime> & { + options?: Component.ComponentOptions; + }) & + ThisType<Instance<TData, TCustom>>; + type TrivialInstance = Instance<IAnyObject, IAnyObject>; + interface Constructor { + <TData extends DataOption, TCustom extends CustomOption>( + options: Options<TData, TCustom> + ): void; + } + interface ILifetime { + /** 生命周期回调—监听页面加载 + * + * 页面加载时触发。一个页面只会调用一次,可以在 onLoad 的参数中获取打开当前页面路径中的参数。 + */ + onLoad( + /** 打开当前页面路径中的参数 */ + query: Record<string, string | undefined> + ): void | Promise<void>; + /** 生命周期回调—监听页面显示 + * + * 页面显示/切入前台时触发。 + */ + onShow(): void | Promise<void>; + /** 生命周期回调—监听页面初次渲染完成 + * + * 页面初次渲染完成时触发。一个页面只会调用一次,代表页面已经准备妥当,可以和视图层进行交互。 + * + + * 注意:对界面内容进行设置的 API 如`wx.setNavigationBarTitle`,请在`onReady`之后进行。 + */ + onReady(): void | Promise<void>; + /** 生命周期回调—监听页面隐藏 + * + * 页面隐藏/切入后台时触发。 如 `navigateTo` 或底部 `tab` 切换到其他页面,小程序切入后台等。 + */ + onHide(): void | Promise<void>; + /** 生命周期回调—监听页面卸载 + * + * 页面卸载时触发。如`redirectTo`或`navigateBack`到其他页面时。 + */ + onUnload(): void | Promise<void>; + /** 监听用户下拉动作 + * + * 监听用户下拉刷新事件。 + * - 需要在`app.json`的`window`选项中或页面配置中开启`enablePullDownRefresh`。 + * - 可以通过`wx.startPullDownRefresh`触发下拉刷新,调用后触发下拉刷新动画,效果与用户手动下拉刷新一致。 + * - 当处理完数据刷新后,`wx.stopPullDownRefresh`可以停止当前页面的下拉刷新。 + */ + onPullDownRefresh(): void | Promise<void>; + /** 页面上拉触底事件的处理函数 + * + * 监听用户上拉触底事件。 + * - 可以在`app.json`的`window`选项中或页面配置中设置触发距离`onReachBottomDistance`。 + * - 在触发距离内滑动期间,本事件只会被触发一次。 + */ + onReachBottom(): void | Promise<void>; + /** 用户点击右上角转发 + * + * 监听用户点击页面内转发按钮(`<button>` 组件 `open-type="share"`)或右上角菜单“转发”按钮的行为,并自定义转发内容。 + * + * **注意:只有定义了此事件处理函数,右上角菜单才会显示“转发”按钮** + * + * 此事件需要 return 一个 Object,用于自定义转发内容 + */ + onShareAppMessage( + /** 分享发起来源参数 */ + options: IShareAppMessageOption + ): + | ICustomShareContent + | IAsyncCustomShareContent + | Promise<ICustomShareContent> + | void + | Promise<void>; + /** + * 监听右上角菜单“分享到朋友圈”按钮的行为,并自定义分享内容 + * + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见 [分享到朋友圈 (Beta)](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html) + * + * 基础库 2.11.3 开始支持,低版本需做兼容处理。 + */ + onShareTimeline(): ICustomTimelineContent | void; + + /** 页面滚动触发事件的处理函数 + * + * 监听用户滑动页面事件。 + */ + onPageScroll( + /** 页面滚动参数 */ + options: IPageScrollOption + ): void | Promise<void>; + + /** 当前是 tab 页时,点击 tab 时触发,最低基础库: `1.9.0` */ + onTabItemTap( + /** tab 点击参数 */ + options: ITabItemTapOption + ): void | Promise<void>; + + /** 窗口尺寸改变时触发,最低基础库:`2.4.0` */ + onResize( + /** 窗口尺寸参数 */ + options: IResizeOption + ): void | Promise<void>; + + /** + * 监听用户点击右上角菜单“收藏”按钮的行为,并自定义收藏内容。 + * 基础库 2.10.3,安卓 7.0.15 版本起支持,iOS 暂不支持 + */ + onAddToFavorites(options: IAddToFavoritesOption): IAddToFavoritesContent; + } + interface InstanceProperties { + /** 页面的文件路径 */ + is: string; + + /** 到当前页面的路径 */ + route: string; + + /** 打开当前页面路径中的参数 */ + options: Record<string, string | undefined>; + } + + type DataOption = Record<string, any>; + type CustomOption = Record<string, any>; + + type InstanceMethods<D extends DataOption> = Component.InstanceMethods<D>; + + interface Data<D extends DataOption> { + /** 页面的初始数据 + * + * `data` 是页面第一次渲染使用的**初始数据**。 + * + * 页面加载时,`data` 将会以`JSON`字符串的形式由逻辑层传至渲染层,因此`data`中的数据必须是可以转成`JSON`的类型:字符串,数字,布尔值,对象,数组。 + * + * 渲染层可以通过 `WXML` 对数据进行绑定。 + */ + data: D; + } + + interface ICustomShareContent { + /** 转发标题。默认值:当前小程序名称 */ + title?: string; + /** 转发路径,必须是以 / 开头的完整路径。默认值:当前页面 path */ + path?: string; + /** 自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持PNG及JPG。显示图片长宽比是 5:4,最低基础库: `1.5.0`。默认值:使用默认截图 */ + imageUrl?: string; + } + + interface IAsyncCustomShareContent extends ICustomShareContent { + promise: Promise<ICustomShareContent>; + } + + interface ICustomTimelineContent { + /** 自定义标题,即朋友圈列表页上显示的标题。默认值:当前小程序名称 */ + title?: string; + /** 自定义页面路径中携带的参数,如 `path?a=1&b=2` 的 “?” 后面部分 默认值:当前页面路径携带的参数 */ + query?: string; + /** 自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持 PNG 及 JPG。显示图片长宽比是 1:1。默认值:默认使用小程序 Logo*/ + imageUrl?: string; + } + + interface IPageScrollOption { + /** 页面在垂直方向已滚动的距离(单位px) */ + scrollTop: number; + } + + interface IShareAppMessageOption { + /** 转发事件来源。 + * + * 可选值: + * - `button`:页面内转发按钮; + * - `menu`:右上角转发菜单。 + * + * 最低基础库: `1.2.4` + */ + from: 'button' | 'menu'; + /** 如果 `from` 值是 `button`,则 `target` 是触发这次转发事件的 `button`,否则为 `undefined` + * + * 最低基础库: `1.2.4` */ + target: any; + /** 页面中包含`<web-view>`组件时,返回当前`<web-view>`的url + * + * 最低基础库: `1.6.4` + */ + webViewUrl?: string; + } + + interface ITabItemTapOption { + /** 被点击tabItem的序号,从0开始,最低基础库: `1.9.0` */ + index: string; + /** 被点击tabItem的页面路径,最低基础库: `1.9.0` */ + pagePath: string; + /** 被点击tabItem的按钮文字,最低基础库: `1.9.0` */ + text: string; + } + + interface IResizeOption { + size: { + /** 变化后的窗口宽度,单位 px */ + windowWidth: number; + /** 变化后的窗口高度,单位 px */ + windowHeight: number; + }; + } + + interface IAddToFavoritesOption { + /** 页面中包含web-view组件时,返回当前web-view的url */ + webviewUrl?: string; + } + + interface IAddToFavoritesContent { + /** 自定义标题,默认值:页面标题或账号名称 */ + title?: string; + /** 自定义图片,显示图片长宽比为 1:1,默认值:页面截图 */ + imageUrl?: string; + /** 自定义query字段,默认值:当前页面的query */ + query?: string; + } + + interface GetCurrentPages { + (): Array<Instance<IAnyObject, IAnyObject>>; + } +} + +/** + * 注册小程序中的一个页面。接受一个 `Object` 类型参数,其指定页面的初始数据、生命周期回调、事件处理函数等。 + */ +declare let Page: WechatMiniprogram.Page.Constructor; +/** + * 获取当前页面栈。数组中第一个元素为首页,最后一个元素为当前页面。 + + * __注意:__ + + * - __不要尝试修改页面栈,会导致路由以及页面状态错误。__ + * - 不要在 `App.onLaunch` 的时候调用 `getCurrentPages()`,此时 `page` 还没有生成。 + */ +declare let getCurrentPages: WechatMiniprogram.Page.GetCurrentPages;