diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index df172d9484..e196040b4e 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -51,6 +51,7 @@ $("#carousel").carousel({ keyboard: true, slide: false, pause: "hover", + ride: 'carousel', wrap: true, touch: false, }); @@ -169,6 +170,10 @@ $("#modal").modal({ backdrop: "static", }); +$("#modal").on('hidePrevented.bs.modal', e => { + const {data, target: modal} = e; +}); + // -------------------------------------------------------------------------------------- // Popover // -------------------------------------------------------------------------------------- @@ -307,6 +312,9 @@ $("#tooltip").tooltip({ img: ['src', 'alt', 'title', 'width', 'height'], }, sanitizeFn: (x: string) => x.replace("<", ""), + popperConfig: { + placement: 'bottom', + }, }); $("#tooltip").tooltip({ diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 1cd7c858b3..608777ac69 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Bootstrap 4.3 // Project: https://github.com/twbs/bootstrap/, https://getbootstrap.com // Definitions by: denisname +// Piotr Błażejewicz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -74,6 +75,13 @@ export interface CarouselOption { */ pause?: "hover" | false; + /** + * Autoplays the carousel after the user manually cycles the first item. + * If `carousel`, autoplays the carousel on load. + * @default false + */ + ride?: 'carousel' | boolean; + /** * Whether the carousel should cycle continuously or have hard stops. * @@ -371,6 +379,12 @@ export interface TooltipOption { * @default null */ sanitizeFn?: null | ((input: string) => string); + + /** + * To change Bootstrap's default Popper.js config, + * see {@link https://popper.js.org/docs/v1/ Popper.js's configuration} + */ + popperConfig?: null | object; } // -------------------------------------------------------------------------------------- @@ -449,7 +463,7 @@ export type AlertEvent = "close.bs.alert" | "closed.bs.alert"; export type CarouselEvent = "slide.bs.carousel" | "slid.bs.carousel"; export type CollapseEvent = "show.bs.collapse" | "shown.bs.collapse" | "hide.bs.collapse" | "hidden.bs.collapse"; export type DropdownEvent = "show.bs.dropdown" | "shown.bs.dropdown" | "hide.bs.dropdown" | "hidden.bs.dropdown"; -export type ModalEvent = "show.bs.modal" | "shown.bs.modal" | "hide.bs.modal" | "hidden.bs.modal"; +export type ModalEvent = "show.bs.modal" | "shown.bs.modal" | "hide.bs.modal" | "hidden.bs.modal" | "hidePrevented.bs.modal"; export type PopoverEvent = "show.bs.popover" | "shown.bs.popover" | "hide.bs.popover" | "hidden.bs.popover" | "inserted.bs.popover"; export type ScrollspyEvent = "activate.bs.scrollspy"; export type TapEvent = "show.bs.tab" | "shown.bs.tab" | "hide.bs.tab" | "hidden.bs.tab";