mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Definitions for cordova-plugin-insomnia added
This commit is contained in:
parent
2043a884c6
commit
10e1fbfdb7
11
cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts
Normal file
11
cordova-plugin-insomnia/cordova-plugin-insomnia-tests.ts
Normal 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"); }
|
||||
);
|
||||
24
cordova-plugin-insomnia/cordova-plugin-insomnia.d.ts
vendored
Normal file
24
cordova-plugin-insomnia/cordova-plugin-insomnia.d.ts
vendored
Normal 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;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user