-
Notifications
You must be signed in to change notification settings - Fork 465
/
Copy pathfirstClassModules.res.txt
107 lines (99 loc) · 2.45 KB
/
firstClassModules.res.txt
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
@@jsxConfig({version: 3})
module Select = {
module type T = {
type key
type t
}
@obj
external makeProps: (
~model: module(T with type t = '\"type-a" and type key = '\"type-key"),
~selected: option<'\"type-key">,
~onChange: option<'\"type-key"> => unit,
~items: array<'\"type-a">,
~key: string=?,
unit,
) => {
"model": module(T with type t = '\"type-a" and type key = '\"type-key"),
"selected": option<'\"type-key">,
"onChange": option<'\"type-key"> => unit,
"items": array<'\"type-a">,
} = ""
@react.component
let make = (
type a key,
~model as module(T: T with type t = a and type key = key),
~selected: option<key>,
~onChange: option<key> => unit,
~items: array<a>,
) => {
let _ = (model, selected, onChange, items)
ReactDOMRe.createDOMElementVariadic("div", [])
}
let make = {
let \"FirstClassModules$Select" = (
\"Props": {
"model": module(T with type t = '\"type-a" and type key = '\"type-key"),
"selected": option<'\"type-key">,
"onChange": option<'\"type-key"> => unit,
"items": array<'\"type-a">,
},
) =>
make(
~items=\"Props"["items"],
~onChange=\"Props"["onChange"],
~selected=\"Props"["selected"],
~model=\"Props"["model"],
)
\"FirstClassModules$Select"
}
}
@@jsxConfig({version: 4, mode: "classic"})
module Select = {
module type T = {
type key
type t
}
type props<'model, 'selected, 'onChange, 'items> = {
model: 'model,
selected: 'selected,
onChange: 'onChange,
items: 'items,
}
let make = (
type a key,
{model: module(T: T with type t = a and type key = key), selected, onChange, items, _}: props<
_,
option<key>,
option<key> => unit,
array<a>,
>,
) => {
let _ = (model, selected, onChange, items)
ReactDOM.createDOMElementVariadic("div", [])
}
let make = {
let \"FirstClassModules$Select" = React.component((props: props<_>) => make(props))
\"FirstClassModules$Select"
}
}
module External = {
module type T = {
type key
type t
}
type props<'model, 'selected, 'onChange, 'items> = {
model: 'model,
selected: 'selected,
onChange: 'onChange,
items: 'items,
}
@module("c")
external make: React.component<
props<
module(T with type t = 'a and type key = 'key),
option<'key>,
(option<'key> => unit),
array<'a>,
>,
> = "default"
}