/** * Training Plan Export * * Unified export interface for generating workout files client-side. * Supports: * - ZWO (Zwift workouts) - bike/run only * - FIT (Garmin workouts) - all sports * - MRC (ERG/MRC) - bike only, for indoor trainers * - ICS (iCalendar) - full plan calendar events */ import type { Workout, TrainingPlan, Sport } from "../../../schema/training-plan.js"; import type { Settings } from "../../stores/settings.js"; export type ExportFormat = "zwo" | "fit" | "mrc" | "ics"; export interface ExportResult { success: boolean; filename: string; error?: string; } /** * Trigger a file download in the browser */ export declare function downloadFile(content: string | Uint8Array, filename: string, mimeType: string): void; /** * Sanitize filename to be safe across platforms */ export declare function sanitizeFilename(name: string): string; /** * Get available export formats for a workout based on its sport */ export declare function getAvailableFormats(sport: Sport): ExportFormat[]; /** * Export a single workout to the specified format */ export declare function exportWorkout(workout: Workout, format: ExportFormat, settings: Settings): Promise; /** * Export the full training plan to iCalendar format */ export declare function exportPlanToCalendar(plan: TrainingPlan): ExportResult; /** * Package all exportable workouts from a training plan into a ZIP and trigger its download. * * Skips rest workouts (where `sport === "rest"` or `type === "rest"`) and any workouts not * supported by the selected format. Adds generated ZWO/FIT/MRC files for supported workouts * to the ZIP; if at least one file is added the ZIP is downloaded as `_workouts_.zip`. * * @returns An object with counts and error messages: `exported` is the number of files added to the ZIP, * `skipped` is the number of workouts omitted, and `errors` is an array of per-workout error messages. */ export declare function exportAllWorkouts(plan: TrainingPlan, format: "zwo" | "fit" | "mrc", settings: Settings): Promise<{ exported: number; skipped: number; errors: string[]; }>; export { isZwoSupported } from "./zwo.js"; export { isFitSupported, isFitSdkAvailable } from "./fit.js"; export { isErgSupported } from "./erg.js";