UNPKG

@blossom-carousel/svelte

Version:

A native-scroll-first carousel component for Svelte.

16 lines (15 loc) 860 B
import type { Snippet } from "svelte"; /** * Server-only: unlike a Vue vnode tree or a React element tree, a Svelte * snippet is an opaque render function, not an introspectable data * structure. So slide count is derived by rendering the carousel's * `children` snippet through a tiny probe component and counting * `data-blossom-slide` occurrences in the resulting HTML string. * * Guarded to run only during SSR — on the client this is a no-op, since * dots seed their initial count directly from the live (already-hydrated) * DOM instead (see `navigation.ts`). Browser bundles don't even include * this module: the `browser` field in package.json swaps it for * `ssrSlideCount.client.ts`, keeping `svelte/server` out of client builds. */ export declare function registerSlideCountFromSnippet(id: string, children: Snippet | undefined): void;