File tree Expand file tree Collapse file tree
packages/@vuepress/types/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { PostCssLoaderOptions } from "./style" ;
22import { MarkdownConfig } from "./markdown" ;
3- import { LocaleConfig } from "./locale" ;
3+ import { Locales } from "./locale" ;
44import { ThemeConfig } from "./theme" ;
55import { UserPlugins } from "./plugin" ;
66import { Context } from "./context" ;
77import { ChainWebpack } from "./shared" ;
88
9+
910/**
1011 * HTML tag name
1112 */
1213export type HTMLTagName = keyof HTMLElementTagNameMap ;
1314
15+ /**
16+ * Expose `HeadTags`
17+ */
18+ export type HeadTags = Array <
19+ [
20+ HTMLTagName ,
21+ Partial < HTMLElementTagNameMap [ HTMLTagName ] > ,
22+ string ? /* innerHTML */
23+ ]
24+ > ;
25+
1426/**
1527 * Expose `VuePress` config.
1628 */
@@ -39,13 +51,7 @@ export interface Config<T extends ThemeConfig> {
3951 *
4052 * @see https://vuepress.vuejs.org/config/#head
4153 */
42- head ?: Array <
43- [
44- HTMLTagName ,
45- Partial < HTMLElementTagNameMap [ HTMLTagName ] > ,
46- string ? /* innerHTML */
47- ]
48- > ;
54+ head ?: HeadTags ;
4955 /**
5056 * Specify the host to use for the dev server.
5157 *
@@ -77,7 +83,7 @@ export interface Config<T extends ThemeConfig> {
7783 *
7884 * @see https://vuepress.vuejs.org/config/#locales
7985 */
80- locales ?: { [ path : string ] : LocaleConfig } ;
86+ locales ?: Locales ;
8187 /**
8288 * A function to control what files should have <link rel="prefetch"> resource hints generated.
8389 *
Original file line number Diff line number Diff line change 11import { ThemeConfig } from "./theme" ;
22import { Config } from "./config" ;
33import { Lang } from "./lang" ;
4+ import { SiteData } from "./site-data" ;
45
56/**
67 * Page instance.
@@ -173,4 +174,8 @@ export interface Context<
173174 * Theme API.
174175 */
175176 themeAPI : ThemeAPI ;
177+ /**
178+ * Get site data.
179+ */
180+ getSiteData ( ) : SiteData ;
176181}
Original file line number Diff line number Diff line change @@ -16,3 +16,5 @@ export interface LocaleConfig {
1616 */
1717 description : string ;
1818}
19+
20+ export type Locales = { [ path : string ] : LocaleConfig } ;
Original file line number Diff line number Diff line change 1+ import { Page } from "./context" ;
2+ import { ThemeConfig } from "./theme" ;
3+ import { Locales } from "./locale" ;
4+ import { HeadTags } from "./config" ;
5+
6+ export interface SiteData < T extends ThemeConfig = ThemeConfig > {
7+ title : string ;
8+ description : string ;
9+ base : string ;
10+ pages : Page [ ] ;
11+ headTags : HeadTags ;
12+ themeConfig : T ;
13+ locales : Locales ;
14+ }
You can’t perform that action at this time.
0 commit comments