メインコンテンツまでスキップ

Battery store

Battery values​

PropertydefaultDescription
level0Battery level
chargingfalseBattery charging status
chargingTime0Battery charging time
dischargingTime0Battery discharging time

Battery actions​

Battery events​

Event nameArgumentDescription
changeElementCalled when the battery state change
mountElementCalled when the component is mounted
cleannullCalled 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
change(): void
mount(): void
clean(): void
}