diff --git a/.npmrc b/.npmrc index 859db81..1513a03 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,2 @@ - +registry=http://npm.nps.yunvip123.cn engine-strict=true diff --git a/packages/uni-app/package.json b/packages/uni-app/package.json index 7c0af20..adfba75 100644 --- a/packages/uni-app/package.json +++ b/packages/uni-app/package.json @@ -83,6 +83,7 @@ "test": "vitest run" }, "dependencies": { + "@jonny1994/qqmap-wx-jssdk": "^1.4.0", "@r-utils/common": "workspace:^", "chroma-js": "catalog:", "lodash-es": "catalog:", diff --git a/packages/uni-app/types/nfc/weixin.d.ts b/packages/uni-app/types/nfc/weixin.d.ts index 0e70ea0..85f343e 100644 --- a/packages/uni-app/types/nfc/weixin.d.ts +++ b/packages/uni-app/types/nfc/weixin.d.ts @@ -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; export class WeixinNfcUtil { diff --git a/packages/vue2/src/plugins/visibility/index.d.ts b/packages/vue2/src/plugins/visibility/index.d.ts index 1f7991f..a9cd13f 100644 --- a/packages/vue2/src/plugins/visibility/index.d.ts +++ b/packages/vue2/src/plugins/visibility/index.d.ts @@ -14,7 +14,7 @@ declare module "vue/types/options" { export declare function install(Vue: VueConstructor): void; /** 页面可见性生命周期插件 */ -declare const VisibilityPlugin: PluginObject & { +declare const VisibilityPlugin: PluginObject & { /** 安装页面可见性生命周期插件 */ install: typeof install; }; diff --git a/packages/vue3/src/vue-helper/index.ts b/packages/vue3/src/vue-helper/index.ts index 92b06f8..ef70704 100644 --- a/packages/vue3/src/vue-helper/index.ts +++ b/packages/vue3/src/vue-helper/index.ts @@ -3,6 +3,7 @@ import { ComponentPublicInstance } from "vue"; type CustomClassObj = Record; type CustomClass = string | Array | CustomClassObj; type DistCustomClass = Record; + export function createCustomClassObj(customClass: string): DistCustomClass; export function createCustomClassObj( customClass: Array, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6fb796a..60e54ce 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -153,6 +153,9 @@ importers: packages/uni-app: dependencies: + '@jonny1994/qqmap-wx-jssdk': + specifier: ^1.4.0 + version: 1.4.0 '@r-utils/common': specifier: workspace:^ version: link:../common