From 74d37486b883b7b8bd132996743aa9054b87359c Mon Sep 17 00:00:00 2001 From: Wangnov Date: Mon, 8 Sep 2025 15:42:40 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0Vue=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=92=8Ccomposables=E8=87=AA=E5=8A=A8=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加unplugin-vue-components自动生成的组件类型定义 - 添加unplugin-auto-import自动生成的composables类型定义 - 为TypeScript提供更好的类型支持和IDE智能提示 --- web/admin-spa/auto-imports.d.ts | 87 +++++++++++++++++++++++++++++++++ web/admin-spa/components.d.ts | 51 +++++++++++++++++++ 2 files changed, 138 insertions(+) create mode 100644 web/admin-spa/auto-imports.d.ts create mode 100644 web/admin-spa/components.d.ts diff --git a/web/admin-spa/auto-imports.d.ts b/web/admin-spa/auto-imports.d.ts new file mode 100644 index 00000000..a606bd4d --- /dev/null +++ b/web/admin-spa/auto-imports.d.ts @@ -0,0 +1,87 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// noinspection JSUnusedGlobalSymbols +// Generated by unplugin-auto-import +export {} +declare global { + const EffectScope: typeof import('vue')['EffectScope'] + const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] + const computed: typeof import('vue')['computed'] + const createApp: typeof import('vue')['createApp'] + const createPinia: typeof import('pinia')['createPinia'] + const customRef: typeof import('vue')['customRef'] + const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] + const defineComponent: typeof import('vue')['defineComponent'] + const defineStore: typeof import('pinia')['defineStore'] + const effectScope: typeof import('vue')['effectScope'] + const getActivePinia: typeof import('pinia')['getActivePinia'] + const getCurrentInstance: typeof import('vue')['getCurrentInstance'] + const getCurrentScope: typeof import('vue')['getCurrentScope'] + const h: typeof import('vue')['h'] + const inject: typeof import('vue')['inject'] + const isProxy: typeof import('vue')['isProxy'] + const isReactive: typeof import('vue')['isReactive'] + const isReadonly: typeof import('vue')['isReadonly'] + const isRef: typeof import('vue')['isRef'] + const mapActions: typeof import('pinia')['mapActions'] + const mapGetters: typeof import('pinia')['mapGetters'] + const mapState: typeof import('pinia')['mapState'] + const mapStores: typeof import('pinia')['mapStores'] + const mapWritableState: typeof import('pinia')['mapWritableState'] + const markRaw: typeof import('vue')['markRaw'] + const nextTick: typeof import('vue')['nextTick'] + const onActivated: typeof import('vue')['onActivated'] + const onBeforeMount: typeof import('vue')['onBeforeMount'] + const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] + const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] + const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] + const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] + const onDeactivated: typeof import('vue')['onDeactivated'] + const onErrorCaptured: typeof import('vue')['onErrorCaptured'] + const onMounted: typeof import('vue')['onMounted'] + const onRenderTracked: typeof import('vue')['onRenderTracked'] + const onRenderTriggered: typeof import('vue')['onRenderTriggered'] + const onScopeDispose: typeof import('vue')['onScopeDispose'] + const onServerPrefetch: typeof import('vue')['onServerPrefetch'] + const onUnmounted: typeof import('vue')['onUnmounted'] + const onUpdated: typeof import('vue')['onUpdated'] + const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] + const provide: typeof import('vue')['provide'] + const reactive: typeof import('vue')['reactive'] + const readonly: typeof import('vue')['readonly'] + const ref: typeof import('vue')['ref'] + const resolveComponent: typeof import('vue')['resolveComponent'] + const setActivePinia: typeof import('pinia')['setActivePinia'] + const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'] + const shallowReactive: typeof import('vue')['shallowReactive'] + const shallowReadonly: typeof import('vue')['shallowReadonly'] + const shallowRef: typeof import('vue')['shallowRef'] + const storeToRefs: typeof import('pinia')['storeToRefs'] + const toRaw: typeof import('vue')['toRaw'] + const toRef: typeof import('vue')['toRef'] + const toRefs: typeof import('vue')['toRefs'] + const toValue: typeof import('vue')['toValue'] + const triggerRef: typeof import('vue')['triggerRef'] + const unref: typeof import('vue')['unref'] + const useAttrs: typeof import('vue')['useAttrs'] + const useCssModule: typeof import('vue')['useCssModule'] + const useCssVars: typeof import('vue')['useCssVars'] + const useId: typeof import('vue')['useId'] + const useLink: typeof import('vue-router')['useLink'] + const useModel: typeof import('vue')['useModel'] + const useRoute: typeof import('vue-router')['useRoute'] + const useRouter: typeof import('vue-router')['useRouter'] + const useSlots: typeof import('vue')['useSlots'] + const useTemplateRef: typeof import('vue')['useTemplateRef'] + const watch: typeof import('vue')['watch'] + const watchEffect: typeof import('vue')['watchEffect'] + const watchPostEffect: typeof import('vue')['watchPostEffect'] + const watchSyncEffect: typeof import('vue')['watchSyncEffect'] +} +// for type re-export +declare global { + // @ts-ignore + export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + import('vue') +} diff --git a/web/admin-spa/components.d.ts b/web/admin-spa/components.d.ts new file mode 100644 index 00000000..b698e38b --- /dev/null +++ b/web/admin-spa/components.d.ts @@ -0,0 +1,51 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-vue-components +// Read more: https://github.com/vuejs/core/pull/3399 +export {} + +declare module 'vue' { + export interface GlobalComponents { + AccountForm: typeof import('./src/components/accounts/AccountForm.vue')['default'] + AccountSelector: typeof import('./src/components/common/AccountSelector.vue')['default'] + AggregatedStatsCard: typeof import('./src/components/apistats/AggregatedStatsCard.vue')['default'] + ApiKeyInput: typeof import('./src/components/apistats/ApiKeyInput.vue')['default'] + AppHeader: typeof import('./src/components/layout/AppHeader.vue')['default'] + BatchApiKeyModal: typeof import('./src/components/apikeys/BatchApiKeyModal.vue')['default'] + BatchEditApiKeyModal: typeof import('./src/components/apikeys/BatchEditApiKeyModal.vue')['default'] + ChangeRoleModal: typeof import('./src/components/admin/ChangeRoleModal.vue')['default'] + ConfirmDialog: typeof import('./src/components/common/ConfirmDialog.vue')['default'] + ConfirmModal: typeof import('./src/components/common/ConfirmModal.vue')['default'] + CreateApiKeyModal: typeof import('./src/components/apikeys/CreateApiKeyModal.vue')['default'] + CustomDropdown: typeof import('./src/components/common/CustomDropdown.vue')['default'] + EditApiKeyModal: typeof import('./src/components/apikeys/EditApiKeyModal.vue')['default'] + ExpiryEditModal: typeof import('./src/components/apikeys/ExpiryEditModal.vue')['default'] + GroupManagementModal: typeof import('./src/components/accounts/GroupManagementModal.vue')['default'] + LanguageSwitch: typeof import('./src/components/common/LanguageSwitch.vue')['default'] + LimitConfig: typeof import('./src/components/apistats/LimitConfig.vue')['default'] + LogoTitle: typeof import('./src/components/common/LogoTitle.vue')['default'] + MainLayout: typeof import('./src/components/layout/MainLayout.vue')['default'] + ModelDistribution: typeof import('./src/components/dashboard/ModelDistribution.vue')['default'] + ModelUsageStats: typeof import('./src/components/apistats/ModelUsageStats.vue')['default'] + NewApiKeyModal: typeof import('./src/components/apikeys/NewApiKeyModal.vue')['default'] + OAuthFlow: typeof import('./src/components/accounts/OAuthFlow.vue')['default'] + ProxyConfig: typeof import('./src/components/accounts/ProxyConfig.vue')['default'] + RenewApiKeyModal: typeof import('./src/components/apikeys/RenewApiKeyModal.vue')['default'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + StatCard: typeof import('./src/components/common/StatCard.vue')['default'] + StatsOverview: typeof import('./src/components/apistats/StatsOverview.vue')['default'] + TabBar: typeof import('./src/components/layout/TabBar.vue')['default'] + ThemeToggle: typeof import('./src/components/common/ThemeToggle.vue')['default'] + ToastNotification: typeof import('./src/components/common/ToastNotification.vue')['default'] + TokenDistribution: typeof import('./src/components/apistats/TokenDistribution.vue')['default'] + UsageDetailModal: typeof import('./src/components/apikeys/UsageDetailModal.vue')['default'] + UsageTrend: typeof import('./src/components/dashboard/UsageTrend.vue')['default'] + UserApiKeysManager: typeof import('./src/components/user/UserApiKeysManager.vue')['default'] + UserUsageStats: typeof import('./src/components/user/UserUsageStats.vue')['default'] + UserUsageStatsModal: typeof import('./src/components/admin/UserUsageStatsModal.vue')['default'] + ViewApiKeyModal: typeof import('./src/components/user/ViewApiKeyModal.vue')['default'] + WindowCountdown: typeof import('./src/components/apikeys/WindowCountdown.vue')['default'] + } +}