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