Skip to content

Commit 0b1040e

Browse files
committed
feat(Interfaces): add binding for some HTML specification
1 parent db03408 commit 0b1040e

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

src/Interfaces/Chakra__HTML.res

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
type noReferrer = [
2+
| @as("no-referrer") #noReferrer
3+
]
4+
module LinkTypes = {
5+
type t = [
6+
| #alternate
7+
| #archives
8+
| #author
9+
| #bookmark
10+
| #canonical
11+
| @as("dns-prefetch") #dnsPrefetch
12+
| @as("external") #external_
13+
| #first
14+
| #help
15+
| #icon
16+
| @as("import") #import_
17+
| #index
18+
| #last
19+
| #license
20+
| #manifest
21+
| #modulepreload
22+
| #next
23+
| #nofollow
24+
| #noopener
25+
| #noReferrer
26+
| #opener
27+
| #pingback
28+
| #preconnect
29+
| #prefetch
30+
| #preload
31+
| #prev
32+
| #search
33+
| #shortlink
34+
| #sidebar
35+
| #stylessheet
36+
| #tag
37+
| #up
38+
]
39+
}
40+
module ReferrerPolicy = {
41+
type t = [
42+
| noReferrer
43+
| @as("no-referrer-when-downgrade") #noReferrerWhenDowngrade
44+
| #origin
45+
| @as("origin-when-cross-origin") #originWhenCrossOrigin
46+
| @as("same-origin") #sameOrigin
47+
| @as("strict-origin") #strictOrigin
48+
| @as("strict-origin-when-cross-origin") #strictOriginWhenCrossOrigin
49+
| @as("unsafe-url") #unsafeURL
50+
]
51+
}
52+
module Target = {
53+
type t = [
54+
| @as("_self") #self
55+
| @as("_blank") #blank
56+
| @as("_parent") #parent
57+
| @as("_top") #top
58+
]
59+
}

src/Interfaces/Chakra__HTML.resi

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@ocaml.text("
2+
a List of type definition related with HTML (e.g: HTML Element attributes)
3+
")
4+
type noReferrer = [#noReferrer]
5+
@ocaml.docs("
6+
[LinkTypes] is types for [rel] attributes in HTML.
7+
@see <https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types>
8+
")
9+
module LinkTypes: {
10+
type t = [
11+
| #alternate
12+
| #archives
13+
| #author
14+
| #bookmark
15+
| #canonical
16+
| #dnsPrefetch
17+
| #external_
18+
| #first
19+
| #help
20+
| #icon
21+
| #import_
22+
| #index
23+
| #last
24+
| #license
25+
| #manifest
26+
| #modulepreload
27+
| #next
28+
| #noReferrer
29+
| #nofollow
30+
| #noopener
31+
| #opener
32+
| #pingback
33+
| #preconnect
34+
| #prefetch
35+
| #preload
36+
| #prev
37+
| #search
38+
| #shortlink
39+
| #sidebar
40+
| #stylessheet
41+
| #tag
42+
| #up
43+
]
44+
}
45+
@ocaml.docs("
46+
[ReferrerPolicy] is a list of referrerpolicy.
47+
")
48+
module ReferrerPolicy: {
49+
type t = [
50+
| #noReferrer
51+
| #noReferrerWhenDowngrade
52+
| #origin
53+
| #originWhenCrossOrigin
54+
| #sameOrigin
55+
| #strictOrigin
56+
| #strictOriginWhenCrossOrigin
57+
| #unsafeURL
58+
]
59+
}
60+
@ocaml.docs("
61+
[Target] is a list of [target] attributes.
62+
")
63+
module Target: {
64+
type t = [#blank | #parent | #self | #top]
65+
}

src/Interfaces/Chakra__MakeProps.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,7 @@ module ViewBox = {
10311031
}
10321032

10331033
include Chakra__Theme
1034+
module HTML = Chakra__HTML
10341035

10351036
module Pseudo = {
10361037
@ocaml.docs(

0 commit comments

Comments
 (0)