mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Update for toastr 1.0.3
This commit is contained in:
23
Definitions/toastr-1.0.d.ts
vendored
23
Definitions/toastr-1.0.d.ts
vendored
@@ -3,7 +3,8 @@
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface ToastOptions {
|
||||
|
||||
interface ToastrOptions {
|
||||
tapToDismiss?: bool;
|
||||
toastClass?: string;
|
||||
containerId?: string;
|
||||
@@ -22,16 +23,24 @@ interface ToastOptions {
|
||||
timeOut?: number;
|
||||
titleClass?: string;
|
||||
messageClass?: string;
|
||||
|
||||
onclick?: () => void;
|
||||
}
|
||||
|
||||
interface ToastrDisplayMethod {
|
||||
(message: string): void;
|
||||
(message: string, title: string): void;
|
||||
(message: string, title: string, overrides: ToastrOptions): void;
|
||||
}
|
||||
|
||||
interface Toastr {
|
||||
options: ToastOptions;
|
||||
options: ToastrOptions;
|
||||
|
||||
clear(): void;
|
||||
info(message: string, title?: string): void;
|
||||
warning(message: string, title?: string): void;
|
||||
success(message: string, title?: string): void;
|
||||
error(message: string, title?: string): void;
|
||||
info: ToastrDisplayMethod;
|
||||
warning: ToastrDisplayMethod;
|
||||
success: ToastrDisplayMethod;
|
||||
error: ToastrDisplayMethod;
|
||||
}
|
||||
|
||||
declare var toastr: Toastr;
|
||||
declare var toastr: Toastr;
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
/// <reference path="../Definitions/toastr-1.0.d.ts" />
|
||||
|
||||
/// <reference path="../Definitions/toastr-1.0.d.ts" />
|
||||
|
||||
function test_basic() {
|
||||
toastr.info('Are you the 6 fingered man?');
|
||||
toastr.info('Are you the 6 fingered man?');
|
||||
toastr.warning('My name is Inigo Montoya. You Killed my father, prepare to die!');
|
||||
toastr.success('Have fun storming the castle!', 'Miracle Max Says');
|
||||
toastr.error('I do not think that word means what you tink it means.', 'Inconceivable!');
|
||||
toastr.clear();
|
||||
|
||||
var msg = 'Do you think Rodents of Unusual Size really exist?';
|
||||
var title = 'Fireswamp Legends';
|
||||
var overrides = { timeOut: 250 };
|
||||
toastr.warning(msg, title, overrides);
|
||||
|
||||
toastr.options.onclick = function () {
|
||||
}
|
||||
}
|
||||
|
||||
declare var $;
|
||||
|
||||
Reference in New Issue
Block a user