Skip to content

Commit 0e85a00

Browse files
committed
chore: revert page type update
1 parent e597cab commit 0e85a00

File tree

1 file changed

+122
-120
lines changed

1 file changed

+122
-120
lines changed

packages/core/src/types/page.ts

Lines changed: 122 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -4,131 +4,133 @@ import type { PageBase, PageData, PageFrontmatter } from '@vuepress/shared'
44
/**
55
* Vuepress Page
66
*/
7-
export interface Page<
7+
export type Page<
88
ExtraPageData extends Record<string, unknown> = Record<string, unknown>,
99
ExtraPageFrontmatter extends Record<string, unknown> = Record<
1010
string,
1111
unknown
1212
>,
13-
> extends PageBase<ExtraPageFrontmatter> {
14-
/**
15-
* Data of the page, which will be available in client code
16-
*/
17-
data: PageData<ExtraPageData, ExtraPageFrontmatter>
18-
19-
/**
20-
* Raw Content of the page
21-
*/
22-
content: string
23-
24-
/**
25-
* Rendered content of the page
26-
*/
27-
contentRendered: string
28-
29-
/**
30-
* Date of the page, in 'yyyy-MM-dd' format
31-
*
32-
* @example '2020-09-09'
33-
*/
34-
date: string
35-
36-
/**
37-
* Dependencies of the page
38-
*/
39-
deps: string[]
40-
41-
/**
42-
* Links of the page
43-
*/
44-
links: MarkdownLink[]
45-
46-
/**
47-
* Markdown env object of the page
48-
*/
49-
markdownEnv: Record<string, unknown>
50-
51-
/**
52-
* Path of the page that inferred from file path
53-
*
54-
* If the page does not come from a file, it would be `null`
55-
*
56-
* @example '/guide/index.html'
57-
*/
58-
pathInferred: string | null
59-
60-
/**
61-
* Locale path prefix of the page
62-
*
63-
* @example '/getting-started.html' -> '/'
64-
* @example '/en/getting-started.html' -> '/en/'
65-
* @example '/zh/getting-started.html' -> '/zh/'
66-
*/
67-
pathLocale: string
68-
69-
/**
70-
* Permalink of the page
71-
*
72-
* If the page does not have a permalink, it would be `null`
73-
*/
74-
permalink: string | null
75-
76-
/**
77-
* Custom data to be attached to route record
78-
*/
79-
routeMeta: Record<string, unknown>
80-
81-
/**
82-
* Extracted sfc blocks of the page
83-
*/
84-
sfcBlocks: MarkdownSfcBlocks
85-
86-
/**
87-
* Slug of the page
88-
*/
89-
slug: string
90-
91-
/**
92-
* Source file path
93-
*
94-
* If the page does not come from a file, it would be `null`
95-
*/
96-
filePath: string | null
97-
98-
/**
99-
* Source file path relative to source directory
100-
*
101-
* If the page does not come from a file, it would be `null`
102-
*/
103-
filePathRelative: string | null
104-
105-
/**
106-
* Chunk file path
107-
*/
108-
chunkFilePath: string
109-
110-
/**
111-
* Chunk file path relative to temp directory
112-
*/
113-
chunkFilePathRelative: string
114-
115-
/**
116-
* Chunk name
117-
*
118-
* This will only take effect in webpack
119-
*/
120-
chunkName: string
121-
122-
/**
123-
* Rendered html file path
124-
*/
125-
htmlFilePath: string
126-
127-
/**
128-
* Rendered html file path relative to dest directory
129-
*/
130-
htmlFilePathRelative: string
131-
}
13+
ExtraPageFields extends Record<string, unknown> = Record<string, unknown>,
14+
> = ExtraPageFields &
15+
PageBase<ExtraPageFrontmatter> & {
16+
/**
17+
* Data of the page, which will be available in client code
18+
*/
19+
data: PageData<ExtraPageData, ExtraPageFrontmatter>
20+
21+
/**
22+
* Raw Content of the page
23+
*/
24+
content: string
25+
26+
/**
27+
* Rendered content of the page
28+
*/
29+
contentRendered: string
30+
31+
/**
32+
* Date of the page, in 'yyyy-MM-dd' format
33+
*
34+
* @example '2020-09-09'
35+
*/
36+
date: string
37+
38+
/**
39+
* Dependencies of the page
40+
*/
41+
deps: string[]
42+
43+
/**
44+
* Links of the page
45+
*/
46+
links: MarkdownLink[]
47+
48+
/**
49+
* Markdown env object of the page
50+
*/
51+
markdownEnv: Record<string, unknown>
52+
53+
/**
54+
* Path of the page that inferred from file path
55+
*
56+
* If the page does not come from a file, it would be `null`
57+
*
58+
* @example '/guide/index.html'
59+
*/
60+
pathInferred: string | null
61+
62+
/**
63+
* Locale path prefix of the page
64+
*
65+
* @example '/getting-started.html' -> '/'
66+
* @example '/en/getting-started.html' -> '/en/'
67+
* @example '/zh/getting-started.html' -> '/zh/'
68+
*/
69+
pathLocale: string
70+
71+
/**
72+
* Permalink of the page
73+
*
74+
* If the page does not have a permalink, it would be `null`
75+
*/
76+
permalink: string | null
77+
78+
/**
79+
* Custom data to be attached to route record
80+
*/
81+
routeMeta: Record<string, unknown>
82+
83+
/**
84+
* Extracted sfc blocks of the page
85+
*/
86+
sfcBlocks: MarkdownSfcBlocks
87+
88+
/**
89+
* Slug of the page
90+
*/
91+
slug: string
92+
93+
/**
94+
* Source file path
95+
*
96+
* If the page does not come from a file, it would be `null`
97+
*/
98+
filePath: string | null
99+
100+
/**
101+
* Source file path relative to source directory
102+
*
103+
* If the page does not come from a file, it would be `null`
104+
*/
105+
filePathRelative: string | null
106+
107+
/**
108+
* Chunk file path
109+
*/
110+
chunkFilePath: string
111+
112+
/**
113+
* Chunk file path relative to temp directory
114+
*/
115+
chunkFilePathRelative: string
116+
117+
/**
118+
* Chunk name
119+
*
120+
* This will only take effect in webpack
121+
*/
122+
chunkName: string
123+
124+
/**
125+
* Rendered html file path
126+
*/
127+
htmlFilePath: string
128+
129+
/**
130+
* Rendered html file path relative to dest directory
131+
*/
132+
htmlFilePathRelative: string
133+
}
132134

133135
/**
134136
* Options to create vuepress page

0 commit comments

Comments
 (0)