Bootbox: improve typing with string union types (#14561)

This commit is contained in:
Troy McKinnon
2017-03-10 16:21:12 -08:00
committed by Mohamed Hegazy
parent 37f8604200
commit 43b17712ec
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ bootbox.alert("Are we ok with callback?", function () {
console.log("Callback called!");
});
bootbox.alert({
size: "medium",
size: "small",
message: "Are we ok with callback and custom button?",
callback: function () {
console.log("Callback called!");
+3 -2
View File
@@ -15,7 +15,8 @@ interface BootboxBaseOptions {
closeButton?: boolean;
animate?: boolean;
className?: string;
size?: string;
/** All other values result in medium */
size?: "small" | "large";
buttons?: BootboxButtonMap; // complex object where each key is of type BootboxButton
}
@@ -40,7 +41,7 @@ interface BootboxConfirmOptions extends BootboxDialogOptions {
interface BootboxPromptOptions extends BootboxBaseOptions {
title: string;
value?: string;
inputType?: string;
inputType?: "text" | "textarea" | "email" | "select" | "checkbox" | "date" | "time" | "number" | "password";
callback: (result: string) => any;
buttons?: BootboxConfirmPromptButtonMap;
}