angular-toolbox 0.10.0 → 0.10.1

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.
@@ -0,0 +1,56 @@
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 `BatteryManager` interface of the Battery Status API provides information about
10
+ * the system battery charge level. The `navigator.getBattery()` method returns a promise
11
+ * that resolves with a `BatteryManager` interface.
12
+ */
13
+ export interface BatteryManager extends EventTarget {
14
+ /**
15
+ * A boolean value indicating whether the battery is currently being charged.
16
+ */
17
+ readonly charging: boolean;
18
+ /**
19
+ * A number representing the remaining time in seconds until the battery is fully charged,
20
+ * or 0 if the battery is already fully charged.
21
+ */
22
+ readonly chargingTime: number;
23
+ /**
24
+ * A number representing the remaining time in seconds until the battery
25
+ * is completely discharged and the system suspends.
26
+ */
27
+ readonly dischargingTime: number;
28
+ /**
29
+ * A number representing the system's battery charge level scaled to a value between 0.0 and 1.0.
30
+ */
31
+ readonly level: number;
32
+ /**
33
+ * Fired when the battery charging state (the `charging` property) is updated.
34
+ *
35
+ * @param event A generic `Event`.
36
+ */
37
+ onlevelchange(event: Event): void;
38
+ /**
39
+ * Fired when the battery charging time (the `chargingTime` property) is updated.
40
+ *
41
+ * @param event A generic `Event`.
42
+ */
43
+ onchargingchange(event: Event): void;
44
+ /**
45
+ * Fired when the battery discharging time (the `dischargingTime` property) is updated.
46
+ *
47
+ * @param event A generic `Event`.
48
+ */
49
+ chargingtimechange(event: Event): void;
50
+ /**
51
+ * Fired when the battery level (the `level` property) is updated.
52
+ *
53
+ * @param event A generic `Event`.
54
+ */
55
+ dischargingtimechange(event: Event): void;
56
+ }
@@ -6,6 +6,6 @@
6
6
  * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
7
  */
8
8
  /**
9
- * The type of connection as defined by the `NetworkInformation.type`property.
9
+ * The type of connection as defined by the `NetworkInformation.type` property.
10
10
  */
11
11
  export type ConnectionType = 'bluetooth' | 'cellular' | 'ethernet' | 'mixed' | 'none' | 'other' | 'unknown' | 'wifi' | 'wimax';
@@ -6,6 +6,6 @@
6
6
  * the LICENSE file at https://pascalechemann.com/angular-toolbox/resources/license
7
7
  */
8
8
  /**
9
- * The effective type of connection as defined by the `NetworkInformation.effectiveType`property.
9
+ * The effective type of connection as defined by the `NetworkInformation.effectiveType` property.
10
10
  */
11
11
  export type EffectiveConnectionType = '2g' | '3g' | '4g' | 'slow-2g';
@@ -1,3 +1,4 @@
1
1
  export * from './connection-type';
2
2
  export * from './effective-connection-type';
3
3
  export * from './network-information';
4
+ export * from './battery-manager';
@@ -21,6 +21,11 @@ export interface NetworkInformation extends EventTarget {
21
21
  * rounded to the nearest multiple of 25 kilobits per seconds.
22
22
  */
23
23
  readonly downlink: number;
24
+ /**
25
+ * Returns the maximum downlink speed, in megabits per second (Mbps),
26
+ * for the underlying connection technology.
27
+ */
28
+ readonly downlinkMax: number;
24
29
  /**
25
30
  * Returns the effective type of the connection meaning one of the `EffectiveConnectionType` enum.
26
31
  * This value is determined using a combination of recently observed round-trip time and downlink values.
@@ -28,7 +33,7 @@ export interface NetworkInformation extends EventTarget {
28
33
  readonly effectiveType: EffectiveConnectionType;
29
34
  /**
30
35
  * Returns the type of connection a device is using to communicate with the network.
31
- * It will be one of the `ConnectionType` enum
36
+ * It will be one of the `ConnectionType` enum.
32
37
  */
33
38
  readonly type: ConnectionType;
34
39
  /**
@@ -37,7 +42,7 @@ export interface NetworkInformation extends EventTarget {
37
42
  */
38
43
  readonly rtt: number;
39
44
  /**
40
- * Returns `true` iwhether the user has set a reduced data usage option on the user agent.
45
+ * Returns `true` whether the user has set a reduced data usage option on the user agent.
41
46
  * `false` otherwise.
42
47
  */
43
48
  readonly saveData: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angular-toolbox",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^18.0.0",