Skip to content

Commit

Permalink
feat(types): ctx.themeAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Dec 25, 2021
1 parent 5f1e3b0 commit 4269714
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions packages/@vuepress/types/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>;
layoutComponentMap: Record<string, any>;
}

/**
* Context API
*
Expand Down Expand Up @@ -136,4 +169,8 @@ export interface Context<
* VuePress Config.
*/
siteConfig: C;
/**
* Theme API.
*/
themeAPI: ThemeAPI;
}

0 comments on commit 4269714

Please sign in to comment.