import type { LoadMoreSource } from './types'; import type { Snippet } from 'svelte'; type Props = { /** * Where the next batch comes from. Either an async callback invoked when the sentinel becomes visible — it should resolve once the batch is appended * (or no-op when there are no more items — `CursorDataLoader.loadMore` already returns `[]` in that case) — or a data loader, whose `failed` then also * stops the sentinel from firing on its own and offers a manual continue instead. * * The object form must report `failed` and `canLoadMore` reactively: pass the loader itself, or an object literal rebuilt by the surrounding reactive * scope (`{ loadMore: () => l.loadMore(key), failed: l.failed(key), canLoadMore: l.canLoadMore(key) }`). A plain object holding fixed values type-checks * and leaves the sentinel armed through every failure. */ loadMore: LoadMoreSource; /** Scroll ancestor used as the IntersectionObserver root. Required when the viewport differs from the scrolling container. */ container?: HTMLElement | null; /** IntersectionObserver `rootMargin`. Default `'200px'` — fires the load a viewport-screen before reaching the bottom. */ rootMargin?: string; children: Snippet; /** Custom loading indicator snippet. Defaults to the kit `Spinner`. */ loading?: Snippet; /** Manual continue shown while `failed`, taking the callback that retries the failed page. Defaults to a kit `Button`. */ retry?: Snippet<[() => void]>; }; /** * Triggers an async `loadMore` callback when a sentinel element scrolls into view, using IntersectionObserver. Re-observes the sentinel on container resize so layout shifts inside the parent re-evaluate visibility (a known IntersectionObserver gotcha). Internal `isLoading` guard prevents overlapping fires while a load is in flight. * * Pairs with `core/data-loaders` (`CursorDataLoader`, `PageDataLoader`, `CursorDataLoaderWithSearch`) — wire `loadMore={loader.loadMore}` and `{#each loader.items as item}` directly. * * Passing the loader itself — `loadMore={loader}` instead of `loadMore={loader.loadMore}` — disarms the sentinel while the loader reports `failed`, so a failing backend is not asked again on its own and the already-loaded list is kept. The manual continue appears only when the loader can still continue (`resumeAfterFailure`); a loader that closed its list on the failure ends silently, as it does at the natural end. A successful retry re-arms the sentinel on its own. * * ### CSS Custom Properties * | Property | Description | Default | * |---|---|---| * | `--sc-kit--infinite-scroll--display` | Display mode for root and items container | `block` | * | `--sc-kit--infinite-scroll--flex` | Flex shorthand for root and items container | `initial` | * | `--sc-kit--infinite-scroll--overflow-y` | Vertical overflow behavior | `initial` | */ declare const Cmp: import("svelte").Component; type Cmp = ReturnType; export default Cmp;