global.d.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. // 申明外部 npm 插件模块
  2. declare module 'vue-grid-layout';
  3. declare module 'vue-signature-pad';
  4. declare module 'vform3-builds';
  5. declare module 'qrcodejs2-fixes';
  6. declare module 'splitpanes';
  7. declare module 'js-cookie';
  8. //declare module '@wangeditor/editor-for-vue';
  9. //declare module 'js-table2excel';
  10. //declare module 'qs';
  11. //declare module 'sortablejs';
  12. declare module 'vue-plugin-hiprint';
  13. declare module 'vcrontab-3';
  14. // 声明一个模块,防止引入文件时报错
  15. declare module '*.json';
  16. declare module '*.png';
  17. declare module '*.jpg';
  18. declare module '*.scss';
  19. declare module '*.ts';
  20. declare module '*.js';
  21. // 声明文件,*.vue 后缀的文件交给 vue 模块来处理
  22. declare module '*.vue' {
  23. import type { DefineComponent } from 'vue';
  24. const component: DefineComponent<{}, {}, any>;
  25. export default component;
  26. }
  27. // 声明文件,定义全局变量
  28. /* eslint-disable */
  29. declare interface Window {
  30. nextLoading: boolean;
  31. BMAP_SATELLITE_MAP: any;
  32. BMap: any;
  33. __env__: any;
  34. }
  35. // 声明路由当前项类型
  36. declare type RouteItem<T = any> = {
  37. path: string;
  38. name?: string | symbol | undefined | null;
  39. redirect?: string;
  40. k?: T;
  41. meta?: {
  42. title?: string;
  43. isLink?: string;
  44. isHide?: boolean;
  45. isKeepAlive?: boolean;
  46. isAffix?: boolean;
  47. isIframe?: boolean;
  48. roles?: string[];
  49. icon?: string;
  50. isDynamic?: boolean;
  51. isDynamicPath?: string;
  52. isIframeOpen?: string;
  53. loading?: boolean;
  54. };
  55. children: T[];
  56. query?: { [key: string]: T };
  57. params?: { [key: string]: T };
  58. contextMenuClickId?: string | number;
  59. commonUrl?: string;
  60. isFnClick?: boolean;
  61. url?: string;
  62. transUrl?: string;
  63. title?: string;
  64. id?: string | number;
  65. };
  66. // 声明路由 to from
  67. declare interface RouteToFrom<T = any> extends RouteItem {
  68. path?: string;
  69. children?: T[];
  70. }
  71. // 声明路由当前项类型集合
  72. declare type RouteItems<T extends RouteItem = any> = T[];
  73. // 声明 ref
  74. declare type RefType<T = any> = T | null;
  75. // 声明 HTMLElement
  76. declare type HtmlType = HTMLElement | string | undefined | null;
  77. // 申明 children 可选
  78. declare type ChilType<T = any> = {
  79. children?: T[];
  80. };
  81. // 申明 数组
  82. declare type EmptyArrayType<T = any> = T[];
  83. // 申明 对象
  84. declare type EmptyObjectType<T = any> = {
  85. [key: string]: T;
  86. };
  87. // 申明 select option
  88. declare type SelectOptionType = {
  89. value: string | number;
  90. label: string | number;
  91. };
  92. // 鼠标滚轮滚动类型
  93. declare interface WheelEventType extends WheelEvent {
  94. wheelDelta: number;
  95. }
  96. // table 数据格式公共类型
  97. declare interface TableType<T = any> {
  98. total: number;
  99. loading: boolean;
  100. param: {
  101. pageNum: number;
  102. pageSize: number;
  103. [key: string]: T;
  104. };
  105. }
  106. // 字典数据结构
  107. declare interface DictItem {
  108. typeCode: string;
  109. label: string;
  110. value: string;
  111. name: string;
  112. status: string;
  113. orderNo: number;
  114. remark?: string;
  115. tagType?: string;
  116. extData?: string;
  117. styleSetting?: string;
  118. classSetting?: string;
  119. [key: string]: any;
  120. }