mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
[@types/bootbox] Update and add options (#37051)
* add missing options * add tests for new options
This commit is contained in:
@@ -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',
|
||||
|
||||
Vendored
+7
-3
@@ -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 <https://github.com/vbortone>, Kon Pik <https://github.com/konpikwastaken>, Anup Kattel <https://github.com/kanup>, Dominik Schroeter <https://github.com/icereed>, Troy McKinnon <https://github.com/trodi>, Stanny Nuytkens <https://github.com/stannynuytkens>, Soner Köksal <https://github.com/renjfk>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -17,13 +17,17 @@ interface BootboxBaseOptions<T = any> {
|
||||
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<T = any> extends BootboxBaseOptions<T> {
|
||||
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<boolean> {
|
||||
interface BootboxPromptOptions extends BootboxBaseOptions<string> {
|
||||
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 }[];
|
||||
|
||||
Reference in New Issue
Block a user