Skip to content

Interface: BatteryStatus ​

Defined in: types/desktop-engine.d.ts:4159

The battery, in PowerStatus.battery

Properties ​

charging ​

ts
readonly charging: boolean;

Defined in: types/desktop-engine.d.ts:4163

Whether it's charging now


full ​

ts
readonly full: boolean;

Defined in: types/desktop-engine.d.ts:4165

Whether it's full (or macOS holds it below full to keep it healthy) while plugged in


level ​

ts
readonly level: number;

Defined in: types/desktop-engine.d.ts:4161

How full, 0...1


timeToEmpty ​

ts
readonly timeToEmpty: number | null;

Defined in: types/desktop-engine.d.ts:4167

Minutes until empty on battery; null while plugged in and while macOS is still estimating, which takes a minute or two after unplugging


timeToFull ​

ts
readonly timeToFull: number | null;

Defined in: types/desktop-engine.d.ts:4169

Minutes until full while charging; null otherwise and while macOS is still estimating

The SDK is released under the Apache License 2.0