refactor(miniprogram): 消灭全部 any 类型 — 32处 → 0 (E3-1)

- catch (err: any) → catch (err: unknown) + instanceof Error 类型缩窄(6 文件 13 处)
- BLE 回调类型提取 BLEScanResult/BLEConnectionChangeResult/BLECharacteristicChangeResult/BLEServiceItem
- BLEManager 7 处 any 注解替换为具体接口类型
- request.ts method as any → method as ValidMethod 字面量联合类型
- appointment ScheduleItem 接口定义替代 any[]
- Taro.requestSubscribeMessage 使用类型断言替代 as any
- globalThis.__hms 使用 Record<string, unknown>
- TrendChart Canvas/useRef 保留 eslint-disable(微信 API 限制)
- 0 TS 错误,119 测试通过
This commit is contained in:
iven
2026-05-22 08:30:01 +08:00
parent bdc2d07c1c
commit c9fe654d44
14 changed files with 99 additions and 50 deletions

View File

@@ -22,12 +22,12 @@ function App({ children }: PropsWithChildren<Record<string, unknown>>) {
// 暴露全局 bridge 供 MCP/自动化测试调用(仅 dev 模式)
useEffect(() => {
if (process.env.NODE_ENV === 'production') return;
(globalThis as any).__hms = {
(globalThis as Record<string, unknown>).__hms = {
restoreAuth: () => { restoreAuth(); return useAuthStore.getState(); },
restoreUI,
getAuthState: () => useAuthStore.getState(),
};
return () => { delete (globalThis as any).__hms; };
return () => { delete (globalThis as Record<string, unknown>).__hms; };
}, []);
// Analytics 定时器:仅在页面可见时运行,后台时暂停以节省资源