UNPKG

@exadel/esl

Version:

Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components

65 lines (64 loc) 3.34 kB
import type { ESLCarousel } from './esl-carousel'; import type { ESLCarouselDirection, ESLCarouselStaticState } from './esl-carousel.types'; /** {@link ESLCarouselSlideEvent} init object */ export interface ESLCarouselSlideEventInit { /** A list of indexes of slides that were active before the change */ indexesBefore: number[]; /** A list of indexes of slides that are active after the change */ indexesAfter: number[]; /** Direction of slide animation */ direction?: ESLCarouselDirection; /** Auxiliary request attribute that represents object that initiates slide change */ activator?: any; } /** {@link ESLCarousel} event that represents slide change event */ export declare class ESLCarouselSlideEvent extends Event implements ESLCarouselSlideEventInit { /** {@link ESLCarouselSlideEvent} cancelable event type dispatched before slide change (pre-event) */ static readonly BEFORE = "esl:before:slide-change"; /** {@link ESLCarouselSlideEvent} event type dispatched before carousel is going to change active slide (post-event) */ static readonly CHANGE = "esl:slide-change"; /** {@link ESLCarouselSlideEvent} event type dispatched after slide change (post-event) */ static readonly AFTER = "esl:after:slide-change"; readonly target: ESLCarousel; readonly indexesBefore: number[]; readonly indexesAfter: number[]; readonly direction: ESLCarouselDirection; readonly activator?: any; protected constructor(type: string, init: ESLCarouselSlideEventInit); /** @returns first index of before sate */ get indexBefore(): number; /** @returns first index of after state */ get indexAfter(): number; /** @returns list of slides that are active before the change */ get $slidesBefore(): HTMLElement[]; /** @returns list of slides that are active after the change */ get $slidesAfter(): HTMLElement[]; static create(type: 'BEFORE' | 'CHANGE' | 'AFTER', init: ESLCarouselSlideEventInit): ESLCarouselSlideEvent; } /** {@link ESLCarouselChangeEvent} init object */ interface ESLCarouselChangeEventInit { /** Whether the event is initial (on carousel creation) */ initial?: boolean; /** Current {@link ESLCarousel} instance config */ config: ESLCarouselStaticState; /** Previous {@link ESLCarousel} instance config */ oldConfig?: ESLCarouselStaticState; /** A list of slides that has been added to the current carousel instance */ added: HTMLElement[]; /** A list of slides that has been removed from the current carousel instance */ removed: HTMLElement[]; } /** {@link ESLCarousel} event that represents slide configuration change */ export declare class ESLCarouselChangeEvent extends Event implements ESLCarouselChangeEventInit { /** {@link ESLCarouselSlideEvent} event type dispatched on carousel config changes */ static readonly TYPE = "esl:carousel:change"; readonly target: ESLCarousel; readonly initial: boolean; readonly config: ESLCarouselStaticState; readonly oldConfig?: ESLCarouselStaticState; readonly added: HTMLElement[]; readonly removed: HTMLElement[]; protected constructor(type: typeof ESLCarouselChangeEvent.TYPE, init: ESLCarouselChangeEventInit); static create(init: ESLCarouselChangeEventInit): ESLCarouselChangeEvent; } export {};