/** * Result type for ensureFreshData function */ export interface FreshnessResult { synced: boolean; reason?: "not_configured" | "fresh" | "error"; syncedCount?: number; warning?: string; cached?: boolean; } /** * Options for ensureFreshData */ export interface FreshnessOptions { verbose?: boolean; noSync?: boolean; } /** * Ensure that activity data is fresh before any command reads it. * * This function: * 1. Checks if Strava is configured (tokens exist in database or config) * 2. If not configured → returns `{ synced: false, reason: 'not_configured' }` * 3. Queries date of most recent activity in local DB * 4. If latest date >= today → returns `{ synced: false, reason: 'fresh' }` * 5. Calculates sync window: `min(today - latestDate, 30)` days * 6. Calls existing sync logic internally * 7. On success → returns `{ synced: true, syncedCount: N }` * 8. On failure → returns `{ synced: false, reason: 'error', warning: string, cached: true }` * * @param options - Options for controlling sync behavior * @param options.verbose - If true, show detailed sync activity logs * @param options.noSync - If true, skip auto-sync even if data is stale * @returns A FreshnessResult indicating the sync status */ export declare function ensureFreshData(options?: FreshnessOptions): Promise;