mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
Adding missing timeout property, changing others to be properties instead of functions, spelling fixes
This commit is contained in:
parent
bba34156c1
commit
75f03d73ce
@ -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;
|
||||
}
|
||||
|
||||
25
notifyjs/notifyjs.d.ts
vendored
25
notifyjs/notifyjs.d.ts
vendored
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user