// 申明外部 npm 插件模块 declare module 'vue-grid-layout'; declare module 'qrcodejs2-fixes'; declare module 'splitpanes'; declare module 'js-cookie'; declare module '@wangeditor/editor-for-vue'; declare module 'js-table2excel'; declare module 'qs'; //全局生命 json预览模块 declare module 'vue3-json-viewer' //全局生命 图片预览模块 declare module 'vue3-preview-image' // 声明一个模块,防止引入文件时报错 declare module '*.json'; declare module '*.png'; declare module '*.jpg'; declare module '*.scss'; declare module '*.ts'; declare module '*.js'; // 声明文件,*.vue 后缀的文件交给 vue 模块来处理 declare module '*.vue' { import type { DefineComponent } from 'vue'; const component: DefineComponent<{}, {}, any>; export default component; } // 声明文件,定义全局变量 /* eslint-disable */ declare interface Window { nextLoading: boolean; } // 声明路由当前项类型 declare type RouteItem = { path: string; name?: string | symbol | undefined | null; redirect?: string; k?: T; meta?: { title?: string; isLink?: string; isHide?: boolean; isKeepAlive?: boolean; isAffix?: boolean; isIframe?: boolean; roles?: string[]; icon?: string; isDynamic?: boolean; isDynamicPath?: string; isIframeOpen?: string; loading?: boolean; }; children: T[]; query?: { [key: string]: T }; params?: { [key: string]: T }; contextMenuClickId?: string | number; commonUrl?: string; isFnClick?: boolean; url?: string; transUrl?: string; title?: string; id?: string | number; }; // 声明路由 to from declare interface RouteToFrom extends RouteItem {//interface与type区别,interface接口可以用extends继承,type只能用&用法;参考:https://blog.csdn.net/weixin_43550562/article/details/123546720 path?: string; children?: T[]; } // 声明路由当前项类型集合--tsconfig.json配置文件include包含目录‘src/**/*.d.ts’ declare type RouteItems = T[]; // 声明 ref declare type RefType = T | null; // 声明 HTMLElement declare type HtmlType = HTMLElement | string | undefined | null; // 申明 children 可选 declare type ChilType = { children?: T[]; }; // 申明 数组 declare type EmptyArrayType = T[]; // 申明 对象 declare type EmptyObjectType = { [key: string]: T; }; // 申明 select option declare type SelectOptionType = { value: string | number; label: string | number; }; // 鼠标滚轮滚动类型,接口interface继承WheelEvent原生鼠标滚动事件 declare interface WheelEventType extends WheelEvent { wheelDelta: number; } // table 数据格式公共类型 declare interface TableType { total: number; loading: boolean; param: { pageIndex: number; pageSize: number; [key: string]: T; }; }