export type GetApiPrecipApiV1DailyOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Returns comprehensive daily precipitation data for the given time range and location(s). Each day includes precipitation amount, type (rain/snow/mixed), probability (for forecasts), and data source. Seamlessly combines historical observations with forecast data depending on the requested time range. * * GET /precip/api/v1/daily */ export const getApiPrecipApiV1Daily = async (options?: GetApiPrecipApiV1DailyOptions) => { const {baseUrl = "https://mpp.orthogonal.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/precip/api/v1/daily${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };