forked from denoland/deno_blog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
45 lines (39 loc) · 1015 Bytes
/
types.d.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
// Copyright 2022 the Deno authors. All rights reserved. MIT license.
import type { ConnInfo, VNode } from "./deps.ts";
export interface BlogContext {
state: BlogState;
connInfo: ConnInfo;
next: () => Promise<Response>;
}
export interface BlogMiddleware {
(req: Request, ctx: BlogContext): Promise<Response>;
}
export interface BlogSettings {
title?: string;
description?: string;
picture?: string;
author?: string;
links?: { title: string; url: string; icon?: VNode }[];
header?: VNode;
footer?: VNode;
style?: string;
background?: string;
ogImage?: string;
middlewares?: BlogMiddleware[];
}
export interface BlogState extends BlogSettings {
directory: string;
}
/** Represents a Post in the Blog. */
export interface Post {
pathname: string;
markdown: string;
title: string;
publishDate: Date;
author?: string;
snippet?: string;
coverHtml?: string;
background?: string;
/** An image URL which is used in the OpenGraph og:image tag. */
ogImage?: string;
}