@rescript/webapi 0.1.0-experimental-c882807 → 0.1.0-experimental-36cb2d1

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-c882807",
3
+ "version": "0.1.0-experimental-36cb2d1",
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",
@@ -27,22 +27,20 @@ external btoa: (window, string) => string = "btoa"
27
27
  external atob: (window, string) => string = "atob"
28
28
 
29
29
  /**
30
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout)
31
- */
32
- @send
33
- external setTimeout: (window, ~handler: string, ~timeout: int=?) => int = "setTimeout"
30
+ Executes a function after a delay given in milliseconds expires.
34
31
 
35
- /**
36
32
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout)
37
33
  */
38
34
  @send
39
- external setTimeout2: (window, ~handler: unit => unit, ~timeout: int=?) => int = "setTimeout"
35
+ external setTimeout: (window, ~handler: unit => unit, ~timeout: int=?) => timeoutId = "setTimeout"
40
36
 
41
37
  /**
38
+ Cancels the execution of a timeout created with setTimeout.
39
+
42
40
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout)
43
41
  */
44
42
  @send
45
- external clearTimeout: (window, int) => unit = "clearTimeout"
43
+ external clearTimeout: (window, timeoutId) => unit = "clearTimeout"
46
44
 
47
45
  /**
48
46
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setInterval)
package/src/DOMAPI.res CHANGED
@@ -9917,3 +9917,5 @@ type blobCallback = blob => unit
9917
9917
  type videoFrameRequestCallback = float => videoFrameCallbackMetadata => unit
9918
9918
 
9919
9919
  type frameRequestCallback = float => unit
9920
+
9921
+ type timeoutId
package/src/Global.res CHANGED
@@ -260,19 +260,18 @@ external btoa: string => string = "btoa"
260
260
  external atob: string => string = "atob"
261
261
 
262
262
  /**
263
- [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout)
264
- */
265
- external setTimeout: (~handler: string, ~timeout: int=?) => int = "setTimeout"
263
+ Executes a function after a delay given in milliseconds expires.
266
264
 
267
- /**
268
265
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setTimeout)
269
266
  */
270
- external setTimeout2: (~handler: unit => unit, ~timeout: int=?) => int = "setTimeout"
267
+ external setTimeout: (~handler: unit => unit, ~timeout: int=?) => timeoutId = "setTimeout"
271
268
 
272
269
  /**
270
+ Cancels the execution of a timeout created with setTimeout.
271
+
273
272
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout)
274
273
  */
275
- external clearTimeout: int => unit = "clearTimeout"
274
+ external clearTimeout: timeoutId => unit = "clearTimeout"
276
275
 
277
276
  /**
278
277
  [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Window/setInterval)
@@ -86,6 +86,10 @@ type notificationOptions = {
86
86
  mutable requireInteraction?: bool,
87
87
  mutable data?: JSON.t,
88
88
  mutable actions?: array<notificationAction>,
89
+ /**
90
+ [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification#vibrate)
91
+ */
92
+ mutable vibrate?: array<int>,
89
93
  }
90
94
 
91
95
  type getNotificationOptions = {mutable tag?: string}