Add Toastr definitions and tests

This commit is contained in:
Boris Yankov
2012-11-06 00:59:05 +02:00
parent 073bdc108d
commit 6f4c7d834d
3 changed files with 151 additions and 62 deletions
+36
View File
@@ -0,0 +1,36 @@
// Type definitions for Toastr 1.0
// Project: https://github.com/CodeSeven/toastr
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface ToastOptions {
tapToDismiss?: bool;
toastClass?: string;
containerId?: string;
debug?: bool;
fadeIn?: number;
fadeOut?: number;
extendedTimeOut?: number;
iconClasses?: {
error: string;
info: string;
success: string;
warning: string;
};
iconClass?: string;
positionClass?: string;
timeOut?: number;
titleClass?: string;
messageClass?: string;
}
interface Toastr {
options: ToastOptions;
info(message: string, title?: string);
warning(message: string, title?: string);
success(message: string, title?: string);
error(message: string, title?: string);
}
declare var toastr: Toastr;