From 826ae11b61ec2f94600a2901af02d82bcb092a57 Mon Sep 17 00:00:00 2001 From: Icereed Date: Sat, 25 Jul 2015 21:51:24 +0200 Subject: [PATCH 1/2] Added typing to the buttons in BootboxDialogOptions. --- bootbox/bootbox.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bootbox/bootbox.d.ts b/bootbox/bootbox.d.ts index bc4f40f0fd..d71de8b702 100644 --- a/bootbox/bootbox.d.ts +++ b/bootbox/bootbox.d.ts @@ -1,6 +1,6 @@ // Type definitions for Bootbox 4.4.0 // Project: https://github.com/makeusabrew/bootbox -// Definitions by: Vincent Bortone , Kon Pik , Anup Kattel +// Definitions by: Vincent Bortone , Kon Pik , Anup Kattel , Dominik Schroeter // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -28,6 +28,10 @@ interface BootboxButton { callback?: () => any; } +interface BootboxButtonMap { + [key: string]: BootboxButton; +} + interface BootboxDialogOptions { message: string | Element; title?: string | Element; @@ -40,7 +44,7 @@ interface BootboxDialogOptions { animate?: boolean; className?: string; size?: string; - buttons?: Object; // complex object where each key is of type BootboxButton + buttons?: BootboxButtonMap; // complex object where each key is of type BootboxButton } interface BootboxDefaultOptions { @@ -69,7 +73,7 @@ interface BootboxStatic { dialog(options: BootboxDialogOptions): JQuery; setDefaults(options: BootboxDefaultOptions): void; hideAll(): void; - + addLocale(name: string, values: BootboxLocaleValues): void; removeLocale(name: string): void; setLocale(name: string): void; From 3fc372d45d6a415bf496e9ff121d886f776e7c0e Mon Sep 17 00:00:00 2001 From: Icereed Date: Wed, 29 Jul 2015 08:37:50 +0200 Subject: [PATCH 2/2] Added possibility to add a button as function --- bootbox/bootbox.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootbox/bootbox.d.ts b/bootbox/bootbox.d.ts index d71de8b702..5ec2a7abd8 100644 --- a/bootbox/bootbox.d.ts +++ b/bootbox/bootbox.d.ts @@ -29,7 +29,7 @@ interface BootboxButton { } interface BootboxButtonMap { - [key: string]: BootboxButton; + [key: string]: BootboxButton | Function; } interface BootboxDialogOptions {