@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
64 lines (63 loc) • 2.57 kB
TypeScript
import { ESLCarouselPlugin } from '../esl-carousel.plugin';
export interface ESLCarouselAutoplayConfig {
/** Duration of the autoplay timer in milliseconds. Default: 5000 */
duration: string | number;
/** Navigation command to send to the host carousel. Default: 'slide:next' */
command: string;
/** Whether to track user interaction (focus/hover) with the carousel to pause/resume autoplay */
trackInteraction: boolean;
/** Selector for control to toggle plugin state */
control?: string;
/** Class to toggle on control element, when autoplay is active */
controlCls?: string;
/** Class to toggle on container element, when autoplay is active */
containerCls?: string;
}
/**
* {@link ESLCarousel} autoplay (auto-advance) plugin mixin
* Automatically switch slides by timeout
*
* @author Alexey Stsefanovich (ala'n)
*/
export declare class ESLCarouselAutoplayMixin extends ESLCarouselPlugin<ESLCarouselAutoplayConfig> {
static is: string;
static DEFAULT_CONFIG: ESLCarouselAutoplayConfig;
static DEFAULT_CONFIG_KEY: keyof ESLCarouselAutoplayConfig;
private _enabled;
private _duration;
/** True if the autoplay timer is currently active */
get active(): boolean;
/** True if the autoplay plugin is enabled */
get enabled(): boolean;
protected set enabled(value: boolean);
/** The duration of the autoplay timer in milliseconds */
get duration(): number;
/** A list of control elements to toggle plugin state */
get $controls(): HTMLElement[];
protected onInit(): void;
protected disconnectedCallback(): void;
protected onConfigChange(): void;
/** Activates and restarts the autoplay carousel timer */
start(): void;
/**
* Deactivates the autoplay carousel timer.
* @param system - If true, the plugin will be suspended but not disabled.
*/
stop(system?: boolean): void;
/**
* Starts a new autoplay cycle.
* Produces cycle self call after a timeout with enabled command execution.
*/
protected _onCycle(exec?: boolean): Promise<void>;
/** Handles click on control element to toggle plugin state */
protected _onToggle(e: Event): void;
/** Handles auxiliary events that represent user interaction to pause/resume timer */
protected _onInteract(e: Event): void;
/** Handles carousel slide change event to restart the timer */
protected _onSlideChange(): void;
}
declare global {
export interface ESLCarouselNS {
Autoplay: typeof ESLCarouselAutoplayMixin;
}
}