import { TouchEvent as ReactTouchEvent } from 'react'; /** Default pull distance (px of finger travel) required to trigger a refresh. */ export declare const PULL_TO_REFRESH_THRESHOLD = 72; /** * Refresh progress for a downward pull: 0 at rest, 1 once the finger has * travelled `threshold` px. Clamped; negative/zero pulls and invalid * thresholds yield 0. */ export declare function computePullProgress(dy: number, threshold: number): number; /** * Rubber-banded indicator offset (px) for a pull of `dy` px. Approaches * `threshold * 1.5` asymptotically so long pulls feel damped like the native * gesture instead of tracking the finger 1:1. */ export declare function computePullOffset(dy: number, threshold: number): number; export interface UsePullToRefreshOptions { /** Called when the gesture completes past the threshold. */ onRefresh: () => Promise | void; /** Finger travel (px) required to arm the refresh. Default 72. */ threshold?: number; /** Hard-disable the gesture (e.g. while a form blocks navigation). */ disabled?: boolean; /** * Whether the gesture is active at all. Defaults to `isNative()` — web * browsers already have reload affordances; pass `true` to enable it for * installed PWAs too. */ enabled?: boolean; } export interface PullToRefreshBind { /** Attach to the scrollable container. */ ref: (node: HTMLElement | null) => void; onTouchStart: (event: ReactTouchEvent) => void; onTouchMove: (event: ReactTouchEvent) => void; onTouchEnd: () => void; onTouchCancel: () => void; } export interface UsePullToRefreshResult { /** Spread onto the scroll container (`
`). */ bind: PullToRefreshBind; /** True while the finger is down and pulling past the top. */ pulling: boolean; /** 0..1 — fraction of the threshold reached. */ progress: number; /** Damped indicator offset in px. */ offset: number; /** True while `onRefresh` is running. */ refreshing: boolean; /** Resolved enablement (native detection + `disabled`). */ enabled: boolean; } /** * Touch pull-to-refresh for scrollable lists (spec §5.7): only engages when * the container is scrolled to the top, fires `impact('medium')` once when the * pull crosses the threshold, and `notify('success')` after `onRefresh` * resolves. Pair with the `PullToRefresh` wrapper from * `@burdenoff/fe-libs/ui`, or spread `bind` onto your own container (give it * `overscroll-behavior-y: contain` — the `[data-pull-to-refresh]` CSS does * this — so the browser's own overscroll doesn't fight the gesture). */ export declare function usePullToRefresh(options: UsePullToRefreshOptions): UsePullToRefreshResult; //# sourceMappingURL=usePullToRefresh.d.ts.map