/** Opt-in polling knob accepted by every collection hook. */ export interface PollOptions { /** When set (> 0), re-fetch on this millisecond cadence. Off by default. */ pollMs?: number; } export interface Resource { data: T; error: Error | undefined; isLoading: boolean; refresh(): Promise; } /** Drive one async source into a `{ data, error, isLoading, refresh }` view. * * `fetcher` must be memoised by the caller (stable across renders while its * inputs are unchanged) — refresh, the mount fetch, and the poll all key off * its identity. A per-call generation guard drops out-of-order and post-unmount * responses so overlapping refreshes (poll + manual + post-mutation) never * clobber newer state. `isLoading` reflects only the very first load, so a * background poll or refresh never flickers a consumer's initial skeleton. */ export declare function useResource(fetcher: () => Promise, initial: T, { pollMs }?: PollOptions): Resource;