Skip to content

ElectronPowerSaveBlocker

Unofficial

Electron powerSaveBlocker module for blocking the system from entering low-power (sleep) mode.

Import:

import type { ElectronPowerSaveBlocker } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface ElectronPowerSaveBlocker

Methods

MethodReturnsDescription
isStarted(id)booleanWhether the corresponding powerSaveBlocker has started.
start(type)numberStarts preventing the system from entering lower-power mode. Returns an integer identifying the power save blocker.

prevent-display-sleep has higher precedence over prevent-app-suspension. Only the highest precedence type takes effect. In other words, prevent-display-sleep always takes precedence over prevent-app-suspension.
stop(id)voidStops the specified power save blocker.

Links to this page: