kvision / pl.treksoft.kvision.cordova / Battery

Battery

object Battery

Main object for Cordova battery.

Types

BatteryEvent

enum class BatteryEvent

Battery status event types.

Functions

addStatusListener

fun addStatusListener(event: Battery.BatteryEvent, listener: (BatteryStatus) -> Unit): Unit

Add listeners for battery status Cordova events.

getStatus

suspend fun getStatus(): BatteryStatus

Get battery status.

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.