New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@wevu/api

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wevu/api

tsdown bundler template

latest
Source
npmnpm
Version
0.2.3
Version published
Weekly downloads
629
43.28%
Maintainers
1
Weekly downloads
 
Created
Source

@wevu/api

简介

@wevu/api 提供跨平台的小程序 API 封装,默认推荐 Promise 风格,同时兼容传统回调风格。

特性

  • 动态代理,覆盖微信小程序全量 API
  • 跨平台适配(微信/支付宝/百度/字节/QQ/快应用/京东/小红书/快手/淘宝等)
  • Promise 风格优先,回调风格可用
  • 支持显式注入平台适配器

类型对齐与平台支持

@wevu/api 的默认导出 wpi 会同时对齐:

  • 微信类型:miniprogram-api-typings
  • 支付宝类型:@mini-types/alipay
  • 抖音类型:@douyin-microapp/typings

平台类型对齐矩阵

平台全局对象类型来源支持度
微信小程序wxminiprogram-api-typings✅ 全量
支付宝小程序my@mini-types/alipay✅ 全量
抖音小程序tt@douyin-microapp/typings✅ 全量
其他平台(swan/jd/xhs 等)运行时宿主对象运行时透传⚠️ 按宿主能力支持

API 支持覆盖率报告

平台可调用 API 数语义对齐 API 数fallback API 数API 总数可调用覆盖率语义对齐覆盖率
微信小程序 (wx)4814810481100.00%100.00%
支付宝小程序 (my)201201048141.79%41.79%
抖音小程序 (tt)133133048127.65%27.65%
三端可调用完全对齐 (wx/my/tt)117--48124.32%-
三端语义完全对齐 (wx/my/tt)-117-481-24.32%

该报告由 WEAPI_METHOD_SUPPORT_MATRIX 与映射规则自动计算生成。

核心跨端映射矩阵

