Skip to main content

Battery store

Battery values

level0Battery level
chargingfalseBattery charging status
chargingTime0Battery charging time
dischargingTime0Battery discharging time

Battery actions

Battery events

Event nameArgumentDescription
onChangeElementCalled when the battery state change
onMountElementCalled when the component is mounted
onCleannullCalled when the component is removed

Battery state

export interface BatteryState {
snapshot: [BatteryState]
target: any
level: number // 0 ~ 1
charging: boolean
chargingTime: number // 3180
dischargingTime: number // Infinity
callback(): void
onChange(): void
onMount(): void
onClean(): void