Skip to content

Commit 4269714

Browse files
committedDec 25, 2021
feat(types): ctx.themeAPI
1 parent 5f1e3b0 commit 4269714

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
 

‎packages/@vuepress/types/src/context.ts

+37
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,39 @@ export interface Page<
9191
date: string;
9292
}
9393

94+
/**
95+
* Resolve theme.
96+
*/
97+
export interface ResolvedTheme {
98+
/**
99+
* Theme's directory
100+
*/
101+
path: string;
102+
/**
103+
* Theme's full name
104+
*/
105+
name: string;
106+
/**
107+
* Theme's short name
108+
*/
109+
shortcut: string;
110+
/**
111+
* Theme entry path.
112+
*/
113+
entry: string;
114+
}
115+
116+
/**
117+
* Theme API.
118+
*/
119+
export interface ThemeAPI {
120+
theme: ResolvedTheme;
121+
parentTheme: ResolvedTheme;
122+
existsParentTheme: boolean;
123+
componentMap: Record<string, any>;
124+
layoutComponentMap: Record<string, any>;
125+
}
126+
94127
/**
95128
* Context API
96129
*
@@ -136,4 +169,8 @@ export interface Context<
136169
* VuePress Config.
137170
*/
138171
siteConfig: C;
172+
/**
173+
* Theme API.
174+
*/
175+
themeAPI: ThemeAPI;
139176
}

0 commit comments

Comments
 (0)
Please sign in to comment.