ws-dottie
Version:
Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration
32 lines • 1.24 kB
TypeScript
/**
* @fileoverview Fetch Handler Implementations
*
* This module provides the fetch handler implementations for native fetch
* and JSONP requests. These are pure handler functions that handle the
* low-level details of making HTTP requests.
*/
import type { FetchHandler } from "../../types";
/**
* Native fetch handler implementation
*
* Uses the standard fetch API available in Node.js and modern browsers.
* Performs standard HTTP requests and handles response status codes appropriately.
*
* @param url - The URL to fetch data from
* @returns Promise resolving to the response data as a string
* @throws Error if the response is not ok (status >= 400)
*/
export declare const handleFetchNative: FetchHandler;
/**
* JSONP fetch handler implementation
*
* Handles CORS restrictions by using JSONP callbacks instead of direct
* HTTP requests. Creates a script tag with a callback parameter and
* handles the response through a global callback function.
*
* @param url - The URL to fetch data from
* @returns Promise resolving to the response data as a JSON string
* @throws Error if the JSONP request fails or times out
*/
export declare const handleFetchJsonp: FetchHandler;
//# sourceMappingURL=handleFetch.d.ts.map