/** * Suspense-compatible remote data hook with bounded LRU cache and short error * TTL so a transient failure does not poison the cache for `ttl` minutes. * * Supports cache tags + `revalidateTag` / `revalidatePath` for explicit * invalidation (Next-style). `useRemoteData` subscribes to a revalidation * signal, so purging an entry re-suspends and refetches on the next render. */ export interface UseRemoteDataOptions { key: string; fetcher: () => Promise; /** Cache TTL for successful values (ms). Default 60_000. */ ttl?: number; /** Negative cache TTL for errors (ms). Default 1500 — keeps retries cheap but doesn't loop. */ errorTtl?: number; /** Cache tags for `revalidateTag` invalidation, e.g. `['posts', 'post:42']`. */ tags?: string[]; } /** * Subscribe a component to the global revalidation signal. Returns the current * version; bumps (and re-renders) whenever `revalidateTag` / `revalidatePath` / * `invalidateRemoteData` purges anything. Used internally by `useRemoteData`. */ export declare function useRevalidationVersion(): number; /** * Suspense-compatible data fetching hook. Throws the promise while pending so * an enclosing renders the fallback. Errors bubble to ErrorBoundary. * * Successful values are cached for `ttl`; errors are cached for `errorTtl` so * the same render pass doesn't thrash the network — after that window, the * next call retries. */ export declare function useRemoteData(options: UseRemoteDataOptions): T; export declare function invalidateRemoteData(key: string): void; export declare function clearRemoteDataCache(): void; /** * Purge every cached entry carrying `tag` and re-render subscribers so they * refetch. Pair with `useRemoteData({ key, fetcher, tags: ['posts'] })`. */ export declare function revalidateTag(tag: string): void; /** * Convenience over {@link revalidateTag}: invalidate everything tagged with a * route path. Tag your loaders with the path (e.g. `tags: ['/dashboard']`) to * use it. */ export declare function revalidatePath(path: string): void; export declare function prefetchRemoteData(key: string, fetcher: () => Promise, ttl?: number, tags?: string[]): Promise; //# sourceMappingURL=use-remote-data.d.ts.map