We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff4fa62 commit 3fed6f9Copy full SHA for 3fed6f9
src/client/app/data.ts
@@ -6,10 +6,10 @@ import { withBase } from './utils'
6
7
export const dataSymbol: InjectionKey<VitePressData> = Symbol()
8
9
-export interface VitePressData {
10
- site: Ref<SiteData>
+export interface VitePressData<T = any> {
+ site: Ref<SiteData<T>>
11
page: Ref<PageData>
12
- theme: Ref<any>
+ theme: Ref<T>
13
frontmatter: Ref<PageData['frontmatter']>
14
title: Ref<string>
15
description: Ref<string>
@@ -61,7 +61,7 @@ export function initData(route: Route): VitePressData {
61
}
62
63
64
-export function useData(): VitePressData {
+export function useData<T = any>(): VitePressData<T> {
65
const data = inject(dataSymbol)
66
if (!data) {
67
throw new Error('vitepress data not properly injected in app')
0 commit comments