global.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * @Description: 全局声明文件
  3. * @Author: James324
  4. * @Date: 2023-08-18 11:36:00
  5. * @LastEditors: James324
  6. * @LastEditTime: 2024-01-17 14:23:20
  7. */
  8. import { AxiosInstance } from 'axios';
  9. import BaseSearch from '@/components/base-ui/base-search/index.vue';
  10. import BaseTable from '@/components/base-ui/base-table/index.vue';
  11. import BaseEdit from '@/components/base-ui/base-edit/index.vue';
  12. declare module 'pinia-plugin-persistedstate';
  13. declare module '*.vue' {
  14. import type { DefineComponent } from 'vue';
  15. const component: DefineComponent<{}, {}, any>;
  16. export default component;
  17. }
  18. declare module '*.md' {
  19. import { ComponentOptions } from 'vue';
  20. const Component: ComponentOptions;
  21. export default Component;
  22. }
  23. declare module '@vue/runtime-core' {
  24. // eslint-disable-next-line no-unused-vars
  25. export interface ComponentCustomProperties {
  26. $axios: AxiosInstance;
  27. }
  28. }
  29. declare module 'vue-router' {
  30. import type { RouteRecordRaw } from 'vue-router';
  31. export type Route = Partial<RouteRecordRaw> & {
  32. [key: string]: any;
  33. fullPath?: string;
  34. level?: string | number;
  35. parent?: string;
  36. };
  37. }
  38. declare module 'mitt' {
  39. import type { Emitter, EventType } from 'mitt';
  40. export type EmitBus = Emitter<Record<EventType, unknown>>;
  41. }
  42. declare global {
  43. type SearchRef = InstanceType<typeof BaseSearch>;
  44. type TableRef = InstanceType<typeof BaseTable>;
  45. type EditRef = InstanceType<typeof BaseEdit>;
  46. interface RouteTagRecord
  47. extends Omit<_RouteLocationBase, 'hash' | 'redirectedFrom' | 'matched'> {
  48. title: string;
  49. }
  50. interface PageCommonParams {
  51. current?: number;
  52. size?: number;
  53. }
  54. interface ResponseListCommon<T = any> {
  55. size?: number;
  56. total?: number;
  57. pages?: number;
  58. records?: T[];
  59. current?: number;
  60. }
  61. interface SlotData<T = any> {
  62. row: T;
  63. }
  64. }
  65. declare module 'vue-i18n';