-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
meta.ts
139 lines (135 loc) · 3.83 KB
/
meta.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import type { MaybePromiseProps, Stringable } from './utils'
export type MetaNames =
'charset' |
'description' |
'color-scheme' |
'application-name' |
'author' |
'creator' |
'publisher' |
'generator' |
'referrer' |
'viewport' |
'robots' |
'google' |
'googlebot' |
'google-site-verification' |
'rating' |
'fb:app_id' |
'theme-color' |
'mobile-web-app-capable' |
'apple-mobile-web-app-capable' |
'apple-mobile-web-app-status-bar-style' |
'apple-mobile-web-app-title' |
'apple-itunes-app' |
'format-detection' |
'msapplication-TileImage' |
'msapplication-TileColor' |
'msapplication-Config' |
'content-security-policy' |
'content-type' |
'default-style' |
'x-ua-compatible' |
'refresh'
export type MetaProperties = 'og:url' |
'og:title' |
'og:description' |
'og:type' |
'og:locale' |
'og:locale:alternate' |
'og:determiner' |
'og:site:name' |
'og:video' |
'og:video:url' |
'og:video:secure_url' |
'og:video:type' |
'og:video:width' |
'og:video:height' |
'og:image' |
'og:image:url' |
'og:image:secure_url' |
'og:image:type' |
'og:image:width' |
'og:image:height' |
'fb:app:id' |
'twitter:card' |
'twitter:title' |
'twitter:description' |
'twitter:image' |
'twitter:image:alt' |
'twitter:site' |
'twitter:site:id' |
'twitter:creator' |
'twitter:creator:id' |
'twitter:player' |
'twitter:player:width' |
'twitter:player:height' |
'twitter:player:stream' |
'twitter:app:name:iphone' |
'twitter:app:id:iphone' |
'twitter:app:url:iphone' |
'twitter:app:name:ipad' |
'twitter:app:id:ipad' |
'twitter:app:url:ipad' |
'twitter:app:name:googleplay' |
'twitter:app:id:googleplay' |
'twitter:app:url:googleplay' |
'twitter:data:1' |
'twitter:label:1' |
'twitter:data:2' |
'twitter:label:2'
export interface Meta {
/**
* This attribute declares the document's character encoding.
* If the attribute is present, its value must be an ASCII case-insensitive match for the string "utf-8",
* because UTF-8 is the only valid encoding for HTML5 documents.
* <meta> elements which declare a character encoding must be located entirely within the first 1024 bytes
* of the document.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset
*/
charset?: 'utf-8' | (string & Record<never, never>)
/**
* This attribute contains the value for the http-equiv or name attribute, depending on which is used.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-content
*/
content?: Stringable
/**
* Defines a pragma directive. The attribute is named http-equiv(alent) because all the allowed values are names of
* particular HTTP headers.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-http-equiv
*/
['http-equiv']?: 'content-security-policy' |
'content-type' |
'default-style' |
'x-ua-compatible' |
'refresh' |
'accept-ch' |
(string & Record<never, never>)
/**
* The name and content attributes can be used together to provide document metadata in terms of name-value pairs,
* with the name attribute giving the metadata name, and the content attribute giving the value.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-name
*/
name?: MetaNames | (string & Record<never, never>)
/**
* The property attribute is used to define a property associated with the content attribute.
*
* Mainly used for og and twitter meta tags.
*/
property?: MetaProperties | (string & Record<never, never>)
/**
* This attribute defines the unique ID.
*/
id?: string
/**
* A valid media query list that can be included to set the media the `theme-color` metadata applies to.
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
*/
media?: '(prefers-color-scheme: light)' | '(prefers-color-scheme: dark)' | (string & Record<never, never>)
}
export type AsyncMeta = MaybePromiseProps<Meta>