-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
Copy pathshared.ts
42 lines (37 loc) · 831 Bytes
/
shared.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// types shared between server and client
export interface LocaleConfig {
lang: string;
title?: string;
description?: string;
head?: HeadConfig[];
label?: string;
selectText?: string;
}
export interface SiteData<ThemeConfig = any> {
base: string;
lang: string;
title: string;
description: string;
head: HeadConfig[];
themeConfig: ThemeConfig;
locales: Record<string, LocaleConfig>;
}
export type HeadConfig =
| [string, Record<string, string>]
| [string, Record<string, string>, string];
export interface PageData {
relativePath: string;
title: string;
description: string;
headers: Header[];
frontmatter: Record<string, any>;
lastUpdated: number;
content?: string;
html?: string;
}
export interface Header {
level: number;
title: string;
slug: string;
content: string;
}