-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
types.ts
119 lines (118 loc) · 2.54 KB
/
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
import { HeadersInit } from "node-fetch";
export type Opts = {
/** support retreiving oembed metadata */
oembed?: boolean;
/** req/res timeout in ms, it resets on redirect. 0 to disable (OS limit applies) */
timeout?: number;
/** maximum redirect count. 0 to not follow redirect */
follow?: number;
/** support gzip/deflate content encoding */
compress?: boolean;
/** maximum response body size in bytes. 0 to disable */
size?: number;
/** map of request headers, overrides the defaults */
headers?: HeadersInit;
/** Custom fetch implementation */
fetch?: (url: string) => Promise<any /* Response */>; // eslint-disable-line
};
export type Metadata = {
title?: string;
description?: string;
keywords?: string[];
favicon?: string;
author?: string;
theme_color?: string;
canonical_url?: string;
oEmbed?: {
type: "photo" | "video" | "link" | "rich";
width?: number;
height?: number;
version?: string;
title?: string;
author_name?: string;
author_url?: string;
provider_name?: string;
provider_url?: string;
cache_age?: number;
thumbnails?: [
{
url?: string;
width?: number;
height?: number;
}
];
};
twitter_card: {
card: string;
site?: string;
creator?: string;
creator_id?: string;
title?: string;
description?: string;
players?: {
url: string;
stream?: string;
height?: number;
width?: number;
}[];
apps: {
iphone: {
id: string;
name: string;
url: string;
};
ipad: {
id: string;
name: string;
url: string;
};
googleplay: {
id: string;
name: string;
url: string;
};
};
images: {
url: string;
alt: string;
}[];
};
open_graph: {
title: string;
type: string;
images?: {
url: string;
secure_url?: string;
type: string;
width: number;
height: number;
alt?: string;
}[];
url?: string;
audio?: {
url: string;
secure_url?: string;
type: string;
}[];
description?: string;
determiner?: string;
site_name?: string;
locale: string;
locale_alt: string;
videos: {
url: string;
stream?: string;
height?: number;
width?: number;
tags?: string[];
}[];
article: {
published_time?: string;
modified_time?: string;
expiration_time?: string;
author?: string;
section?: string;
tags?: string[];
};
};
};