From ba9faa76918b32cb33ce2b96546826cddac71786 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Tue, 5 Aug 2025 09:43:25 -0700 Subject: [PATCH] chore: updates generated files --- assets/auto-imports.d.ts | 6 +++- assets/typed-router.d.ts | 72 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) diff --git a/assets/auto-imports.d.ts b/assets/auto-imports.d.ts index 324e4edc..67741693 100644 --- a/assets/auto-imports.d.ts +++ b/assets/auto-imports.d.ts @@ -53,6 +53,7 @@ declare global { const getActivePinia: typeof import('pinia')['getActivePinia'] const getCurrentInstance: typeof import('vue')['getCurrentInstance'] const getCurrentScope: typeof import('vue')['getCurrentScope'] + const getCurrentWatcher: typeof import('vue')['getCurrentWatcher'] const getDeep: typeof import('./utils/index')['getDeep'] const globalShowPopup: typeof import('./composable/popup')['globalShowPopup'] const h: typeof import('vue')['h'] @@ -68,6 +69,7 @@ declare global { const isReactive: typeof import('vue')['isReactive'] const isReadonly: typeof import('vue')['isReadonly'] const isRef: typeof import('vue')['isRef'] + const isShallow: typeof import('vue')['isShallow'] const lightTheme: typeof import('./stores/settings')['lightTheme'] const loadBetween: typeof import('./composable/eventStreams')['loadBetween'] const locale: typeof import('./stores/settings')['locale'] @@ -376,7 +378,7 @@ declare global { // for type re-export declare global { // @ts-ignore - export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + export type { Component, Slot, Slots, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, ShallowRef, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' import('vue') // @ts-ignore export type { DrawerWidth } from './composable/drawer' @@ -447,6 +449,7 @@ declare module 'vue' { readonly getActivePinia: UnwrapRef readonly getCurrentInstance: UnwrapRef readonly getCurrentScope: UnwrapRef + readonly getCurrentWatcher: UnwrapRef readonly getDeep: UnwrapRef readonly globalShowPopup: UnwrapRef readonly h: UnwrapRef @@ -462,6 +465,7 @@ declare module 'vue' { readonly isReactive: UnwrapRef readonly isReadonly: UnwrapRef readonly isRef: UnwrapRef + readonly isShallow: UnwrapRef readonly lightTheme: UnwrapRef readonly loadBetween: UnwrapRef readonly locale: UnwrapRef diff --git a/assets/typed-router.d.ts b/assets/typed-router.d.ts index bc64747e..ca7b5912 100644 --- a/assets/typed-router.d.ts +++ b/assets/typed-router.d.ts @@ -31,4 +31,76 @@ declare module 'vue-router/auto-routes' { '/show': RouteRecordInfo<'/show', '/show', Record, Record>, '/stack/[name]': RouteRecordInfo<'/stack/[name]', '/stack/:name', { name: ParamValue }, { name: ParamValue }>, } + + /** + * Route file to route info map by unplugin-vue-router. + * Used by the volar plugin to automatically type useRoute() + * + * Each key is a file path relative to the project root with 2 properties: + * - routes: union of route names of the possible routes when in this page (passed to useRoute<...>()) + * - views: names of nested views (can be passed to ) + * + * @internal + */ + export interface _RouteFileInfoMap { + 'assets/pages/index.vue': { + routes: '/' + views: never + } + 'assets/pages/[...all].vue': { + routes: '/[...all]' + views: never + } + 'assets/pages/container/[id].vue': { + routes: '/container/[id]' + views: never + } + 'assets/pages/container/[id].time.[datetime].vue': { + routes: '/container/[id].time.[datetime]' + views: never + } + 'assets/pages/group/[name].vue': { + routes: '/group/[name]' + views: never + } + 'assets/pages/host/[id].vue': { + routes: '/host/[id]' + views: never + } + 'assets/pages/login.vue': { + routes: '/login' + views: never + } + 'assets/pages/merged/[ids].vue': { + routes: '/merged/[ids]' + views: never + } + 'assets/pages/service/[name].vue': { + routes: '/service/[name]' + views: never + } + 'assets/pages/settings.vue': { + routes: '/settings' + views: never + } + 'assets/pages/show.vue': { + routes: '/show' + views: never + } + 'assets/pages/stack/[name].vue': { + routes: '/stack/[name]' + views: never + } + } + + /** + * Get a union of possible route names in a certain route component file. + * Used by the volar plugin to automatically type useRoute() + * + * @internal + */ + export type _RouteNamesForFilePath = + _RouteFileInfoMap extends Record + ? Info['routes'] + : keyof RouteNamedMap }