global.d.ts 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* Menu */
  2. declare namespace Menu {
  3. interface MenuOptions {
  4. path: string
  5. name: string
  6. hidden: boolean
  7. component?: string | (() => Promise<unknown>)
  8. redirect?: string
  9. meta: MetaProps
  10. children?: MenuOptions[]
  11. }
  12. interface MetaProps {
  13. icon: string
  14. title: string
  15. activeMenu?: string
  16. link?: string
  17. full: boolean
  18. affix: boolean
  19. noCache: boolean
  20. }
  21. }
  22. /* FileType */
  23. declare namespace File {
  24. type FileUploadType = 'img-upload-s3' | 'img-upload' | 'file-upload-s3' | 'file-upload'
  25. type ImageMimeType =
  26. | 'image/apng'
  27. | 'image/bmp'
  28. | 'image/gif'
  29. | 'image/jpeg'
  30. | 'image/pjpeg'
  31. | 'image/png'
  32. | 'image/svg+xml'
  33. | 'image/tiff'
  34. | 'image/webp'
  35. | 'image/x-icon'
  36. type ExcelMimeType = 'application/vnd.ms-excel' | 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
  37. type WordMimeType = 'application/msword' | 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
  38. type PdfMimeType = 'application/pdf'
  39. type PptMimeType = 'application/vnd.ms-powerpoint' | 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
  40. type TxtMimeType = 'text/plain'
  41. type ZipMimeType = 'application/zip' | 'application/x-zip-compressed' | 'application/x-rar-compressed'
  42. type FileMimeType = ExcelMimeType | WordMimeType | PdfMimeType | PptMimeType | TxtMimeType | ZipMimeType
  43. }
  44. /* Vite */
  45. declare type Recordable<T = any> = Record<string, T>
  46. declare interface ViteEnv {
  47. VITE_USER_NODE_ENV: 'development' | 'production' | 'test'
  48. VITE_GLOB_APP_TITLE: string
  49. VITE_PORT: number
  50. VITE_OPEN: boolean
  51. VITE_REPORT: boolean
  52. VITE_ROUTER_MODE: 'hash' | 'history'
  53. VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'gzip,brotli' | 'none'
  54. VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean
  55. VITE_DROP_CONSOLE: boolean
  56. VITE_PWA: boolean
  57. VITE_PUBLIC_PATH: string
  58. VITE_API_URL: string
  59. VITE_PROXY: [string, string][]
  60. }
  61. interface ImportMetaEnv extends ViteEnv {
  62. __: unknown
  63. }
  64. /* __APP_INFO__ */
  65. declare const __APP_INFO__: {
  66. pkg: {
  67. name: string
  68. version: string
  69. dependencies: Recordable<string>
  70. devDependencies: Recordable<string>
  71. }
  72. lastBuildTime: string
  73. }
  74. /**
  75. * 界面字段隐藏属性
  76. */
  77. declare interface FieldOption {
  78. key: number
  79. label: string
  80. visible: boolean
  81. children?: Array<FieldOption>
  82. }