chore: ts配置优化

This commit is contained in:
digua
2026-02-11 21:08:37 +08:00
committed by digua
parent 6ea9e863b3
commit 6c58049506
3 changed files with 12 additions and 1 deletions
+3
View File
@@ -1,4 +1,7 @@
/// <reference types="vite/client" />
/// <reference path="../electron/preload/index.d.ts" />
// 显式引入 preload 的全局类型声明,确保 TS 插件能识别 window.chatApi 等注入 API。
declare module '*.vue' {
import type { DefineComponent } from 'vue'
+7
View File
@@ -1,4 +1,11 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@electron/*": ["electron/*"]
}
},
"files": [],
"references": [{ "path": "./tsconfig.node.json" }, { "path": "./tsconfig.web.json" }]
}
+2 -1
View File
@@ -20,7 +20,8 @@
"allowJs": true,
"forceConsistentCasingInFileNames": true,
"paths": {
"@/*": ["src/*"]
"@/*": ["src/*"],
"@electron/*": ["electron/*"]
}
}
}