@ribajs/bs4
Version:
Bootstrap 4 module for Riba.js
145 lines (144 loc) • 6.12 kB
TypeScript
import { EventDispatcher } from "@ribajs/events";
import { TemplateFunction, TemplatesComponent } from "@ribajs/core";
import { Dragscroll, Autoscroll, ScrollPosition, ScrollEventsService } from "@ribajs/extras";
export type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl";
export type ControlsPosition = "inside-middle" | "inside-bottom" | "inside-top" | "outside-middle" | "outside-bottom" | "outside-top";
export type IndicatorsPosition = "inside-bottom" | "inside-top" | "inside-right" | "inside-left" | "outside-bottom" | "outside-top" | "outside-right" | "outside-left";
export interface Position extends DOMRect {
centerX: number;
centerY: number;
}
export interface Slide {
title?: string;
content: string;
handle?: string;
active: boolean;
type?: string;
position: Position;
index: number;
}
export interface ResponsiveOptions extends Partial<Options> {
minWidth: number;
}
export interface Options {
controls: boolean;
controlsPosition: ControlsPosition;
indicators: boolean;
indicatorsPosition: IndicatorsPosition;
pauseOnHover: boolean;
slidesToScroll: number;
sticky: boolean;
drag: boolean;
autoplay: boolean;
autoplayInterval: number;
autoplayVelocity: number;
controlPrevIconSrc: string;
controlNextIconSrc: string;
indicatorInactiveIconSrc: string;
indicatorActiveIconSrc: string;
angle: "vertical" | "horizontal";
pause: boolean;
xs: ResponsiveOptions;
sm: ResponsiveOptions;
md: ResponsiveOptions;
lg: ResponsiveOptions;
xl: ResponsiveOptions;
}
export interface Scope extends Options {
next: Bs4SlideshowComponent["next"];
prev: Bs4SlideshowComponent["prev"];
goTo: Bs4SlideshowComponent["goTo"];
controlsPositionClass: string;
indicatorsPositionClass: string;
items: Slide[];
}
export declare class Bs4SlideshowComponent extends TemplatesComponent {
protected resizeObserver?: any;
protected get slideshowInner(): HTMLElement;
protected get slideElements(): NodeListOf<Element>;
protected get controlsElements(): NodeListOf<Element>;
protected get indicatorsElement(): HTMLElement | null;
static get observedAttributes(): string[];
static tagName: string;
protected templateAttributes: ({
name: string;
required: boolean;
type?: undefined;
} | {
name: string;
type: string;
required: boolean;
})[];
protected autobind: boolean;
protected dragscrollService?: Dragscroll;
protected continuousAutoplayService?: Autoscroll;
protected scrollEventsService?: ScrollEventsService;
protected _slideshowInner: HTMLElement | null;
protected _slideElements: NodeListOf<Element> | null;
protected _controlsElements: NodeListOf<Element> | null;
protected _indicatorsElement: HTMLElement | null;
protected templateControls: string;
protected templateIndicators: string;
protected autoplayIntervalIndex: number | null;
protected continuousAutoplayIntervalIndex: number | null;
protected resumeTimer: number | null;
protected routerEvents: EventDispatcher;
protected breakpoint: Breakpoint;
scope: Scope;
constructor();
next(): void;
prev(): void;
goTo(index: number): void;
protected setOptions(dest: ResponsiveOptions | Options, source: ResponsiveOptions | Options): void;
protected setOptionsIfUndefined(dest: ResponsiveOptions | Options, source: ResponsiveOptions | Options): void;
protected initResponsiveOptions(): void;
protected setControlsOptions(): void;
protected setIndicatorsOptions(): void;
protected getBreakpoint(): Breakpoint;
protected setOptionsByBreakpoint(breakpoint: Breakpoint): void;
protected onBreakpointChanges(): void;
protected _onViewChanges(): void;
protected onViewChanges: (...params: any[]) => Promise<any>;
protected onVisibilityChanged(event: CustomEvent): void;
protected _onScroll(): void;
protected onScroll: (...params: any[]) => Promise<any>;
protected onScrollend(): void;
protected onMouseIn(): void;
protected onMouseOut(): void;
protected _onMouseUp(): void;
protected onMouseUp: (...params: any[]) => Promise<unknown>;
protected resume(delay?: number): void;
protected connectedCallback(): Promise<void>;
protected addEventListeners(): void;
protected removeEventListeners(): void;
protected beforeBind(): Promise<any>;
protected afterBind(): Promise<void>;
protected initSlideshowInner(): void;
protected enableDesktopDragscroll(): void;
protected disableDesktopDragscroll(): void;
protected enableContinuousAutoplay(): void;
protected disableContinuousAutoplay(): void;
protected enableIntervalAutoplay(): void;
protected disableIntervalAutoplay(): void;
protected disableAutoplay(): void;
protected enableAutoplay(): void;
protected initSlideshowInnerSlides(): void;
protected transformTemplateAttributes(attributes: any, index: number): any;
protected addItemByTemplate(tpl: HTMLTemplateElement, index: number): void;
protected addItemsByChilds(): void;
protected getScrollPosition(): ScrollPosition;
protected getCurrentClosestNumber(goal: number, curr: number, prev: number): number;
protected getMostCenteredSlideIndex(): number;
protected setAllSlidesInactive(excludeIndex?: number): void;
protected setCenteredSlideActive(): number;
protected isScrollableToIndex(index: number): boolean;
protected scrollToNextSlide(): void;
protected scrollToPrevSlide(): void;
protected scrollToNearestSlide(): void;
protected setSlidePositions(): void;
protected requiredAttributes(): string[];
protected attributeChangedCallback(attributeName: string, oldValue: any, newValue: any, namespace: string | null): Promise<void>;
protected parsedAttributeChangedCallback(attributeName: string, oldValue: any, newValue: any, namespace: string | null): void;
protected disconnectedCallback(): void;
protected template(): ReturnType<TemplateFunction>;
}