@rescript/webapi 0.1.0-experimental-8ad0d94 → 0.1.0-experimental-82a7689
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 +1 -1
- package/src/CredentialManagementAPI/CredentialsContainer.res +2 -4
- package/src/EncryptedMediaExtensionsAPI/MediaKeys.res +1 -2
- package/src/FileAPI/FileSystemDirectoryHandle.res +1 -2
- package/src/UIEventsAPI/PointerEvent.res +23 -0
- package/src/UIEventsAPI/Touch.res +7 -0
- package/src/UIEventsAPI/TouchEvent.res +11 -0
- package/src/UIEventsAPI/TouchList.res +7 -0
- package/src/UIEventsAPI.res +205 -0
- package/src/WebLocksAPI/LockManager.res +2 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rescript/webapi",
|
|
3
|
-
"version": "0.1.0-experimental-
|
|
3
|
+
"version": "0.1.0-experimental-82a7689",
|
|
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",
|
|
@@ -4,10 +4,8 @@ open CredentialManagementAPI
|
|
|
4
4
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/get)
|
|
5
5
|
*/
|
|
6
6
|
@send
|
|
7
|
-
external get: (
|
|
8
|
-
|
|
9
|
-
~options: credentialRequestOptions=?,
|
|
10
|
-
) => promise<credential> = "get"
|
|
7
|
+
external get: (credentialsContainer, ~options: credentialRequestOptions=?) => promise<credential> =
|
|
8
|
+
"get"
|
|
11
9
|
|
|
12
10
|
/**
|
|
13
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/CredentialsContainer/store)
|
|
@@ -24,5 +24,4 @@ external setServerCertificate: (mediaKeys, DataView.t) => promise<bool> = "setSe
|
|
|
24
24
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/MediaKeys/setServerCertificate)
|
|
25
25
|
*/
|
|
26
26
|
@send
|
|
27
|
-
external setServerCertificate2: (mediaKeys, ArrayBuffer.t) => promise<bool> =
|
|
28
|
-
"setServerCertificate"
|
|
27
|
+
external setServerCertificate2: (mediaKeys, ArrayBuffer.t) => promise<bool> = "setServerCertificate"
|
|
@@ -5,8 +5,7 @@ external asFileSystemHandle: fileSystemDirectoryHandle => fileSystemHandle = "%i
|
|
|
5
5
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/isSameEntry)
|
|
6
6
|
*/
|
|
7
7
|
@send
|
|
8
|
-
external isSameEntry: (fileSystemDirectoryHandle, fileSystemHandle) => promise<bool> =
|
|
9
|
-
"isSameEntry"
|
|
8
|
+
external isSameEntry: (fileSystemDirectoryHandle, fileSystemHandle) => promise<bool> = "isSameEntry"
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getFileHandle)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
open UIEventsAPI
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent)
|
|
5
|
+
*/
|
|
6
|
+
@new
|
|
7
|
+
external make: (~type_: string, ~eventInitDict: pointerEventInit=?) => pointerEvent = "PointerEvent"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/getCoalescedEvents)
|
|
11
|
+
*/
|
|
12
|
+
@send
|
|
13
|
+
external getCoalescedEvents: pointerEvent => array<pointerEvent> = "getCoalescedEvents"
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/getPredictedEvents)
|
|
17
|
+
*/
|
|
18
|
+
@send
|
|
19
|
+
external getPredictedEvents: pointerEvent => array<pointerEvent> = "getPredictedEvents"
|
|
20
|
+
|
|
21
|
+
include MouseEvent.Impl({
|
|
22
|
+
type t = pointerEvent
|
|
23
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
open UIEventsAPI
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent)
|
|
5
|
+
*/
|
|
6
|
+
@new
|
|
7
|
+
external make: (~type_: string, ~eventInitDict: touchEventInit=?) => touchEvent = "TouchEvent"
|
|
8
|
+
|
|
9
|
+
include UIEvent.Impl({
|
|
10
|
+
type t = touchEvent
|
|
11
|
+
})
|
package/src/UIEventsAPI.res
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
open EventAPI
|
|
4
4
|
open DOMAPI
|
|
5
5
|
|
|
6
|
+
type touchType =
|
|
7
|
+
| @as("direct") Direct
|
|
8
|
+
| @as("stylus") Stylus
|
|
9
|
+
|
|
6
10
|
/**
|
|
7
11
|
Simple user interface events.
|
|
8
12
|
[See UIEvent on MDN](https://developer.mozilla.org/docs/Web/API/UIEvent)
|
|
@@ -296,6 +300,164 @@ type wheelEvent = {
|
|
|
296
300
|
deltaMode: int,
|
|
297
301
|
}
|
|
298
302
|
|
|
303
|
+
/**
|
|
304
|
+
A single contact point on a touch-sensitive device. The contact point is commonly a finger or stylus and the device may be a touchscreen or trackpad.
|
|
305
|
+
[See Touch on MDN](https://developer.mozilla.org/docs/Web/API/Touch)
|
|
306
|
+
*/
|
|
307
|
+
type touch = {
|
|
308
|
+
/**
|
|
309
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/identifier)
|
|
310
|
+
*/
|
|
311
|
+
identifier: int,
|
|
312
|
+
/**
|
|
313
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/target)
|
|
314
|
+
*/
|
|
315
|
+
target: eventTarget,
|
|
316
|
+
/**
|
|
317
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/screenX)
|
|
318
|
+
*/
|
|
319
|
+
screenX: float,
|
|
320
|
+
/**
|
|
321
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/screenY)
|
|
322
|
+
*/
|
|
323
|
+
screenY: float,
|
|
324
|
+
/**
|
|
325
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/clientX)
|
|
326
|
+
*/
|
|
327
|
+
clientX: float,
|
|
328
|
+
/**
|
|
329
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/clientY)
|
|
330
|
+
*/
|
|
331
|
+
clientY: float,
|
|
332
|
+
/**
|
|
333
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/pageX)
|
|
334
|
+
*/
|
|
335
|
+
pageX: float,
|
|
336
|
+
/**
|
|
337
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/pageY)
|
|
338
|
+
*/
|
|
339
|
+
pageY: float,
|
|
340
|
+
/**
|
|
341
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/radiusX)
|
|
342
|
+
*/
|
|
343
|
+
radiusX: float,
|
|
344
|
+
/**
|
|
345
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/radiusY)
|
|
346
|
+
*/
|
|
347
|
+
radiusY: float,
|
|
348
|
+
/**
|
|
349
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/rotationAngle)
|
|
350
|
+
*/
|
|
351
|
+
rotationAngle: float,
|
|
352
|
+
/**
|
|
353
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/Touch/force)
|
|
354
|
+
*/
|
|
355
|
+
force: float,
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
A list of contact points on a touch surface. For example, if the user has three fingers on the touch surface (such as a screen or trackpad), the corresponding TouchList object would have one Touch object for each finger, for a total of three entries.
|
|
360
|
+
[See TouchList on MDN](https://developer.mozilla.org/docs/Web/API/TouchList)
|
|
361
|
+
*/
|
|
362
|
+
type touchList = {
|
|
363
|
+
/**
|
|
364
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchList/length)
|
|
365
|
+
*/
|
|
366
|
+
length: int,
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
An event sent when the state of contacts with a touch-sensitive surface changes. This surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth.
|
|
371
|
+
[See TouchEvent on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent)
|
|
372
|
+
*/
|
|
373
|
+
type touchEvent = {
|
|
374
|
+
...uiEvent,
|
|
375
|
+
/**
|
|
376
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/touches)
|
|
377
|
+
*/
|
|
378
|
+
touches: touchList,
|
|
379
|
+
/**
|
|
380
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/targetTouches)
|
|
381
|
+
*/
|
|
382
|
+
targetTouches: touchList,
|
|
383
|
+
/**
|
|
384
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/changedTouches)
|
|
385
|
+
*/
|
|
386
|
+
changedTouches: touchList,
|
|
387
|
+
/**
|
|
388
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/altKey)
|
|
389
|
+
*/
|
|
390
|
+
altKey: bool,
|
|
391
|
+
/**
|
|
392
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/metaKey)
|
|
393
|
+
*/
|
|
394
|
+
metaKey: bool,
|
|
395
|
+
/**
|
|
396
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/ctrlKey)
|
|
397
|
+
*/
|
|
398
|
+
ctrlKey: bool,
|
|
399
|
+
/**
|
|
400
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/TouchEvent/shiftKey)
|
|
401
|
+
*/
|
|
402
|
+
shiftKey: bool,
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
The state of a DOM event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc.
|
|
407
|
+
[See PointerEvent on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent)
|
|
408
|
+
*/
|
|
409
|
+
type pointerEvent = {
|
|
410
|
+
...mouseEvent,
|
|
411
|
+
/**
|
|
412
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/pointerId)
|
|
413
|
+
*/
|
|
414
|
+
pointerId: int,
|
|
415
|
+
/**
|
|
416
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/width)
|
|
417
|
+
*/
|
|
418
|
+
width: float,
|
|
419
|
+
/**
|
|
420
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/height)
|
|
421
|
+
*/
|
|
422
|
+
height: float,
|
|
423
|
+
/**
|
|
424
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/pressure)
|
|
425
|
+
*/
|
|
426
|
+
pressure: float,
|
|
427
|
+
/**
|
|
428
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/tangentialPressure)
|
|
429
|
+
*/
|
|
430
|
+
tangentialPressure: float,
|
|
431
|
+
/**
|
|
432
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/tiltX)
|
|
433
|
+
*/
|
|
434
|
+
tiltX: int,
|
|
435
|
+
/**
|
|
436
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/tiltY)
|
|
437
|
+
*/
|
|
438
|
+
tiltY: int,
|
|
439
|
+
/**
|
|
440
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/twist)
|
|
441
|
+
*/
|
|
442
|
+
twist: int,
|
|
443
|
+
/**
|
|
444
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/altitudeAngle)
|
|
445
|
+
*/
|
|
446
|
+
altitudeAngle: float,
|
|
447
|
+
/**
|
|
448
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/azimuthAngle)
|
|
449
|
+
*/
|
|
450
|
+
azimuthAngle: float,
|
|
451
|
+
/**
|
|
452
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/pointerType)
|
|
453
|
+
*/
|
|
454
|
+
pointerType: string,
|
|
455
|
+
/**
|
|
456
|
+
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PointerEvent/isPrimary)
|
|
457
|
+
*/
|
|
458
|
+
isPrimary: bool,
|
|
459
|
+
}
|
|
460
|
+
|
|
299
461
|
type uiEventInit = {
|
|
300
462
|
...eventInit,
|
|
301
463
|
mutable view?: Null.t<window>,
|
|
@@ -371,3 +533,46 @@ type inputEventInit = {
|
|
|
371
533
|
mutable dataTransfer?: Null.t<dataTransfer>,
|
|
372
534
|
mutable targetRanges?: array<staticRange>,
|
|
373
535
|
}
|
|
536
|
+
|
|
537
|
+
type touchInit = {
|
|
538
|
+
mutable identifier: int,
|
|
539
|
+
mutable target: eventTarget,
|
|
540
|
+
mutable clientX?: float,
|
|
541
|
+
mutable clientY?: float,
|
|
542
|
+
mutable screenX?: float,
|
|
543
|
+
mutable screenY?: float,
|
|
544
|
+
mutable pageX?: float,
|
|
545
|
+
mutable pageY?: float,
|
|
546
|
+
mutable radiusX?: float,
|
|
547
|
+
mutable radiusY?: float,
|
|
548
|
+
mutable rotationAngle?: float,
|
|
549
|
+
mutable force?: float,
|
|
550
|
+
mutable altitudeAngle?: float,
|
|
551
|
+
mutable azimuthAngle?: float,
|
|
552
|
+
mutable touchType?: touchType,
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
type pointerEventInit = {
|
|
556
|
+
...mouseEventInit,
|
|
557
|
+
mutable pointerId?: int,
|
|
558
|
+
mutable width?: float,
|
|
559
|
+
mutable height?: float,
|
|
560
|
+
mutable pressure?: float,
|
|
561
|
+
mutable tangentialPressure?: float,
|
|
562
|
+
mutable tiltX?: int,
|
|
563
|
+
mutable tiltY?: int,
|
|
564
|
+
mutable twist?: int,
|
|
565
|
+
mutable altitudeAngle?: float,
|
|
566
|
+
mutable azimuthAngle?: float,
|
|
567
|
+
mutable pointerType?: string,
|
|
568
|
+
mutable isPrimary?: bool,
|
|
569
|
+
mutable coalescedEvents?: array<pointerEvent>,
|
|
570
|
+
mutable predictedEvents?: array<pointerEvent>,
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
type touchEventInit = {
|
|
574
|
+
...eventModifierInit,
|
|
575
|
+
mutable touches?: array<touch>,
|
|
576
|
+
mutable targetTouches?: array<touch>,
|
|
577
|
+
mutable changedTouches?: array<touch>,
|
|
578
|
+
}
|
|
@@ -5,11 +5,8 @@ open WebLocksAPI
|
|
|
5
5
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request)
|
|
6
6
|
*/
|
|
7
7
|
@send
|
|
8
|
-
external request: (
|
|
9
|
-
|
|
10
|
-
~name: string,
|
|
11
|
-
~callback: lockGrantedCallback,
|
|
12
|
-
) => promise<JSON.t> = "request"
|
|
8
|
+
external request: (lockManager, ~name: string, ~callback: lockGrantedCallback) => promise<JSON.t> =
|
|
9
|
+
"request"
|
|
13
10
|
|
|
14
11
|
/**
|
|
15
12
|
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/LockManager/request)
|