import { EventEmitter } from "../../stencil-public-runtime"; import { StzhCarouselSlideStartEvent, StzhCarouselSlidePassedEvent, StzhCarouselSlideEndEvent } from "../../index"; import { StzhCarouselLocalizedText } from "./stzh-carousel.localization"; /** * @slot - Slot for any content * @slot actions - Slot for `stzh-actions` element */ export declare class StzhCarousel { /** Translation strings */ localization: StzhCarouselLocalizedText; /** Carousel variant */ variant: "default" | "cards"; /** Whether carousel is disabled */ disabled: boolean; /** Whether to remove inside/outside peek. */ noPeek: boolean; /** Slides number */ slides: number; /** Slides number above small breakpoint */ slidesSmall: number; /** Slides number above medium breakpoint */ slidesMedium: number; /** Slides number above large breakpoint */ slidesLarge: number; /** Slides number above ultra breakpoint */ slidesUltra: number; /** Active slide (readonly) */ slide: number; /** * Whether autoplay is enabled. * Gets paused, when user has focus inside carousel element or hovers over it. * Also when reduced motion media query is active or carousel is set disabled. * Gets disabled permanently, when user interacts with carousel manually (clicks prev/next, scrolls or drags) */ autoplay: boolean; /** Timeout delay in milliseconds used for autoplay */ autoplayTimeout: number; /** Whether scrolling & dragging should be disabled */ nonInteractive: boolean; /** Whether drag with mouse should be disabled (still will be able to scroll with wheeling or arrow keys) */ preventMouseDrag: boolean; /** Whether autoplay pause should be prevented when user hovers/focuses carousel */ preventAutoplayPause: boolean; /** Whether autoplay stop should be prevented when user scroll or drags carousel */ preventAutoplayStop: boolean; /** * Enable all slides to be tabbable (will disable prev/next arrows from being tabbable). * By default only the visible slides will be tabbable and the prev/next can be used to change slides * (enabled when `variant` is set to `cards`). */ tabThrough: boolean; /** Whether indicator should be shown */ withTrack: boolean; /** Timeout delay in milliseconds used to catch the end of scroll events */ scrollTimeout: number; /** Minimum drag distance that needs to be reached to swipe to next/previous slide(s). */ distanceQuickSwipe: number; /** Minimum drag distance that neeeds to be reached to prevent click on slide elements. */ distancePreventClick: number; element: HTMLStzhCarouselElement; /** Slide start event */ stzhSlideStart: EventEmitter; /** Slide passed event */ stzhSlidePassed: EventEmitter; /** Slide end event */ stzhSlideEnd: EventEmitter; /** Scroll to a slide by index */ slideTo(index: any, behaviour?: "auto" | "smooth"): Promise; /** Scroll to previous snap point */ slideToPrevious(behaviour?: "auto" | "smooth"): Promise; /** Scroll to next snap point */ slideToNext(behaviour?: "auto" | "smooth"): Promise; disabledWatcher(): void; preventMouseDragWatcher(): void; autoplayRunningWatcher(): void; snapAlignWatcher(): void; inertWatcher(): void; prevNextNavigationWatcher(): void; prevNextHiddenWatcher(): void; nextPrevDisabledWatcher(): void; nextElementsWatcher(): void; previousElementsWatcher(): void; /** Whether autoplay is currently running */ autoplayRunning: boolean; /** Whether autoplay is currently disabled by reduced motion media */ autoplayDisabledByMotionMedia: boolean; /** Whether autoplay is currently disabled by mouse */ autoplayDisabledByMouse: boolean; /** Whether autoplay is currently disabled by focus */ autoplayDisabledByFocus: boolean; /** Whether autoplay is currently disabled by scroll */ autoplayDisabledByScroll: boolean; /** Whether autoplay is currently disabled by drag */ autoplayDisabledByDrag: boolean; /** Whether user is currently dragging with mouse */ dragging: boolean; /** Whether user is currently scrolling */ scrolling: boolean; /** Aria live text */ announcementText: string; /** Currently shown slides */ currentSlides: number; /** How many slides should be moved currently */ currentSwipeSlides: number; /** Slide elements */ slideElements: HTMLElement[]; /** Previous elements */ previousElements: HTMLElement[]; /** Next elements */ nextElements: HTMLElement[]; /** Navigation text elements */ navigationTextElements: HTMLElement[]; private scrollElement; /** Unique generated id */ private readonly uid; /** Current scroll position */ private slideScrollLeft; /** Flag whether scrolling was done by user or not */ private scrolledByAutoplay; /** Timeout ID used to catch the end of scroll events */ private scrollTimeoutId; /** Interval ID for autoplay */ private autoplayIntervalId; /** Last drag event position */ private lastX; /** Where the dragging started */ private startX; /** Where the dragging started scroll position */ private startScrollLeft; /** Timeout ID for a smooth drag release */ private disableTimeoutId; /** Calculated size of a single item */ private itemSize; /** Resize observer used to update item size */ private resizeObserver; /** Mutation observer used to keep track of slides */ private mutationObserver; /** Whether user has just stopped dragging */ private stoppedDragging; private scrollToSlide; /** Width of a slide */ private sizingMethod; /** * Calculates the active slide. * The scroll-snap-type property makes sure that the container snaps perfectly to integer multiples. */ private calculateSlide; private scrollToPreviousSnapPoint; private scrollToNextSnapPoint; private update; private hasReachedLastSlide; private onReducedMotionMediaChange; private onMouseenter; private onMouseleave; private onFocusin; private onFocusout; private onPreviousClick; private onNextClick; private onSlideResize; private onMutation; private onScroll; private onScrollEnd; private onMediaChange; /** Scroll the slider the appropriate amount of pixels and update the last event position */ private mouseMove; /** Clear disable timeout, set up variables and styles and attach the listener. */ private startDragging; /** User stopped dragging */ private stopDragging; private checkClick; private autoplayInterval; componentWillLoad(): Promise; componentDidLoad(): void; connectedCallback(): void; disconnectedCallback(): void; render(): any; }