refactor: Move type files to src/types (#126)

This commit is contained in:
CharleeWa 2024-09-12 17:19:46 +08:00
parent 03c604523e
commit b4061d98fa
8 changed files with 11 additions and 14 deletions

View File

@ -69,9 +69,9 @@ members of the project's leadership.
## Attribution ## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html available at <https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>
[homepage]: https://www.contributor-covenant.org [homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq <https://www.contributor-covenant.org/faq>

View File

@ -22,7 +22,7 @@ export function createVitePlugins() {
VueRouter({ VueRouter({
extensions: ['.vue'], extensions: ['.vue'],
routesFolder: 'src/pages', routesFolder: 'src/pages',
dts: 'src/typed-router.d.ts', dts: 'src/types/typed-router.d.ts',
}), }),
vue(), vue(),
@ -38,7 +38,7 @@ export function createVitePlugins() {
extensions: ['vue'], extensions: ['vue'],
resolvers: [VantResolver()], resolvers: [VantResolver()],
include: [/\.vue$/, /\.vue\?vue/], include: [/\.vue$/, /\.vue\?vue/],
dts: 'src/components.d.ts', dts: 'src/types/components.d.ts',
}), }),
// https://github.com/antfu/unplugin-auto-import // https://github.com/antfu/unplugin-auto-import
@ -60,7 +60,7 @@ export function createVitePlugins() {
}, },
unheadVueComposablesImports, unheadVueComposablesImports,
], ],
dts: 'src/auto-imports.d.ts', dts: 'src/types/auto-imports.d.ts',
dirs: [ dirs: [
'src/composables', 'src/composables',
], ],

View File

@ -49,7 +49,7 @@ declare global {
const inject: typeof import('vue')['inject'] const inject: typeof import('vue')['inject']
const injectHead: typeof import('@unhead/vue')['injectHead'] const injectHead: typeof import('@unhead/vue')['injectHead']
const injectLocal: typeof import('@vueuse/core')['injectLocal'] const injectLocal: typeof import('@vueuse/core')['injectLocal']
const isDark: typeof import('./composables/dark')['isDark'] const isDark: typeof import('../composables/dark')['isDark']
const isDefined: typeof import('@vueuse/core')['isDefined'] const isDefined: typeof import('@vueuse/core')['isDefined']
const isProxy: typeof import('vue')['isProxy'] const isProxy: typeof import('vue')['isProxy']
const isReactive: typeof import('vue')['isReactive'] const isReactive: typeof import('vue')['isReactive']
@ -80,7 +80,7 @@ declare global {
const onUnmounted: typeof import('vue')['onUnmounted'] const onUnmounted: typeof import('vue')['onUnmounted']
const onUpdated: typeof import('vue')['onUpdated'] const onUpdated: typeof import('vue')['onUpdated']
const pausableWatch: typeof import('@vueuse/core')['pausableWatch'] const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
const preferredDark: typeof import('./composables/dark')['preferredDark'] const preferredDark: typeof import('../composables/dark')['preferredDark']
const provide: typeof import('vue')['provide'] const provide: typeof import('vue')['provide']
const provideLocal: typeof import('@vueuse/core')['provideLocal'] const provideLocal: typeof import('@vueuse/core')['provideLocal']
const reactify: typeof import('@vueuse/core')['reactify'] const reactify: typeof import('@vueuse/core')['reactify']
@ -114,7 +114,7 @@ declare global {
const toRef: typeof import('vue')['toRef'] const toRef: typeof import('vue')['toRef']
const toRefs: typeof import('vue')['toRefs'] const toRefs: typeof import('vue')['toRefs']
const toValue: typeof import('vue')['toValue'] const toValue: typeof import('vue')['toValue']
const toggleDark: typeof import('./composables/dark')['toggleDark'] const toggleDark: typeof import('../composables/dark')['toggleDark']
const triggerRef: typeof import('vue')['triggerRef'] const triggerRef: typeof import('vue')['triggerRef']
const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount'] const tryOnBeforeMount: typeof import('@vueuse/core')['tryOnBeforeMount']
const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount'] const tryOnBeforeUnmount: typeof import('@vueuse/core')['tryOnBeforeUnmount']

View File

@ -7,11 +7,11 @@ export {}
/* prettier-ignore */ /* prettier-ignore */
declare module 'vue' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
Chart: typeof import('./components/Chart/index.vue')['default'] Chart: typeof import('./../components/Chart/index.vue')['default']
NavBar: typeof import('./components/NavBar.vue')['default'] NavBar: typeof import('./../components/NavBar.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
TabBar: typeof import('./components/TabBar.vue')['default'] TabBar: typeof import('./../components/TabBar.vue')['default']
VanButton: typeof import('vant/es')['Button'] VanButton: typeof import('vant/es')['Button']
VanCell: typeof import('vant/es')['Cell'] VanCell: typeof import('vant/es')['Cell']
VanCellGroup: typeof import('vant/es')['CellGroup'] VanCellGroup: typeof import('vant/es')['CellGroup']

View File

View File

@ -1,3 +0,0 @@
import type { Ref } from 'vue'
export type MaybeRef<T> = T | Ref<T>