UNPKG

@exadel/esl

Version:

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

68 lines (67 loc) 3.81 kB
import { ESLCarouselActionEvent } from './esl-carousel.events.base'; import type { ESLCarousel } from './esl-carousel'; import type { ESLCarouselActionEventBaseInit } from './esl-carousel.events.base'; import type { ESLCarouselDirection, ESLCarouselStaticState } from './esl-carousel.types'; /** {@link ESLCarouselSlideEvent} init object */ export interface ESLCarouselSlideEventInit extends ESLCarouselActionEventBaseInit { /** Direction of slide animation */ direction?: ESLCarouselDirection; } type ESLCarouselSlideEventType = typeof ESLCarouselSlideEvent.BEFORE | typeof ESLCarouselSlideEvent.CHANGE | typeof ESLCarouselSlideEvent.AFTER; /** {@link ESLCarousel} event that represents slide change event */ export declare class ESLCarouselSlideEvent extends ESLCarouselActionEvent 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 type: ESLCarouselSlideEventType; protected constructor(type: ESLCarouselSlideEventType, init: ESLCarouselSlideEventInit); static create(type: 'BEFORE' | 'CHANGE' | 'AFTER', init: ESLCarouselSlideEventInit): ESLCarouselSlideEvent; } /** {@link ESLCarouselMoveEvent} init object */ export interface ESLCarouselMoveEventInit extends ESLCarouselActionEventBaseInit { /** Carousel offset in pixels */ offset: number; /** Carousel offset before the move in pixels */ offsetBefore: number; } /** {@link ESLCarousel} event that represents slide move event */ export declare class ESLCarouselMoveEvent extends ESLCarouselActionEvent implements ESLCarouselMoveEventInit { /** {@link ESLCarouselMoveEvent} event type dispatched on carousel move */ static readonly TYPE = "esl:carousel:move"; readonly type: typeof ESLCarouselMoveEvent.TYPE; readonly offset: number; readonly offsetBefore: number; protected constructor(type: typeof ESLCarouselMoveEvent.TYPE, init: ESLCarouselMoveEventInit); static create(init: ESLCarouselMoveEventInit): ESLCarouselMoveEvent; } /** {@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 type: typeof ESLCarouselChangeEvent.TYPE; 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 {};