Skip to content

Instantly share code, notes, and snippets.

@mattiaz9
Last active January 23, 2019 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattiaz9/3d3102878a90038d82d4aa6aca3bf4c8 to your computer and use it in GitHub Desktop.
Save mattiaz9/3d3102878a90038d82d4aa6aca3bf4c8 to your computer and use it in GitHub Desktop.
Typescript definition for bootstrap.native v-4
declare module "bootstrap.native/dist/bootstrap-native-v4" {
/** ALERT */
export class Alert {
constructor(element?: string | HTMLElement);
close(): void;
}
/** BUTTON */
export class Button {
constructor(element?: string | HTMLElement);
}
/** CAROUSEL */
export interface CarouselOptions {
interval?: number
keyboard?: boolean
pause?: 'hover'
}
export class Carousel {
constructor(element?: string | HTMLElement, options?: CarouselOptions);
cycle(): void;
slideTo(next: number): void;
getActiveIndex(): number
}
/** COLLAPSE */
export interface CollapseOptions {
parent?: string | HTMLElement
}
export class Collapse {
constructor(element?: string | HTMLElement, options?: CollapseOptions);
show(): void;
hide(): void;
toggle(): void;
}
/** DROPDOWN */
export class Dropdown {
constructor(element?: string | HTMLElement, persist?: boolean);
toggle(): void;
}
/** MODAL */
export interface ModalOptions {
keyboard?: boolean
backdrop?: boolean | 'static'
content?: string | null
}
export class Modal {
constructor(element?: string | HTMLElement, options?: ModalOptions);
show(): void;
hide(): void;
toggle(): void;
update(): void;
setContent(content: string | null): void;
}
/** POPOVER */
export interface PopoverOptions {
container?: string | HTMLElement
template?: string
trigger?: 'focus' | 'hover' | 'click'
}
export class Popover {
constructor(element?: string | HTMLElement, options?: PopoverOptions);
show(): void;
hide(): void;
toggle(): void;
}
/** SCROLLSPY */
export interface ScrollSpyOptions {
target?: string
offset?: number
}
export class ScrollSpy {
constructor(element?: string | HTMLElement, options?: ScrollSpyOptions);
refresh(): void;
}
/** TAB */
export interface TabOptions {
height?: boolean
}
export class Tab {
constructor(element?: string | HTMLElement, options?: TabOptions);
show(): void;
}
/** TOAST */
export interface ToastOptions {
animation?: number
autohide?: number
delay?: number | string
}
export class Toast {
constructor(element?: string | HTMLElement, options?: ToastOptions);
show(): void;
hide(): void;
dispose(): void;
}
/** TOOLTIP */
export interface TooltipOptions {
animation?: 'fade'
placement?: 'top' | 'left' | 'bottom' | 'right'
delay?: number | string
}
export class Tooltip {
constructor(element?: string | HTMLElement, options?: TooltipOptions);
show(): void;
hide(): void;
toggle(): void;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment