ws-dottie
Version:
Your friendly TypeScript companion for Washington State transportation APIs - WSDOT and WSF data with smart caching and React Query integration
14 lines • 747 B
TypeScript
/**
* @fileoverview React Query Hook Factory
*
* Creates strongly-typed React Query hooks from metadata objects.
* Handles both regular hooks and cache-flush-date-aware hooks.
*/
import type { UseQueryResult } from "@tanstack/react-query";
import type { ApiDefinition, EndpointGroupMeta, EndpointMeta } from "../../apis/types";
import type { FetchFunctionParams, QueryHookOptions } from "./types";
/**
* Creates a strongly-typed React Query hook from three metadata objects.
*/
export declare function createHook<I, O>(apiDefinition: ApiDefinition, group: EndpointGroupMeta, endpoint: EndpointMeta<I, O>): (params?: FetchFunctionParams<I>, options?: QueryHookOptions<O>) => UseQueryResult<O, Error>;
//# sourceMappingURL=createHook.d.ts.map