@rescript/webapi 0.1.0-experimental-0aaab65 → 0.1.0-experimental-ae83778

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rescript/webapi",
3
- "version": "0.1.0-experimental-0aaab65",
3
+ "version": "0.1.0-experimental-ae83778",
4
4
  "description": "Experimental successor to [rescript-webapi](https://github.com/TheSpyder/rescript-webapi)",
5
5
  "homepage": "https://rescript-lang.github.io/experimental-rescript-webapi/",
6
6
  "bugs": "https://github.com/rescript-lang/experimental-rescript-webapi/issues",
@@ -84,7 +84,7 @@ Returns the first element that is a descendant of node that matches selectors.
84
84
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
85
85
  */
86
86
  @send
87
- external querySelector: (document, string) => element = "querySelector"
87
+ external querySelector: (document, string) => Null.t<element> = "querySelector"
88
88
 
89
89
  /**
90
90
  Returns all element descendants of node that match selectors.
@@ -66,7 +66,7 @@ Returns the first element that is a descendant of node that matches selectors.
66
66
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DocumentFragment/querySelector)
67
67
  */
68
68
  @send
69
- external querySelector: (T.t, string) => element = "querySelector"
69
+ external querySelector: (T.t, string) => Null.t<element> = "querySelector"
70
70
 
71
71
  /**
72
72
  Returns all element descendants of node that match selectors.
@@ -267,7 +267,7 @@ Returns the first element that is a descendant of node that matches selectors.
267
267
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Document/querySelector)
268
268
  */
269
269
  @send
270
- external querySelector: (T.t, string) => element = "querySelector"
270
+ external querySelector: (T.t, string) => Null.t<element> = "querySelector"
271
271
 
272
272
  /**
273
273
  Returns all element descendants of node that match selectors.
@@ -388,16 +388,46 @@ When supplied, options's navigationUI member indicates whether showing navigatio
388
388
  external scrollBy2: (T.t, ~x: float, ~y: float) => unit = "scrollBy"
389
389
 
390
390
  /**
391
+ `scrollIntoView()`
392
+
393
+ Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
394
+
395
+ ```res
396
+ element->Element.scrollIntoView()
397
+ ```
398
+
399
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
400
+ */
401
+ @send
402
+ external scrollIntoView: T.t => unit = "scrollIntoView"
403
+
404
+ /**
405
+ `scrollIntoView(true)`
406
+
407
+ Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
408
+
409
+ ```res
410
+ element->Element.scrollIntoView_alignToTop()
411
+ ```
412
+
391
413
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
392
414
  */
393
415
  @send
394
- external scrollIntoView: (T.t, ~arg: bool=?) => unit = "scrollIntoView"
416
+ external scrollIntoView_alignToTop: (T.t, @as(json`true`) _) => unit = "scrollIntoView"
395
417
 
396
418
  /**
419
+ `scrollIntoView({ behavior: "smooth" })`
420
+
421
+ Scrolls the element's ancestor containers such that the element on which scrollIntoView() is called is visible to the user.
422
+
423
+ ```res
424
+ element->Element.scrollIntoView_withOptions({ behavior: DOMAPI.Smooth })
425
+ ```
426
+
397
427
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollIntoView)
398
428
  */
399
429
  @send
400
- external scrollIntoView2: (T.t, ~arg: scrollIntoViewOptions=?) => unit = "scrollIntoView"
430
+ external scrollIntoView_withOptions: (T.t, scrollIntoViewOptions) => unit = "scrollIntoView"
401
431
 
402
432
  /**
403
433
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Element/scrollTo)
package/src/DOMAPI.res CHANGED
@@ -7131,6 +7131,13 @@ type range = {
7131
7131
  commonAncestorContainer: node,
7132
7132
  }
7133
7133
 
7134
+ /**
7135
+ [See StaticRange on MDN](https://developer.mozilla.org/docs/Web/API/StaticRange)
7136
+ */
7137
+ type staticRange = {
7138
+ ...abstractRange,
7139
+ }
7140
+
7134
7141
  type nodeFilter = {}
7135
7142
 
