import type Database from 'better-sqlite3'; export interface LastUpdate { hearthstone?: string; } export interface PipelineOptions { force?: boolean; dataDir?: string; fetchFn?: typeof fetch; } /** * Returns true if the cached snapshot is older than STALE_AFTER_MS. * Exported for testing. */ export declare function isStale(lastUpdate: LastUpdate, now?: Date, staleAfterMs?: number): boolean; /** * Load last_update.json from the data directory. * Returns an empty object if the file does not exist. */ export declare function loadLastUpdate(dataDir?: string): LastUpdate; /** * Save last_update.json to the data directory. */ export declare function saveLastUpdate(lastUpdate: LastUpdate, dataDir?: string): void; /** * Returns true if no hearthstone data has ever been fetched. */ export declare function isFirstRun(lastUpdate: LastUpdate): boolean; /** * Run the data pipeline: fetch cards from HearthstoneJSON and ingest into DB. * * Logic: * 1. Load last_update.json * 2. If we have data and not forced refresh, skip fetch (return existing count) * 3. Otherwise fetch cards, clear existing data, re-ingest * 4. On failure: if first run and no data, throw. Otherwise graceful degradation * 5. Save updated timestamp * * @returns Number of cards in the database after pipeline completes */ export declare function runPipeline(db: Database.Database, options?: PipelineOptions): Promise; //# sourceMappingURL=pipeline.d.ts.map