From 4e4668205e85139d1a9e0110f8607af05dad0391 Mon Sep 17 00:00:00 2001 From: Rewrite0 Date: Thu, 1 Jun 2023 09:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9dts=E5=AD=98=E6=94=BE?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.json | 3 ++- {src => types/dts}/auto-imports.d.ts | 32 ++++++++++++++-------------- {src => types/dts}/components.d.ts | 0 {src => types/dts}/router-type.d.ts | 0 {src => types/dts}/vite-env.d.ts | 0 vite.config.ts | 6 +++--- 6 files changed, 21 insertions(+), 20 deletions(-) rename {src => types/dts}/auto-imports.d.ts (94%) rename {src => types/dts}/components.d.ts (100%) rename {src => types/dts}/router-type.d.ts (100%) rename {src => types/dts}/vite-env.d.ts (100%) diff --git a/tsconfig.json b/tsconfig.json index 00268abd..85ecd0bc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,7 +24,8 @@ "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", - "types/**/*.ts" + "types/*.ts", + "types/dts/*.d.ts" ], "references": [{ "path": "./tsconfig.node.json" }] } diff --git a/src/auto-imports.d.ts b/types/dts/auto-imports.d.ts similarity index 94% rename from src/auto-imports.d.ts rename to types/dts/auto-imports.d.ts index 550850fd..5d3f7d1d 100644 --- a/src/auto-imports.d.ts +++ b/types/dts/auto-imports.d.ts @@ -5,17 +5,17 @@ declare global { const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] const afterAll: typeof import('vitest')['afterAll'] const afterEach: typeof import('vitest')['afterEach'] - const apiAuth: typeof import('./api/auth')['apiAuth'] - const apiBangumi: typeof import('./api/bangumi')['apiBangumi'] - const apiCheck: typeof import('./api/check')['apiCheck'] - const apiConfig: typeof import('./api/config')['apiConfig'] - const apiDownload: typeof import('./api/download')['apiDownload'] - const apiLog: typeof import('./api/log')['apiLog'] - const apiProgram: typeof import('./api/program')['apiProgram'] + const apiAuth: typeof import('../../src/api/auth')['apiAuth'] + const apiBangumi: typeof import('../../src/api/bangumi')['apiBangumi'] + const apiCheck: typeof import('../../src/api/check')['apiCheck'] + const apiConfig: typeof import('../../src/api/config')['apiConfig'] + const apiDownload: typeof import('../../src/api/download')['apiDownload'] + const apiLog: typeof import('../../src/api/log')['apiLog'] + const apiProgram: typeof import('../../src/api/program')['apiProgram'] const assert: typeof import('vitest')['assert'] const asyncComputed: typeof import('@vueuse/core')['asyncComputed'] const autoResetRef: typeof import('@vueuse/core')['autoResetRef'] - const axios: typeof import('./utils/axios')['axios'] + const axios: typeof import('../../src/utils/axios')['axios'] const beforeAll: typeof import('vitest')['beforeAll'] const beforeEach: typeof import('vitest')['beforeEach'] const chai: typeof import('vitest')['chai'] @@ -134,12 +134,12 @@ declare global { const unrefElement: typeof import('@vueuse/core')['unrefElement'] const until: typeof import('@vueuse/core')['until'] const useActiveElement: typeof import('@vueuse/core')['useActiveElement'] - const useApi: typeof import('./hooks/useApi')['useApi'] + const useApi: typeof import('../../src/hooks/useApi')['useApi'] const useAsyncQueue: typeof import('@vueuse/core')['useAsyncQueue'] const useAsyncState: typeof import('@vueuse/core')['useAsyncState'] const useAttrs: typeof import('vue')['useAttrs'] - const useAuth: typeof import('./hooks/useAuth')['useAuth'] - const useBangumiStore: typeof import('./store/bangumi')['useBangumiStore'] + const useAuth: typeof import('../../src/hooks/useAuth')['useAuth'] + const useBangumiStore: typeof import('../../src/store/bangumi')['useBangumiStore'] const useBase64: typeof import('@vueuse/core')['useBase64'] const useBattery: typeof import('@vueuse/core')['useBattery'] const useBluetooth: typeof import('@vueuse/core')['useBluetooth'] @@ -150,7 +150,7 @@ declare global { const useClamp: typeof import('@vueuse/core')['useClamp'] const useClipboard: typeof import('@vueuse/core')['useClipboard'] const useColorMode: typeof import('@vueuse/core')['useColorMode'] - const useConfigStore: typeof import('./store/config')['useConfigStore'] + const useConfigStore: typeof import('../../src/store/config')['useConfigStore'] const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog'] const useCounter: typeof import('@vueuse/core')['useCounter'] const useCssModule: typeof import('vue')['useCssModule'] @@ -199,14 +199,14 @@ declare global { const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier'] const useLastChanged: typeof import('@vueuse/core')['useLastChanged'] const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage'] - const useLogStore: typeof import('./store/log')['useLogStore'] + const useLogStore: typeof import('../../src/store/log')['useLogStore'] const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys'] const useManualRefHistory: typeof import('@vueuse/core')['useManualRefHistory'] const useMediaControls: typeof import('@vueuse/core')['useMediaControls'] const useMediaQuery: typeof import('@vueuse/core')['useMediaQuery'] const useMemoize: typeof import('@vueuse/core')['useMemoize'] const useMemory: typeof import('@vueuse/core')['useMemory'] - const useMessage: typeof import('./hooks/useMessage')['useMessage'] + const useMessage: typeof import('../../src/hooks/useMessage')['useMessage'] const useMounted: typeof import('@vueuse/core')['useMounted'] const useMouse: typeof import('@vueuse/core')['useMouse'] const useMouseInElement: typeof import('@vueuse/core')['useMouseInElement'] @@ -221,13 +221,13 @@ declare global { const usePageLeave: typeof import('@vueuse/core')['usePageLeave'] const useParallax: typeof import('@vueuse/core')['useParallax'] const usePermission: typeof import('@vueuse/core')['usePermission'] - const usePlayerStore: typeof import('./store/player')['usePlayerStore'] + const usePlayerStore: typeof import('../../src/store/player')['usePlayerStore'] const usePointer: typeof import('@vueuse/core')['usePointer'] const usePointerSwipe: typeof import('@vueuse/core')['usePointerSwipe'] const usePreferredColorScheme: typeof import('@vueuse/core')['usePreferredColorScheme'] const usePreferredDark: typeof import('@vueuse/core')['usePreferredDark'] const usePreferredLanguages: typeof import('@vueuse/core')['usePreferredLanguages'] - const useProgramStore: typeof import('./store/program')['useProgramStore'] + const useProgramStore: typeof import('../../src/store/program')['useProgramStore'] const useRafFn: typeof import('@vueuse/core')['useRafFn'] const useRefHistory: typeof import('@vueuse/core')['useRefHistory'] const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver'] diff --git a/src/components.d.ts b/types/dts/components.d.ts similarity index 100% rename from src/components.d.ts rename to types/dts/components.d.ts diff --git a/src/router-type.d.ts b/types/dts/router-type.d.ts similarity index 100% rename from src/router-type.d.ts rename to types/dts/router-type.d.ts diff --git a/src/vite-env.d.ts b/types/dts/vite-env.d.ts similarity index 100% rename from src/vite-env.d.ts rename to types/dts/vite-env.d.ts diff --git a/vite.config.ts b/vite.config.ts index 186cb2cf..267af685 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ base: './', plugins: [ VueRouter({ - dts: 'src/router-type.d.ts', + dts: 'types/dts/router-type.d.ts', }), vue({ script: { @@ -22,11 +22,11 @@ export default defineConfig({ UnoCSS(), AutoImport({ imports: ['vue', 'vitest', 'pinia', '@vueuse/core', VueRouterAutoImports], - dts: 'src/auto-imports.d.ts', + dts: 'types/dts/auto-imports.d.ts', dirs: ['src/api', 'src/store', 'src/hooks', 'src/utils'], }), Components({ - dts: 'src/components.d.ts', + dts: 'types/dts/components.d.ts', dirs: [ 'src/components', 'src/components/basic',