7136
7143
  /**
@@ -32,8 +32,8 @@ The event listener is appended to target's event listener list and is not append
32
32
  @send
33
33
  external addEventListener: (
34
34
  T.t,
35
- ~type_: eventType,
36
- ~callback: eventListener<'event>,
35
+ eventType,
36
+ eventListener<'event>,
37
37
  ~options: addEventListenerOptions=?,
38
38
  ) => unit = "addEventListener"
39
39
 
@@ -56,8 +56,8 @@ The event listener is appended to target's event listener list and is not append
56
56
  @send
57
57
  external addEventListener_useCapture: (
58
58
  T.t,
59
- ~type_: eventType,
60
- ~callback: eventListener<'event>,
59
+ eventType,
60
+ eventListener<'event>,
61
61
  @as(json`true`) _,
62
62
  ) => unit = "addEventListener"
63
63
 
@@ -68,8 +68,8 @@ Removes the event listener in target's event listener list with the same type, c
68
68
  @send
69
69
  external removeEventListener: (
70
70
  T.t,
71
- ~type_: eventType,
72
- ~callback: eventListener<'event>,
71
+ eventType,
72
+ eventListener<'event>,
73
73
  ~options: eventListenerOptions=?,
74
74
  ) => unit = "removeEventListener"
75
75
 
@@ -80,8 +80,8 @@ Removes the event listener in target's event listener list with the same type, c
80
80
  @send
81
81
  external removeEventListener_useCapture: (
82
82
  T.t,
83
- ~type_: eventType,
84
- ~callback: eventListener<'event>,
83
+ eventType,
84
+ eventListener<'event>,
85
85
  @as(json`true`) _,
86
86
  ) => unit = "removeEventListener"
87
87
 
package/src/Global.res CHANGED
@@ -535,8 +535,8 @@ The event listener is appended to target's event listener list and is not append
535
535
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
536
536
  */
537
537
  external addEventListener: (
538
- ~type_: string,
539
- ~callback: eventListener<'event>,
538
+ eventType,
539
+ eventListener<'event>,
540
540
  ~options: addEventListenerOptions=?,
541
541
  ) => unit = "addEventListener"
542
542
 
@@ -556,10 +556,10 @@ If an AbortSignal is passed for options's signal, then the event listener will b
556
556
  The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.
557
557
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener)
558
558
  */
