From 8971d0ddf2e43e5f77f112392d561e2a60a5aa77 Mon Sep 17 00:00:00 2001 From: BarnacleBoy Date: Mon, 18 May 2026 12:43:58 +0000 Subject: [PATCH] fix: useMeta callable type + remove invalid function body from route-meta.d.ts --- apps/vdn-static/src/composables/useMeta.ts | 2 +- apps/vdn-static/src/types/route-meta.d.ts | 27 +--------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/apps/vdn-static/src/composables/useMeta.ts b/apps/vdn-static/src/composables/useMeta.ts index 4d5766c..3f874ce 100644 --- a/apps/vdn-static/src/composables/useMeta.ts +++ b/apps/vdn-static/src/composables/useMeta.ts @@ -235,7 +235,7 @@ export function useMeta( routeValue: RouteLocationNormalizedLoaded ): T | undefined => { if (value === undefined) return undefined - return typeof value === 'function' ? value(routeValue) : value + return typeof value === 'function' ? (value as Function)(routeValue) as T : value } /** diff --git a/apps/vdn-static/src/types/route-meta.d.ts b/apps/vdn-static/src/types/route-meta.d.ts index ab58a94..06e20c5 100644 --- a/apps/vdn-static/src/types/route-meta.d.ts +++ b/apps/vdn-static/src/types/route-meta.d.ts @@ -116,29 +116,4 @@ export type RouteMetaValue = T | ((route: RouteLocationNormalizedLoaded) => T /** * Helper function type for dynamic meta values */ -export type MetaValueFunction = (route: RouteLocationNormalizedLoaded) => T - -/** - * Type guard for checking if a meta value is a function - */ -export function isMetaFunction( - value: RouteMetaValue -): value is MetaValueFunction { - return typeof value === 'function' -} - -/** - * Type for route with extended meta - */ -export interface RouteWithMeta { - meta: RouteMeta - name?: string | symbol - path: string -} - -/** - * Type for pages that support meta configuration - */ -export interface PageMetaConfig { - meta?: RouteMeta -} \ No newline at end of file +export type MetaValueFunction = (route: RouteLocationNormalizedLoaded) => T \ No newline at end of file