Chartbreaker
    Preparing search index...

    Interface WakeLockSentinel

    The WakeLockSentinel interface of the Screen Wake Lock API can be used to monitor the status of the platform screen wake lock, and manually release the lock when needed. Available only in secure contexts.

    MDN Reference

    interface WakeLockSentinel {
        onrelease: ((this: WakeLockSentinel, ev: Event) => any) | null;
        released: boolean;
        type: "screen";
        addEventListener<K extends "release">(
            type: K,
            listener: (this: WakeLockSentinel, ev: WakeLockSentinelEventMap[K]) => any,
            options?: boolean | AddEventListenerOptions,
        ): void;
        addEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | AddEventListenerOptions,
        ): void;
        dispatchEvent(event: Event): boolean;
        release(): Promise<void>;
        removeEventListener<K extends "release">(
            type: K,
            listener: (this: WakeLockSentinel, ev: WakeLockSentinelEventMap[K]) => any,
            options?: boolean | EventListenerOptions,
        ): void;
        removeEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject,
            options?: boolean | EventListenerOptions,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    onrelease: ((this: WakeLockSentinel, ev: Event) => any) | null
    released: boolean

    The released read-only property of the WakeLockSentinel interface returns a boolean that indicates whether a WakeLockSentinel has been released.

    MDN Reference

    type: "screen"

    The type read-only property of the WakeLockSentinel interface returns a string representation of the currently acquired WakeLockSentinel type.

    MDN Reference

    Methods

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().

      MDN Reference

      Parameters

      Returns boolean

    • The release() method of the WakeLockSentinel interface releases the WakeLockSentinel, returning a Promise that is resolved once the sentinel has been successfully released.

      MDN Reference

      Returns Promise<void>

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Type Parameters

      • K extends "release"

      Parameters

      Returns void

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.

      MDN Reference

      Parameters

      Returns void