UNPKG

ws-dottie

Version:

Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration

26 lines 1.25 kB
/** * @fileoverview Cache Flush Date Hooks for WS-Dottie * * Provides React Query hooks for polling cache flush dates and invalidating * queries when flush dates change. This is specifically for WSF APIs that * use cache flush dates to indicate when static data has been updated. * * Uses internal fetch functions created with createFetchFunction to break * circular dependencies. These are separate from the public-facing fetch * functions exported from API modules. */ import type { UseQueryResult } from "@tanstack/react-query"; /** * Hook to poll cache flush date endpoint * * @param apiName - The name of the API (e.g., "wsf-vessels") * @param fetchMode - Optional fetch mode to use ("native" or "jsonp"). * Defaults to "native". Should match the fetchMode used * by the underlying hook to ensure consistent behavior. */ export declare const useCacheFlushDate: (apiName: string, fetchMode?: "native" | "jsonp") => UseQueryResult<string, Error>; /** * Hook to handle cache invalidation when flush date changes */ export declare const useInvalidateOnFlushChange: (endpointId: string, flushDateQuery?: UseQueryResult<string, Error>) => void; //# sourceMappingURL=cacheFlushDate.d.ts.map