From 42697142a50dc4839350df1f0d65bc0d968b3097 Mon Sep 17 00:00:00 2001 From: chenhaoli Date: Sun, 26 Dec 2021 04:37:23 +0800 Subject: [PATCH] feat(types): `ctx.themeAPI` --- packages/@vuepress/types/src/context.ts | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/packages/@vuepress/types/src/context.ts b/packages/@vuepress/types/src/context.ts index 7f74ea40f7..83ec112487 100644 --- a/packages/@vuepress/types/src/context.ts +++ b/packages/@vuepress/types/src/context.ts @@ -91,6 +91,39 @@ export interface Page< date: string; } +/** + * Resolve theme. + */ +export interface ResolvedTheme { + /** + * Theme's directory + */ + path: string; + /** + * Theme's full name + */ + name: string; + /** + * Theme's short name + */ + shortcut: string; + /** + * Theme entry path. + */ + entry: string; +} + +/** + * Theme API. + */ +export interface ThemeAPI { + theme: ResolvedTheme; + parentTheme: ResolvedTheme; + existsParentTheme: boolean; + componentMap: Record; + layoutComponentMap: Record; +} + /** * Context API * @@ -136,4 +169,8 @@ export interface Context< * VuePress Config. */ siteConfig: C; + /** + * Theme API. + */ + themeAPI: ThemeAPI; }