From eabf6d2aa69d2a5452042bbb59edbbbc95aece87 Mon Sep 17 00:00:00 2001 From: Evan You Date: Sun, 16 Jan 2022 00:50:13 +0800 Subject: [PATCH] fix(types): fix vitepress/theme type close #489, close #438, close #494, close #442 --- package.json | 3 ++- theme.d.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 55890d2d3103..321601252fbb 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "bin", "dist", "types", - "client.d.ts" + "client.d.ts", + "theme.d.ts" ], "scripts": { "dev": "run-s dev-shared dev-start", diff --git a/theme.d.ts b/theme.d.ts index dd034b53b298..e18d5bb62ce9 100644 --- a/theme.d.ts +++ b/theme.d.ts @@ -1,3 +1,9 @@ // so that users can do `import DefaultTheme from 'vitepress/theme'` -import DefaultTheme from './dist/client/theme-default/index' -export default DefaultTheme +import { ComponentOptions } from 'vue' + +declare const defaultTheme: { + Layout: ComponentOptions + NotFound: ComponentOptions +} + +export default defaultTheme