/** * @fileoverview Reference-data service — resolves Open Charge Map reference names/codes to the * integer IDs that POI filters key on, served from a bundled snapshot (offline, zero-latency). * Builds per-category lookup indices (exact-ID, normalized-title, curated connector aliases) at * init, with an optional startup refresh from the live `/v3/referencedata` endpoint that falls * back to the bundled snapshot on any failure. * @module services/reference-data/reference-data-service */ import type { ServerConfig } from '../../config/server-config.js'; import type { ReferenceCategory, ReferencePage, ReferenceSource } from './types.js'; export declare class ReferenceDataService { private readonly serverConfig; private indices; /** Vintage of the data the indices actually hold, not of the bundle they may have replaced. */ private activeDate; private activeSource; constructor(serverConfig: ServerConfig); /** Load the bundled snapshot, optionally refresh from the live endpoint, then build indices. */ setup(): Promise; /** * Date the reference data now in memory was captured — the day of a successful live refresh, or * the bundled snapshot's own capture date when the bundle is what is being served. */ get snapshotDate(): string; /** Which of the two sources the active data came from. Pairs with {@link snapshotDate}. */ get source(): ReferenceSource; /** The `find_stations` filter param a category's IDs feed, or undefined when there is none. */ filterParam(category: ReferenceCategory): string | undefined; /** * Resolve a query to matching reference entries within a category, best/exact first. * Strict normalized token match over the complete category set, plus curated connector aliases. * Ranks every match, then returns the `[offset, offset + limit)` window alongside the full match * count so the caller can disclose and page what the window left out. `total: 0` means no match * (caller surfaces a browse hint). */ resolve(category: ReferenceCategory, query: string, limit: number, offset?: number): ReferencePage; /** * Browse a full category, ordered by ID. Returns the `[offset, offset + limit)` window and the * full category total, so the caller can disclose and page what the window left out. */ browse(category: ReferenceCategory, limit: number, offset?: number): ReferencePage; /** Human-readable title for a numeric ID within a category, or undefined when not found. */ labelFor(category: ReferenceCategory, id: number | null | undefined): string | undefined; private requireIndex; private buildIndices; private toMatch; private detailFor; /** Attempt a live reference refresh; returns the parsed set on success, undefined on any failure. */ private tryRefresh; } /** Construct and initialize the reference-data service. Awaited in `createApp()`'s `setup()`. */ export declare function initReferenceDataService(serverConfig: ServerConfig): Promise; /** Accessor for the initialized reference-data service. */ export declare function getReferenceDataService(): ReferenceDataService; /** Reset the singleton (test isolation only). */ export declare function resetReferenceDataService(): void; //# sourceMappingURL=reference-data-service.d.ts.map