From ffbdae8cae2e3e131356654f322953668666a7a7 Mon Sep 17 00:00:00 2001 From: Ryan Pineo Date: Thu, 17 Nov 2016 12:57:21 -0500 Subject: [PATCH] add toastr.remove type def --- toastr/toastr-tests.ts | 3 ++- toastr/toastr.d.ts | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/toastr/toastr-tests.ts b/toastr/toastr-tests.ts index adacb19340..c09d484dca 100644 --- a/toastr/toastr-tests.ts +++ b/toastr/toastr-tests.ts @@ -8,6 +8,7 @@ function test_basic() { t.push(toastr.error('I do not think that word means what you think it means.', 'Inconceivable!')); toastr.clear(t[0]); // clear 1 toastr.clear(); // clear all + toastr.remove(); var msg = 'Do you think Rodents of Unusual Size really exist?'; var title = 'Fireswamp Legends'; @@ -82,4 +83,4 @@ function test_fromdemo() { $('#cleartoasts').click(function () { toastr.clear(); }); -} \ No newline at end of file +} diff --git a/toastr/toastr.d.ts b/toastr/toastr.d.ts index 33a739f52e..29c507335d 100644 --- a/toastr/toastr.d.ts +++ b/toastr/toastr.d.ts @@ -174,19 +174,25 @@ interface Toastr { (): void; /** * Clear specific toast - * + * * @param toast Toast to clear */ (toast: JQuery): void; /** * Clear specific toast - * + * * @param toast Toast to clear * @param clearOptions force clearing a toast, ignoring focus */ (toast: JQuery, clearOptions: { force: boolean }): void; }; /** + * Removes all toasts (without animation) + */ + remove: { + (): void; + }; + /** * Create an error toast */ error: ToastrDisplayMethod; @@ -207,7 +213,7 @@ interface Toastr { */ warning: ToastrDisplayMethod; /** - * Get toastr version + * Get toastr version */ version: string; }