@gachlab/capacitor-keep-awake-plugin 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +7 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/plugin.cjs.js +1 -23
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +1 -26
- package/dist/plugin.js.map +1 -1
- package/dist/web-BNfo7bz7.js +2 -0
- package/dist/web-BNfo7bz7.js.map +1 -0
- package/dist/web-CFH8HkZO.mjs +13 -0
- package/dist/web-CFH8HkZO.mjs.map +1 -0
- package/ios/Sources/KeepAwakePlugin/KeepAwake.swift +3 -4
- package/ios/Sources/KeepAwakePlugin/KeepAwakePlugin.swift +2 -2
- package/package.json +6 -5
- package/dist/docs.json +0 -35
- package/dist/esm/definitions.d.ts +0 -8
- package/dist/esm/definitions.js +0 -2
- package/dist/esm/definitions.js.map +0 -1
- package/dist/esm/index.d.ts +0 -4
- package/dist/esm/web.d.ts +0 -10
- package/dist/esm/web.js +0 -10
- package/dist/esm/web.js.map +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { registerPlugin } from
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
import { registerPlugin as p } from "@capacitor/core";
|
|
2
|
+
const t = p("KeepAwake", {
|
|
3
|
+
web: () => import("../web-CFH8HkZO.mjs").then((e) => new e.KeepAwakeWeb())
|
|
4
4
|
});
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export {
|
|
6
|
+
t as KeepAwake
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { KeepAwakePlugin } from './definitions';\n\nconst KeepAwake = registerPlugin<KeepAwakePlugin>('KeepAwake', {\n web: () => import('./web').then(m => new m.KeepAwakeWeb()),\n});\n\nexport * from './definitions';\nexport { KeepAwake };\n"],"names":["KeepAwake","registerPlugin","m"],"mappings":";AAIM,MAAAA,IAAYC,EAAgC,aAAa;AAAA,EAC7D,KAAK,MAAM,OAAO,qBAAO,EAAE,KAAK,CAAKC,MAAA,IAAIA,EAAE,aAAc,CAAA;AAC3D,CAAC;"}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var core = require('@capacitor/core');
|
|
4
|
-
|
|
5
|
-
const KeepAwake = core.registerPlugin('KeepAwake', {
|
|
6
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.KeepAwakeWeb()),
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
class KeepAwakeWeb extends core.WebPlugin {
|
|
10
|
-
dontAllowSleep() {
|
|
11
|
-
throw new Error('Method not implemented for Web.');
|
|
12
|
-
}
|
|
13
|
-
allowSleep() {
|
|
14
|
-
throw new Error('Method not implemented for Web.');
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var web = /*#__PURE__*/Object.freeze({
|
|
19
|
-
__proto__: null,
|
|
20
|
-
KeepAwakeWeb: KeepAwakeWeb
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
exports.KeepAwake = KeepAwake;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@capacitor/core"),t=r.registerPlugin("KeepAwake",{web:()=>Promise.resolve().then(()=>require("./web-BNfo7bz7.js")).then(e=>new e.KeepAwakeWeb)});exports.KeepAwake=t;
|
|
24
2
|
//# sourceMappingURL=plugin.cjs.js.map
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["../src/index.ts"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { KeepAwakePlugin } from './definitions';\n\nconst KeepAwake = registerPlugin<KeepAwakePlugin>('KeepAwake', {\n web: () => import('./web').then(m => new m.KeepAwakeWeb()),\n});\n\nexport * from './definitions';\nexport { KeepAwake };\n"],"names":["KeepAwake","registerPlugin","m"],"mappings":"mHAIMA,EAAYC,iBAAgC,YAAa,CAC7D,IAAK,IAAM,QAAO,QAAA,EAAA,KAAA,IAAA,QAAA,mBAAO,GAAE,KAAUC,GAAA,IAAIA,EAAE,YAAc,CAC3D,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
var capacitorKeepAwake = (
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
const KeepAwake = core.registerPlugin('KeepAwake', {
|
|
5
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.KeepAwakeWeb()),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
class KeepAwakeWeb extends core.WebPlugin {
|
|
9
|
-
dontAllowSleep() {
|
|
10
|
-
throw new Error('Method not implemented for Web.');
|
|
11
|
-
}
|
|
12
|
-
allowSleep() {
|
|
13
|
-
throw new Error('Method not implemented for Web.');
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
var web = /*#__PURE__*/Object.freeze({
|
|
18
|
-
__proto__: null,
|
|
19
|
-
KeepAwakeWeb: KeepAwakeWeb
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
exports.KeepAwake = KeepAwake;
|
|
23
|
-
|
|
24
|
-
return exports;
|
|
25
|
-
|
|
26
|
-
})({}, capacitorExports);
|
|
1
|
+
var capacitorKeepAwake=function(e,t){"use strict";const r=t.registerPlugin("KeepAwake",{web:()=>Promise.resolve().then(()=>l).then(o=>new o.KeepAwakeWeb)});class n extends t.WebPlugin{dontAllowSleep(){throw new Error("Method not implemented for Web.")}allowSleep(){throw new Error("Method not implemented for Web.")}}const l=Object.freeze(Object.defineProperty({__proto__:null,KeepAwakeWeb:n},Symbol.toStringTag,{value:"Module"}));return e.KeepAwake=r,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({},capacitorExports);
|
|
27
2
|
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["../src/index.ts","../src/web.ts"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { KeepAwakePlugin } from './definitions';\n\nconst KeepAwake = registerPlugin<KeepAwakePlugin>('KeepAwake', {\n web: () => import('./web').then(m => new m.KeepAwakeWeb()),\n});\n\nexport * from './definitions';\nexport { KeepAwake };\n","import { WebPlugin } from '@capacitor/core';\n\nimport type { KeepAwakePlugin } from './definitions';\n\nexport class KeepAwakeWeb extends WebPlugin implements KeepAwakePlugin {\n dontAllowSleep(): Promise<{ isAllowdSleep: boolean; }> {\n throw new Error('Method not implemented for Web.');\n }\n allowSleep(): Promise<{ isAllowdSleep: boolean; }> {\n throw new Error('Method not implemented for Web.');\n }\n \n}\n"],"names":["KeepAwake","registerPlugin","web","m","KeepAwakeWeb","WebPlugin"],"mappings":"kDAIM,MAAAA,EAAYC,iBAAgC,YAAa,CAC7D,IAAK,IAAM,QAAA,QAAA,EAAA,KAAA,IAAAC,CAAA,EAAgB,KAAUC,GAAA,IAAIA,EAAE,YAAc,CAC3D,CAAC,ECFM,MAAMC,UAAqBC,EAAAA,SAAqC,CACrE,gBAAuD,CAC/C,MAAA,IAAI,MAAM,iCAAiC,CAAA,CAEnD,YAAmD,CAC3C,MAAA,IAAI,MAAM,iCAAiC,CAAA,CAGrD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@capacitor/core");class o extends e.WebPlugin{dontAllowSleep(){throw new Error("Method not implemented for Web.")}allowSleep(){throw new Error("Method not implemented for Web.")}}exports.KeepAwakeWeb=o;
|
|
2
|
+
//# sourceMappingURL=web-BNfo7bz7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-BNfo7bz7.js","sources":["../src/web.ts"],"sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { KeepAwakePlugin } from './definitions';\n\nexport class KeepAwakeWeb extends WebPlugin implements KeepAwakePlugin {\n dontAllowSleep(): Promise<{ isAllowdSleep: boolean; }> {\n throw new Error('Method not implemented for Web.');\n }\n allowSleep(): Promise<{ isAllowdSleep: boolean; }> {\n throw new Error('Method not implemented for Web.');\n }\n \n}\n"],"names":["KeepAwakeWeb","WebPlugin"],"mappings":"mHAIO,MAAMA,UAAqBC,EAAAA,SAAqC,CACrE,gBAAuD,CAC/C,MAAA,IAAI,MAAM,iCAAiC,CAAA,CAEnD,YAAmD,CAC3C,MAAA,IAAI,MAAM,iCAAiC,CAAA,CAGrD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WebPlugin as e } from "@capacitor/core";
|
|
2
|
+
class t extends e {
|
|
3
|
+
dontAllowSleep() {
|
|
4
|
+
throw new Error("Method not implemented for Web.");
|
|
5
|
+
}
|
|
6
|
+
allowSleep() {
|
|
7
|
+
throw new Error("Method not implemented for Web.");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
t as KeepAwakeWeb
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=web-CFH8HkZO.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web-CFH8HkZO.mjs","sources":["../src/web.ts"],"sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { KeepAwakePlugin } from './definitions';\n\nexport class KeepAwakeWeb extends WebPlugin implements KeepAwakePlugin {\n dontAllowSleep(): Promise<{ isAllowdSleep: boolean; }> {\n throw new Error('Method not implemented for Web.');\n }\n allowSleep(): Promise<{ isAllowdSleep: boolean; }> {\n throw new Error('Method not implemented for Web.');\n }\n \n}\n"],"names":["KeepAwakeWeb","WebPlugin"],"mappings":";AAIO,MAAMA,UAAqBC,EAAqC;AAAA,EACrE,iBAAuD;AAC/C,UAAA,IAAI,MAAM,iCAAiC;AAAA,EAAA;AAAA,EAEnD,aAAmD;AAC3C,UAAA,IAAI,MAAM,iCAAiC;AAAA,EAAA;AAGrD;"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import Foundation
|
|
2
|
+
import UIKit
|
|
2
3
|
|
|
3
4
|
@objc public class KeepAwake: NSObject {
|
|
4
|
-
@objc public func dontAllowSleep() ->
|
|
5
|
-
print("Sleep Disabled",terminator: "\n")
|
|
5
|
+
@objc public func dontAllowSleep() -> Bool {
|
|
6
6
|
UIApplication.shared.isIdleTimerDisabled = true
|
|
7
7
|
return false
|
|
8
8
|
}
|
|
9
|
-
@objc public func allowSleep() ->
|
|
10
|
-
print("Sleep Enabled",terminator: "\n")
|
|
9
|
+
@objc public func allowSleep() -> Bool {
|
|
11
10
|
UIApplication.shared.isIdleTimerDisabled = false
|
|
12
11
|
return true
|
|
13
12
|
}
|
|
@@ -18,12 +18,12 @@ public class KeepAwakePlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
18
18
|
|
|
19
19
|
@objc func dontAllowSleep(_ call: CAPPluginCall) {
|
|
20
20
|
call.resolve([
|
|
21
|
-
"
|
|
21
|
+
"isAllowdSleep": implementation.dontAllowSleep()
|
|
22
22
|
])
|
|
23
23
|
}
|
|
24
24
|
@objc func allowSleep(_ call: CAPPluginCall) {
|
|
25
25
|
call.resolve([
|
|
26
|
-
"
|
|
26
|
+
"isAllowdSleep": implementation.allowSleep()
|
|
27
27
|
])
|
|
28
28
|
}
|
|
29
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gachlab/capacitor-keep-awake-plugin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A plugin to keep awake the device screen",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
|
|
41
41
|
"swiftlint": "node-swiftlint",
|
|
42
42
|
"docgen": "docgen --api KeepAwakePlugin --output-readme README.md --output-json dist/docs.json",
|
|
43
|
-
"build": "npm run clean &&
|
|
43
|
+
"build": "npm run clean && vite build",
|
|
44
44
|
"clean": "rimraf ./dist",
|
|
45
|
-
"watch": "
|
|
45
|
+
"watch": "vite build --watch",
|
|
46
46
|
"prepublishOnly": "npm run build"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -57,9 +57,10 @@
|
|
|
57
57
|
"prettier": "^3.4.2",
|
|
58
58
|
"prettier-plugin-java": "^2.6.6",
|
|
59
59
|
"rimraf": "^6.0.1",
|
|
60
|
-
"rollup": "^4.30.1",
|
|
61
60
|
"swiftlint": "^2.0.0",
|
|
62
|
-
"typescript": "~4.1.5"
|
|
61
|
+
"typescript": "~4.1.5",
|
|
62
|
+
"vite": "^5.4.19",
|
|
63
|
+
"vite-plugin-dts": "^3.9.1"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"@capacitor/core": ">=7.0.0"
|
package/dist/docs.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"api": {
|
|
3
|
-
"name": "KeepAwakePlugin",
|
|
4
|
-
"slug": "keepawakeplugin",
|
|
5
|
-
"docs": "",
|
|
6
|
-
"tags": [],
|
|
7
|
-
"methods": [
|
|
8
|
-
{
|
|
9
|
-
"name": "dontAllowSleep",
|
|
10
|
-
"signature": "() => Promise<{ isAllowdSleep: boolean; }>",
|
|
11
|
-
"parameters": [],
|
|
12
|
-
"returns": "Promise<{ isAllowdSleep: boolean; }>",
|
|
13
|
-
"tags": [],
|
|
14
|
-
"docs": "",
|
|
15
|
-
"complexTypes": [],
|
|
16
|
-
"slug": "dontallowsleep"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "allowSleep",
|
|
20
|
-
"signature": "() => Promise<{ isAllowdSleep: boolean; }>",
|
|
21
|
-
"parameters": [],
|
|
22
|
-
"returns": "Promise<{ isAllowdSleep: boolean; }>",
|
|
23
|
-
"tags": [],
|
|
24
|
-
"docs": "",
|
|
25
|
-
"complexTypes": [],
|
|
26
|
-
"slug": "allowsleep"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"properties": []
|
|
30
|
-
},
|
|
31
|
-
"interfaces": [],
|
|
32
|
-
"enums": [],
|
|
33
|
-
"typeAliases": [],
|
|
34
|
-
"pluginConfigs": []
|
|
35
|
-
}
|
package/dist/esm/definitions.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface KeepAwakePlugin {\n dontAllowSleep(): Promise<{ isAllowdSleep: boolean }>;\n allowSleep(): Promise<{ isAllowdSleep: boolean }>;\n}\n"]}
|
package/dist/esm/index.d.ts
DELETED
package/dist/esm/web.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { KeepAwakePlugin } from './definitions';
|
|
3
|
-
export declare class KeepAwakeWeb extends WebPlugin implements KeepAwakePlugin {
|
|
4
|
-
dontAllowSleep(): Promise<{
|
|
5
|
-
isAllowdSleep: boolean;
|
|
6
|
-
}>;
|
|
7
|
-
allowSleep(): Promise<{
|
|
8
|
-
isAllowdSleep: boolean;
|
|
9
|
-
}>;
|
|
10
|
-
}
|
package/dist/esm/web.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
export class KeepAwakeWeb extends WebPlugin {
|
|
3
|
-
dontAllowSleep() {
|
|
4
|
-
throw new Error('Method not implemented for Web.');
|
|
5
|
-
}
|
|
6
|
-
allowSleep() {
|
|
7
|
-
throw new Error('Method not implemented for Web.');
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,YAAa,SAAQ,SAAS;IACzC,cAAc;QACZ,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,UAAU;QACR,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;CAEF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { KeepAwakePlugin } from './definitions';\n\nexport class KeepAwakeWeb extends WebPlugin implements KeepAwakePlugin {\n dontAllowSleep(): Promise<{ isAllowdSleep: boolean; }> {\n throw new Error('Method not implemented for Web.');\n }\n allowSleep(): Promise<{ isAllowdSleep: boolean; }> {\n throw new Error('Method not implemented for Web.');\n }\n \n}\n"]}
|