-
Notifications
You must be signed in to change notification settings - Fork 0
/
NetworkInformation.cljs
147 lines (108 loc) · 4.45 KB
/
NetworkInformation.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
(ns web.other.NetworkInformation
"The NetworkInformation interface provides information about the
a device is using to communicate with the network and provides
means for scripts to be notified if the connection type changes.
NetworkInformation interfaces cannot be instantiated. It is instead
through the connection property of the `web.performance.Navigator`"
(:refer-clojure :exclude [type]))
(defn true
"Property.
NetworkInformation.type Read only"
[this]
(-> this (.-true)))
(defn set-true!
"Property.
NetworkInformation.type Read only"
[this val]
(aset this "true" val))
(defn bluetooth
"Property."
[this]
(-> this (.-bluetooth)))
(defn set-bluetooth!
"Property."
[this val]
(aset this "bluetooth" val))
(defn onchange
"Property.
The NetworkInformation.onchange event handler contains the code
is fired when connection information changes, and the change
received by the `web.other.NetworkInformation` object.
`netInfo.onchange = function() { ... }`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/onchange`"
[this]
(-> this (.-onchange)))
(defn set-onchange!
"Property.
The NetworkInformation.onchange event handler contains the code
is fired when connection information changes, and the change
received by the `web.other.NetworkInformation` object.
`netInfo.onchange = function() { ... }`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/onchange`"
[this val]
(aset this "onchange" val))
(defn downlink
"Property.
The downlink read-only property of the `web.other.NetworkInformation`
returns the effective bandwidth estimate in megabits per second,
to the nearest multiple of 25 kilobits per seconds. This value
based on recently observed application layer throughput across
active connections, excluding connections made to a private address
In the absence of recent bandwidth measurement data, the attribute
is determined by the properties of the underlying connection
`var downLink = NetworkInformation.downlink`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/downlink`"
[this]
(-> this (.-downlink)))
(defn set-downlink!
"Property.
The downlink read-only property of the `web.other.NetworkInformation`
returns the effective bandwidth estimate in megabits per second,
to the nearest multiple of 25 kilobits per seconds. This value
based on recently observed application layer throughput across
active connections, excluding connections made to a private address
In the absence of recent bandwidth measurement data, the attribute
is determined by the properties of the underlying connection
`var downLink = NetworkInformation.downlink`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/downlink`"
[this val]
(aset this "downlink" val))
(defn downlink-max
"Property.
The NetworkInformation.downlinkMax read-only property returns
maximum downlink speed, in megabits per second (Mbps), for the
connection technology.
`var max = NetworkInformation.downlinkMax`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/downlinkMax`"
[this]
(-> this (.-downlinkMax)))
(defn rtt
"Property.
The NetworkInformation.rtt read-only property returns the estimated
round-trip time of the current connection, rounded to the nearest
of 25 milliseconds. This value is based on recently observed
RTT measurements across recently active connections. It excludes
made to a private address space. If no recent measurement data
available, the value is based on the properties of the underlying
technology.
`rtt = NetworkInformation.rtt`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/rtt`"
[this]
(-> this (.-rtt)))
(defn save-data
"Property.
The NetworkInformation.saveData read-only property of the `web.other.NetworkInformation`
returns true if the user has set a reduced data usage option
the user agent.
`var saveData = NetworkInformation.saveData;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/saveData`"
[this]
(-> this (.-saveData)))
(defn type
"Property.
The NetworkInformation.type read-only property returns the type
connection a device is using to communicate with the network.
`var type = netInfo.type`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/type`"
[this]
(-> this (.-type)))