diff --git a/types/bootbox/bootbox-tests.ts b/types/bootbox/bootbox-tests.ts index f5604d5312..42e1f3da2a 100644 --- a/types/bootbox/bootbox-tests.ts +++ b/types/bootbox/bootbox-tests.ts @@ -12,6 +12,26 @@ bootbox.alert({ console.log("Callback called!"); } }); +bootbox.alert({ + size: "extra-large", + message: "Are we ok with new sizes?", +}); +bootbox.alert({ + size: "lg", + message: "Are we ok with new alternative size keys?", +}); +bootbox.alert({ + scrollable: true, + message: "Are we ok with scrollable?", +}); +bootbox.alert({ + swapButtonOrder: true, + message: "Are we ok with swapButtonOrder?", +}); +bootbox.alert({ + centerVertical: true, + message: "Are we ok with centerVertical?", +}); bootbox.confirm("Click cancel to pass test", function (result) { console.log(!result); @@ -38,6 +58,18 @@ bootbox.prompt({ console.log(result); } }); +bootbox.prompt({ + size: "xl", + title: "Enter 'ok' to pass test", callback: function (result) { + console.log(result); + } +}); +bootbox.prompt({ + scrollable: true, + title: "Enter 'ok' to pass test", callback: function (result) { + console.log(result); + } +}); bootbox.prompt({ title: "This is a prompt with a set of checkbox inputs!", inputType: 'checkbox', diff --git a/types/bootbox/index.d.ts b/types/bootbox/index.d.ts index dfdf0de871..15498266b3 100644 --- a/types/bootbox/index.d.ts +++ b/types/bootbox/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Bootbox 4.4.0 +// Type definitions for Bootbox 5.2.0 // Project: https://github.com/makeusabrew/bootbox // Definitions by: Vincent Bortone , Kon Pik , Anup Kattel , Dominik Schroeter , Troy McKinnon , Stanny Nuytkens , Soner Köksal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,13 +17,17 @@ interface BootboxBaseOptions { animate?: boolean; className?: string; /** All other values result in medium */ - size?: "small" | "large"; + size?: "small" | "sm" | "large" | "lg" | "extra-large" | "xl"; + locale?: string; buttons?: BootboxButtonMap; // complex object where each key is of type BootboxButton + scrollable?: boolean; } /** Bootbox options available for custom modals */ interface BootboxDialogOptions extends BootboxBaseOptions { message: JQuery|any[]|Element|DocumentFragment|Text|string|((index: number, html: string) => string|Element|JQuery); + swapButtonOrder?: boolean; + centerVertical?: boolean; } /** Bootbox options available for alert modals */ @@ -42,7 +46,7 @@ interface BootboxConfirmOptions extends BootboxDialogOptions { interface BootboxPromptOptions extends BootboxBaseOptions { title: string; value?: string; - inputType?: "text" | "textarea" | "email" | "select" | "checkbox" | "date" | "time" | "number" | "password"; + inputType?: "text" | "textarea" | "email" | "select" | "checkbox" | "date" | "time" | "number" | "password" | "radio" | "range"; callback: (result: string) => any; buttons?: BootboxConfirmPromptButtonMap; inputOptions?: { text: string, value: string, group?: string }[];