global.d.ts 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* Menu */
  2. declare namespace Menu {
  3. interface MenuOptions {
  4. path: string;
  5. name: string;
  6. component?: string | (() => Promise<unknown>);
  7. redirect?: string;
  8. meta: MetaProps;
  9. children?: MenuOptions[];
  10. }
  11. interface MetaProps {
  12. icon: string;
  13. title: string;
  14. activeMenu?: string;
  15. isLink?: string;
  16. isHide: boolean;
  17. isFull: boolean;
  18. isAffix: boolean;
  19. isKeepAlive: boolean;
  20. /** 仅一个可见子菜单时不在侧栏渲染父级分组,直接展示子项 */
  21. flattenSingleChild?: boolean;
  22. }
  23. }
  24. /* FileType */
  25. declare namespace File {
  26. type ImageMimeType =
  27. | "image/apng"
  28. | "image/bmp"
  29. | "image/gif"
  30. | "image/jpeg"
  31. | "image/pjpeg"
  32. | "image/png"
  33. | "image/svg+xml"
  34. | "image/tiff"
  35. | "image/webp"
  36. | "image/x-icon";
  37. type ExcelMimeType = "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
  38. }
  39. /* Vite */
  40. declare type Recordable<T = any> = Record<string, T>;
  41. declare interface ViteEnv {
  42. VITE_USER_NODE_ENV: "development" | "production" | "test";
  43. VITE_GLOB_APP_TITLE: string;
  44. VITE_PORT: number;
  45. VITE_OPEN: boolean;
  46. VITE_REPORT: boolean;
  47. VITE_ROUTER_MODE: "hash" | "history";
  48. VITE_BUILD_COMPRESS: "gzip" | "brotli" | "gzip,brotli" | "none";
  49. VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean;
  50. VITE_DROP_CONSOLE: boolean;
  51. VITE_PWA: boolean;
  52. VITE_DEVTOOLS: boolean;
  53. VITE_PUBLIC_PATH: string;
  54. VITE_API_URL: string;
  55. VITE_API_URL_PLATFORM: string;
  56. VITE_PROXY: [string, string][];
  57. VITE_PROXY_AI: [string, string][];
  58. VITE_CODEINSPECTOR: boolean;
  59. VITE_API_ENCRYPTION_ENABLED: string;
  60. VITE_CRYPTO_KEY: string;
  61. VITE_CRYPTO_IV: string;
  62. VITE_WS_BASE?: string;
  63. /** 上传 API 请求根(可选;不配则默认同源 /ai-upload,依赖 Vite/Nginx 反代) */
  64. VITE_AI_UPLOAD_BASE?: string;
  65. /** 上传完成后对外访问 URL 前缀 */
  66. VITE_AI_FILES_PUBLIC_BASE?: string;
  67. }
  68. interface ImportMetaEnv extends ViteEnv {
  69. __: unknown;
  70. }
  71. /* __APP_INFO__ */
  72. declare const __APP_INFO__: {
  73. pkg: {
  74. name: string;
  75. version: string;
  76. dependencies: Recordable<string>;
  77. devDependencies: Recordable<string>;
  78. };
  79. lastBuildTime: string;
  80. };