Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@danyalwe/capacitor-battery

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@danyalwe/capacitor-battery

Capacitor plugin to get access to every info about the device battery

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

@danyalwe/capacitor-battery

Capacitor plugin to get access to every info about the device battery

Install

npm install @danyalwe/capacitor-battery
npx cap sync

Todos

  • Improve documentation, add JSDoc strings
  • Add support for iOS

Supported methods

NameAndroidiOSWeb
start
stop
addListener
removeAllListeners

Supported properties

PropertyAndroidiOSWeb
currentCapacity
totalCapacity
realPercentage
technology
temperature
voltage
amperage
wattage
health
status
chargeMode
level
hasBattery
isCharging
chargingTime
dischargingTime

API

  • start()
  • stop()
  • addListener('batteryChange', ...)
  • removeAllListeners()
  • Interfaces
  • Enums

start()

start() => Promise<Battery | undefined>

Returns: Promise<Battery>


stop()

stop() => Promise<void>

addListener('batteryChange', ...)

addListener(eventName: 'batteryChange', listenerFunc: (event: Battery) => void) => Promise<PluginListenerHandle>
ParamType
eventName'batteryChange'
listenerFunc(event: Battery) => void

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Interfaces

Battery
PropType
levelnumber
hasBatteryboolean
isChargingboolean
chargingTimenumber
dischargingTimenumber
currentCapacitynumber
totalCapacitynumber
realPercentagenumber
technologystring
temperaturenumber
voltagenumber
amperagenumber
wattagenumber
healthBatteryHealth
statusBatteryStatus
chargeModeBatteryChargeMode
PluginListenerHandle
PropType
remove() => Promise<void>

Enums

BatteryHealth
Members
UNKNOWN
COLD
DEAD
GOOD
OVERHEAT
OVER_VOLTAGE
FAILURE
BatteryStatus
Members
UNKNOWN
NOT_CHARGING
DISCHARGING
CHARGING
FULL
BatteryChargeMode
Members
UNKNOWN
AC
USB
DOCK
WIRELESS

Keywords

FAQs

Package last updated on 05 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc