Interface: SystemStatus
Defined in: types/desktop-engine.d.ts:4207
How the Mac is doing (DesktopEngine.systemStatus): processor, memory, network, power, temperature and disk, e.g. for a widget that shows them. Needs the "system-info" permission (and "apiVersion": 8); DesktopEngine.systemStatus is null without it. It never tells which apps run, which network the Mac is on, or any address.
The app takes a reading about once a second while the content reads the properties or listens to the events (but resume), and stops 2 seconds after the last read once nothing listens. Each property is a frozen object that's replaced by the next reading, so keep a reference to compare with the next one. Nothing comes while the content is suspended: the resume event says for how long it was.
Extends
Properties
bootTime
readonly bootTime: number;Defined in: types/desktop-engine.d.ts:4229
When the Mac started, ms since the epoch, to the minute
cpu
readonly cpu: Readonly<CPUStatus>;Defined in: types/desktop-engine.d.ts:4209
The processor
disk
readonly disk: Readonly<DiskStatus>;Defined in: types/desktop-engine.d.ts:4227
The startup disk
memory
readonly memory: Readonly<MemoryStatus>;Defined in: types/desktop-engine.d.ts:4211
Memory
network
readonly network: Readonly<NetworkStatus>;Defined in: types/desktop-engine.d.ts:4213
The network
onchange
onchange:
| EventHandler<SystemStatus, void>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4231
change callback
onmemorypressurechange
onmemorypressurechange:
| EventHandler<SystemStatus, void>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4247
memorypressurechange callback
onnetworkchange
onnetworkchange:
| EventHandler<SystemStatus, void>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4243
networkchange callback
onpowerchange
onpowerchange:
| EventHandler<SystemStatus, void>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4235
powerchange callback
onresume
onresume:
| EventHandler<SystemStatus, SystemResumePayload>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4251
resume callback
onthermalchange
onthermalchange:
| EventHandler<SystemStatus, void>
| null
| undefined;Defined in: types/desktop-engine.d.ts:4239
thermalchange callback
power
readonly power: Readonly<PowerStatus>;Defined in: types/desktop-engine.d.ts:4215
Power and the battery
temperature
readonly temperature: number | null;Defined in: types/desktop-engine.d.ts:4225
The processor's temperature in °C, the average of its cores' sensors; null when the Mac doesn't let the app read it. It moves with the work the Mac does; thermal tells when the heat slows the Mac down
thermal
readonly thermal: ThermalState;Defined in: types/desktop-engine.d.ts:4220
How hard the Mac is working to stay cool, as macOS tells it: it goes up when the Mac has to slow down to cool itself. It isn't a temperature: a Mac can run hot and still be nominal
Methods
addEventListener()
addEventListener<K>(type, listener): void;Defined in: types/desktop-engine.d.ts:143
Adds an event listener; type may be given with or without the on prefix
Type Parameters
| Type Parameter |
|---|
K extends | "change" | "powerchange" | "thermalchange" | "networkchange" | "memorypressurechange" | "resume" |
Parameters
| Parameter | Type |
|---|---|
type | K | `on${K}` |
listener | EventHandler<SystemStatus, SystemStatusEventMap[K]> |
Returns
void
Inherited from
EventedObject.addEventListener
destroy()
destroy(): void;Defined in: types/desktop-engine.d.ts:147
Clears all event listeners and on callbacks so the object can be garbage-collected; components also process their children recursively
Returns
void
Inherited from
offchange()
offchange(): void;Defined in: types/desktop-engine.d.ts:4233
Removes the onchange callback
Returns
void
offmemorypressurechange()
offmemorypressurechange(): void;Defined in: types/desktop-engine.d.ts:4249
Removes the onmemorypressurechange callback
Returns
void
offnetworkchange()
offnetworkchange(): void;Defined in: types/desktop-engine.d.ts:4245
Removes the onnetworkchange callback
Returns
void
offpowerchange()
offpowerchange(): void;Defined in: types/desktop-engine.d.ts:4237
Removes the onpowerchange callback
Returns
void
offresume()
offresume(): void;Defined in: types/desktop-engine.d.ts:4253
Removes the onresume callback
Returns
void
offthermalchange()
offthermalchange(): void;Defined in: types/desktop-engine.d.ts:4241
Removes the onthermalchange callback
Returns
void
removeEventListener()
removeEventListener<K>(type, listener): void;Defined in: types/desktop-engine.d.ts:145
Removes the given event listener
Type Parameters
| Type Parameter |
|---|
K extends | "change" | "powerchange" | "thermalchange" | "networkchange" | "memorypressurechange" | "resume" |
Parameters
| Parameter | Type |
|---|---|
type | K | `on${K}` |
listener | EventHandler<SystemStatus, SystemStatusEventMap[K]> |
Returns
void
