angular-toolbox 0.9.5 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -6
- package/esm2022/lib/model/business/index.mjs +2 -1
- package/esm2022/lib/model/business/navigator/connection-type.mjs +9 -0
- package/esm2022/lib/model/business/navigator/effective-connection-type.mjs +9 -0
- package/esm2022/lib/model/business/navigator/index.mjs +4 -0
- package/esm2022/lib/model/business/navigator/network-information.mjs +9 -0
- package/esm2022/lib/model/service/version/angular-toolbox-version.service.mjs +4 -4
- package/fesm2022/angular-toolbox.mjs +27 -3
- package/fesm2022/angular-toolbox.mjs.map +1 -1
- package/lib/model/business/index.d.ts +1 -0
- package/lib/model/business/navigator/connection-type.d.ts +11 -0
- package/lib/model/business/navigator/effective-connection-type.d.ts +11 -0
- package/lib/model/business/navigator/index.d.ts +3 -0
- package/lib/model/business/navigator/network-information.d.ts +48 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
6
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The type of connection as defined by the `NetworkInformation.type`property.
|
|
10
|
+
*/
|
|
11
|
+
export type ConnectionType = 'bluetooth' | 'cellular' | 'ethernet' | 'mixed' | 'none' | 'other' | 'unknown' | 'wifi' | 'wimax';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
6
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The effective type of connection as defined by the `NetworkInformation.effectiveType`property.
|
|
10
|
+
*/
|
|
11
|
+
export type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Pascal ECHEMANN. All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be found in
|
|
6
|
+
* the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
|
|
7
|
+
*/
|
|
8
|
+
import { ConnectionType } from "./connection-type";
|
|
9
|
+
import { EffectiveConnectionType } from "./effective-connection-type";
|
|
10
|
+
/**
|
|
11
|
+
* The `NetworkInformation` interface of the Network Information API provides
|
|
12
|
+
* information about the connection a device is using to communicate with the network
|
|
13
|
+
* and provides a means for scripts to be notified if the connection type changes.
|
|
14
|
+
* The `NetworkInformation` interface cannot be instantiated. It is instead accessed
|
|
15
|
+
* through the connection property of the `Navigator` interface or the `WorkerNavigator`
|
|
16
|
+
* interface.
|
|
17
|
+
*/
|
|
18
|
+
export interface NetworkInformation extends EventTarget {
|
|
19
|
+
/**
|
|
20
|
+
* Returns the effective bandwidth estimate in megabits per second,
|
|
21
|
+
* rounded to the nearest multiple of 25 kilobits per seconds.
|
|
22
|
+
*/
|
|
23
|
+
readonly downlink: number;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the effective type of the connection meaning one of the `EffectiveConnectionType` enum.
|
|
26
|
+
* This value is determined using a combination of recently observed round-trip time and downlink values.
|
|
27
|
+
*/
|
|
28
|
+
readonly effectiveType: EffectiveConnectionType;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the type of connection a device is using to communicate with the network.
|
|
31
|
+
* It will be one of the `ConnectionType` enum
|
|
32
|
+
*/
|
|
33
|
+
readonly type: ConnectionType;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the estimated effective round-trip time of the current connection,
|
|
36
|
+
* rounded to the nearest multiple of 25 milliseconds.
|
|
37
|
+
*/
|
|
38
|
+
readonly rtt: number;
|
|
39
|
+
/**
|
|
40
|
+
* Returns `true` iwhether the user has set a reduced data usage option on the user agent.
|
|
41
|
+
* `false` otherwise.
|
|
42
|
+
*/
|
|
43
|
+
readonly saveData: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* The event that's fired when connection information changes.
|
|
46
|
+
*/
|
|
47
|
+
onchange: EventListener;
|
|
48
|
+
}
|