Definitions for cordova-plugin-insomnia added

This commit is contained in:
Ritzlgrmft 2016-02-29 14:31:24 +01:00
parent 2043a884c6
commit 10e1fbfdb7
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,11 @@
/// <reference path="../cordova/plugins/Push.d.ts" />
/// <reference path="./cordova-plugin-insomnia.d.ts" />
window.plugins.insomnia.allowSleepAgain(
() => { console.log("success"); },
() => { console.log("fail"); }
);
window.plugins.insomnia.keepAwake(
() => { console.log("success"); },
() => { console.log("fail"); }
);

View File

@ -0,0 +1,24 @@
// Type definitions for Insomnia-PhoneGap-Plugin v4.0.1
// Project: https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin/
// Definitions by: Markus Wagner <https://github.com/Ritzlgrmft/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface Plugins {
insomnia: InsomniaPlugin.Insomnia;
}
declare module InsomniaPlugin {
export interface Insomnia {
/**
* Prevent the screen of the mobile device from falling asleep.
*/
keepAwake(success?: () => any, fail?: () => any): void;
/**
* After making your app practically a zombie, you can allow it to sleep again by calling allowSleepAgain.
*/
allowSleepAgain(success?: () => any, fail?: () => any): void;
}
}