From 4b466018791c707e787c2c1bd03df3db43f35d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7?= <308487730@qq.com> Date: Wed, 14 Sep 2022 08:22:17 +0800 Subject: [PATCH] update types --- electron/electron-env.d.ts | 24 ++++++++++++++++++++++++ tsconfig.node.json | 5 +---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 electron/electron-env.d.ts diff --git a/electron/electron-env.d.ts b/electron/electron-env.d.ts new file mode 100644 index 0000000..b0ec4b6 --- /dev/null +++ b/electron/electron-env.d.ts @@ -0,0 +1,24 @@ +/// + +declare namespace NodeJS { + interface ProcessEnv { + /** + * The built directory structure + * + * ```tree + * ├─┬ dist + * │ ├─┬ electron + * │ │ ├─┬ main + * │ │ │ └── index.js + * │ │ └─┬ preload + * │ │ └── index.js + * │ ├── index.html + * │ ├── ...other-static-files-from-public + * │ + * ``` + */ + DIST: string + /** /dist/ or /public/ */ + PUBLIC: string + } +} diff --git a/tsconfig.node.json b/tsconfig.node.json index 767a0b1..9e6f062 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -6,10 +6,7 @@ "moduleResolution": "Node", "jsx": "preserve", "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "types": [ - "vite-plugin-electron/electron-env" - ] + "allowSyntheticDefaultImports": true }, "include": ["package.json", "electron"] }