API说明微信策略支付宝策略抖音策略支持度
showToast显示消息提示框。直连 wx.showToasttitle/icon 映射到 content/type 后调用 my.showToasticon=error 映射为 fail 后调用 tt.showToast
showLoading显示 loading 提示框。直连 wx.showLoadingtitle 映射到 content 后调用 my.showLoading直连 tt.showLoading
showActionSheet显示操作菜单。直连 wx.showActionSheetitemListitemsindextapIndex 双向对齐直连 tt.showActionSheet;缺失时按 unsupported 报错
showModal显示模态弹窗。直连 wx.showModal调用 my.confirm 并对齐按钮字段与 cancel/contentshowCancel=falseeditable 等场景按 unsupported 报错直连 tt.showModal⚠️
chooseImage选择图片。直连 wx.chooseImage返回值 apFilePaths 映射到 tempFilePathstempFilePaths 字符串转数组,缺失时从 tempFiles.path 兜底
chooseMedia选择图片或视频。直连 wx.chooseMedia无同等 API,调用时按 unsupported 报错直连 tt.chooseMedia,并补齐 tempFiles[].tempFilePath/fileType⚠️
chooseMessageFile选择会话文件。直连 wx.chooseMessageFile无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getFuzzyLocation获取模糊地理位置。直连 wx.getFuzzyLocation无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
previewMedia预览图片和视频。直连 wx.previewMedia无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createInterstitialAd创建插屏广告实例。直连 wx.createInterstitialAd无同等 API,调用时按 unsupported 报错直连 tt.createInterstitialAd⚠️
createRewardedVideoAd创建激励视频广告实例。直连 wx.createRewardedVideoAd映射到 my.createRewardedAd,并将 load/show/destroy 参数对齐为微信调用方式直连 tt.createRewardedVideoAd⚠️
createLivePlayerContext创建直播播放器上下文。直连 wx.createLivePlayerContext无同等 API,调用时按 unsupported 报错直连 tt.createLivePlayerContext⚠️
createLivePusherContext创建直播推流上下文。直连 wx.createLivePusherContext无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getVideoInfo获取视频详细信息。直连 wx.getVideoInfo直连 my.getVideoInfo无同等 API,调用时按 unsupported 报错⚠️
saveFile保存文件(跨端扩展,微信 typings 未声明同名 API)。微信当前 typings 未声明同名 API,保留为跨端扩展能力请求参数 tempFilePathapFilePath、结果映射为 savedFilePath直连 tt.saveFile,并在缺失时用 filePath 兜底 savedFilePath⚠️
setClipboardData设置剪贴板内容。直连 wx.setClipboardData转调 my.setClipboard 并映射 datatext直连 tt.setClipboardData
getClipboardData获取剪贴板内容。直连 wx.getClipboardData转调 my.getClipboard 并映射 textdata直连 tt.getClipboardData
chooseAddress选择收货地址。直连 wx.chooseAddress无同等 API,调用时按 unsupported 报错直连 tt.chooseAddress⚠️
createAudioContext创建音频上下文。直连 wx.createAudioContext无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createWebAudioContext创建 WebAudio 上下文。直连 wx.createWebAudioContext无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getSystemInfoAsync异步获取系统信息。直连 wx.getSystemInfoAsync映射到 my.getSystemInfo映射到 tt.getSystemInfo⚠️
openAppAuthorizeSetting打开小程序授权设置页。直连 wx.openAppAuthorizeSetting无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
pluginLogin插件登录。直连 wx.pluginLogin无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
login登录。直连 wx.login无同等 API,调用时按 unsupported 报错直连 tt.login⚠️
authorize提前向用户发起授权请求。直连 wx.authorize无同等 API,调用时按 unsupported 报错直连 tt.authorize⚠️
checkSession检查登录态是否过期。直连 wx.checkSession无同等 API,调用时按 unsupported 报错直连 tt.checkSession⚠️
requestSubscribeDeviceMessage请求订阅设备消息。直连 wx.requestSubscribeDeviceMessage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requestSubscribeEmployeeMessage请求订阅员工消息。直连 wx.requestSubscribeEmployeeMessage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
restartMiniProgram重启小程序。直连 wx.restartMiniProgram无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
scanCode扫码。直连 wx.scanCode无同等 API,调用时按 unsupported 报错直连 tt.scanCode⚠️
requestPayment发起支付。直连 wx.requestPayment无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requestOrderPayment发起订单支付。直连 wx.requestOrderPayment无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requestPluginPayment发起插件支付。直连 wx.requestPluginPayment无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requestVirtualPayment发起虚拟支付。直连 wx.requestVirtualPayment无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
showShareImageMenu显示分享图片菜单。直连 wx.showShareImageMenu无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
updateShareMenu更新分享菜单配置。直连 wx.updateShareMenu无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openEmbeddedMiniProgram打开嵌入式小程序。直连 wx.openEmbeddedMiniProgram无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
saveFileToDisk保存文件到磁盘。直连 wx.saveFileToDisk直连 my.saveFileToDisk无同等 API,调用时按 unsupported 报错⚠️
getEnterOptionsSync获取启动参数(同步)。直连 wx.getEnterOptionsSync直连 my.getEnterOptionsSync无同等 API,调用时按 unsupported 报错⚠️
getSystemSetting获取系统设置。直连 wx.getSystemSetting直连 my.getSystemSetting无同等 API,调用时按 unsupported 报错⚠️
getUserProfile获取用户资料。直连 wx.getUserProfile无同等 API,调用时按 unsupported 报错直连 tt.getUserProfile⚠️
getUserInfo获取用户信息。直连 wx.getUserInfo无同等 API,调用时按 unsupported 报错直连 tt.getUserInfo⚠️
getAppAuthorizeSetting获取 App 授权设置。直连 wx.getAppAuthorizeSetting直连 my.getAppAuthorizeSetting无同等 API,调用时按 unsupported 报错⚠️
getAppBaseInfo获取 App 基础信息。直连 wx.getAppBaseInfo直连 my.getAppBaseInfo无同等 API,调用时按 unsupported 报错⚠️
chooseVideo选择视频。直连 wx.chooseVideo直连 my.chooseVideo无同等 API,调用时按 unsupported 报错⚠️
hideHomeButton隐藏返回首页按钮。直连 wx.hideHomeButton映射到 my.hideBackHome直连 tt.hideHomeButton
getWindowInfo获取窗口信息。直连 wx.getWindowInfo直连 my.getWindowInfo无同等 API,调用时按 unsupported 报错⚠️
getDeviceInfo获取设备基础信息。直连 wx.getDeviceInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getAccountInfoSync同步获取当前账号信息。直连 wx.getAccountInfoSync直连 my.getAccountInfoSync无同等 API,调用时按 unsupported 报错⚠️
setBackgroundColor动态设置窗口背景色。直连 wx.setBackgroundColor直连 my.setBackgroundColor无同等 API,调用时按 unsupported 报错⚠️
setBackgroundTextStyle动态设置下拉背景字体样式。直连 wx.setBackgroundTextStyle直连 my.setBackgroundTextStyle无同等 API,调用时按 unsupported 报错⚠️
getNetworkType获取网络类型。直连 wx.getNetworkType直连 my.getNetworkType无同等 API,调用时按 unsupported 报错⚠️
getBatteryInfo异步获取电量信息。直连 wx.getBatteryInfo直连 my.getBatteryInfo无同等 API,调用时按 unsupported 报错⚠️
getBatteryInfoSync同步获取电量信息。直连 wx.getBatteryInfoSync直连 my.getBatteryInfoSync无同等 API,调用时按 unsupported 报错⚠️
getLogManager获取日志管理器实例。直连 wx.getLogManager无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
nextTick延迟到下一个 UI 更新时机执行回调。直连 wx.nextTick无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
onWindowResize监听窗口尺寸变化事件。直连 wx.onWindowResize无同等 API,调用时按 unsupported 报错直连 tt.onWindowResize⚠️
offWindowResize取消监听窗口尺寸变化事件。直连 wx.offWindowResize无同等 API,调用时按 unsupported 报错直连 tt.offWindowResize⚠️
reportAnalytics上报分析数据。直连 wx.reportAnalytics无同等 API,调用时按 unsupported 报错直连 tt.reportAnalytics⚠️
openCustomerServiceChat打开客服会话。直连 wx.openCustomerServiceChat无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createVKSession创建视觉识别会话。直连 wx.createVKSession无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
compressVideo压缩视频文件。直连 wx.compressVideo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openVideoEditor打开视频编辑器。直连 wx.openVideoEditor无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getShareInfo获取转发详细信息。直连 wx.getShareInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
joinVoIPChat加入音视频通话。直连 wx.joinVoIPChat无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openDocument打开文档。直连 wx.openDocument直连 my.openDocument无同等 API,调用时按 unsupported 报错⚠️
saveVideoToPhotosAlbum保存视频到系统相册。直连 wx.saveVideoToPhotosAlbum直连 my.saveVideoToPhotosAlbum无同等 API,调用时按 unsupported 报错⚠️
batchSetStorage批量异步写入缓存。直连 wx.batchSetStorage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
batchGetStorage批量异步读取缓存。直连 wx.batchGetStorage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
batchSetStorageSync批量同步写入缓存。直连 wx.batchSetStorageSync无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
batchGetStorageSync批量同步读取缓存。直连 wx.batchGetStorageSync无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createCameraContext创建相机上下文对象。直连 wx.createCameraContext无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
offMemoryWarning取消内存不足告警监听。直连 wx.offMemoryWarning直连 my.offMemoryWarning无同等 API,调用时按 unsupported 报错⚠️
cancelIdleCallback取消空闲回调。直连 wx.cancelIdleCallback无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
onBLEConnectionStateChange监听 BLE 连接状态变化。直连 wx.onBLEConnectionStateChange映射到 my.onBLEConnectionStateChanged抖音无同等 API,调用时报 not supported⚠️
offBLEConnectionStateChange取消监听 BLE 连接状态变化。直连 wx.offBLEConnectionStateChange映射到 my.offBLEConnectionStateChanged抖音无同等 API,调用时报 not supported⚠️
addCard添加微信卡券。直连 wx.addCard无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
addFileToFavorites添加文件到收藏。直连 wx.addFileToFavorites无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
addPaymentPassFinish添加支付 pass 完成回调。直连 wx.addPaymentPassFinish无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
addPaymentPassGetCertificateData添加支付 pass 证书数据回调。直连 wx.addPaymentPassGetCertificateData无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
addPhoneCalendar添加日历事件。直连 wx.addPhoneCalendar无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
addPhoneContact添加手机联系人。直连 wx.addPhoneContact直连 my.addPhoneContact无同等 API,调用时按 unsupported 报错⚠️
addPhoneRepeatCalendar添加重复日历事件。直连 wx.addPhoneRepeatCalendar无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
addVideoToFavorites添加视频到收藏。直连 wx.addVideoToFavorites无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
authorizeForMiniProgram获取小程序授权码。直连 wx.authorizeForMiniProgram无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
authPrivateMessage校验私密消息。直连 wx.authPrivateMessage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
bindEmployeeRelation绑定员工关系。直连 wx.bindEmployeeRelation无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
canAddSecureElementPass检测是否可添加安全元素卡片。直连 wx.canAddSecureElementPass无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
canvasGetImageData获取 canvas 区域像素数据。直连 wx.canvasGetImageData无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
canvasPutImageData将像素数据绘制到 canvas。直连 wx.canvasPutImageData无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
checkDeviceSupportHevc检测设备是否支持 HEVC 解码。直连 wx.checkDeviceSupportHevc无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
checkEmployeeRelation查询员工关系绑定状态。直连 wx.checkEmployeeRelation无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
checkIsAddedToMyMiniProgram检测是否已添加到我的小程序。直连 wx.checkIsAddedToMyMiniProgram无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
checkIsOpenAccessibility检测系统无障碍是否开启。直连 wx.checkIsOpenAccessibility无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
checkIsPictureInPictureActive检测是否处于画中画状态。直连 wx.checkIsPictureInPictureActive无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
checkIsSoterEnrolledInDevice检测设备是否录入 SOTER 信息。直连 wx.checkIsSoterEnrolledInDevice映射到 my.checkIsIfaaEnrolledInDevicespeech 模式按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
checkIsSupportSoterAuthentication检测设备是否支持 SOTER 生物认证。直连 wx.checkIsSupportSoterAuthentication映射到 my.checkIsSupportIfaaAuthentication无同等 API,调用时按 unsupported 报错⚠️
openCard打开卡券详情。直连 wx.openCard无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openChannelsActivity打开视频号活动页。直连 wx.openChannelsActivity无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openChannelsEvent打开视频号活动详情。直连 wx.openChannelsEvent无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openChannelsLive打开视频号直播。直连 wx.openChannelsLive无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openChannelsLiveNoticeInfo打开视频号直播预告详情。直连 wx.openChannelsLiveNoticeInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openChannelsUserProfile打开视频号用户主页。直连 wx.openChannelsUserProfile无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openChatTool打开客服工具页。直连 wx.openChatTool无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openHKOfflinePayView打开香港线下支付视图。直连 wx.openHKOfflinePayView无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openInquiriesTopic打开询价话题。直连 wx.openInquiriesTopic无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openOfficialAccountArticle打开公众号文章。直连 wx.openOfficialAccountArticle无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openOfficialAccountChat打开公众号会话。直连 wx.openOfficialAccountChat无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openOfficialAccountProfile打开公众号主页。直连 wx.openOfficialAccountProfile无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openPrivacyContract打开隐私协议页面。直连 wx.openPrivacyContract无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openSystemBluetoothSetting打开系统蓝牙设置页面。直连 wx.openSystemBluetoothSetting无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
reportEvent上报事件埋点。直连 wx.reportEvent无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
reportMonitor上报监控数据。直连 wx.reportMonitor无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
reportPerformance上报性能数据。直连 wx.reportPerformance无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openSingleStickerView打开单个表情贴纸详情。直连 wx.openSingleStickerView无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openStickerIPView打开表情 IP 页面。直连 wx.openStickerIPView无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openStickerSetView打开表情包详情页。直连 wx.openStickerSetView无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openStoreCouponDetail打开小店优惠券详情。直连 wx.openStoreCouponDetail无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
openStoreOrderDetail打开小店订单详情。直连 wx.openStoreOrderDetail无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
pauseBackgroundAudio暂停后台音频。直连 wx.pauseBackgroundAudio无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
pauseVoice暂停播放语音。直连 wx.pauseVoice无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
playBackgroundAudio播放后台音频。直连 wx.playBackgroundAudio无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
playVoice播放语音。直连 wx.playVoice无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
postMessageToReferrerMiniProgram向来源小程序发送消息。直连 wx.postMessageToReferrerMiniProgram无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
postMessageToReferrerPage向来源页面发送消息。直连 wx.postMessageToReferrerPage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
preDownloadSubpackage预下载分包。直连 wx.preDownloadSubpackage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
preloadAssets预加载资源。直连 wx.preloadAssets无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
preloadSkylineView预加载 Skyline 视图。直连 wx.preloadSkylineView无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
preloadWebview预加载 WebView 页面。直连 wx.preloadWebview无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
removeSecureElementPass移除安全元素卡片。直连 wx.removeSecureElementPass无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
chooseInvoiceTitle选择发票抬头。直连 wx.chooseInvoiceTitle无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
chooseLicensePlate选择车牌号。直连 wx.chooseLicensePlate无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
choosePoi选择兴趣点 POI。直连 wx.choosePoi无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
closeBLEConnection断开低功耗蓝牙连接。直连 wx.closeBLEConnectiondeviceId 对齐后映射到 my.disconnectBLEDevice,并将 errorCode/errorMessage 映射为 errCode/errMsg无同等 API,调用时按 unsupported 报错⚠️
createBLEConnection创建低功耗蓝牙连接。直连 wx.createBLEConnectiondeviceId/timeout 对齐后映射到 my.connectBLEDevice,并将 error/errorMessage 映射为 errCode/errMsg无同等 API,调用时按 unsupported 报错⚠️
cropImage裁剪图片。直连 wx.cropImage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
editImage编辑图片。直连 wx.editImage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
exitVoIPChat退出音视频通话。直连 wx.exitVoIPChat无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
faceDetect人脸检测。直连 wx.faceDetect无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getApiCategory获取 API 分类信息。直连 wx.getApiCategory无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getBackgroundFetchToken获取后台拉取 token。直连 wx.getBackgroundFetchToken无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getChannelsLiveInfo获取视频号直播信息。直连 wx.getChannelsLiveInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getChannelsLiveNoticeInfo获取视频号直播预告信息。直连 wx.getChannelsLiveNoticeInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getChannelsShareKey获取视频号分享 key。直连 wx.getChannelsShareKey无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getChatToolInfo获取客服工具信息。直连 wx.getChatToolInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getCommonConfig获取通用配置。直连 wx.getCommonConfig无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getGroupEnterInfo获取群聊进入信息。直连 wx.getGroupEnterInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getPrivacySetting获取隐私设置。直连 wx.getPrivacySetting无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
initFaceDetect初始化人脸检测。直连 wx.initFaceDetect无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
join1v1Chat发起 1v1 通话。直连 wx.join1v1Chat无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareAppMessageToGroup分享到群聊会话。直连 wx.shareAppMessageToGroup无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareEmojiToGroup分享到群聊表情。直连 wx.shareEmojiToGroup无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareFileMessage分享文件消息。直连 wx.shareFileMessage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareFileToGroup分享文件到群。直连 wx.shareFileToGroup无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareImageToGroup分享图片到群。直连 wx.shareImageToGroup无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareToOfficialAccount分享至公众号。直连 wx.shareToOfficialAccount无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareToWeRun分享至微信运动。直连 wx.shareToWeRun无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareVideoMessage分享视频消息。直连 wx.shareVideoMessage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
shareVideoToGroup分享视频到群。直连 wx.shareVideoToGroup无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
showRedPackage展示红包组件。直连 wx.showRedPackage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
startDeviceMotionListening开始监听设备方向变化。直连 wx.startDeviceMotionListening无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
startHCE启动 HCE 功能。直连 wx.startHCE无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
startLocalServiceDiscovery开始本地服务发现。直连 wx.startLocalServiceDiscovery无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
startLocationUpdate开始持续定位。直连 wx.startLocationUpdate无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
startLocationUpdateBackground开始后台持续定位。直连 wx.startLocationUpdateBackground无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
startRecord开始录音。直连 wx.startRecord无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
startSoterAuthentication开始 SOTER 认证。直连 wx.startSoterAuthentication无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
stopBackgroundAudio停止后台音频。直连 wx.stopBackgroundAudio无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
stopDeviceMotionListening停止监听设备方向变化。直连 wx.stopDeviceMotionListening无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
stopFaceDetect停止人脸检测。直连 wx.stopFaceDetect无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requestCommonPayment发起通用支付请求。直连 wx.requestCommonPayment无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requestDeviceVoIP请求设备 VoIP 能力。直连 wx.requestDeviceVoIP无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requestMerchantTransfer发起商家转账请求。直连 wx.requestMerchantTransfer无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requirePrivacyAuthorize请求隐私授权。直连 wx.requirePrivacyAuthorize无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
reserveChannelsLive预约视频号直播。直连 wx.reserveChannelsLive无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
selectGroupMembers选择群成员。直连 wx.selectGroupMembers无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
sendHCEMessage发送 HCE 消息。直连 wx.sendHCEMessage无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
sendSms发送短信。直连 wx.sendSms无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
setBackgroundFetchToken设置后台拉取 token。直连 wx.setBackgroundFetchToken无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
setEnable1v1Chat设置 1v1 通话可用状态。直连 wx.setEnable1v1Chat无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
setTopBarText设置顶栏文本。直连 wx.setTopBarText无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
setWindowSize设置窗口尺寸。直连 wx.setWindowSize无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
stopHCE停止 HCE 功能。直连 wx.stopHCE无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
stopLocalServiceDiscovery停止本地服务发现。直连 wx.stopLocalServiceDiscovery无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
stopLocationUpdate停止持续定位。直连 wx.stopLocationUpdate无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
stopRecord停止录音。直连 wx.stopRecord无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
stopVoice停止播放语音。直连 wx.stopVoice无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
subscribeVoIPVideoMembers订阅 VoIP 视频成员变化。直连 wx.subscribeVoIPVideoMembers无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
updateVoIPChatMuteConfig更新 VoIP 静音配置。直连 wx.updateVoIPChatMuteConfig无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
updateWeChatApp拉起微信升级流程。直连 wx.updateWeChatApp无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getBackgroundAudioPlayerState获取后台音频播放状态。直连 wx.getBackgroundAudioPlayerState无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getDeviceBenchmarkInfo获取设备性能评估信息。直连 wx.getDeviceBenchmarkInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getDeviceVoIPList获取设备 VoIP 列表。直连 wx.getDeviceVoIPList无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getHCEState获取 HCE 状态。直连 wx.getHCEState无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getInferenceEnvInfo获取推理环境信息。直连 wx.getInferenceEnvInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getNFCAdapter获取 NFC 适配器。直连 wx.getNFCAdapter无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getPerformance获取性能对象。直连 wx.getPerformance无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getRandomValues获取随机值。直连 wx.getRandomValues无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getRealtimeLogManager获取实时日志管理器。直连 wx.getRealtimeLogManager无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getRendererUserAgent获取渲染层 UserAgent。直连 wx.getRendererUserAgent无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getScreenRecordingState获取录屏状态。直连 wx.getScreenRecordingState无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getSecureElementPasses获取安全元素卡片列表。直连 wx.getSecureElementPasses无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getSelectedTextRange获取已选中文本范围。直连 wx.getSelectedTextRange无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getShowSplashAdStatus获取开屏广告展示状态。直连 wx.getShowSplashAdStatus无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getSkylineInfo获取 Skyline 信息。直连 wx.getSkylineInfo无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getUserCryptoManager获取用户加密管理器。直连 wx.getUserCryptoManager无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getWeRunData获取微信运动数据。直连 wx.getWeRunData无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
getXrFrameSystem获取 XR 框架系统对象。直连 wx.getXrFrameSystem无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
isBluetoothDevicePaired判断蓝牙设备是否已配对。直连 wx.isBluetoothDevicePaired无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
isVKSupport判断是否支持视觉识别能力。直连 wx.isVKSupport无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createBLEPeripheralServer创建 BLE 外设服务实例。直连 wx.createBLEPeripheralServer无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createBufferURL创建缓冲区 URL。直连 wx.createBufferURL无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createCacheManager创建缓存管理器。直连 wx.createCacheManager无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createGlobalPayment创建全局支付对象。直连 wx.createGlobalPayment无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createInferenceSession创建推理会话。直连 wx.createInferenceSession无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createMediaAudioPlayer创建媒体音频播放器。直连 wx.createMediaAudioPlayer无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createMediaContainer创建媒体容器实例。直连 wx.createMediaContainer无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createMediaRecorder创建媒体录制器。直连 wx.createMediaRecorder无同等 API,调用时按 unsupported 报错直连 tt.createMediaRecorder⚠️
createTCPSocket创建 TCP Socket。直连 wx.createTCPSocket无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createUDPSocket创建 UDP Socket。直连 wx.createUDPSocket无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
createVideoDecoder创建视频解码器。直连 wx.createVideoDecoder无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
loadBuiltInFontFace加载内置字体。直连 wx.loadBuiltInFontFace无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
notifyGroupMembers通知群成员。直连 wx.notifyGroupMembers无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
requestIdleCallback空闲时回调请求。直连 wx.requestIdleCallback无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
revokeBufferURL释放缓冲区 URL。直连 wx.revokeBufferURL无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
rewriteRoute重写路由规则。直连 wx.rewriteRoute无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
seekBackgroundAudio调整后台音频播放进度。直连 wx.seekBackgroundAudio无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
setEnableDebug设置调试开关。直连 wx.setEnableDebug无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️
setInnerAudioOption设置内部音频选项。直连 wx.setInnerAudioOption无同等 API,调用时按 unsupported 报错无同等 API,调用时按 unsupported 报错⚠️

安装

pnpm add @wevu/api

使用

Promise 风格(推荐)

import { wpi } from '@wevu/api'

const res = await wpi.request({
  url: 'https://example.com',
  method: 'GET',
})

console.log(res)

回调风格(兼容)

import { wpi } from '@wevu/api'

wpi.request({
  url: 'https://example.com',
  method: 'GET',
  success(res) {
    console.log(res)
  },
  fail(err) {
    console.error(err)
  },
})

显式注入平台适配器

import { createWeapi } from '@wevu/api'

const api = createWeapi({
  adapter: wx,
  platform: 'wx',
})

await api.getSystemInfo()

行为说明

  • 只在不传回调时返回 Promise
  • 同步 API(*Sync)与事件 API(onXxx/offXxx)直接透传
  • 可通过 wpi.resolveTarget('showModal') 查看当前平台目标方法与可用性
  • 可通过 wpi.supports('showModal') 快速判断当前平台是否支持调用
  • 缺失 API 时:
    • 回调风格触发 fail/complete
    • Promise 风格返回 rejected Promise

相关链接

  • 仓库:https://github.com/weapp-vite/weapp-vite

FAQs

Package last updated on 07 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts