Skip to content

Commit 1cd74f0

Browse files
committed
bring back tests
1 parent da91f58 commit 1cd74f0

42 files changed

Lines changed: 233 additions & 190 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
include WebApiEvent.EventTarget.Impl({type t = Types.clipboard})
22

33
/**
4-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiClipboard/read)
4+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/read)
55
*/
66
@send
77
external read: Types.clipboard => promise<array<Types.clipboardItem>> = "read"
88

99
/**
10-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiClipboard/readText)
10+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/readText)
1111
*/
1212
@send
1313
external readText: Types.clipboard => promise<string> = "readText"
1414

1515
/**
16-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiClipboard/write)
16+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/write)
1717
*/
1818
@send
1919
external write: (Types.clipboard, array<Types.clipboardItem>) => promise<unit> = "write"
2020

2121
/**
22-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiClipboard/writeText)
22+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard/writeText)
2323
*/
2424
@send
2525
external writeText: (Types.clipboard, string) => promise<unit> = "writeText"

packages/Clipboard/src/Types.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ type clipboardItem = private {
2121
}
2222

2323
/**
24-
[See WebApiClipboard on MDN](https://developer.mozilla.org/docs/Web/API/WebApiClipboard)
24+
[See WebApiClipboard on MDN](https://developer.mozilla.org/docs/Web/API/Clipboard)
2525
*/
2626
@editor.completeFrom(WebApiClipboard)
2727
type clipboard = private {

packages/Event/src/Event.res

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent)
2+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event)
33
*/
44
@new
5-
external make: (~type_: string, ~eventInitDict: Types.eventInit=?) => Types.event = "WebApiEvent"
5+
external make: (~type_: string, ~eventInitDict: Types.eventInit=?) => Types.event = "Event"
66

