fix(uni-app): 🐛 安装类型依赖

This commit is contained in:
2026-05-28 11:54:22 +08:00
parent 80debf6d6b
commit 18a037e9b7
6 changed files with 49 additions and 2 deletions
+42
View File
@@ -1,3 +1,45 @@
declare namespace WechatMiniprogram {
/** 微信小程序 NFC 适配器 */
interface NFCAdapter {
/** 开始监听 NFC 标签发现事件 */
startDiscovery(options?: {
/** 启动成功回调 */
success?: (res: NFCError) => void;
/** 启动失败回调 */
fail?: (res: NFCError) => void;
}): void;
/** 停止监听 NFC 标签发现事件 */
stopDiscovery(options?: {
/** 停止成功回调 */
success?: (res: NFCError) => void;
/** 停止失败回调 */
fail?: (res: NFCError) => void;
}): void;
/** 注册 NFC 标签发现回调 */
onDiscovered(callback: (res: OnDiscoveredCallbackResult) => void): void;
/** 取消注册 NFC 标签发现回调 */
offDiscovered(callback?: (res: OnDiscoveredCallbackResult) => void): void;
}
/** 微信小程序 NFC 操作结果 */
interface NFCError {
/** 错误码 */
errCode?: number;
/** 错误信息 */
errMsg?: string;
}
/** 微信小程序 NFC 标签发现结果 */
interface OnDiscoveredCallbackResult {
/** NFC 标签 ID */
id: ArrayBuffer;
/** NFC 标签消息列表 */
messages?: unknown[];
/** NFC 支持的技术列表 */
techs?: string[];
}
}
export function startNfcScan(): Promise<number[]>;
export class WeixinNfcUtil {