PowerMonitor

external interface PowerMonitor : EventEmitter(source)

Properties

Link copied to clipboard
abstract external val lockScreenEvent: EventInstance<Tuple>
Link copied to clipboard
abstract external val onAcEvent: EventInstance<Tuple>
Link copied to clipboard
abstract external val onBatteryEvent: EventInstance<Tuple>
Link copied to clipboard
abstract external var onBatteryPower: Boolean

A boolean property. True if the system is on battery power.

Link copied to clipboard
abstract external val resumeEvent: EventInstance<Tuple>
Link copied to clipboard
abstract external val shutdownEvent: EventInstance<Tuple>
Link copied to clipboard
abstract external val suspendEvent: EventInstance<Tuple>
Link copied to clipboard
abstract external val unlockScreenEvent: EventInstance<Tuple>
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
external fun addListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun emit(type: EventType, vararg args: Any?): Boolean
Link copied to clipboard
Link copied to clipboard

The system's current thermal state. Can be unknown, nominal, fair, serious, or critical.

Link copied to clipboard
external fun getMaxListeners(): Double
Link copied to clipboard
abstract external fun getSystemIdleState(idleThreshold: Double): PowerMonitorGetSystemIdleStateResult

The system's current idle state. Can be active, idle, locked or unknown.

Link copied to clipboard
abstract external fun getSystemIdleTime(): Double

Idle time in seconds

Link copied to clipboard
abstract external fun isOnBatteryPower(): Boolean

Whether the system is on battery power.

Link copied to clipboard
external fun listenerCount(type: EventType, listener: EventListener): Double
Link copied to clipboard
Link copied to clipboard
external fun off(type: EventType, listener: EventListener)
Link copied to clipboard
external fun on(type: EventType, listener: EventListener)
Link copied to clipboard
external fun once(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun prependOnceListener(type: EventType, listener: EventListener)
Link copied to clipboard
Link copied to clipboard
external fun removeAllListeners(type: EventType)
Link copied to clipboard
external fun removeListener(type: EventType, listener: EventListener)
Link copied to clipboard
external fun setMaxListeners(n: Number)