/** * Service for interacting with the RCC ACIS (Applied Climate Information * System) API — https://data.rcc-acis.org * * ACIS provides US daily temperature records (record high/low for a given * calendar date, and the year each was set) for stations with a sufficiently * long period of record. Unlike NCEI, ACIS is **keyless** (no signup, no * published rate limits) and **POST-based** (JSON request bodies rather than * query strings). * * Retrieval works in two steps: * 1. `findRecordsStation` — find the nearby station with the longest * period of record (preferring "threaded" stitched-record station IDs). * 2. `getDailyRecords` — fetch that station's full 366-slot daily * high/low record table in a single call. * * Records are garnish, never load-bearing: this service throws on failure * (no station found, malformed response, network error) exactly like NCEI's * client, and it is the caller's job — `src/utils/records.ts` — to catch * those failures and omit the records line rather than fail the tool call. */ import type { AcisStation, DailyRecords } from '../types/acis.js'; export interface AcisServiceConfig { baseURL?: string; timeout?: number; } /** * Compute the 0-based index of a month/day in the leap-calendar day-of-year * table used by `getDailyRecords`. Pure, deterministic, no I/O. * * Examples: Jan 1 → 0, Feb 29 → 59, Mar 1 → 60 (same index whether or not * the *current* year is a leap year — the table is always 366 slots wide), * Aug 12 → 224, Dec 31 → 365. */ export declare function dayOfYearIndex(month: number, day: number): number; /** * RCC ACIS API client. * * Provides US daily temperature records (highs/lows by calendar date, with * the year each was set). No API key required. */ export declare class AcisService { private client; private cache; constructor(config?: AcisServiceConfig); /** * Find the best nearby station carrying daily maxt/mint records, preferring * the longest period of record and, among ties, a "threaded" (stitched) * station identifier. Widens the search bbox once if the initial extent * finds no stations. * * @throws {Error} If no station with a usable period of record is found. */ findRecordsStation(latitude: number, longitude: number): Promise; /** * Fetch a station's full 366-slot daily high/low temperature record table * in a single call. Station name and period-of-record start year are * passed through from `findRecordsStation` (already known — no second * metadata request needed) and packaged into the returned `DailyRecords`. * * @throws {Error} If the response is missing or malformed. */ getDailyRecords(stationId: string, stationName: string, porStartYear: number): Promise; /** * Handle API errors. ACIS has no service literal in `ApiError` (it is not * one of the project's original data sources), so errors are surfaced as * plain `Error`s — this is fine because records are garnish: every caller * of this service catches failures and omits the records line rather than * propagating them (see `src/utils/records.ts`). * @private */ private handleError; } //# sourceMappingURL=acis.d.ts.map