UNPKG

ws-dottie

Version:

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

1,333 lines (1,298 loc) 351 kB
import * as _tanstack_react_query from '@tanstack/react-query'; import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import { z } from 'zod'; /** * WSDOT API Configuration Manager * * This module provides centralized configuration management for WSDOT and WSF APIs. * It handles API key management, base URL configuration, and environment-based * configuration loading across different platforms (Node.js, browser, test environments). * * Key Features: * - Environment-based API key loading (WSDOT_ACCESS_TOKEN) * - Configurable base URL (WSDOT_BASE_URL) * - Cross-platform compatibility (Node.js, browser, test) * - Global configuration state management * - Type-safe configuration interface * * Usage: * ```typescript * // Set API key only * configManager.setApiKey("your-api-key"); * * // Set base URL only * configManager.setBaseUrl("https://custom.wsdot.wa.gov"); * * // Get API key (auto-initializes from environment if not set) * const apiKey = configManager.getApiKey(); * * // Get base URL * const baseUrl = configManager.getBaseUrl(); * ``` */ interface WsdotConfig { WSDOT_ACCESS_TOKEN: string; WSDOT_BASE_URL?: string; } declare const configManager: { getApiKey: () => string; getBaseUrl: () => string; setApiKey: (apiKey: string) => void; setBaseUrl: (baseUrl: string) => void; clearConfig: () => void; }; type LoggingMode = "none" | "info" | "debug"; /** * Get border crossing wait times from WSDOT Border Crossings API * * Returns estimated wait times for all border crossings between Washington State and Canada. * Data includes location information, crossing names, timestamps, and current wait times. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise resolving to array of border crossing data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const crossings = await getBorderCrossings(); * console.log(crossings[0].CrossingName); // "Peace Arch" * ``` */ declare const getBorderCrossings: () => Promise<{ [x: string]: unknown; BorderCrossingLocation: { [x: string]: unknown; Description: string; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; } | null; CrossingName: string; Time: Date; WaitTime: number; }[]>; /** * Options for WS‑Dottie hooks that map to TanStack Query's UseQueryOptions, * excluding 'queryKey' and 'queryFn' which are provided by the hooks. */ type TanStackOptions<TData, TError = Error> = Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">; declare const borderCrossingLocationSchema: z.ZodNullable<z.ZodObject<{ Description: z.ZodString; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>>; declare const borderCrossingDataSchema: z.ZodObject<{ BorderCrossingLocation: z.ZodNullable<z.ZodObject<{ Description: z.ZodString; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>>; CrossingName: z.ZodString; Time: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; WaitTime: z.ZodNumber; }, z.core.$catchall<z.ZodUnknown>>; type BorderCrossingData = z.infer<typeof borderCrossingDataSchema>; type BorderCrossingLocation = z.infer<typeof borderCrossingLocationSchema>; /** * Hook for getting border crossing wait times from WSDOT Border Crossings API * * Returns estimated wait times for all border crossings between Washington State and Canada. * Uses frequent update options since border crossing data changes frequently. * * @param options - Optional React Query options to override defaults * @returns React Query result with border crossing data * * @example * ```typescript * const { data: crossings } = useBorderCrossings(); * console.log(crossings?.[0]?.CrossingName); // "Peace Arch" * ``` */ declare const useBorderCrossings: (options?: TanStackOptions<BorderCrossingData[]>) => UseQueryResult<BorderCrossingData[], Error>; type index$f_BorderCrossingData = BorderCrossingData; type index$f_BorderCrossingLocation = BorderCrossingLocation; declare const index$f_getBorderCrossings: typeof getBorderCrossings; declare const index$f_useBorderCrossings: typeof useBorderCrossings; declare namespace index$f { export { type index$f_BorderCrossingData as BorderCrossingData, type index$f_BorderCrossingLocation as BorderCrossingLocation, index$f_getBorderCrossings as getBorderCrossings, index$f_useBorderCrossings as useBorderCrossings }; } /** * Get bridge clearances from WSDOT Bridge Clearances API * * Returns bridge clearance data for a specific route. The Route parameter is required * and should be a valid WSDOT route identifier (e.g., "005" for I-5). * * @param params - Object containing route and optional logMode * @param params.route - The WSDOT route identifier (e.g., "005" for I-5) * @param params.logMode - Optional logging mode for debugging API calls * @returns Promise containing bridge clearance data for the specified route * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const clearances = await getBridgeClearances({ route: "005" }); * console.log(clearances[0].BridgeName); // "Aurora Bridge" * ``` */ declare const getBridgeClearances: (params: { route: string; }) => Promise<{ [x: string]: unknown; APILastUpdate: Date; BridgeNumber: string; ControlEntityGuid: string; CrossingDescription: string; CrossingLocationId: number; CrossingRecordGuid: string; InventoryDirection: string | null; Latitude: number; LocationGuid: string; Longitude: number; RouteDate: Date; SRMP: number; SRMPAheadBackIndicator: string | null; StateRouteID: string; StateStructureId: string; VerticalClearanceMaximumFeetInch: string; VerticalClearanceMaximumInches: number; VerticalClearanceMinimumFeetInch: string; VerticalClearanceMinimumInches: number; }[]>; declare const bridgeDataGisSchema: z.ZodObject<{ APILastUpdate: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; BridgeNumber: z.ZodString; ControlEntityGuid: z.ZodString; CrossingDescription: z.ZodString; CrossingLocationId: z.ZodNumber; CrossingRecordGuid: z.ZodString; InventoryDirection: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; LocationGuid: z.ZodString; Longitude: z.ZodNumber; RouteDate: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; SRMP: z.ZodNumber; SRMPAheadBackIndicator: z.ZodNullable<z.ZodString>; StateRouteID: z.ZodString; StateStructureId: z.ZodString; VerticalClearanceMaximumFeetInch: z.ZodString; VerticalClearanceMaximumInches: z.ZodNumber; VerticalClearanceMinimumFeetInch: z.ZodString; VerticalClearanceMinimumInches: z.ZodNumber; }, z.core.$catchall<z.ZodUnknown>>; type BridgeDataGIS = z.infer<typeof bridgeDataGisSchema>; /** * Hook for getting bridge clearances from WSDOT Bridge Clearances API * * Returns bridge clearance data for a specific route. The Route parameter is required * and should be a valid WSDOT route identifier (e.g., "005" for I-5). * * @param params - Object containing route * @param params.route - The WSDOT route identifier (e.g., "005" for I-5) * @param options - Optional React Query options to override defaults * @returns React Query result with bridge clearance data * * @example * ```typescript * const { data: clearances } = useBridgeClearances({ route: "005" }); * console.log(clearances?.[0]?.BridgeName); // "Aurora Bridge" * ``` */ declare const useBridgeClearances: (params: { route: string; }, options?: TanStackOptions<BridgeDataGIS[]>) => UseQueryResult<BridgeDataGIS[], Error>; type index$e_BridgeDataGIS = BridgeDataGIS; declare const index$e_getBridgeClearances: typeof getBridgeClearances; declare const index$e_useBridgeClearances: typeof useBridgeClearances; declare namespace index$e { export { type index$e_BridgeDataGIS as BridgeDataGIS, index$e_getBridgeClearances as getBridgeClearances, index$e_useBridgeClearances as useBridgeClearances }; } /** * Get commercial vehicle restrictions from WSDOT Commercial Vehicle Restrictions API * * Returns commercial vehicle restriction data including weight limits, bridge restrictions, * and other commercial vehicle limitations across Washington State highways. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise resolving to array of commercial vehicle restriction data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const restrictions = await getCommercialVehicleRestrictions(); * console.log(restrictions[0].RouteName); // "I-5" * ``` */ declare const getCommercialVehicleRestrictions: () => Promise<{ [x: string]: unknown; BLMaxAxle: number | null; BridgeName: string; BridgeNumber: string; CL8MaxAxle: number | null; DateEffective: Date; DateExpires: Date; DatePosted: Date; EndRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; IsDetourAvailable: boolean; IsExceptionsAllowed: boolean; IsPermanentRestriction: boolean; IsWarning: boolean; Latitude: number; LocationDescription: string; LocationName: string; Longitude: number; MaximumGrossVehicleWeightInPounds: number | null; RestrictionComment: string; RestrictionHeightInInches: number | null; RestrictionLengthInInches: number | null; RestrictionType: number; RestrictionWeightInPounds: number | null; RestrictionWidthInInches: number | null; SAMaxAxle: number | null; StartRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; State: string; StateRouteID: string; TDMaxAxle: number | null; VehicleType: string; }[]>; /** * Get commercial vehicle restrictions with unique IDs from WSDOT Commercial Vehicle Restrictions API * * Returns commercial vehicle restriction data including weight limits, bridge restrictions, * and other commercial vehicle limitations across Washington State highways. This endpoint * includes unique identifiers for each restriction. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise resolving to array of commercial vehicle restriction data with unique IDs * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const restrictions = await getCommercialVehicleRestrictionsWithId(); * console.log(restrictions[0].RestrictionID); // 12345 * ``` */ declare const getCommercialVehicleRestrictionsWithId: () => Promise<{ [x: string]: unknown; BLMaxAxle: number | null; BridgeName: string; BridgeNumber: string; CL8MaxAxle: number | null; DateEffective: Date; DateExpires: Date; DatePosted: Date; EndRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; IsDetourAvailable: boolean; IsExceptionsAllowed: boolean; IsPermanentRestriction: boolean; IsWarning: boolean; Latitude: number; LocationDescription: string; LocationName: string; Longitude: number; MaximumGrossVehicleWeightInPounds: number | null; RestrictionComment: string; RestrictionHeightInInches: number | null; RestrictionLengthInInches: number | null; RestrictionType: number; RestrictionWeightInPounds: number | null; RestrictionWidthInInches: number | null; SAMaxAxle: number | null; StartRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; State: string; StateRouteID: string; TDMaxAxle: number | null; VehicleType: string; UniqueID: string; }[]>; declare const roadwayLocationSchema$1: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const commercialVehicleRestrictionSchema: z.ZodObject<{ BLMaxAxle: z.ZodNullable<z.ZodNumber>; BridgeName: z.ZodString; BridgeNumber: z.ZodString; CL8MaxAxle: z.ZodNullable<z.ZodNumber>; DateEffective: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; DateExpires: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; DatePosted: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; EndRoadwayLocation: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; IsDetourAvailable: z.ZodBoolean; IsExceptionsAllowed: z.ZodBoolean; IsPermanentRestriction: z.ZodBoolean; IsWarning: z.ZodBoolean; Latitude: z.ZodNumber; LocationDescription: z.ZodString; LocationName: z.ZodString; Longitude: z.ZodNumber; MaximumGrossVehicleWeightInPounds: z.ZodNullable<z.ZodNumber>; RestrictionComment: z.ZodString; RestrictionHeightInInches: z.ZodNullable<z.ZodNumber>; RestrictionLengthInInches: z.ZodNullable<z.ZodNumber>; RestrictionType: z.ZodNumber; RestrictionWeightInPounds: z.ZodNullable<z.ZodNumber>; RestrictionWidthInInches: z.ZodNullable<z.ZodNumber>; SAMaxAxle: z.ZodNullable<z.ZodNumber>; StartRoadwayLocation: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; State: z.ZodString; StateRouteID: z.ZodString; TDMaxAxle: z.ZodNullable<z.ZodNumber>; VehicleType: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const commercialVehicleRestrictionWithIdSchema: z.ZodObject<{ BLMaxAxle: z.ZodNullable<z.ZodNumber>; BridgeName: z.ZodString; BridgeNumber: z.ZodString; CL8MaxAxle: z.ZodNullable<z.ZodNumber>; DateEffective: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; DateExpires: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; DatePosted: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; EndRoadwayLocation: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; IsDetourAvailable: z.ZodBoolean; IsExceptionsAllowed: z.ZodBoolean; IsPermanentRestriction: z.ZodBoolean; IsWarning: z.ZodBoolean; Latitude: z.ZodNumber; LocationDescription: z.ZodString; LocationName: z.ZodString; Longitude: z.ZodNumber; MaximumGrossVehicleWeightInPounds: z.ZodNullable<z.ZodNumber>; RestrictionComment: z.ZodString; RestrictionHeightInInches: z.ZodNullable<z.ZodNumber>; RestrictionLengthInInches: z.ZodNullable<z.ZodNumber>; RestrictionType: z.ZodNumber; RestrictionWeightInPounds: z.ZodNullable<z.ZodNumber>; RestrictionWidthInInches: z.ZodNullable<z.ZodNumber>; SAMaxAxle: z.ZodNullable<z.ZodNumber>; StartRoadwayLocation: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; State: z.ZodString; StateRouteID: z.ZodString; TDMaxAxle: z.ZodNullable<z.ZodNumber>; VehicleType: z.ZodString; UniqueID: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; type RoadwayLocation$1 = z.infer<typeof roadwayLocationSchema$1>; type CommercialVehicleRestriction = z.infer<typeof commercialVehicleRestrictionSchema>; type CommercialVehicleRestrictionWithId = z.infer<typeof commercialVehicleRestrictionWithIdSchema>; /** * Hook for getting commercial vehicle restrictions from WSDOT Commercial Vehicle Restrictions API * * Returns commercial vehicle restriction data including weight limits, bridge restrictions, * and other commercial vehicle limitations across Washington State highways. * * @param options - Optional React Query options to override defaults * @returns React Query result with commercial vehicle restriction data * * @example * ```typescript * const { data: restrictions } = useCommercialVehicleRestrictions(); * console.log(restrictions?.[0]?.RouteName); // "I-5" * ``` */ declare const useCommercialVehicleRestrictions: (options?: TanStackOptions<CommercialVehicleRestriction[]>) => UseQueryResult<CommercialVehicleRestriction[], Error>; /** * Hook for getting commercial vehicle restrictions with unique IDs from WSDOT Commercial Vehicle Restrictions API * * Returns commercial vehicle restriction data including weight limits, bridge restrictions, * and other commercial vehicle limitations across Washington State highways. This endpoint * includes unique identifiers for each restriction. * * @param options - Optional React Query options to override defaults * @returns React Query result with commercial vehicle restriction data with unique IDs * * @example * ```typescript * const { data: restrictions } = useCommercialVehicleRestrictionsWithId(); * console.log(restrictions?.[0]?.RestrictionID); // 12345 * ``` */ declare const useCommercialVehicleRestrictionsWithId: (options?: TanStackOptions<CommercialVehicleRestrictionWithId[]>) => UseQueryResult<CommercialVehicleRestriction[], Error>; type index$d_CommercialVehicleRestriction = CommercialVehicleRestriction; type index$d_CommercialVehicleRestrictionWithId = CommercialVehicleRestrictionWithId; declare const index$d_getCommercialVehicleRestrictions: typeof getCommercialVehicleRestrictions; declare const index$d_getCommercialVehicleRestrictionsWithId: typeof getCommercialVehicleRestrictionsWithId; declare const index$d_useCommercialVehicleRestrictions: typeof useCommercialVehicleRestrictions; declare const index$d_useCommercialVehicleRestrictionsWithId: typeof useCommercialVehicleRestrictionsWithId; declare namespace index$d { export { type index$d_CommercialVehicleRestriction as CommercialVehicleRestriction, type index$d_CommercialVehicleRestrictionWithId as CommercialVehicleRestrictionWithId, type RoadwayLocation$1 as RoadwayLocation, index$d_getCommercialVehicleRestrictions as getCommercialVehicleRestrictions, index$d_getCommercialVehicleRestrictionsWithId as getCommercialVehicleRestrictionsWithId, index$d_useCommercialVehicleRestrictions as useCommercialVehicleRestrictions, index$d_useCommercialVehicleRestrictionsWithId as useCommercialVehicleRestrictionsWithId }; } /** * Get all highway alerts from WSDOT Highway Alerts API * * Returns current traffic alerts in JSON format. This endpoint provides * all active highway alerts across Washington State. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise containing all highway alert data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const alerts = await getHighwayAlerts(); * console.log(alerts[0].HeadlineDescription); // "Collision on I-5" * ``` */ declare const getHighwayAlerts: () => Promise<{ [x: string]: unknown; AlertID: number; County: string | null; EndRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; EndTime: Date | null; EventCategory: string; EventStatus: string; ExtendedDescription: string; HeadlineDescription: string; LastUpdatedTime: Date; Priority: string; Region: string; StartRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; StartTime: Date; }[]>; /** * Get a specific highway alert by ID from WSDOT Highway Alerts API * * Returns detailed information about a specific highway alert identified by its ID. * * @param params - Object containing alertId and optional logMode * @param params.alertId - The unique identifier of the highway alert * @param params.logMode - Optional logging mode for debugging API calls * @returns Promise containing the specific highway alert data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const alert = await getHighwayAlertById({ alertId: 12345 }); * console.log(alert.HeadlineDescription); // "Collision on I-5" * ``` */ declare const getHighwayAlertById: (params: { alertId: number; }) => Promise<{ [x: string]: unknown; AlertID: number; County: string | null; EndRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; EndTime: Date | null; EventCategory: string; EventStatus: string; ExtendedDescription: string; HeadlineDescription: string; LastUpdatedTime: Date; Priority: string; Region: string; StartRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; StartTime: Date; }>; /** * Get highway alerts by map area from WSDOT Highway Alerts API * * Returns highway alerts filtered by a specific map area or region. * * @param params - Object containing mapArea and optional logMode * @param params.mapArea - The map area or region to filter alerts by * @param params.logMode - Optional logging mode for debugging API calls * @returns Promise containing filtered highway alert data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const alerts = await getHighwayAlertsByMapArea({ mapArea: "Seattle" }); * console.log(alerts[0].HeadlineDescription); // "Collision on I-5" * ``` */ declare const getHighwayAlertsByMapArea: (params: { mapArea: string; }) => Promise<{ [x: string]: unknown; AlertID: number; County: string | null; EndRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; EndTime: Date | null; EventCategory: string; EventStatus: string; ExtendedDescription: string; HeadlineDescription: string; LastUpdatedTime: Date; Priority: string; Region: string; StartRoadwayLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; StartTime: Date; }[]>; declare const roadwayLocationSchema: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const highwayAlertSchema: z.ZodObject<{ AlertID: z.ZodNumber; County: z.ZodNullable<z.ZodString>; EndRoadwayLocation: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; EndTime: z.ZodNullable<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>>; EventCategory: z.ZodString; EventStatus: z.ZodString; ExtendedDescription: z.ZodString; HeadlineDescription: z.ZodString; LastUpdatedTime: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; Priority: z.ZodString; Region: z.ZodString; StartRoadwayLocation: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; StartTime: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; }, z.core.$catchall<z.ZodUnknown>>; type RoadwayLocation = z.infer<typeof roadwayLocationSchema>; type HighwayAlert = z.infer<typeof highwayAlertSchema>; /** * Hook for getting all highway alerts from WSDOT Highway Alerts API * * Returns current traffic alerts in JSON format. This endpoint provides * all active highway alerts across Washington State. * * @param options - Optional React Query options to override defaults * @returns React Query result with highway alert data */ declare const useHighwayAlerts: (options?: TanStackOptions<HighwayAlert[]>) => UseQueryResult<HighwayAlert[], Error>; /** * Hook for getting a specific highway alert by ID from WSDOT Highway Alerts API * * Returns detailed information about a specific highway alert identified by its ID. * * @param params - Object containing alertId * @param params.alertId - The unique identifier of the highway alert * @param options - Optional React Query options to override defaults * @returns React Query result with a single highway alert */ declare const useHighwayAlertById: (params: { alertId: number; }, options?: TanStackOptions<HighwayAlert>) => UseQueryResult<HighwayAlert, Error>; /** * Hook for getting highway alerts by map area from WSDOT Highway Alerts API * * Returns highway alerts filtered by a specific map area or region. * * @param params - Object containing mapArea * @param params.mapArea - The map area or region to filter alerts by * @param options - Optional React Query options to override defaults * @returns React Query result with highway alert data for the specified area */ declare const useHighwayAlertsByMapArea: (params: { mapArea: string; }, options?: TanStackOptions<HighwayAlert[]>) => UseQueryResult<HighwayAlert[], Error>; type index$c_HighwayAlert = HighwayAlert; type index$c_RoadwayLocation = RoadwayLocation; declare const index$c_getHighwayAlertById: typeof getHighwayAlertById; declare const index$c_getHighwayAlerts: typeof getHighwayAlerts; declare const index$c_getHighwayAlertsByMapArea: typeof getHighwayAlertsByMapArea; declare const index$c_useHighwayAlertById: typeof useHighwayAlertById; declare const index$c_useHighwayAlerts: typeof useHighwayAlerts; declare const index$c_useHighwayAlertsByMapArea: typeof useHighwayAlertsByMapArea; declare namespace index$c { export { type index$c_HighwayAlert as HighwayAlert, type index$c_RoadwayLocation as RoadwayLocation, index$c_getHighwayAlertById as getHighwayAlertById, index$c_getHighwayAlerts as getHighwayAlerts, index$c_getHighwayAlertsByMapArea as getHighwayAlertsByMapArea, index$c_useHighwayAlertById as useHighwayAlertById, index$c_useHighwayAlerts as useHighwayAlerts, index$c_useHighwayAlertsByMapArea as useHighwayAlertsByMapArea }; } declare const cameraLocationSchema: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const cameraSchema: z.ZodObject<{ CameraID: z.ZodNumber; CameraLocation: z.ZodObject<{ Description: z.ZodNullable<z.ZodString>; Direction: z.ZodNullable<z.ZodString>; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MilePost: z.ZodNumber; RoadName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; CameraOwner: z.ZodNullable<z.ZodString>; Description: z.ZodNullable<z.ZodString>; DisplayLatitude: z.ZodNumber; DisplayLongitude: z.ZodNumber; ImageHeight: z.ZodNumber; ImageURL: z.ZodString; ImageWidth: z.ZodNumber; IsActive: z.ZodBoolean; OwnerURL: z.ZodNullable<z.ZodString>; Region: z.ZodString; SortOrder: z.ZodNumber; Title: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const searchCamerasParamsSchema: z.ZodObject<{ StateRoute: z.ZodOptional<z.ZodString>; Region: z.ZodOptional<z.ZodString>; StartingMilepost: z.ZodOptional<z.ZodNumber>; EndingMilepost: z.ZodOptional<z.ZodNumber>; }, z.core.$strict>; type CameraLocation = z.infer<typeof cameraLocationSchema>; type Camera = z.infer<typeof cameraSchema>; type GetCameraResponse = Camera; type SearchCamerasParams = z.infer<typeof searchCamerasParamsSchema>; /** * WSDOT Highway Cameras API Functions * * Based on cURL validation of: * - https://wsdot.wa.gov/traffic/api/HighwayCameras/HighwayCamerasREST.svc/Help * - https://wsdot.wa.gov/traffic/api/Documentation/group___highway_cameras.html */ /** * Get all highway cameras * * Returns all available highway cameras from the WSDOT Highway Cameras API. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise containing all camera data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const cameras = await getHighwayCameras(); * console.log(cameras[0].Title); // "I-5 @ NE 85th St" * ``` */ declare const getHighwayCameras: () => Promise<{ [x: string]: unknown; CameraID: number; CameraLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; CameraOwner: string | null; Description: string | null; DisplayLatitude: number; DisplayLongitude: number; ImageHeight: number; ImageURL: string; ImageWidth: number; IsActive: boolean; OwnerURL: string | null; Region: string; SortOrder: number; Title: string; }[]>; /** * Get a specific highway camera by ID * * Returns detailed information about a specific highway camera identified by its ID. * * @param params - Object containing cameraID and optional logMode * @param params.cameraID - The unique identifier of the highway camera * @param params.logMode - Optional logging mode for debugging API calls * @returns Promise containing the specific camera data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const camera = await getHighwayCamera({ cameraID: 1001 }); * console.log(camera.Title); // "I-5 @ NE 85th St" * ``` */ declare const getHighwayCamera: (params: { cameraID: number; }) => Promise<{ [x: string]: unknown; CameraID: number; CameraLocation: { [x: string]: unknown; Description: string | null; Direction: string | null; Latitude: number; Longitude: number; MilePost: number; RoadName: string; }; CameraOwner: string | null; Description: string | null; DisplayLatitude: number; DisplayLongitude: number; ImageHeight: number; ImageURL: string; ImageWidth: number; IsActive: boolean; OwnerURL: string | null; Region: string; SortOrder: number; Title: string; }>; /** * Search for highway cameras with optional filters * * Returns filtered highway camera data based on search criteria such as region, * state route, or milepost range. * * @param params - Object containing search parameters and optional logMode * @param params.StateRoute - Optional state route number (e.g., "9", "405") * @param params.Region - Optional region code (NW, NC, SC, SW, ER, OL, OS, WA) * @param params.StartingMilepost - Optional starting milepost for search range * @param params.EndingMilepost - Optional ending milepost for search range * @param params.logMode - Optional logging mode for debugging API calls * @returns Promise containing filtered camera data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const cameras = await searchHighwayCameras({ StateRoute: "5" }); * console.log(cameras[0].Title); // "I-5 @ NE 85th St" * ``` */ declare const searchHighwayCameras: (params: SearchCamerasParams, logMode?: LoggingMode) => Promise<Camera[]>; /** * WSDOT Highway Cameras API React Query Hooks * * Based on cURL validation of: * - https://wsdot.wa.gov/traffic/api/HighwayCameras/HighwayCamerasREST.svc/Help * - https://wsdot.wa.gov/traffic/api/Documentation/group___highway_cameras.html */ /** * React Query hook for getting all highway cameras * * Returns all available highway cameras from the WSDOT Highway Cameras API. * * @param options - Optional query options * @returns React Query result containing all camera data * * @example * ```typescript * const { data: cameras } = useHighwayCameras(); * console.log(cameras?.[0]?.Title); // "I-5 @ NE 85th St" * ``` */ declare const useHighwayCameras: (options?: TanStackOptions<Camera[]>) => UseQueryResult<Camera[], Error>; /** * React Query hook for getting a specific highway camera by ID * * Returns detailed information about a specific highway camera identified by its ID. * * @param params - Object containing cameraID * @param params.cameraID - The unique identifier of the highway camera * @param options - Optional query options * @returns React Query result containing the camera data * * @example * ```typescript * const { data: camera } = useHighwayCamera({ cameraID: 1001 }); * console.log(camera?.Title); // "I-5 @ NE 85th St" * ``` */ declare const useHighwayCamera: (params: { cameraID: number; }, options?: TanStackOptions<GetCameraResponse>) => UseQueryResult<GetCameraResponse, Error>; /** * React Query hook for searching highway cameras with filters * * Returns filtered highway camera data based on search criteria such as region, * state route, or milepost range. * * @param params - Search parameters (StateRoute, Region, StartingMilepost, EndingMilepost) * @param params.StateRoute - Optional state route number (e.g., "9", "405") * @param params.Region - Optional region code (NW, NC, SC, SW, ER, OL, OS, WA) * @param params.StartingMilepost - Optional starting milepost for search range * @param params.EndingMilepost - Optional ending milepost for search range * @param options - Optional query options * @returns React Query result containing filtered camera data * * @example * ```typescript * const { data: cameras } = useSearchHighwayCameras({ StateRoute: "5" }); * console.log(cameras?.[0]?.Title); // "I-5 @ NE 85th St" * ``` */ declare const useSearchHighwayCameras: (params: SearchCamerasParams, options?: TanStackOptions<Camera[]>) => UseQueryResult<Camera[], Error>; /** * WSDOT Highway Cameras API * * Exports all types, functions, and React hooks for the WSDOT Highway Cameras API. * * Based on cURL validation of: * - https://wsdot.wa.gov/traffic/api/HighwayCameras/HighwayCamerasREST.svc/Help * - https://wsdot.wa.gov/traffic/api/Documentation/group___highway_cameras.html */ type index$b_Camera = Camera; type index$b_CameraLocation = CameraLocation; type index$b_GetCameraResponse = GetCameraResponse; type index$b_SearchCamerasParams = SearchCamerasParams; declare const index$b_getHighwayCamera: typeof getHighwayCamera; declare const index$b_getHighwayCameras: typeof getHighwayCameras; declare const index$b_searchHighwayCameras: typeof searchHighwayCameras; declare const index$b_useHighwayCamera: typeof useHighwayCamera; declare const index$b_useHighwayCameras: typeof useHighwayCameras; declare const index$b_useSearchHighwayCameras: typeof useSearchHighwayCameras; declare namespace index$b { export { type index$b_Camera as Camera, type index$b_CameraLocation as CameraLocation, type index$b_GetCameraResponse as GetCameraResponse, type index$b_SearchCamerasParams as SearchCamerasParams, index$b_getHighwayCamera as getHighwayCamera, index$b_getHighwayCameras as getHighwayCameras, index$b_searchHighwayCameras as searchHighwayCameras, index$b_useHighwayCamera as useHighwayCamera, index$b_useHighwayCameras as useHighwayCameras, index$b_useSearchHighwayCameras as useSearchHighwayCameras }; } /** * Retrieves all mountain pass conditions from WSDOT API * * Returns current mountain pass conditions across Washington State, including * road conditions, restrictions, and travel advisories. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise containing all mountain pass condition data * @throws {WsdotApiError} When the API request fails */ declare const getMountainPassConditions: () => Promise<{ [x: string]: unknown; DateUpdated: Date; ElevationInFeet: number; Latitude: number; Longitude: number; MountainPassId: number; MountainPassName: string; RestrictionOne: { [x: string]: unknown; TravelDirection: string; RestrictionText: string; }; RestrictionTwo: { [x: string]: unknown; TravelDirection: string; RestrictionText: string; }; RoadCondition: string; TemperatureInFahrenheit: number | null; TravelAdvisoryActive: boolean; WeatherCondition: string; }[]>; /** * Retrieves a specific mountain pass condition by ID * Note: This endpoint may not work as expected based on testing * * Returns detailed information about a specific mountain pass condition * identified by its ID. * * @param params - Object containing passConditionId and optional logMode * @param params.passConditionId - The ID of the specific mountain pass condition * @param params.logMode - Optional logging mode for debugging API calls * @returns Promise containing the specific mountain pass condition data * @throws {WsdotApiError} When the API request fails */ declare const getMountainPassConditionById: (params: { passConditionId: number; }) => Promise<{ [x: string]: unknown; DateUpdated: Date; ElevationInFeet: number; Latitude: number; Longitude: number; MountainPassId: number; MountainPassName: string; RestrictionOne: { [x: string]: unknown; TravelDirection: string; RestrictionText: string; }; RestrictionTwo: { [x: string]: unknown; TravelDirection: string; RestrictionText: string; }; RoadCondition: string; TemperatureInFahrenheit: number | null; TravelAdvisoryActive: boolean; WeatherCondition: string; }>; declare const travelRestrictionSchema: z.ZodObject<{ TravelDirection: z.ZodString; RestrictionText: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const mountainPassConditionSchema: z.ZodObject<{ DateUpdated: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; ElevationInFeet: z.ZodNumber; Latitude: z.ZodNumber; Longitude: z.ZodNumber; MountainPassId: z.ZodNumber; MountainPassName: z.ZodString; RestrictionOne: z.ZodObject<{ TravelDirection: z.ZodString; RestrictionText: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; RestrictionTwo: z.ZodObject<{ TravelDirection: z.ZodString; RestrictionText: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; RoadCondition: z.ZodString; TemperatureInFahrenheit: z.ZodNullable<z.ZodNumber>; TravelAdvisoryActive: z.ZodBoolean; WeatherCondition: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; type TravelRestriction = z.infer<typeof travelRestrictionSchema>; type MountainPassCondition = z.infer<typeof mountainPassConditionSchema>; /** * React Query hook for retrieving all mountain pass conditions * * Returns current mountain pass conditions across Washington State, including * road conditions, restrictions, and travel advisories. * * @param options - Optional query options * @returns React Query result containing mountain pass conditions data * * @example * ```typescript * const { data: conditions } = useMountainPassConditions(); * console.log(conditions[0].MountainPassName); // "Blewett Pass US 97" * ``` */ declare const useMountainPassConditions: (options?: TanStackOptions<MountainPassCondition[]>) => UseQueryResult<MountainPassCondition[], Error>; /** * React Query hook for retrieving a specific mountain pass condition by ID * Note: This endpoint may not work as expected based on testing * * Returns detailed information about a specific mountain pass condition * identified by its ID. * * @param params - Object containing passConditionId * @param params.passConditionId - The ID of the specific mountain pass condition * @param options - Optional query options * @returns React Query result containing mountain pass condition data * * @example * ```typescript * const { data: condition } = useMountainPassConditionById({ passConditionId: 1 }); * console.log(condition.MountainPassName); // "Blewett Pass US 97" * ``` */ declare const useMountainPassConditionById: (params: { passConditionId: number; }, options?: TanStackOptions<MountainPassCondition>) => UseQueryResult<MountainPassCondition, Error>; type index$a_MountainPassCondition = MountainPassCondition; type index$a_TravelRestriction = TravelRestriction; declare const index$a_getMountainPassConditionById: typeof getMountainPassConditionById; declare const index$a_getMountainPassConditions: typeof getMountainPassConditions; declare const index$a_useMountainPassConditionById: typeof useMountainPassConditionById; declare const index$a_useMountainPassConditions: typeof useMountainPassConditions; declare namespace index$a { export { type index$a_MountainPassCondition as MountainPassCondition, type index$a_TravelRestriction as TravelRestriction, index$a_getMountainPassConditionById as getMountainPassConditionById, index$a_getMountainPassConditions as getMountainPassConditions, index$a_useMountainPassConditionById as useMountainPassConditionById, index$a_useMountainPassConditions as useMountainPassConditions }; } /** * Retrieves all current toll rates from WSDOT API * * Returns current toll rates for all WSDOT toll facilities, including * pricing information and facility details. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise containing all toll rate data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const tollRates = await getTollRates(); * console.log(tollRates[0].CurrentToll); // 125 * ``` */ declare const getTollRates: () => Promise<{ [x: string]: unknown; CurrentMessage: string | null; CurrentToll: number; EndLatitude: number; EndLocationName: string; EndLongitude: number; EndMilepost: number; StartLatitude: number; StartLocationName: string; StartLongitude: number; StartMilepost: number; StateRoute: string; TimeUpdated: Date; TravelDirection: string; TripName: string; }[]>; /** * Retrieves toll trip information with geometry data from WSDOT API * * Returns detailed trip information including geometry data for toll * facilities and routes. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise containing all toll trip information data * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const tripInfo = await getTollTripInfo(); * console.log(tripInfo[0].TripName); // "405tp01351" * ``` */ declare const getTollTripInfo: () => Promise<{ [x: string]: unknown; EndLatitude: number; EndLocationName: string; EndLongitude: number; EndMilepost: number; Geometry: string; ModifiedDate: Date | null; StartLatitude: number; StartLocationName: string; StartLongitude: number; StartMilepost: number; TravelDirection: string; TripName: string; }[]>; /** * Retrieves toll trip rates with messages and update times from WSDOT API * * Returns current toll trip rates along with system messages and * last updated timestamps. * * @param logMode - Optional logging mode for debugging API calls * @returns Promise containing toll trip rates with last updated time * @throws {WsdotApiError} When the API request fails * * @example * ```typescript * const tripRates = await getTollTripRates(); * console.log(tripRates.LastUpdated); // Date object * console.log(tripRates.Trips[0].Toll); // 0 * ``` */ declare const getTollTripRates: () => Promise<{ [x: string]: unknown; LastUpdated: Date; Trips: { [x: string]: unknown; Message: string; MessageUpdateTime: Date; Toll: number; TripName: string; }[]; }>; declare const tollRateSchema: z.ZodObject<{ CurrentMessage: z.ZodNullable<z.ZodString>; CurrentToll: z.ZodNumber; EndLatitude: z.ZodNumber; EndLocationName: z.ZodString; EndLongitude: z.ZodNumber; EndMilepost: z.ZodNumber; StartLatitude: z.ZodNumber; StartLocationName: z.ZodString; StartLongitude: z.ZodNumber; StartMilepost: z.ZodNumber; StateRoute: z.ZodString; TimeUpdated: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; TravelDirection: z.ZodString; TripName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const tollTripInfoSchema: z.ZodObject<{ EndLatitude: z.ZodNumber; EndLocationName: z.ZodString; EndLongitude: z.ZodNumber; EndMilepost: z.ZodNumber; Geometry: z.ZodString; ModifiedDate: z.ZodNullable<z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>>; StartLatitude: z.ZodNumber; StartLocationName: z.ZodString; StartLongitude: z.ZodNumber; StartMilepost: z.ZodNumber; TravelDirection: z.ZodString; TripName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const tollTripRateSchema: z.ZodObject<{ Message: z.ZodString; MessageUpdateTime: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; Toll: z.ZodNumber; TripName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>; declare const tollTripRatesSchema: z.ZodObject<{ LastUpdated: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; Trips: z.ZodArray<z.ZodObject<{ Message: z.ZodString; MessageUpdateTime: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>, z.ZodDate]>; Toll: z.ZodNumber; TripName: z.ZodString; }, z.core.$catchall<z.ZodUnknown>>>; }, z.core.$catchall<z.ZodUnknown>>; type TollRate = z.infer<typeof tollRateSchema>; type TollTripInfo = z.infer<typeof tollTripInfoSchema>; type TollTripRate = z.infer<typeof tollTripRateSchema>; type TollTripRates = z.infer<typeof tollTripRatesSchema>; /** * React Query hook for retrieving all toll rates * * Returns current toll rates for all WSDOT toll facilities, including * pricing information and facility details. * * @param options - Optional query options * @returns React Query result containing toll rates data * * @example * ```typescript * const { data: tollRates } = useTollRates(); * console.log(tollRates[0].CurrentToll); // 125 * ``` */ declare const useTollRates: (options?: TanStackOptions<TollRate[]>) => UseQueryResult<TollRate[], Error>; /** * React Query hook for retrieving toll trip information with geometry * * Returns detailed trip information including geometry data for toll * facilities and routes. * * @param options - Optional query options * @returns React Query result containing toll trip information data * * @example * ```typescript * const { data: tripInfo } = useTollTripInfo(); * console.log(tripInfo[0].TripName); // "405tp01351" * ``` */ declare const useTollTripInfo: (options?: TanStackOptions<TollTripInfo[]>) => UseQueryResult<TollTripInfo[], Error>; /** * React Query hook for retrieving toll trip rates with messages * * Returns current toll trip rates along with system messages and * last updated timestamps. * * @param options - Optional query options * @returns React Query result containing toll trip rates data * * @example * ```typescript * const { data: tripRates } = useTollTripRates(); * console.log(tripRates.LastUpdated); // Date object * console.log(tripRates.Trips[0].Toll); // 0 * ``` */ declare const useTollTripRates: (options?: TanStackOptions<TollTripRates>) => UseQueryResult<TollTripRates, Error>; type index$9_TollRate = TollRate;