559
- external addEventListener2: (
560
- ~type_: string,
561
- ~callback: eventListener<'event>,
562
- ~options: bool=?,
559
+ external addEventListener_useCapture: (
560
+ eventType,
561
+ eventListener<'event>,
562
+ @as(json`true`) _,
563
563
  ) => unit = "addEventListener"
564
564
 
565
565
  /**
@@ -567,8 +567,8 @@ Removes the event listener in target's event listener list with the same type, c
567
567
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
568
568
  */
569
569
  external removeEventListener: (
570
- ~type_: string,
571
- ~callback: eventListener<'event>,
570
+ string,
571
+ eventListener<'event>,
572
572
  ~options: eventListenerOptions=?,
573
573
  ) => unit = "removeEventListener"
574
574
 
@@ -576,10 +576,10 @@ external removeEventListener: (
576
576
  Removes the event listener in target's event listener list with the same type, callback, and options.
577
577
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/EventTarget/removeEventListener)
578
578
  */
579
- external removeEventListener2: (
580
- ~type_: string,
581
- ~callback: eventListener<'event>,
582
- ~options: bool=?,
579
+ external removeEventListener_useCapture: (
580
+ eventType,
581
+ eventListener<'event>,
582
+ @as(json`true`) _,
583
583
  ) => unit = "removeEventListener"
584
584
 
585
585
  /**
@@ -0,0 +1,12 @@
1
+ open UIEventsAPI
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CompositionEvent)
5
+ */
6
+ @new
7
+ external make: (~type_: string, ~eventInitDict: compositionEventInit=?) => compositionEvent =
8
+ "CompositionEvent"
9
+
10
+ include UIEvent.Impl({
11
+ type t = compositionEvent
12
+ })
@@ -0,0 +1,36 @@
1
+ open UIEventsAPI
2
+ open DOMAPI
3
+
4
+ /**
5
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer)
6
+ */
7
+ @new
8
+ external make: unit => dataTransfer = "DataTransfer"
9
+
10
+ /**
11
+ Uses the given element to update the drag feedback, replacing any previously specified feedback.
12
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/setDragImage)
13
+ */
14
+ @send
15
+ external setDragImage: (dataTransfer, ~image: element, ~x: int, ~y: int) => unit = "setDragImage"
16
+
17
+ /**
18
+ Returns the specified data. If there is no such data, returns the empty string.
19
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/getData)
20
+ */
21
+ @send
22
+ external getData: (dataTransfer, string) => string = "getData"
23
+
24
+ /**
25
+ Adds the specified data.
26
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/setData)
27
+ */
28
+ @send
29
+ external setData: (dataTransfer, ~format: string, ~data: string) => unit = "setData"
30
+
31
+ /**
32
+ Removes the data of the specified formats. Removes all data if the argument is omitted.
33
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/clearData)
34
+ */
35
+ @send
36
+ external clearData: (dataTransfer, ~format: string=?) => unit = "clearData"
@@ -0,0 +1,23 @@
1
+ open UIEventsAPI
2
+ open FileAPI
3
+ open FileAndDirectoryEntriesAPI
4
+
5
+ /**
6
+ Invokes the callback with the string data as the argument, if the drag data item kind is text.
7
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItem/getAsString)
8
+ */
9
+ @send
10
+ external getAsString: (dataTransferItem, string => unit) => unit = "getAsString"
11
+
12
+ /**
13
+ Returns a File object, if the drag data item kind is File.
14
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItem/getAsFile)
15
+ */
16
+ @send
17
+ external getAsFile: dataTransferItem => file = "getAsFile"
18
+
19
+ /**
20
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry)
21
+ */
22
+ @send
23
+ external webkitGetAsEntry: dataTransferItem => fileSystemEntry = "webkitGetAsEntry"
@@ -0,0 +1,30 @@
1
+ open UIEventsAPI
2
+ open FileAPI
3
+
4
+ /**
5
+ Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also.
6
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/add)
7
+ */
8
+ @send
9
+ external add: (dataTransferItemList, ~data: string, ~type_: string) => dataTransferItem = "add"
10
+
11
+ /**
12
+ Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also.
13
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/add)
14
+ */
15
+ @send
16
+ external add2: (dataTransferItemList, file) => dataTransferItem = "add"
17
+
18
+ /**
19
+ Removes the indexth entry in the drag data store.
20
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/remove)
21
+ */
22
+ @send
23
+ external remove: (dataTransferItemList, int) => unit = "remove"
24
+
25
+ /**
26
+ Removes all the entries in the drag data store.
27
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/clear)
28
+ */
29
+ @send
30
+ external clear: dataTransferItemList => unit = "clear"
@@ -0,0 +1,11 @@
1
+ open UIEventsAPI
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FocusEvent)
5
+ */
6
+ @new
7
+ external make: (~type_: string, ~eventInitDict: focusEventInit=?) => focusEvent = "FocusEvent"
8
+
9
+ include UIEvent.Impl({
10
+ type t = focusEvent
11
+ })
@@ -0,0 +1,18 @@
1
+ open UIEventsAPI
2
+ open DOMAPI
3
+
4
+ /**
5
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/InputEvent)
6
+ */
7
+ @new
8
+ external make: (~type_: string, ~eventInitDict: inputEventInit=?) => inputEvent = "InputEvent"
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/InputEvent/getTargetRanges)
12
+ */
13
+ @send
14
+ external getTargetRanges: inputEvent => array<staticRange> = "getTargetRanges"
15
+
16
+ include UIEvent.Impl({
17
+ type t = inputEvent
18
+ })
@@ -0,0 +1,18 @@
1
+ open UIEventsAPI
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent)
5
+ */
6
+ @new
7
+ external make: (~type_: string, ~eventInitDict: keyboardEventInit=?) => keyboardEvent =
8
+ "KeyboardEvent"
9
+
10
+ /**
11
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/getModifierState)
12
+ */
13
+ @send
14
+ external getModifierState: (keyboardEvent, string) => bool = "getModifierState"
15
+
16
+ include UIEvent.Impl({
17
+ type t = keyboardEvent
18
+ })
@@ -0,0 +1,29 @@
1
+ open UIEventsAPI
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent)
5
+ */
6
+ @new
7
+ external make: (~type_: string, ~eventInitDict: mouseEventInit=?) => mouseEvent = "MouseEvent"
8
+
9
+ module Impl = (
10
+ T: {
11
+ type t
12
+ },
13
+ ) => {
14
+ external asMouseEvent: T.t => mouseEvent = "%identity"
15
+
16
+ include UIEvent.Impl({
17
+ type t = T.t
18
+ })
19
+
20
+ /**
21
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/getModifierState)
22
+ */
23
+ @send
24
+ external getModifierState: (T.t, string) => bool = "getModifierState"
25
+ }
26
+
27
+ include Impl({
28
+ type t = mouseEvent
29
+ })
@@ -0,0 +1,23 @@
1
+ open UIEventsAPI
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/UIEvent)
5
+ */
6
+ @new
7
+ external make: (~type_: string, ~eventInitDict: uiEventInit=?) => uiEvent = "UIEvent"
8
+
9
+ module Impl = (
10
+ T: {
11
+ type t
12
+ },
13
+ ) => {
14
+ external asUIEvent: T.t => uiEvent = "%identity"
15
+
16
+ include Event.Impl({
17
+ type t = T.t
18
+ })
19
+ }
20
+
21
+ include Impl({
22
+ type t = uiEvent
23
+ })
@@ -0,0 +1,11 @@
1
+ open UIEventsAPI
2
+
3
+ /**
4
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WheelEvent)
5
+ */
6
+ @new
7
+ external make: (~type_: string, ~eventInitDict: wheelEventInit=?) => wheelEvent = "WheelEvent"
8
+
9
+ include MouseEvent.Impl({
10
+ type t = wheelEvent
11
+ })
@@ -0,0 +1,373 @@
1
+ @@warning("-30")
2
+
3
+ open EventAPI
4
+ open DOMAPI
5
+
6
+ /**
7
+ Simple user interface events.
8
+ [See UIEvent on MDN](https://developer.mozilla.org/docs/Web/API/UIEvent)
9
+ */
10
+ type uiEvent = {
11
+ ...event,
12
+ /**
13
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/UIEvent/view)
14
+ */
15
+ view: Null.t<window>,
16
+ /**
17
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/UIEvent/detail)
18
+ */
19
+ detail: int,
20
+ }
21
+
22
+ /**
23
+ The DOM CompositionEvent represents events that occur due to the user indirectly entering text.
24
+ [See CompositionEvent on MDN](https://developer.mozilla.org/docs/Web/API/CompositionEvent)
25
+ */
26
+ type compositionEvent = {
27
+ ...uiEvent,
28
+ /**
29
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CompositionEvent/data)
30
+ */
31
+ data: string,
32
+ }
33
+
34
+ /**
35
+ Focus-related events like focus, blur, focusin, or focusout.
36
+ [See FocusEvent on MDN](https://developer.mozilla.org/docs/Web/API/FocusEvent)
37
+ */
38
+ type focusEvent = {
39
+ ...uiEvent,
40
+ /**
41
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/FocusEvent/relatedTarget)
42
+ */
43
+ relatedTarget: Null.t<eventTarget>,
44
+ }
45
+
46
+ /**
47
+ One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object.
48
+ [See DataTransferItem on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItem)
49
+ */
50
+ type dataTransferItem = {
51
+ /**
52
+ Returns the drag data item kind, one of: "string", "file".
53
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItem/kind)
54
+ */
55
+ kind: string,
56
+ /**
57
+ Returns the drag data item type string.
58
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItem/type)
59
+ */
60
+ @as("type")
61
+ type_: string,
62
+ }
63
+
64
+ /**
65
+ A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList.
66
+ [See DataTransferItemList on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList)
67
+ */
68
+ type dataTransferItemList = {
69
+ /**
70
+ Returns the number of items in the drag data store.
71
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransferItemList/length)
72
+ */
73
+ length: int,
74
+ }
75
+
76
+ /**
77
+ Used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API.
78
+ [See DataTransfer on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer)
79
+ */
80
+ type dataTransfer = {
81
+ /**
82
+ Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail.
83
+
84
+ Can be set, to change the selected operation.
85
+
86
+ The possible values are "none", "copy", "link", and "move".
87
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/dropEffect)
88
+ */
89
+ mutable dropEffect: string,
90
+ /**
91
+ Returns the kinds of operations that are to be allowed.
92
+
93
+ Can be set (during the dragstart event), to change the allowed operations.
94
+
95
+ The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized",
96
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/effectAllowed)
97
+ */
98
+ mutable effectAllowed: string,
99
+ /**
100
+ Returns a DataTransferItemList object, with the drag data.
101
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/items)
102
+ */
103
+ items: dataTransferItemList,
104
+ /**
105
+ Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string "Files".
106
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/types)
107
+ */
108
+ types: array<string>,
109
+ /**
110
+ Returns a FileList of the files being dragged, if any.
111
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/DataTransfer/files)
112
+ */
113
+ files: fileList,
114
+ }
115
+
116
+ /**
117
+ [See InputEvent on MDN](https://developer.mozilla.org/docs/Web/API/InputEvent)
118
+ */
119
+ type inputEvent = {
120
+ ...uiEvent,
121
+ /**
122
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/InputEvent/data)
123
+ */
124
+ data: Null.t<string>,
125
+ /**
126
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/InputEvent/isComposing)
127
+ */
128
+ isComposing: bool,
129
+ /**
130
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/InputEvent/inputType)
131
+ */
132
+ inputType: string,
133
+ /**
134
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/InputEvent/dataTransfer)
135
+ */
136
+ dataTransfer: Null.t<dataTransfer>,
137
+ }
138
+
139
+ /**
140
+ KeyboardEvent objects describe a user interaction with the keyboard; each event describes a single interaction between the user and a key (or combination of a key with modifier keys) on the keyboard.
141
+ [See KeyboardEvent on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent)
142
+ */
143
+ type keyboardEvent = {
144
+ ...uiEvent,
145
+ /**
146
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/key)
147
+ */
148
+ key: string,
149
+ /**
150
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/code)
151
+ */
152
+ code: string,
153
+ /**
154
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/location)
155
+ */
156
+ location: int,
157
+ /**
158
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/ctrlKey)
159
+ */
160
+ ctrlKey: bool,
161
+ /**
162
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/shiftKey)
163
+ */
164
+ shiftKey: bool,
165
+ /**
166
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/altKey)
167
+ */
168
+ altKey: bool,
169
+ /**
170
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/metaKey)
171
+ */
172
+ metaKey: bool,
173
+ /**
174
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/repeat)
175
+ */
176
+ repeat: bool,
177
+ /**
178
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/KeyboardEvent/isComposing)
179
+ */
180
+ isComposing: bool,
181
+ }
182
+
183
+ /**
184
+ Events that occur due to the user interacting with a pointing device (such as a mouse). Common events using this interface include click, dblclick, mouseup, mousedown.
185
+ [See MouseEvent on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent)
186
+ */
187
+ type mouseEvent = {
188
+ ...uiEvent,
189
+ /**
190
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/screenX)
191
+ */
192
+ screenX: int,
193
+ /**
194
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/screenY)
195
+ */
196
+ screenY: int,
197
+ /**
198
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/clientX)
199
+ */
200
+ clientX: int,
201
+ /**
202
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/clientY)
203
+ */
204
+ clientY: int,
205
+ /**
206
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/layerX)
207
+ */
208
+ layerX: int,
209
+ /**
210
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/layerY)
211
+ */
212
+ layerY: int,
213
+ /**
214
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/ctrlKey)
215
+ */
216
+ ctrlKey: bool,
217
+ /**
218
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/shiftKey)
219
+ */
220
+ shiftKey: bool,
221
+ /**
222
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/altKey)
223
+ */
224
+ altKey: bool,
225
+ /**
226
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/metaKey)
227
+ */
228
+ metaKey: bool,
229
+ /**
230
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/button)
231
+ */
232
+ button: int,
233
+ /**
234
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/buttons)
235
+ */
236
+ buttons: int,
237
+ /**
238
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/relatedTarget)
239
+ */
240
+ relatedTarget: Null.t<eventTarget>,
241
+ /**
242
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/pageX)
243
+ */
244
+ pageX: float,
245
+ /**
246
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/pageY)
247
+ */
248
+ pageY: float,
249
+ /**
250
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/x)
251
+ */
252
+ x: float,
253
+ /**
254
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/y)
255
+ */
256
+ y: float,
257
+ /**
258
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/offsetX)
259
+ */
260
+ offsetX: float,
261
+ /**
262
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/offsetY)
263
+ */
264
+ offsetY: float,
265
+ /**
266
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/movementX)
267
+ */
268
+ movementX: float,
269
+ /**
270
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/MouseEvent/movementY)
271
+ */
272
+ movementY: float,
273
+ }
274
+
275
+ /**
276
+ Events that occur due to the user moving a mouse wheel or similar input device.
277
+ [See WheelEvent on MDN](https://developer.mozilla.org/docs/Web/API/WheelEvent)
278
+ */
279
+ type wheelEvent = {
280
+ ...mouseEvent,
281
+ /**
282
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WheelEvent/deltaX)
283
+ */
284
+ deltaX: float,
285
+ /**
286
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WheelEvent/deltaY)
287
+ */
288
+ deltaY: float,
289
+ /**
290
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WheelEvent/deltaZ)
291
+ */
292
+ deltaZ: float,
293
+ /**
294
+ [Read more on MDN](https://developer.mozilla.org/docs/Web/API/WheelEvent/deltaMode)
295
+ */
296
+ deltaMode: int,
297
+ }
298
+
299
+ type uiEventInit = {
300
+ ...eventInit,
301
+ mutable view?: Null.t<window>,
302
+ mutable detail?: int,
303
+ mutable which?: int,
304
+ }
305
+
306
+ type eventModifierInit = {
307
+ ...uiEventInit,
308
+ mutable ctrlKey?: bool,
309
+ mutable shiftKey?: bool,
310
+ mutable altKey?: bool,
311
+ mutable metaKey?: bool,
312
+ mutable modifierAltGraph?: bool,
313
+ mutable modifierCapsLock?: bool,
314
+ mutable modifierFn?: bool,
315
+ mutable modifierFnLock?: bool,
316
+ mutable modifierHyper?: bool,
317
+ mutable modifierNumLock?: bool,
318
+ mutable modifierScrollLock?: bool,
319
+ mutable modifierSuper?: bool,
320
+ mutable modifierSymbol?: bool,
321
+ mutable modifierSymbolLock?: bool,
322
+ }
323
+
324
+ type mouseEventInit = {
325
+ ...eventModifierInit,
326
+ mutable screenX?: int,
327
+ mutable screenY?: int,
328
+ mutable clientX?: int,
329
+ mutable clientY?: int,
330
+ mutable button?: int,
331
+ mutable buttons?: int,
332
+ mutable relatedTarget?: Null.t<eventTarget>,
333
+ mutable movementX?: float,
334
+ mutable movementY?: float,
335
+ }
336
+
337
+ type focusEventInit = {
338
+ ...uiEventInit,
339
+ mutable relatedTarget?: Null.t<eventTarget>,
340
+ }
341
+
342
+ type compositionEventInit = {
343
+ ...uiEventInit,
344
+ mutable data?: string,
345
+ }
346
+
347
+ type wheelEventInit = {
348
+ ...mouseEventInit,
349
+ mutable deltaX?: float,
350
+ mutable deltaY?: float,
351
+ mutable deltaZ?: float,
352
+ mutable deltaMode?: int,
353
+ }
354
+
355
+ type keyboardEventInit = {
356
+ ...eventModifierInit,
357
+ mutable key?: string,
358
+ mutable code?: string,
359
+ mutable location?: int,
360
+ mutable repeat?: bool,
361
+ mutable isComposing?: bool,
362
+ mutable charCode?: int,
363
+ mutable keyCode?: int,
364
+ }
365
+
366
+ type inputEventInit = {
367
+ ...uiEventInit,
368
+ mutable data?: Null.t<string>,
369
+ mutable isComposing?: bool,
370
+ mutable inputType?: string,
371
+ mutable dataTransfer?: Null.t<dataTransfer>,
372
+ mutable targetRanges?: array<staticRange>,
373
+ }