-
Notifications
You must be signed in to change notification settings - Fork 0
/
Client.cljs
120 lines (83 loc) · 3.42 KB
/
Client.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
(ns web.service-workers.Client
"The Client interface represents an executable context such as
`web.workers.Worker`, or a `web.workers.SharedWorker`. `web.Window`
are represented by the more-specific `web.service-workers.WindowClient`.
can get Client/WindowClient objects from methods such as `Clients.matchAll()`
`Clients.get()`."
(:refer-clojure :exclude [type]))
(defn post-message
"Method.
The postMessage() method of `web.service-workers.Client` allows
service worker to send a message to a client (a `web.Window`,
or `web.workers.SharedWorker`). The message is received in the
event on `navigator.serviceWorker`.
`Client.postMessage(message[, transfer]);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/postMessage`"
[this & args]
(-> this .-postMessage (.apply this (clj->js args))))
(defn id
"Property.
The id read-only property of the `web.service-workers.Client`
returns the universally unique identifier of the `web.service-workers.Client`
`var clientId = Client.id;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/id`"
[this]
(-> this (.-id)))
(defn set-id!
"Property.
The id read-only property of the `web.service-workers.Client`
returns the universally unique identifier of the `web.service-workers.Client`
`var clientId = Client.id;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/id`"
[this val]
(aset this "id" val))
(defn type
"Property.
The type read-only property of the `web.service-workers.Client`
indicates the type of client the service worker is controlling.
`var myClientType = Client.type;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/type`"
[this]
(-> this (.-type)))
(defn set-type!
"Property.
The type read-only property of the `web.service-workers.Client`
indicates the type of client the service worker is controlling.
`var myClientType = Client.type;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/type`"
[this val]
(aset this "type" val))
(defn url
"Property.
The url read-only property of the `web.service-workers.Client`
returns the URL of the current service worker client.
`var clientUrl = Client.url;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/url`"
[this]
(-> this (.-url)))
(defn set-url!
"Property.
The url read-only property of the `web.service-workers.Client`
returns the URL of the current service worker client.
`var clientUrl = Client.url;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/url`"
[this val]
(aset this "url" val))
(defn frame-type
"Property.
The frameType read-only property of the `web.service-workers.Client`
indicates the type of browsing context of the current `web.service-workers.Client`.
value can be one of auxiliary, top-level, nested, or none.
`var myFrameType = Client.frameType;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/frameType`"
[this]
(-> this (.-frameType)))
(defn set-frame-type!
"Property.
The frameType read-only property of the `web.service-workers.Client`
indicates the type of browsing context of the current `web.service-workers.Client`.
value can be one of auxiliary, top-level, nested, or none.
`var myFrameType = Client.frameType;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Client/frameType`"
[this val]
(aset this "frameType" val))