mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
jquery.growl: Add test file and fix types (#16295)
This commit is contained in:
Vendored
+25
-22
@@ -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 {
|
||||
|
||||
@@ -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!" });
|
||||
@@ -16,6 +16,7 @@
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
"index.d.ts",
|
||||
"jquery.growl-tests.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user