77
module Impl = (
88
T: {
@@ -13,28 +13,28 @@ module Impl = (
1313

1414
/**
1515
Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget.
16-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/composedPath)
16+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composedPath)
1717
*/
1818
@send
1919
external composedPath: T.t => array<Types.eventTarget> = "composedPath"
2020

2121
/**
2222
If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled.
23-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/preventDefault)
23+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/preventDefault)
2424
*/
2525
@send
2626
external preventDefault: T.t => unit = "preventDefault"
2727

2828
/**
2929
Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects.
30-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/stopImmediatePropagation)
30+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopImmediatePropagation)
3131
*/
3232
@send
3333
external stopImmediatePropagation: T.t => unit = "stopImmediatePropagation"
3434

3535
/**
3636
When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object.
37-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/stopPropagation)
37+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/stopPropagation)
3838
*/
3939
@send
4040
external stopPropagation: T.t => unit = "stopPropagation"

packages/Event/src/Types.res

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,59 +120,59 @@ type eventTarget = WebApiPrelude.Event.eventTarget = private {...WebApiPrelude.E
120120

121121
/**
122122
An event which takes place in the WebApiDOM.
123-
[See WebApiEvent on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent)
123+
[See WebApiEvent on MDN](https://developer.mozilla.org/docs/Web/API/Event)
124124
*/
125125
@editor.completeFrom(WebApiEvent)
126126
type event = private {
127127
/**
128128
Returns the type of event, e.g. "click", "hashchange", or "submit".
129-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/type)
129+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/type)
130130
*/
131131
@as("type")
132132
type_: eventType,
133133
/**
134134
Returns the object to which event is dispatched (its target).
135-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/target)
135+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/target)
136136
*/
137137
target: Null.t<eventTarget>,
138138
/**
139139
Returns the object whose event listener's callback is currently being invoked.
140-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/currentTarget)
140+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/currentTarget)
141141
*/
142142
currentTarget: Null.t<eventTarget>,
143143
/**
144144
Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE.
145-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/eventPhase)
145+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/eventPhase)
146146
*/
147147
eventPhase: int,
148148
/**
149149
Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise.
150-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/bubbles)
150+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/bubbles)
151151
*/
152152
bubbles: bool,
153153
/**
154154
Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method.
155-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/cancelable)
155+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/cancelable)
156156
*/
157157
cancelable: bool,
158158
/**
159159
Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise.
160-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/defaultPrevented)
160+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/defaultPrevented)
161161
*/
162162
defaultPrevented: bool,
163163
/**
164164
Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise.
165-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/composed)
165+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/composed)
166166
*/
167167
composed: bool,
168168
/**
169169
Returns true if event was dispatched by the user agent, and false otherwise.
170-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/isTrusted)
170+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/isTrusted)
171171
*/
172172
isTrusted: bool,
173173
/**
174174
Returns the event's timestamp as the number of milliseconds measured relative to the time origin.
175-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiEvent/timeStamp)
175+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Event/timeStamp)
176176
*/
177177
timeStamp: float,
178178
}

packages/File/src/File.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ type t = Types.file = private {...Types.file}
33
include Blob.Impl({type t = t})
44

55
/**
6-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiFile)
6+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/File)
77
*/
88
@new
99
external make: (
1010
~fileBits: array<Types.blobPart>,
1111
~fileName: string,
1212
~options: Types.filePropertyBag=?,
13-
) => t = "WebApiFile"
13+
) => t = "File"
1414

15-
let isInstanceOf = (_: 't): bool => %raw(`param instanceof WebApiFile`)
15+
let isInstanceOf = (_: 't): bool => %raw(`param instanceof File`)

packages/File/src/Types.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,21 @@ type writableStreamDefaultController = private {
6868

6969
/**
7070
Provides information about files and allows JavaScript in a web page to access their content.
71-
[See WebApiFile on MDN](https://developer.mozilla.org/docs/Web/API/WebApiFile)
71+
[See WebApiFile on MDN](https://developer.mozilla.org/docs/Web/API/File)
7272
*/
7373
@editor.completeFrom(WebApiFile)
7474
type file = WebApiPrelude.File.file = private {
7575
...blob,
7676
/**
77-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiFile/name)
77+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/File/name)
7878
*/
7979
name: string,
8080
/**
81-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiFile/lastModified)
81+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/File/lastModified)
8282
*/
8383
lastModified: int,
8484
/**
85-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiFile/webkitRelativePath)
85+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/File/webkitRelativePath)
8686
*/
8787
webkitRelativePath: string,
8888
}

packages/Gamepad/src/Types.res

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,39 +39,39 @@ type gamepadHapticActuator = private {}
3939

4040
/**
4141
This WebApiGamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.
42-
[See WebApiGamepad on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad)
42+
[See WebApiGamepad on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad)
4343
*/
4444
type gamepad = {
4545
/**
46-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad/id)
46+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/id)
4747
*/
4848
id: string,
4949
/**
50-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad/index)
50+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/index)
5151
*/
5252
index: int,
5353
/**
54-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad/connected)
54+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/connected)
5555
*/
5656
connected: bool,
5757
/**
58-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad/timestamp)
58+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/timestamp)
5959
*/
6060
timestamp: float,
6161
/**
62-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad/mapping)
62+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/mapping)
6363
*/
6464
mapping: gamepadMappingType,
6565
/**
66-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad/axes)
66+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/axes)
6767
*/
6868
axes: array<float>,
6969
/**
70-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad/buttons)
70+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/buttons)
7171
*/
7272
buttons: array<gamepadButton>,
7373
/**
74-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGamepad/vibrationActuator)
74+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Gamepad/vibrationActuator)
7575
*/
7676
vibrationActuator: gamepadHapticActuator,
7777
}

packages/Geolocation/src/Geolocation.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGeolocation/getCurrentPosition)
2+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation/getCurrentPosition)
33
*/
44
@send
55
external getCurrentPosition: (
@@ -10,7 +10,7 @@ external getCurrentPosition: (
1010
) => unit = "getCurrentPosition"
1111

1212
/**
13-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGeolocation/watchPosition)
13+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation/watchPosition)
1414
*/
1515
@send
1616
external watchPosition: (
@@ -21,7 +21,7 @@ external watchPosition: (
2121
) => int = "watchPosition"
2222

2323
/**
24-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGeolocation/clearWatch)
24+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation/clearWatch)
2525
*/
2626
@send
2727
external clearWatch: (Types.geolocation, int) => unit = "clearWatch"

packages/Geolocation/src/Types.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@@warning("-30")
22
/**
33
An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location.
4-
[See WebApiGeolocation on MDN](https://developer.mozilla.org/docs/Web/API/WebApiGeolocation)
4+
[See WebApiGeolocation on MDN](https://developer.mozilla.org/docs/Web/API/Geolocation)
55
*/
66
@editor.completeFrom(WebApiGeolocation)
77
type geolocation = private {}

packages/History/src/History.res

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
/**
2-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiHistory/go)
2+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/go)
33
*/
44
@send
55
external go: (Types.history, ~delta: int=?) => unit = "go"
66

77
/**
8-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiHistory/back)
8+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/back)
99
*/
1010
@send
1111
external back: Types.history => unit = "back"
1212

1313
/**
14-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiHistory/forward)
14+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/forward)
1515
*/
1616
@send
1717
external forward: Types.history => unit = "forward"
1818

1919
/**
20-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiHistory/pushState)
20+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/pushState)
2121
*/
2222
@send
2323
external pushState: (Types.history, ~data: JSON.t, ~unused: string, ~url: string=?) => unit =
2424
"pushState"
2525

2626
/**
27-
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/WebApiHistory/replaceState)
27+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/History/replaceState)
2828
*/
2929
@send
3030
external replaceState: (Types.history, ~data: JSON.t, ~unused: string, ~url: string=?) => unit =

0 commit comments

Comments
 (0)