jquery.growl: Add test file and fix types (#16295)

This commit is contained in:
Andy
2017-05-03 11:53:59 -07:00
committed by Mohamed Hegazy
parent 158ea650e5
commit 08b6b892b4
3 changed files with 31 additions and 23 deletions
+25 -22
View File
@@ -5,31 +5,34 @@
///<reference types="jquery" />
interface growlOptions {
// Message
message: string;
// Title
title?: string;
// URL
url?: string;
// while hovering over the alert, prevent it from being dismissed (true | false - default: true)
delayOnHover?: boolean;
// the duration (in milliseconds) for which the alert is displayed (default: 3200)
duration?: number;
// whether the alert should be fixed rather than auto- dismissed(true | false - default: false)
fixed?: boolean;
// the alert's position ('tl' | 'tr' | 'bl' | 'br' | 'tc' | 'bc' - default: 'tr')
location?: string;
// the alert's size ('small' | 'medium' | 'large' - default: 'medium')
size?: string;
// the alert's style ('default' | 'error' | 'notice' | 'warning' - default: 'default')
style?: string;
declare namespace growl {
interface Options {
// Message
message: string;
// Title
title?: string;
// URL
url?: string;
// while hovering over the alert, prevent it from being dismissed (true | false - default: true)
delayOnHover?: boolean;
// the duration (in milliseconds) for which the alert is displayed (default: 3200)
duration?: number;
// whether the alert should be fixed rather than auto- dismissed(true | false - default: false)
fixed?: boolean;
// the alert's position ('tl' | 'tr' | 'bl' | 'br' | 'tc' | 'bc' - default: 'tr')
location?: string;
// the alert's size ('small' | 'medium' | 'large' - default: 'medium')
size?: string;
// the alert's style ('default' | 'error' | 'notice' | 'warning' - default: 'default')
style?: string;
}
}
interface growl {
error(options: growlOptions): void;
notice(options: growlOptions): void;
warning(options: growlOptions): void;
(options: growl.Options): void;
error(options: growl.Options): void;
notice(options: growl.Options): void;
warning(options: growl.Options): void;
}
interface JQueryStatic {
+4
View File
@@ -0,0 +1,4 @@
$.growl({ title: "Growl", message: "The kitten is awake!" });
$.growl.error({ message: "The kitten is attacking!" });
$.growl.notice({ message: "The kitten is cute!" });
$.growl.warning({ message: "The kitten is ugly!" });
+2 -1
View File
@@ -16,6 +16,7 @@
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts"
"index.d.ts",
"jquery.growl-tests.ts"
]
}