Skip to content

Commit

Permalink
feat: 优化全局类型
Browse files Browse the repository at this point in the history
  • Loading branch information
yuntian001 committed Mar 29, 2023
1 parent 04caa07 commit 1f07048
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions types/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {};
import { DefineComponent } from 'vue';
declare global {
//unplugin-auto-import的Element是在页面加载到的时候才生成类型,这里全局声明一下
const ElLoading: typeof import('element-plus/es')['ElLoading'];
Expand All @@ -10,13 +10,11 @@ declare global {
size: (StringConstructor | NumberConstructor)[];
color: StringConstructor;
}>;
/* eslint-disable */
declare const __SSR__: boolean;
declare const __DEV__: boolean;
declare const __COMPAT__: boolean;

// Feature flags
declare const __FEATURE_PROD_DEVTOOLS__: boolean;
declare const __FEATURE_SUSPENSE__: boolean;
/* eslint-disable */
type ComponentProps<Component> = {
-readonly [K in keyof Omit<
InstanceType<Component>['$props'],
keyof InstanceType<DefineComponent>['$props']
>]: InstanceType<Component>['$props'][K];
};
}

0 comments on commit 1f07048

Please sign in to comment.