Adding missing timeout property, changing others to be properties instead of functions, spelling fixes

This commit is contained in:
Chris Barr 2015-05-12 08:13:37 -04:00
parent bba34156c1
commit 75f03d73ce
2 changed files with 22 additions and 9 deletions

View File

@ -14,6 +14,7 @@ function test_Notify_constructor() {
body : "fuga",
icon : "./logo.png",
tag : "user",
timeout: 2,
notifyShow : (e:Event)=> console.log("notifyShow", e),
notifyClose : ()=> console.log("notifyClose"),
notifyClick : ()=> console.log("notifyClick"),
@ -26,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;
}

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 {
@ -72,6 +78,11 @@ declare module notifyjs {
* unique identifier to stop duplicate notifications
*/
tag? : string;
/**
* number of seconds to close the notification automatically
*/
timeout? : number;
/**
* callback when notification is shown
@ -98,4 +109,4 @@ declare module notifyjs {
*/
permissionDenied? : Function;
}
}
}