UNPKG

@sv-use/core

Version:

A collection of Svelte 5 utilities.

27 lines (26 loc) 1.14 kB
import { type ConfigurableDocument, type ConfigurableNavigator } from '../__internal__/configurable.js'; import type { AutoCleanup, CleanupFunction } from '../__internal__/types.js'; type WakeLockType = 'screen'; interface WakeLockSentinel extends EventTarget { type: WakeLockType; released: boolean; release: () => Promise<void>; } interface HandleWakeLockOptions extends ConfigurableNavigator, ConfigurableDocument, AutoCleanup { } type HandleWakeLockReturn = { readonly isSupported: boolean | undefined; readonly isActive: boolean; sentinel: WakeLockSentinel | null; request: (type: WakeLockType) => Promise<void>; forceRequest: (type: WakeLockType) => Promise<void>; release: () => Promise<void>; cleanup: CleanupFunction; }; /** * Provides a way to prevent devices from dimming or locking the screen when an application needs to keep running. * @param options Additional options to customize the behavior. * @see https://svelte-librarian.github.io/sv-use/docs/core/create-vibration */ export declare function handleWakeLock(options?: HandleWakeLockOptions): HandleWakeLockReturn; export {};