This page was translated from English by the community. Learn more and join the MDN Web Docs community.
BatteryManager
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Want more browser support for this feature? Tell us why.
BatteryManager 인터페이스는 시스템의 배터리 충전 상태에 대한 정보를 확인 하는 방법을 제공합니다.
navigator.battery 프로퍼티는 Battery Status API와 상호작용 할 수 있는 BatteryManager 인터페이스의 인스턴스를 반환합니다.
속성
BatteryManager.charging읽기 전용-
배터리가 현재 충전 중인지 여부를 Boolean 값으로 나타냅니다.
BatteryManager.chargingTime읽기 전용-
배터리가 완전히 충전되기 까지 남은 시간을 초로 표현합니다. 0 이면 이미 배터리의 충전이 완료 된 상황 입니다.
BatteryManager.dischargingTime읽기 전용-
배터리가 완전히 방전되고 시스템이 중지 될 때까지의 남은 시간을 초로 표현 합니다.
BatteryManager.level읽기 전용-
배터리의 충전 상태를 0.0 에서 1.0 사이의 값으로 표현 합니다.
이벤트
chargingchange-
charging이벤트의 핸들러 입니다. 이 이벤트는 배터리 충전 상태가 변경될 때 발생합니다. chargingtimechange-
chargingTime이벤트의 핸들러 입니다. 이 이벤트는 배터리 충전 시간이 변경될 때 발생합니다. dischargingtimechange-
dischargingTime이벤트의 핸들러 입니다. 이 이벤트는 배터리 방전 시간이 변경될 때 발생합니다. levelchange-
level이벤트의 핸들러 입니다. 이 이벤트는 배터리 수준 상태가 변경 될 때 발생합니다.
메서드
EventTarget 으로 부터 상속을 받습니다.
명세
| Specification |
|---|
| Battery Status API> # the-batterymanager-interface> |
