-
Notifications
You must be signed in to change notification settings - Fork 0
/
ServiceWorkerMessageEvent.cljs
152 lines (106 loc) · 5.24 KB
/
ServiceWorkerMessageEvent.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
(ns web.deprecated.ServiceWorkerMessageEvent
"The ServiceWorkerMessageEvent interface of the `ServiceWorker
contains information about an event sent to a `web.workers.ServiceWorkerContainer`
This extends the default message event to allow setting a `web.workers.ServiceWorker`
as the source of a message. The event object is accessed via
handler function of a message event, when fired by a message
from a service worker."
(:refer-clojure :exclude []))
(def constructor
"Constructor.
The ServiceWorkerMessageEvent() constructor creates a new `web.deprecated.ServiceWorkerMessageEvent` object instance.
type
A `web.dom.DOMString` that defines the type of the message event being created.
init Optional
An initialisation object, which should contain the following parameters:
data: The event's data — this can be any type.
origin: A `web.dom.DOMString` that defines the origin of the corresponding service worker's environment settings object.
lastEventId: A `web.dom.DOMString` that defines the last event ID of the event source.
source: The `web.workers.ServiceWorker` or `web.other.MessagePort` that sent the message.
ports: An array containing the `web.other.MessagePort` objects connected to the channel sending the message.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/ServiceWorkerMessageEvent`"
js/ServiceWorkerMessageEvent)
(defn data
"Property.
The data read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
returns the event's data. It can be any data type.
`var myData = ServiceWorkerMessageEventInstance.data;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/data`"
[this]
(-> this (.-data)))
(defn set-data!
"Property.
The data read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
returns the event's data. It can be any data type.
`var myData = ServiceWorkerMessageEventInstance.data;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/data`"
[this val]
(aset this "data" val))
(defn origin
"Property.
The origin read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
returns the origin of the service worker's environment settings
`var myOrigin = ServiceWorkerMessageEventInstance.origin;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/origin`"
[this]
(-> this (.-origin)))
(defn set-origin!
"Property.
The origin read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
returns the origin of the service worker's environment settings
`var myOrigin = ServiceWorkerMessageEventInstance.origin;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/origin`"
[this val]
(aset this "origin" val))
(defn last-event-id
"Property.
The lastEventID read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
represents, in server-sent events, the last event ID of the event
`var myLastEventId = ServiceWorkerMessageEventInstance.lastEventId;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/lastEventId`"
[this]
(-> this (.-lastEventId)))
(defn set-last-event-id!
"Property.
The lastEventID read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
represents, in server-sent events, the last event ID of the event
`var myLastEventId = ServiceWorkerMessageEventInstance.lastEventId;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/lastEventId`"
[this val]
(aset this "lastEventId" val))
(defn source
"Property.
The source read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
a reference to the `web.workers.ServiceWorker` object of the
service worker that sent the message.
`var mySource = ServiceWorkerMessageEventInstance.source;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/source`"
[this]
(-> this (.-source)))
(defn set-source!
"Property.
The source read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
a reference to the `web.workers.ServiceWorker` object of the
service worker that sent the message.
`var mySource = ServiceWorkerMessageEventInstance.source;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/source`"
[this val]
(aset this "source" val))
(defn ports
"Property.
The ports read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
returns an array of `web.other.MessagePort` objects connected
the message channel the message is being sent through.
`var myPorts = ServiceWorkerMessageEventInstance.ports;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/ports`"
[this]
(-> this (.-ports)))
(defn set-ports!
"Property.
The ports read-only property of the `web.deprecated.ServiceWorkerMessageEvent`
returns an array of `web.other.MessagePort` objects connected
the message channel the message is being sent through.
`var myPorts = ServiceWorkerMessageEventInstance.ports;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerMessageEvent/ports`"
[this val]
(aset this "ports" val))