vite-env.d.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_APP_TITLE?: string;
  44. /**应用版本 */
  45. VITE_APP_VERSION?: string;
  46. /**路由模式 */
  47. VITE_ROUTER_MODE?: 'hash' | 'history';
  48. /**存储命名空间 */
  49. VITE_STORAGE_NAME_SPACE?: string;
  50. /**是否启用请求加密 */
  51. VITE_ENABLE_REQUEST_ENCRYPTION?: string;
  52. /**请求加密密钥 */
  53. VITE_REQUEST_ENCRYPTION_KEY?: string;
  54. /**存储加密总开关,如果设置为 false,则会忽略 StorageOptions 中的加密配置,不对存储进行加密 */
  55. VITE_ENABLE_STORAGE_ENCRYPTION?: string;
  56. /**存储加密密钥 */
  57. VITE_STORAGE_ENCRYPTION_KEY?: string;
  58. /**API基础URL */
  59. VITE_API_BASE_URL?: string;
  60. }
  61. interface ImportMeta {
  62. readonly env: ImportMetaEnv;
  63. }