import { type Tokens } from "../../lib/config.js"; import { getAthlete } from "../../strava/api.js"; import type { ActivityLapsArgs, AuthArgs, SyncArgs } from "../args.js"; /** * Initiates Strava OAuth authorization flow or exchanges an authorization code for tokens. * * @param args - CLI authentication arguments. If `args.code` is provided, exchanges it (accepting either a raw code or a full redirect URL) for tokens and saves them; otherwise requires `args.clientId` and `args.clientSecret`, saves a configuration, and prints an authorization URL with step‑by‑step instructions. */ export declare function runAuth(args: AuthArgs): Promise; /** * Result type for sync operations */ export interface SyncResult { syncedCount: number; error?: string; } /** * Core sync logic - reusable by both CLI and auto-sync. * * @param tokens - Valid Strava tokens * @param days - Number of days to look back for activities * @param verbose - Whether to log detailed progress * @returns SyncResult with count and optional error */ export declare function syncActivities(tokens: Tokens, days: number, verbose?: boolean, preFetchedAthlete?: Awaited>): Promise; /** * Synchronizes Strava activities into the local SQLite database. * * Performs authentication either with provided access/refresh tokens or via an OAuth browser flow, * fetches athlete profile and activities for the configured lookback period, inserts or updates athlete and activity rows, * records a sync_log entry, and persists tokens and configuration as needed. * * @param args - Synchronization options. May include: * - `accessToken` and `refreshToken`: use token-based auth (no browser). * - `clientId` and `clientSecret`: create/save configuration when none exists. * - `days`: number of days to sync (overrides stored config; defaults to 730). */ export declare function runSync(args: SyncArgs): Promise; /** * Fetches lap segments for a Strava activity and writes the result as pretty-printed JSON to stdout. * * @param args - Command arguments containing the activity identifier * @param args.id - The Strava activity ID whose laps should be retrieved */ export declare function runActivityLaps(args: ActivityLapsArgs): Promise;