import { EventEmitter } from '../../stencil-public-runtime'; import type { EmblaCarouselType } from 'embla-carousel'; /** * Carousel context shared with child components */ export interface CarouselContext { emblaApi: EmblaCarouselType | null; selectedIndex: number; scrollSnapCount: number; canScrollPrev: boolean; canScrollNext: boolean; scrollPrev: () => void; scrollNext: () => void; scrollTo: (index: number) => void; } /** * Interface for the carousel element with its public methods */ export interface CarouselElement extends HTMLElement { scrollPrev: () => Promise; scrollNext: () => Promise; goToSlide: (index: number) => Promise; getSelectedIndex: () => Promise; getContext: () => Promise; } /** * @slot - Carousel content (seki-carousel-content, arrows, dots) */ export declare class SekiCarousel { el: HTMLElement; /** Enable infinite loop scrolling */ loop: boolean; /** Enable autoplay */ autoplay: boolean; /** Autoplay delay in milliseconds */ autoplayDelay: number; /** Pause autoplay on hover */ pauseOnHover: boolean; /** Number of slides to scroll at once */ slidesToScroll: number; /** Initial slide index */ startIndex: number; /** Enable momentum/free scrolling */ dragFree: boolean; /** Accessible label for the carousel */ ariaLabel: string; /** Currently selected slide index */ selectedIndex: number; /** Total number of scroll snaps */ scrollSnapCount: number; /** Whether can scroll to previous */ canScrollPrev: boolean; /** Whether can scroll to next */ canScrollNext: boolean; /** Whether autoplay is currently paused */ autoplayPaused: boolean; /** Emitted when the selected slide changes */ slideChange: EventEmitter<{ index: number; total: number; }>; /** * Internal notification that the carousel's context (canScrollPrev/Next, * selectedIndex, scrollSnapCount) has changed. Child nav buttons and dots * subscribe to this and re-read getContext(). Unlike sekiSlideChange, it also * fires on the first embla init and on reInit — otherwise children that read * state once at mount (before embla, gated behind a dynamic import since #263, * has finished loading) would freeze at that premature state forever (#274). * Matches the context-bridge convention (see src/utils/context-bridge.ts); * eventName must be a string literal for Stencil to register it. */ contextChange: EventEmitter; private emblaApi; private autoplayInterval; private viewportEl; private initRafId; private initRetries; private hasLoaded; /** * Bumped by teardownEmbla(). initEmbla() awaits (content definition, the * embla-carousel import), so an init that started before a teardown checks * this and gives up instead of creating a second, orphaned Embla instance. */ private initGeneration; /** Slide to come back to when Embla is re-created after a move or option change. */ private resumeIndex; private waitedForContentDefinition; /** Direction Embla was created with; compared on `dir` changes (#381). */ private appliedRtl; private dirObserver; private static readonly MAX_INIT_RETRIES; connectedCallback(): void; componentDidLoad(): void; disconnectedCallback(): void; handleAutoplayChange(newValue: boolean): void; handleOptionsChange(): void; /** Scroll to the previous slide */ scrollPrev(): Promise; /** Scroll to the next slide */ scrollNext(): Promise; /** Scroll to a specific slide index */ goToSlide(index: number): Promise; /** Get the currently selected slide index */ getSelectedIndex(): Promise; /** Get the carousel context for child components */ getContext(): Promise; /** * Embla's `direction` is fixed at creation, so watch the `dir` attribute of * every ancestor (crossing shadow roots) and re-create Embla when the computed * direction actually flips. Attribute-filtered and non-subtree, so it is cheap. */ private observeDirection; private handleDirectionChange; /** Stop autoplay, cancel a pending init and destroy Embla. Idempotent. */ private teardownEmbla; private initEmbla; private handleSelect; private handleReInit; private handlePointerDown; private handlePointerUp; private updateState; private startAutoplay; private stopAutoplay; private pauseAutoplay; private resumeAutoplay; private handleMouseEnter; private handleMouseLeave; private handleFocusIn; private handleFocusOut; private handleKeyDown; render(): any; }