Skip to content

ElectronPowerMonitor.on('on-ac') method

ElectronPowerMonitor › on(‘on-ac’)

Unofficial

Emitted when the system changes to AC power.

Signature:

on(event: "on-ac", listener: () => void): this

Parameters:

ParameterTypeDescription
event"on-ac"The event name.
listener() => voidCallback invoked when the event is emitted.

Returns: thisThis PowerMonitor instance. Platform: darwin,win32.