27 lines
567 B
TypeScript
27 lines
567 B
TypeScript
/// <reference types="vite/client" />
|
|
|
|
// Vite 环境变量类型定义
|
|
interface ImportMetaEnv {
|
|
readonly VITE_API_BASE_URL: string
|
|
readonly VITE_APP_TITLE: string
|
|
readonly VITE_APP_MODE?: string
|
|
}
|
|
|
|
interface ImportMeta {
|
|
readonly env: ImportMetaEnv
|
|
}
|
|
|
|
// 兼容旧的 process.env 写法(如果代码中有使用)
|
|
declare global {
|
|
namespace NodeJS {
|
|
interface ProcessEnv {
|
|
readonly BASE_URL?: string
|
|
readonly VITE_API_BASE_URL?: string
|
|
readonly VITE_APP_TITLE?: string
|
|
readonly VITE_APP_MODE?: string
|
|
}
|
|
}
|
|
}
|
|
|
|
export {}
|