Merge pull request #4320 from chrismbarr/patch-5

Adding missing property & other minor changes
This commit is contained in:
Masahiro Wakame
2015-08-02 23:07:34 +09:00
2 changed files with 16 additions and 9 deletions
+4 -3
View File
@@ -14,7 +14,7 @@ function test_Notify_constructor() {
body : "fuga",
icon : "./logo.png",
tag : "user",
timeout : 1000,
timeout: 2,
notifyShow : (e:Event)=> console.log("notifyShow", e),
notifyClose : ()=> console.log("notifyClose"),
notifyClick : ()=> console.log("notifyClick"),
@@ -27,9 +27,10 @@ function test_Notify_constructor() {
}
function test_Notify_static_methods() {
Notify.needsPermission();
Notify.needsPermission;
Notify.requestPermission();
Notify.requestPermission(()=> console.log("onPermissionGrantedCallback"));
Notify.requestPermission(()=> console.log("onPermissionGrantedCallback"), ()=> console.log("onPermissionDeniedCallback"));
Notify.isSupported();
Notify.isSupported;
Notify.permissionLevel;
}
+12 -6
View File
@@ -1,4 +1,4 @@
// Type definitions for notify.js 1.2.0
// Type definitions for notify.js 1.2.3
// Project: https://github.com/alexgibson/notify.js
// Definitions by: soundTricker <https://github.com/soundTricker>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -10,20 +10,26 @@ declare var Notify: {
* Check is permission is needed for the user to receive notifications.
* @return true : needs permission, false : does not need
*/
needsPermission() : boolean;
needsPermission : boolean;
/**
* Asks the user for permission to display notifications
* @param onPermissionGrantedCallback A callback for permmision is granted.
* @param onPermissionDeniedCallback A callback for permmision is denied.
* @param onPermissionGrantedCallback A callback for permission is granted.
* @param onPermissionDeniedCallback A callback for permission is denied.
*/
requestPermission(onPermissionGrantedCallback?: ()=> any, onPermissionDeniedCallback? : ()=> any) : void;
/**
* return true if the browser supports HTML5 Notification
* @param true : the browser supports HTML5 Notification, false ; the browswer does not supports HTML5 Notification.
* @param true : the browser supports HTML5 Notification, false ; the browser does not supports HTML5 Notification.
*/
isSupported() : boolean;
isSupported: boolean;
/**
* shows the user's current permission level (granted, denied or default), returns null if notifications are not supported.
* @return 'granted' : permission has been given, 'denied' : permission has been denied, 'default' : permission has not yet been set, null : notifications are not supported
*/
permissionLevel: string;
}
declare module notifyjs {