Skip to content

Commit

Permalink
[bootstrap] Update API for jQuery Events API changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
leonard-thieu committed Nov 24, 2018
1 parent 68c38a8 commit b6bb6a6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions types/bootstrap/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export interface TooltipOption {
// Events
// --------------------------------------------------------------------------------------

export interface CarouselEventHandler<TElement> extends JQuery.Event<TElement, undefined> {
export interface CarouselEventHandler<TElement> extends JQuery.TriggeredEvent<TElement, undefined> {
/**
* The direction in which the carousel is sliding.
*/
Expand All @@ -339,6 +339,10 @@ export interface CarouselEventHandler<TElement> extends JQuery.Event<TElement, u
to: number;
}

export interface TapEventHandler<TElement> extends JQuery.TriggeredEvent<TElement, undefined> {
relatedTarget: HTMLElement;
}

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";
Expand Down Expand Up @@ -383,9 +387,10 @@ declare global {
tooltip(options?: TooltipOption): this;

on(events: CarouselEvent, handler: JQuery.EventHandlerBase<TElement, CarouselEventHandler<TElement>>): this;
on(events: TapEvent, handler: JQuery.EventHandlerBase<TElement, TapEventHandler<TElement>>): this;
on(events:
AlertEvent | CollapseEvent | DropdownEvent | ModalEvent |
PopoverEvent | ScrollspyEvent | TapEvent | TooltipEvent,
PopoverEvent | ScrollspyEvent | TooltipEvent,
handler: JQuery.EventHandler<TElement>): this;
}
}

0 comments on commit b6bb6a6

Please sign in to comment.