import { type Context, type ReactNode } from "react"; import { type NativeScrollEvent, type NativeSyntheticEvent } from "react-native"; export interface ScrollAncestry { /** Listen for a scroll of this scroller or of any kit scroller around it. */ subscribe(listener: () => void): () => void; /** The value this scroller gives React Native's scroll context inside it. */ token: object; } /** The nearest kit scroller around a node, or null. */ export declare const ScrollAncestryContext: Context; export declare const NativeScrollContext: Context; /** Whether a node sits in a scroller the kit cannot hear (React Native's own, used directly). */ export declare function useUnheardScroller(): boolean; /** * Listen for every scroll the document reports (capture phase, so a scroll of any * element is heard as well as the window's). A no-op where there is no document. */ export declare function subscribeDocumentScroll(listener: () => void): () => void; type ScrollHandler = ((event: NativeSyntheticEvent) => void) | undefined; /** * A kit scroller's half: wraps its children in the contexts above and composes its * scroll handler, which it attaches only while a card listens (or its owner passed one). * While a card listens, the scroller asks for a scroll event every frame * (`scrollEventThrottle` 16); a scroller that sets its own throttle keeps it. * * Each child gets its own pair of providers, which render no node: React Native's * ScrollView finds sticky headers by child index, and a paging one on the web gives each * child its own snap cell, so the scroller's children must reach it as they were passed, * one for one. An empty slot stays empty (`false`, which React Native skips exactly as it * skips the null it stands for), so no index moves and no empty cell appears. */ export declare function useScrollAncestor({ horizontal, onScroll, scrollEventThrottle }: { horizontal?: boolean | null; onScroll?: ScrollHandler; scrollEventThrottle?: number; }): { onScroll: ((event: NativeSyntheticEvent) => void) | undefined; scrollEventThrottle: number | undefined; children: (content: ReactNode) => import("react").JSX.Element[] | null | undefined; }; export {}; //# sourceMappingURL=scroll-ancestry.d.ts.map