From 3fed6f94e532eb8a32ed1fe89b607adac3280f44 Mon Sep 17 00:00:00 2001 From: Evan You Date: Wed, 16 Jun 2021 17:28:24 -0400 Subject: [PATCH] type: support specifying themeConfig type for useData() via generics --- src/client/app/data.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/app/data.ts b/src/client/app/data.ts index 836d719c..143b3f5a 100644 --- a/src/client/app/data.ts +++ b/src/client/app/data.ts @@ -6,10 +6,10 @@ import { withBase } from './utils' export const dataSymbol: InjectionKey = Symbol() -export interface VitePressData { - site: Ref +export interface VitePressData { + site: Ref> page: Ref - theme: Ref + theme: Ref frontmatter: Ref title: Ref description: Ref @@ -61,7 +61,7 @@ export function initData(route: Route): VitePressData { } } -export function useData(): VitePressData { +export function useData(): VitePressData { const data = inject(dataSymbol) if (!data) { throw new Error('vitepress data not properly injected in app')