// 声明一个模块,防止引入文件时报错 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; } // 声明 ref declare type RefType = T | null; // 声明 HTMLElement declare type HtmlType = HTMLElement | string | undefined | null; // 申明 children 可选 declare type ChildType = { children?: T[]; }; // 申明 数组 declare type EmptyArrayType = T[]; // 申明 对象 declare type EmptyObjectType = { [key: string]: T; };