env.d.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // https://cn.vitejs.dev/guide/env-and-mode
  2. declare module "*.vue" {
  3. import { DefineComponent } from "vue";
  4. // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
  5. const component: DefineComponent<{}, {}, any>;
  6. export default component;
  7. }
  8. // TypeScript 类型提示都为 string: https://github.com/vitejs/vite/issues/6930
  9. interface ImportMetaEnv {
  10. /** 应用端口 */
  11. VITE_APP_PORT: number;
  12. /** API 基础路径(代理前缀) */
  13. VITE_APP_BASE_API: string;
  14. /** API 地址 */
  15. VITE_APP_API_URL: string;
  16. /** 是否开启 Mock 服务 */
  17. VITE_MOCK_DEV_SERVER: boolean;
  18. }
  19. interface ImportMeta {
  20. readonly env: ImportMetaEnv;
  21. }
  22. /**
  23. * 平台的名称、版本、运行所需的`node`版本、依赖、构建时间的类型提示
  24. */
  25. declare const __APP_INFO__: {
  26. pkg: {
  27. name: string;
  28. version: string;
  29. engines: {
  30. node: string;
  31. };
  32. dependencies: Record<string, string>;
  33. devDependencies: Record<string, string>;
  34. };
  35. buildTimestamp: number;
  36. };