-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathPushManagerAPI.res
More file actions
67 lines (59 loc) · 1.94 KB
/
Copy pathPushManagerAPI.res
File metadata and controls
67 lines (59 loc) · 1.94 KB
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
@@warning("-30")
open Prelude
type permissionState =
| @as("denied") Denied
| @as("granted") Granted
| @as("prompt") Prompt
type pushEncryptionKeyName =
| @as("auth") Auth
| @as("p256dh") P256dh
/**
This Push API interface provides a way to receive notifications from third-party servers as well as request URLs for push notifications.
[See PushManager on MDN](https://developer.mozilla.org/docs/Web/API/PushManager)
*/
type pushManager = {
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushManager/supportedContentEncodings_static)
*/
supportedContentEncodings: array<string>,
}
/**
[See PushSubscriptionOptions on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions)
*/
type pushSubscriptionOptions = {
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/userVisibleOnly)
*/
userVisibleOnly: bool,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscriptionOptions/applicationServerKey)
*/
applicationServerKey: Null.t<ArrayBuffer.t>,
}
/**
This Push API interface provides a subcription's URL endpoint and allows unsubscription from a push service.
[See PushSubscription on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription)
*/
type pushSubscription = {
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/endpoint)
*/
endpoint: string,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/expirationTime)
*/
expirationTime: Null.t<int>,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/PushSubscription/options)
*/
options: pushSubscriptionOptions,
}
type pushSubscriptionOptionsInit = {
mutable userVisibleOnly?: bool,
mutable applicationServerKey?: Null.t<unknown>,
}
type pushSubscriptionJSON = {
mutable endpoint?: string,
mutable expirationTime?: Null.t<int>,
mutable keys?: any,
}