-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b143842
commit 421d6db
Showing
26 changed files
with
647 additions
and
605 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/client-api/src/providers/battery/battery-provider-types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { Provider } from '../create-base-provider'; | ||
|
||
export interface BatteryProviderConfig { | ||
type: 'battery'; | ||
|
||
/** | ||
* How often this provider refreshes in milliseconds. | ||
*/ | ||
refreshInterval?: number; | ||
} | ||
|
||
export type BatteryProvider = Provider< | ||
BatteryProviderConfig, | ||
BatteryOutput | ||
>; | ||
|
||
export interface BatteryOutput { | ||
chargePercent: number; | ||
cycleCount: number; | ||
healthPercent: number; | ||
powerConsumption: number; | ||
state: 'discharging' | 'charging' | 'full' | 'empty' | 'unknown'; | ||
isCharging: boolean; | ||
timeTillEmpty: number | null; | ||
timeTillFull: number | null; | ||
voltage: number | null; | ||
} |
36 changes: 6 additions & 30 deletions
36
packages/client-api/src/providers/battery/create-battery-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/client-api/src/providers/cpu/cpu-provider-types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Provider } from '../create-base-provider'; | ||
|
||
export interface CpuProviderConfig { | ||
type: 'cpu'; | ||
|
||
/** | ||
* How often this provider refreshes in milliseconds. | ||
*/ | ||
refreshInterval?: number; | ||
} | ||
|
||
export type CpuProvider = Provider<CpuProviderConfig, CpuOutput>; | ||
|
||
export interface CpuOutput { | ||
frequency: number; | ||
usage: number; | ||
logicalCoreCount: number; | ||
physicalCoreCount: number; | ||
vendor: string; | ||
} |
29 changes: 6 additions & 23 deletions
29
packages/client-api/src/providers/cpu/create-cpu-provider.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.