feat(client): declare $frontmatter and $params as ComponentCustomProperties

Allows the template globals to resolve and be typed in editors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pull/5340/head
Divyansh Singh 2 months ago
parent a5ce6ab200
commit 0535009f44

@ -9,6 +9,7 @@ export type { Route, VitePressData } from './shared'
export type { EnhanceAppContext, Theme } from './app/theme' export type { EnhanceAppContext, Theme } from './app/theme'
// shared types // shared types
import type { PageData } from '../../types/shared'
export type { HeadConfig, Header, PageData, SiteData } from '../../types/shared' export type { HeadConfig, Header, PageData, SiteData } from '../../types/shared'
// components // components
@ -36,4 +37,9 @@ declare module 'vue' {
ClientOnly: typeof ClientOnly ClientOnly: typeof ClientOnly
Content: typeof Content Content: typeof Content
} }
interface ComponentCustomProperties {
$frontmatter: PageData['frontmatter']
$params: PageData['params']
}
} }

Loading…
Cancel
Save