refactor(typescript): 删除全局组件和自导入中的多余声明

移除@vue/runtime-core的冗余模块声明,简化了全局组件的TypeScript定义。同时,优化了组件声明,提高了代码的可读性和维护性。
This commit is contained in:
hello8693 2024-08-04 21:01:51 +08:00
parent e5e1989878
commit 6fd5cd4d62
2 changed files with 1 additions and 60 deletions

View File

@ -139,62 +139,3 @@ declare module 'vue' {
readonly watchSyncEffect: UnwrapRef<(typeof import('vue'))['watchSyncEffect']>; readonly watchSyncEffect: UnwrapRef<(typeof import('vue'))['watchSyncEffect']>;
} }
} }
declare module '@vue/runtime-core' {
interface GlobalComponents {}
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<(typeof import('vue'))['EffectScope']>;
readonly computed: UnwrapRef<(typeof import('vue'))['computed']>;
readonly createApp: UnwrapRef<(typeof import('vue'))['createApp']>;
readonly customRef: UnwrapRef<(typeof import('vue'))['customRef']>;
readonly defineAsyncComponent: UnwrapRef<(typeof import('vue'))['defineAsyncComponent']>;
readonly defineComponent: UnwrapRef<(typeof import('vue'))['defineComponent']>;
readonly effectScope: UnwrapRef<(typeof import('vue'))['effectScope']>;
readonly getCurrentInstance: UnwrapRef<(typeof import('vue'))['getCurrentInstance']>;
readonly getCurrentScope: UnwrapRef<(typeof import('vue'))['getCurrentScope']>;
readonly h: UnwrapRef<(typeof import('vue'))['h']>;
readonly inject: UnwrapRef<(typeof import('vue'))['inject']>;
readonly isProxy: UnwrapRef<(typeof import('vue'))['isProxy']>;
readonly isReactive: UnwrapRef<(typeof import('vue'))['isReactive']>;
readonly isReadonly: UnwrapRef<(typeof import('vue'))['isReadonly']>;
readonly isRef: UnwrapRef<(typeof import('vue'))['isRef']>;
readonly markRaw: UnwrapRef<(typeof import('vue'))['markRaw']>;
readonly nextTick: UnwrapRef<(typeof import('vue'))['nextTick']>;
readonly onActivated: UnwrapRef<(typeof import('vue'))['onActivated']>;
readonly onBeforeMount: UnwrapRef<(typeof import('vue'))['onBeforeMount']>;
readonly onBeforeUnmount: UnwrapRef<(typeof import('vue'))['onBeforeUnmount']>;
readonly onBeforeUpdate: UnwrapRef<(typeof import('vue'))['onBeforeUpdate']>;
readonly onDeactivated: UnwrapRef<(typeof import('vue'))['onDeactivated']>;
readonly onErrorCaptured: UnwrapRef<(typeof import('vue'))['onErrorCaptured']>;
readonly onMounted: UnwrapRef<(typeof import('vue'))['onMounted']>;
readonly onRenderTracked: UnwrapRef<(typeof import('vue'))['onRenderTracked']>;
readonly onRenderTriggered: UnwrapRef<(typeof import('vue'))['onRenderTriggered']>;
readonly onScopeDispose: UnwrapRef<(typeof import('vue'))['onScopeDispose']>;
readonly onServerPrefetch: UnwrapRef<(typeof import('vue'))['onServerPrefetch']>;
readonly onUnmounted: UnwrapRef<(typeof import('vue'))['onUnmounted']>;
readonly onUpdated: UnwrapRef<(typeof import('vue'))['onUpdated']>;
readonly provide: UnwrapRef<(typeof import('vue'))['provide']>;
readonly reactive: UnwrapRef<(typeof import('vue'))['reactive']>;
readonly readonly: UnwrapRef<(typeof import('vue'))['readonly']>;
readonly ref: UnwrapRef<(typeof import('vue'))['ref']>;
readonly resolveComponent: UnwrapRef<(typeof import('vue'))['resolveComponent']>;
readonly shallowReactive: UnwrapRef<(typeof import('vue'))['shallowReactive']>;
readonly shallowReadonly: UnwrapRef<(typeof import('vue'))['shallowReadonly']>;
readonly shallowRef: UnwrapRef<(typeof import('vue'))['shallowRef']>;
readonly toRaw: UnwrapRef<(typeof import('vue'))['toRaw']>;
readonly toRef: UnwrapRef<(typeof import('vue'))['toRef']>;
readonly toRefs: UnwrapRef<(typeof import('vue'))['toRefs']>;
readonly toValue: UnwrapRef<(typeof import('vue'))['toValue']>;
readonly triggerRef: UnwrapRef<(typeof import('vue'))['triggerRef']>;
readonly unref: UnwrapRef<(typeof import('vue'))['unref']>;
readonly useAttrs: UnwrapRef<(typeof import('vue'))['useAttrs']>;
readonly useCssModule: UnwrapRef<(typeof import('vue'))['useCssModule']>;
readonly useCssVars: UnwrapRef<(typeof import('vue'))['useCssVars']>;
readonly useRoute: UnwrapRef<(typeof import('vue-router/auto'))['useRoute']>;
readonly useRouter: UnwrapRef<(typeof import('vue-router/auto'))['useRouter']>;
readonly useSlots: UnwrapRef<(typeof import('vue'))['useSlots']>;
readonly watch: UnwrapRef<(typeof import('vue'))['watch']>;
readonly watchEffect: UnwrapRef<(typeof import('vue'))['watchEffect']>;
readonly watchPostEffect: UnwrapRef<(typeof import('vue'))['watchPostEffect']>;
readonly watchSyncEffect: UnwrapRef<(typeof import('vue'))['watchSyncEffect']>;
}
}

View File

@ -8,7 +8,7 @@ export {};
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
AppFooter: (typeof import('./components/AppFooter.vue'))['default'] AppFooter: (typeof import('./components/AppFooter.vue'))['default']
AppTopBar: (typeof import('./components/AppTopBar.vue'))['default'] AppTopBar: typeof import('./components/AppTopBar.vue')['default']
Clock: typeof import('./components/Clock.vue')['default'] Clock: typeof import('./components/Clock.vue')['default']
DBtn: typeof import('vue-devui/btn/index.es.js')['Btn'] DBtn: typeof import('vue-devui/btn/index.es.js')['Btn']
DButton: typeof import('vue-devui/button/index.es.js')['Button'] DButton: typeof import('vue-devui/button/index.es.js')['Button']