generated from 2nthony/empty-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
types.ts
54 lines (49 loc) · 1016 Bytes
/
types.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
43
44
45
46
47
48
49
50
51
52
53
54
type TODO = any
export interface Attributes {
title: string
slug: string
date: string
description?: string
}
export interface Post {
id: string
html?: string
markdown?: string
attributes: Attributes
}
export interface Feed {
slug: string
markdown?: string
title: string
date: Date
description?: string
}
export type Posts = Pick<Post, 'id' | 'attributes'>[]
export interface Request {
getPostList(): Promise<Posts>
getPost(slug: string): Promise<Omit<Post, 'html'>>
getFeeds?(): Promise<Feed[]>
}
export interface BlogkitConfig {
siteConfig: {
title: string
author?: string
url?: string
}
theme: {
Home: TODO
Post: TODO
}
themeConfig?: Record<string, any>
request: Request | ((config: BlogkitConfig) => Request)
}
export interface PageProps {
siteConfig: BlogkitConfig['siteConfig']
themeConfig: BlogkitConfig['themeConfig']
}
export type HomePageProps = {
posts: Posts
} & PageProps
export type PostPageProps = {
post: Post
} & PageProps