/** * Hook for automatic request cleanup on unmount * * @example * ```tsx * function Component() { * const { trackRequest, untrackRequest } = useRequestCleanup(); * * useEffect(() => { * const key = '/api/data'; * trackRequest(key); * fetchData(key).finally(() => untrackRequest(key)); * }, []); * } * ``` */ export declare function useRequestCleanup(): { trackRequest: (key: string) => void; untrackRequest: (key: string) => void; abortTracked: (reason?: string) => void; }; /** * Hook for request with automatic abort * * @param key - Unique request identifier * @returns Object with signal and abort function * * @example * ```tsx * function SearchComponent() { * const { signal, abort } = useAbortableRequest('search'); * * const handleSearch = async (query: string) => { * try { * const results = await fetch(`/api/search?q=${query}`, { signal }); * // Handle results * } catch (err) { * if (!isAbortError(err)) { * // Handle real error * } * } * }; * } * ``` */ export declare function useAbortableRequest(key: string): { signal: AbortSignal | undefined; abort: (reason?: string) => void; }; /** * Hook for managing a group of related requests * * @param groupName - Name for the request group * @returns Object with request management functions * * @example * ```tsx * function Dashboard() { * const { makeRequest, abortGroup } = useRequestGroup('dashboard'); * * useEffect(() => { * makeRequest('stats', () => api.getStats()); * makeRequest('users', () => api.getUsers()); * }, []); * * const handleRefresh = () => { * abortGroup('Refreshing'); * // Make new requests * }; * } * ``` */ export declare function useRequestGroup(groupName: string): { makeRequest: (key: string, fetcher: () => Promise) => Promise; abortGroup: (reason?: string) => void; getActiveCount: () => number; }; /** * Hook for route-aware requests that abort on route change * * @returns Object with makeRequest function * * @example * ```tsx * function PageComponent() { * const { makeRequest } = useRouteAwareRequest(); * * useEffect(() => { * makeRequest('page-data', () => api.getPageData()); * }, []); * // Automatically aborted on route change * } * ``` */ export declare function useRouteAwareRequest(): { makeRequest: (key: string, fetcher: () => Promise) => Promise; }; //# sourceMappingURL=react.d.ts.map