summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/interfaces/netinfo.idl
blob: ac5265dbebcac2851e047088d5ffc8f7ab256965 (plain)
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
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into webref
// (https://github.com/w3c/webref)
// Source: Network Information API (https://wicg.github.io/netinfo/)

enum ConnectionType {
  "bluetooth",
  "cellular",
  "ethernet",
  "mixed",
  "none",
  "other",
  "unknown",
  "wifi",
  "wimax"
};

enum EffectiveConnectionType {
  "2g",
  "3g",
  "4g",
  "slow-2g"
};

interface mixin NavigatorNetworkInformation {
  [SameObject] readonly attribute NetworkInformation connection;
};

Navigator includes NavigatorNetworkInformation;
WorkerNavigator includes NavigatorNetworkInformation;

[Exposed=(Window,Worker)]
interface NetworkInformation : EventTarget {
  readonly attribute ConnectionType type;
  readonly attribute EffectiveConnectionType effectiveType;
  readonly attribute Megabit downlinkMax;
  readonly attribute Megabit downlink;
  readonly attribute Millisecond rtt;
  attribute EventHandler onchange;
};

typedef unrestricted double Megabit;
typedef unsigned long long Millisecond;