vite-env.d.ts 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /// <reference types="vite/client" />
  2. /**
  3. * 将 @/assets/iconify/single-color 目录下的所有 SVG 文件识别为 IconifyIcon
  4. */
  5. declare module '@/assets/iconify/single-color/*.svg' {
  6. const content: import('@iconify/react').IconifyIcon;
  7. export default content;
  8. }
  9. /**
  10. * 将 @/assets/iconify/multi-color 目录下的所有 SVG 文件识别为 IconifyIcon
  11. */
  12. declare module '@/assets/iconify/multi-color/*.svg' {
  13. const content: import('@iconify/react').IconifyIcon;
  14. export default content;
  15. }
  16. type Recordable<T = any> = Record<string, T>;
  17. /**
  18. * 打包压缩格式的类型声明
  19. */
  20. type BuildCompression =
  21. | 'none'
  22. | 'gzip'
  23. | 'brotli'
  24. | 'both'
  25. | 'gzip-clear'
  26. | 'brotli-clear'
  27. | 'both-clear';
  28. interface ImportMetaEnv {
  29. // 覆盖原本的字段定义
  30. BASE_URL?: string;
  31. MODE?: string;
  32. DEV?: boolean;
  33. PROD?: boolean;
  34. SSR?: boolean;
  35. [key: string]: any;
  36. /**端口号 */
  37. VITE_DEV_PORT?: number;
  38. /**发布路径 */
  39. VITE_BUILD_PUBLIC_PATH?: string;
  40. /**压缩选项 */
  41. VITE_BUILD_COMPRESSION?: BuildCompression;
  42. /**应用代码 */
  43. VITE_API_PRODUCT_CODE?: string;
  44. /**应用标题 */
  45. VITE_APP_TITLE?: string;
  46. /**应用版本 */
  47. VITE_APP_VERSION?: string;
  48. /**路由模式 */
  49. VITE_ROUTER_MODE?: 'hash' | 'history';
  50. /**存储命名空间 */
  51. VITE_STORAGE_NAME_SPACE?: string;
  52. /**是否启用请求加密 */
  53. VITE_ENABLE_REQUEST_ENCRYPTION?: string;
  54. /**请求加密密钥 */
  55. VITE_REQUEST_ENCRYPTION_KEY?: string;
  56. /**存储加密总开关,如果设置为 false,则会忽略 StorageOptions 中的加密配置,不对存储进行加密 */
  57. VITE_ENABLE_STORAGE_ENCRYPTION?: string;
  58. /**存储加密密钥 */
  59. VITE_STORAGE_ENCRYPTION_KEY?: string;
  60. /**请求数据压缩方法 */
  61. VITE_REQUEST_DATA_COMPRESSION?: 'nozip' | 'br' | 'gzip'; // 不压缩、br压缩、gzip压缩
  62. /**API基础URL */
  63. VITE_API_BASE_URL?: string;
  64. /**Google Play 商店地址,未配置时为空 */
  65. VITE_APP_GOOGLE_STORE_URL?: string;
  66. /**Apple App Store 地址,未配置时为空 */
  67. VITE_APP_APPLE_STORE_URL?: string;
  68. /**APK 直链地址,未配置时为空 */
  69. VITE_APP_APK_URL?: string;
  70. /**macOS 客户端下载地址,未配置时为空 */
  71. VITE_APP_MACOS_URL?: string;
  72. /**Windows 客户端下载地址,未配置时为空 */
  73. VITE_APP_WINDOWS_URL?: string;
  74. /**deeplink 地址,未配置时为空 */
  75. VITE_APP_DEEPLINK_URL?: string;
  76. }
  77. interface ImportMeta {
  78. readonly env: ImportMetaEnv;
  79. }