import { SvelteComponentTyped } from "svelte"; import type { SvelteHTMLElements } from "svelte/elements"; export type CarbonCarouselContext = { views: import("svelte/store").Writable; active: import("svelte/store").Writable; stacked: import("svelte/store").Writable; claimSlide: () => number; }; type $RestProps = SvelteHTMLElements["div"]; type $Props = { /** * Specify the active slide index. * Out-of-range values are clamped to the first or last slide. * @default 0 */ selectedIndex?: number; /** * Specify the accessible label for the carousel region. * @default "Carousel" */ labelText?: string; /** * Specify the accessible label for the previous-slide button. * @default "Previous slide" */ prevButtonLabelText?: string; /** * Specify the accessible label for the next-slide button. * @default "Next slide" */ nextButtonLabelText?: string; /** * Set to `false` to size the viewport to each active slide's own height * instead of the tallest slide. * @default true */ useMaxHeight?: boolean; /** * Set to `true` to wrap around: next on the last slide goes to the first, * and previous on the first slide goes to the last. Applies to the buttons * and arrow keys; a bound `selectedIndex` is still clamped. * @default false */ wrap?: boolean; /** * Set to `true` to show the active slide's position next to the buttons. * Pair it with `wrap`, where the buttons no longer disable at the bounds. * @default false */ showCounter?: boolean; /** * Set an id for the top-level element. * The viewport id derives from it as `{id}-viewport`. * @default uniqueId() */ id?: string; /** * Override the counter text. * @default (current, total) => `${current} of ${total}` */ counterText?: (current: number, total: number) => string; children?: (this: void) => void; [key: `data-${string}`]: unknown; }; export type CarouselProps = Omit<$RestProps, keyof $Props> & $Props; export default class Carousel extends SvelteComponentTyped< CarouselProps, { change: CustomEvent<{ currentIndex: number; previousIndex: number; totalViews: number }>; }, { default: Record } > {}