-
Notifications
You must be signed in to change notification settings - Fork 0
/
PushMessageData.cljs
54 lines (37 loc) · 1.45 KB
/
PushMessageData.cljs
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
(ns web.service-workers.PushMessageData
"The PushMessageData interface of the Push API provides methods
let you retrieve the push data sent by a server in various formats."
(:refer-clojure :exclude []))
(defn array-buffer
"Method.
The arrayBuffer()method of the `web.service-workers.PushMessageData`
extracts push message data as an `js.ArrayBuffer` object.
`var myArrayBuffer = PushEvent.data.arrayBuffer();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/PushMessageData/arrayBuffer`"
[this ]
(-> this (.arrayBuffer)))
(defn blob
"Method.
The blob()method of the `web.service-workers.PushMessageData`
extracts push message data as a `web.files.Blob` object.
`var myBlob = PushEvent.data.blob();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/PushMessageData/blob`"
[this ]
(-> this (.blob)))
(defn json
"Method.
The json()method of the `web.service-workers.PushMessageData`
extracts push message data by parsing it as a JSON string and
the result.
`var myData = PushEvent.data.json();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/PushMessageData/json`"
[this ]
(-> this (.json)))
(defn text
"Method.
The text()method of the `web.service-workers.PushMessageData`
extracts push message data as a plain text string.
`var myText = PushEvent.data.text();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/PushMessageData/text`"
[this ]
(-> this (.text)))