New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@capacitor-community/keep-awake

Package Overview
Dependencies
Maintainers
31
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capacitor-community/keep-awake - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

7

CHANGELOG.md

@@ -5,2 +5,9 @@ # Changelog

## [2.1.0](https://github.com/capacitor-community/keep-awake/compare/v2.0.0...v2.1.0) (2021-04-24)
### Features
* add `web` support ([#14](https://github.com/capacitor-community/keep-awake/issues/14)) ([0924bff](https://github.com/capacitor-community/keep-awake/commit/0924bffec8cff2f99deb8856280309fa3ccb443a))
## [2.0.0](https://github.com/capacitor-community/keep-awake/compare/v1.0.0...v2.0.0) (2021-04-10)

@@ -7,0 +14,0 @@

4

dist/docs.json

@@ -14,3 +14,3 @@ {

"tags": [],
"docs": "Prevent the device from dimming the screen.\r\n\r\nOnly available for Android and iOS.",
"docs": "Prevent the device from dimming the screen.",
"complexTypes": [],

@@ -25,3 +25,3 @@ "slug": "keepawake"

"tags": [],
"docs": "Allow the device to dim the screen.\r\n\r\nOnly available for Android and iOS.",
"docs": "Allow the device to dim the screen.",
"complexTypes": [],

@@ -28,0 +28,0 @@ "slug": "allowsleep"

export interface KeepAwakePlugin {
/**
* Prevent the device from dimming the screen.
*
* Only available for Android and iOS.
*/

@@ -10,6 +8,4 @@ keepAwake(): Promise<void>;

* Allow the device to dim the screen.
*
* Only available for Android and iOS.
*/
allowSleep(): Promise<void>;
}
import { WebPlugin } from '@capacitor/core';
import type { KeepAwakePlugin } from './definitions';
export declare class KeepAwakeWeb extends WebPlugin implements KeepAwakePlugin {
private wakeLock;
private readonly isSupported;
keepAwake(): Promise<void>;
allowSleep(): Promise<void>;
private throwUnsupportedError;
}
import { WebPlugin } from '@capacitor/core';
export class KeepAwakeWeb extends WebPlugin {
constructor() {
super(...arguments);
this.wakeLock = null;
this.isSupported = 'wakeLock' in navigator;
}
async keepAwake() {
throw this.unimplemented('Not implemented on web.');
if (!this.isSupported) {
this.throwUnsupportedError();
}
if (this.wakeLock) {
await this.allowSleep();
}
this.wakeLock = await navigator.wakeLock.request('screen');
}
async allowSleep() {
throw this.unimplemented('Not implemented on web.');
var _a;
if (!this.isSupported) {
this.throwUnsupportedError();
}
(_a = this.wakeLock) === null || _a === void 0 ? void 0 : _a.release();
this.wakeLock = null;
}
throwUnsupportedError() {
throw this.unavailable('Screen Wake Lock API not available in this browser.');
}
}
//# sourceMappingURL=web.js.map

@@ -12,8 +12,27 @@ 'use strict';

class KeepAwakeWeb extends core.WebPlugin {
constructor() {
super(...arguments);
this.wakeLock = null;
this.isSupported = 'wakeLock' in navigator;
}
async keepAwake() {
throw this.unimplemented('Not implemented on web.');
if (!this.isSupported) {
this.throwUnsupportedError();
}
if (this.wakeLock) {
await this.allowSleep();
}
this.wakeLock = await navigator.wakeLock.request('screen');
}
async allowSleep() {
throw this.unimplemented('Not implemented on web.');
var _a;
if (!this.isSupported) {
this.throwUnsupportedError();
}
(_a = this.wakeLock) === null || _a === void 0 ? void 0 : _a.release();
this.wakeLock = null;
}
throwUnsupportedError() {
throw this.unavailable('Screen Wake Lock API not available in this browser.');
}
}

@@ -20,0 +39,0 @@

@@ -9,8 +9,27 @@ var capacitorKeepAwake = (function (exports, core) {

class KeepAwakeWeb extends core.WebPlugin {
constructor() {
super(...arguments);
this.wakeLock = null;
this.isSupported = 'wakeLock' in navigator;
}
async keepAwake() {
throw this.unimplemented('Not implemented on web.');
if (!this.isSupported) {
this.throwUnsupportedError();
}
if (this.wakeLock) {
await this.allowSleep();
}
this.wakeLock = await navigator.wakeLock.request('screen');
}
async allowSleep() {
throw this.unimplemented('Not implemented on web.');
var _a;
if (!this.isSupported) {
this.throwUnsupportedError();
}
(_a = this.wakeLock) === null || _a === void 0 ? void 0 : _a.release();
this.wakeLock = null;
}
throwUnsupportedError() {
throw this.unavailable('Screen Wake Lock API not available in this browser.');
}
}

@@ -17,0 +36,0 @@

{
"name": "@capacitor-community/keep-awake",
"version": "2.0.0",
"version": "2.1.0",
"description": "Prevent your screen from getting some sleep!",

@@ -56,2 +56,3 @@ "main": "dist/plugin.cjs.js",

"@ionic/swiftlint-config": "1.1.2",
"@types/dom-screen-wake-lock": "1.0.0",
"eslint": "7.11.0",

@@ -58,0 +59,0 @@ "prettier": "2.2.0",

@@ -76,4 +76,2 @@ <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>

Only available for Android and iOS.
--------------------

@@ -90,4 +88,2 @@

Only available for Android and iOS.
--------------------

@@ -94,0 +90,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc