/** * createCarousel - the HEADLESS core behind : slide navigation * (with optional looping), autoplay that pauses on hover/focus and via a * persistent stop toggle (WCAG 2.2.2), and rtl-aware arrow wiring - as * prop-getters you spread onto your own markup. The component keeps only the * visual track + swipe. Runes-based, like `createListbox`. */ import { type EditorDir } from './editor-contract'; export type CarouselConfig = { count: () => number; /** Active slide index (the component owns the state; core calls onChange). */ current: () => number; onChange?: (index: number) => void; loop?: () => boolean; /** Autoplay interval in ms; 0 = off. */ autoplay?: () => number; dir?: () => EditorDir | undefined; }; export declare function createCarousel(config: CarouselConfig): { readonly paused: boolean; readonly userPaused: boolean; rtl: () => boolean; isActive: (i: number) => boolean; go: (i: number) => void; next: () => void; prev: () => void; canGoPrev: () => boolean; canGoNext: () => boolean; /** Spread onto the carousel container. Pauses autoplay on hover/focus. */ rootProps: (ariaLabel?: string) => { role: "group"; 'aria-roledescription': string; 'aria-label': string; onpointerenter: () => void; onpointerleave: () => void; onfocusin: () => void; onfocusout: () => void; }; /** Spread onto each slide element. */ slideProps: (i: number) => { role: "group"; 'aria-roledescription': string; 'aria-label': string; 'aria-hidden': boolean; inert: boolean; }; /** The visually-leading (inline-start) arrow: logical prev in ltr, next in rtl. */ prevArrowProps: () => { 'aria-label': string; onclick: () => void; disabled: boolean; }; /** The visually-trailing (inline-end) arrow: logical next in ltr, prev in rtl. */ nextArrowProps: () => { 'aria-label': string; onclick: () => void; disabled: boolean; }; /** Spread onto a dot indicator. */ dotProps: (i: number) => { 'aria-label': string; 'aria-current': "true" | undefined; onclick: () => void; }; /** Spread onto the persistent play/pause toggle (render only when autoplay > 0). */ playPauseProps: () => { 'aria-label': string; 'aria-pressed': boolean; onclick: () => void; }; }; export type Carousel = ReturnType;