diff --git a/types/jquery.growl/index.d.ts b/types/jquery.growl/index.d.ts index 4507f1ca4f..2a847b8ef7 100644 --- a/types/jquery.growl/index.d.ts +++ b/types/jquery.growl/index.d.ts @@ -5,31 +5,34 @@ /// -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 { diff --git a/types/jquery.growl/jquery.growl-tests.ts b/types/jquery.growl/jquery.growl-tests.ts new file mode 100644 index 0000000000..3391441bf1 --- /dev/null +++ b/types/jquery.growl/jquery.growl-tests.ts @@ -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!" }); diff --git a/types/jquery.growl/tsconfig.json b/types/jquery.growl/tsconfig.json index a2cbd4e379..8eb3a19e35 100644 --- a/types/jquery.growl/tsconfig.json +++ b/types/jquery.growl/tsconfig.json @@ -16,6 +16,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "jquery.growl-tests.ts" ] }