import { z } from "zod"; //#region src/domain/schemas/krd/index.d.ts /** * Zod schema for the complete KRD (Kaiord Representation Definition) format. * * KRD is a JSON-based canonical format for structured workout, recorded * activity, course, and (as of v2.0) health-domain data. The `type` field * is the top-level discriminator and gates the conditional `metadata.sport` * invariant: * * - For `structured_workout`, `recorded_activity`, `course` — * `metadata.sport` MUST be a non-empty string (preserved from v1.x). * - For the six health types — `metadata.sport` MUST be absent or empty. * * MIME type: `application/vnd.kaiord+json` * * @example * ```typescript * import { krdSchema } from '@kaiord/core'; * * const krd = krdSchema.parse({ * version: '2.0', * type: 'sleep_record', * metadata: { created: '2026-05-22T07:00:00Z' }, * extensions: { * health: { * sleep: { ... } * } * } * }); * ``` */ declare const krdSchema: z.ZodObject<{ version: z.ZodString; type: z.ZodEnum<{ body_composition: "body_composition"; course: "course"; daily_wellness: "daily_wellness"; hrv_summary: "hrv_summary"; recorded_activity: "recorded_activity"; sleep_record: "sleep_record"; stress_episode: "stress_episode"; structured_workout: "structured_workout"; weight_measurement: "weight_measurement"; }>; metadata: z.ZodObject<{ created: z.ZodISODateTime; manufacturer: z.ZodOptional; product: z.ZodOptional; serialNumber: z.ZodOptional; sport: z.ZodOptional; subSport: z.ZodOptional; }, z.core.$strip>; sessions: z.ZodOptional; totalDistance: z.ZodOptional; sport: z.ZodString; subSport: z.ZodOptional; avgHeartRate: z.ZodOptional; maxHeartRate: z.ZodOptional; avgCadence: z.ZodOptional; maxCadence: z.ZodOptional; avgPower: z.ZodOptional; maxPower: z.ZodOptional; normalizedPower: z.ZodOptional; trainingStressScore: z.ZodOptional; intensityFactor: z.ZodOptional; totalCalories: z.ZodOptional; totalAscent: z.ZodOptional; totalDescent: z.ZodOptional; avgSpeed: z.ZodOptional; maxSpeed: z.ZodOptional; }, z.core.$strip>>>; laps: z.ZodOptional; totalDistance: z.ZodOptional; avgHeartRate: z.ZodOptional; maxHeartRate: z.ZodOptional; avgCadence: z.ZodOptional; maxCadence: z.ZodOptional; avgPower: z.ZodOptional; maxPower: z.ZodOptional; normalizedPower: z.ZodOptional; avgSpeed: z.ZodOptional; maxSpeed: z.ZodOptional; totalAscent: z.ZodOptional; totalDescent: z.ZodOptional; totalCalories: z.ZodOptional; trigger: z.ZodOptional>; sport: z.ZodOptional>; subSport: z.ZodOptional>; workoutStepIndex: z.ZodOptional; numLengths: z.ZodOptional; swimStroke: z.ZodOptional>; }, z.core.$strip>>>; records: z.ZodOptional>; altitude: z.ZodOptional; heartRate: z.ZodOptional; cadence: z.ZodOptional; power: z.ZodOptional; speed: z.ZodOptional; distance: z.ZodOptional; temperature: z.ZodOptional; verticalOscillation: z.ZodOptional; stanceTime: z.ZodOptional; stepLength: z.ZodOptional; }, z.core.$strip>>>; events: z.ZodOptional; eventGroup: z.ZodOptional; data: z.ZodOptional; message: z.ZodOptional; }, z.core.$strip>>>; extensions: z.ZodOptional; fit: z.ZodOptional; course: z.ZodOptional; course_points: z.ZodOptional; health: z.ZodOptional; version: z.ZodString; startTime: z.ZodISODateTime; endTime: z.ZodISODateTime; totalDurationSeconds: z.ZodNumber; stages: z.ZodArray; startTime: z.ZodISODateTime; durationSeconds: z.ZodNumber; }, z.core.$strip>>; score: z.ZodOptional; restingHeartRate: z.ZodOptional; kaiordRecordId: z.ZodOptional; sourceBridgeId: z.ZodOptional; externalId: z.ZodOptional; }, z.core.$strip>>; weight: z.ZodOptional; version: z.ZodString; measuredAt: z.ZodISODateTime; weightKilograms: z.ZodNumber; kaiordRecordId: z.ZodOptional; sourceBridgeId: z.ZodOptional; externalId: z.ZodOptional; }, z.core.$strip>>; hrv: z.ZodOptional; version: z.ZodString; measuredAt: z.ZodISODateTime; rMSSD: z.ZodNumber; measurementWindow: z.ZodEnum<{ overnight: "overnight"; spot: "spot"; }>; score: z.ZodOptional; kaiordRecordId: z.ZodOptional; sourceBridgeId: z.ZodOptional; externalId: z.ZodOptional; }, z.core.$strip>>; daily: z.ZodOptional; version: z.ZodString; date: z.ZodISODate; steps: z.ZodNumber; activeCalories: z.ZodNumber; restingCalories: z.ZodNumber; intensityMinutes: z.ZodObject<{ moderate: z.ZodNumber; vigorous: z.ZodNumber; }, z.core.$strip>; floorsClimbed: z.ZodOptional; kaiordRecordId: z.ZodOptional; sourceBridgeId: z.ZodOptional; externalId: z.ZodOptional; }, z.core.$strip>>; bodyComposition: z.ZodOptional; version: z.ZodString; measuredAt: z.ZodISODateTime; bodyFatPercent: z.ZodOptional; leanMassKilograms: z.ZodOptional; boneMassKilograms: z.ZodOptional; bodyWaterPercent: z.ZodOptional; bmi: z.ZodOptional; visceralFatRating: z.ZodOptional; basalMetabolicRateKcal: z.ZodOptional; kaiordRecordId: z.ZodOptional; sourceBridgeId: z.ZodOptional; externalId: z.ZodOptional; }, z.core.$strip>>; stress: z.ZodOptional; version: z.ZodString; startTime: z.ZodISODateTime; endTime: z.ZodISODateTime; averageLevel: z.ZodNumber; peakLevel: z.ZodNumber; kaiordRecordId: z.ZodOptional; sourceBridgeId: z.ZodOptional; externalId: z.ZodOptional; }, z.core.$strip>>; }, z.core.$catchall>>; }, z.core.$catchall>>; }, z.core.$strip>; /** * TypeScript type for the complete KRD format, inferred from {@link krdSchema}. * * KRD (Kaiord Representation Definition) is the canonical JSON format for workout, activity, course, and health data. */ type KRD = z.infer; //#endregion //#region src/test-utils/fixtures.d.ts /** * Load a FIT file fixture as a buffer * * @param filename - Name of the FIT file (e.g., "WorkoutIndividualSteps.fit") * @returns Buffer containing the FIT file data * * @example * ```typescript * const fitBuffer = loadFitFixture("WorkoutIndividualSteps.fit"); * const krd = await fitReader.readToKRD(fitBuffer); * ``` */ declare const loadFitFixture: (filename: string) => Uint8Array; /** * Load a KRD file fixture as a parsed object * * @param filename - Name of the KRD file (e.g., "WorkoutIndividualSteps.krd") * @returns Parsed KRD object * * @example * ```typescript * const krd = loadKrdFixture("WorkoutIndividualSteps.krd"); * expect(krd.version).toBe("1.0"); * ``` */ declare const loadKrdFixture: (filename: string) => KRD; /** * Load a KRD file fixture as raw JSON string * * @param filename - Name of the KRD file (e.g., "WorkoutIndividualSteps.krd") * @returns Raw JSON string * * @example * ```typescript * const jsonString = loadKrdFixtureRaw("WorkoutIndividualSteps.krd"); * const krd = JSON.parse(jsonString); * ``` */ declare const loadKrdFixtureRaw: (filename: string) => string; /** * Load a TCX file fixture as a string * * @param filename - Name of the TCX file (e.g., "WorkoutHeartRateTargets.tcx") * @returns TCX XML string * * @example * ```typescript * const tcxString = loadTcxFixture("WorkoutHeartRateTargets.tcx"); * const krd = await tcxReader.readToKRD(tcxString); * ``` */ declare const loadTcxFixture: (filename: string) => string; /** * Load a ZWO file fixture as a string * * @param filename - Name of the ZWO file (e.g., "WorkoutIndividualSteps.zwo") * @returns ZWO XML string * * @example * ```typescript * const zwoString = loadZwoFixture("WorkoutIndividualSteps.zwo"); * const krd = await zwoReader.readToKRD(zwoString); * ``` */ declare const loadZwoFixture: (filename: string) => string; /** * Get the full path to a fixture file * * @param type - Type of fixture ("fit", "krd", "tcx", or "zwo") * @param filename - Name of the file * @returns Full path to the fixture file * * @example * ```typescript * const path = getFixturePath("fit", "WorkoutIndividualSteps.fit"); * const buffer = readFileSync(path); * ``` */ declare const getFixturePath: (type: "fit" | "krd" | "tcx" | "zwo", filename: string) => string; /** * Available fixture names (without extension) */ declare const FIXTURE_NAMES: { readonly INDIVIDUAL_STEPS: "WorkoutIndividualSteps"; readonly REPEAT_STEPS: "WorkoutRepeatSteps"; readonly CUSTOM_TARGET_VALUES: "WorkoutCustomTargetValues"; readonly REPEAT_GREATER_THAN: "WorkoutRepeatGreaterThanStep"; }; /** * Load a fixture pair (FIT + KRD) for round-trip testing * * @param baseName - Base name without extension (e.g., "WorkoutIndividualSteps") * @returns Object with both FIT buffer and KRD object * * @example * ```typescript * const { fit, krd } = loadFixturePair("WorkoutIndividualSteps"); * const converted = await fitReader.readToKRD(fit); * expect(converted).toEqual(krd); * ``` */ declare const loadFixturePair: (baseName: string) => { fit: Uint8Array; krd: KRD; }; //#endregion //#region src/ports/logger.d.ts type Logger = { debug: (message: string, context?: Record) => void; info: (message: string, context?: Record) => void; warn: (message: string, context?: Record) => void; error: (message: string, context?: Record) => void; }; //#endregion //#region src/tests/helpers/test-utils.d.ts declare const createMockLogger: () => Logger; //#endregion //#region src/tests/fixtures/krd/krd.fixtures.d.ts declare const buildKRD: import("rosie").IFactory<{ version: string; type: "body_composition" | "course" | "daily_wellness" | "hrv_summary" | "recorded_activity" | "sleep_record" | "stress_episode" | "structured_workout" | "weight_measurement"; metadata: { created: string; manufacturer?: string | undefined; product?: string | undefined; serialNumber?: string | undefined; sport?: string | undefined; subSport?: string | undefined; }; sessions?: { startTime: string; totalElapsedTime: number; totalTimerTime?: number | undefined; totalDistance?: number | undefined; sport: string; subSport?: string | undefined; avgHeartRate?: number | undefined; maxHeartRate?: number | undefined; avgCadence?: number | undefined; maxCadence?: number | undefined; avgPower?: number | undefined; maxPower?: number | undefined; normalizedPower?: number | undefined; trainingStressScore?: number | undefined; intensityFactor?: number | undefined; totalCalories?: number | undefined; totalAscent?: number | undefined; totalDescent?: number | undefined; avgSpeed?: number | undefined; maxSpeed?: number | undefined; }[] | undefined; laps?: { startTime: string; totalElapsedTime: number; totalTimerTime?: number | undefined; totalDistance?: number | undefined; avgHeartRate?: number | undefined; maxHeartRate?: number | undefined; avgCadence?: number | undefined; maxCadence?: number | undefined; avgPower?: number | undefined; maxPower?: number | undefined; normalizedPower?: number | undefined; avgSpeed?: number | undefined; maxSpeed?: number | undefined; totalAscent?: number | undefined; totalDescent?: number | undefined; totalCalories?: number | undefined; trigger?: "distance" | "fitness_equipment" | "manual" | "position" | "session_end" | "time" | undefined; sport?: "alpine_skiing" | "american_football" | "archery" | "baseball" | "basketball" | "boating" | "boxing" | "canoeing" | "cricket" | "cross_country_skiing" | "cycling" | "dance" | "disc_golf" | "diving" | "driving" | "e_biking" | "fishing" | "fitness_equipment" | "floor_climbing" | "flying" | "generic" | "geocaching" | "golf" | "grinding" | "hang_gliding" | "hiit" | "hiking" | "hockey" | "horseback_riding" | "hunting" | "ice_skating" | "inline_skating" | "jump_rope" | "jumpmaster" | "kayaking" | "kitesurfing" | "lacrosse" | "meditation" | "mixed_martial_arts" | "mobility" | "motor_sports" | "motorcycling" | "mountaineering" | "multisport" | "paddling" | "para_sport" | "pool_apnea" | "racket" | "rafting" | "rock_climbing" | "rowing" | "rugby" | "running" | "sailing" | "shooting" | "sky_diving" | "snorkeling" | "snowboarding" | "snowmobiling" | "snowshoeing" | "soccer" | "stand_up_paddleboarding" | "surfing" | "swimming" | "tactical" | "team_sport" | "tennis" | "training" | "transition" | "video_gaming" | "volleyball" | "wakeboarding" | "wakesurfing" | "walking" | "water_skiing" | "water_sport" | "water_tubing" | "wheelchair_push_run" | "wheelchair_push_walk" | "windsurfing" | "winter_sport" | undefined; subSport?: "all" | "apnea_diving" | "apnea_hunting" | "atv" | "backcountry" | "bike_to_run_transition" | "bmx" | "cardio_training" | "casual_walking" | "challenge" | "commuting" | "cyclocross" | "downhill" | "e_bike_fitness" | "e_bike_mountain" | "elliptical" | "exercise" | "flexibility_training" | "gauge_diving" | "generic" | "gravel_cycling" | "hand_cycling" | "indoor_cycling" | "indoor_rowing" | "indoor_running" | "indoor_skiing" | "indoor_walking" | "lap_swimming" | "map" | "match" | "mixed_surface" | "motocross" | "mountain" | "multi_gas_diving" | "navigate" | "obstacle" | "open_water" | "pilates" | "rc_drone" | "recumbent" | "resort" | "road" | "run_to_bike_transition" | "single_gas_diving" | "skate_skiing" | "speed_walking" | "spin" | "stair_climbing" | "street" | "strength_training" | "swim_to_bike_transition" | "track" | "track_cycling" | "track_me" | "trail" | "treadmill" | "virtual_activity" | "warm_up" | "whitewater" | "wingsuit" | "yoga" | undefined; workoutStepIndex?: number | undefined; numLengths?: number | undefined; swimStroke?: "backstroke" | "breaststroke" | "butterfly" | "drill" | "freestyle" | "im" | "mixed" | undefined; }[] | undefined; records?: { timestamp: string; position?: { lat: number; lon: number; } | undefined; altitude?: number | undefined; heartRate?: number | undefined; cadence?: number | undefined; power?: number | undefined; speed?: number | undefined; distance?: number | undefined; temperature?: number | undefined; verticalOscillation?: number | undefined; stanceTime?: number | undefined; stepLength?: number | undefined; }[] | undefined; events?: { timestamp: string; eventType: "event_activity_start" | "event_lap" | "event_marker" | "event_pause" | "event_resume" | "event_session_start" | "event_start" | "event_stop" | "event_timer" | "event_workout_step_change"; eventGroup?: number | undefined; data?: number | undefined; message?: string | undefined; }[] | undefined; extensions?: { [x: string]: unknown; structured_workout?: unknown; fit?: unknown; course?: unknown; course_points?: unknown; health?: { [x: string]: unknown; sleep?: { kind: "sleep"; version: string; startTime: string; endTime: string; totalDurationSeconds: number; stages: { stage: "awake" | "deep" | "light" | "rem"; startTime: string; durationSeconds: number; }[]; score?: number | undefined; restingHeartRate?: number | undefined; kaiordRecordId?: string | undefined; sourceBridgeId?: string | undefined; externalId?: string | undefined; } | undefined; weight?: { kind: "weight"; version: string; measuredAt: string; weightKilograms: number; kaiordRecordId?: string | undefined; sourceBridgeId?: string | undefined; externalId?: string | undefined; } | undefined; hrv?: { kind: "hrv"; version: string; measuredAt: string; rMSSD: number; measurementWindow: "overnight" | "spot"; score?: number | undefined; kaiordRecordId?: string | undefined; sourceBridgeId?: string | undefined; externalId?: string | undefined; } | undefined; daily?: { kind: "daily"; version: string; date: string; steps: number; activeCalories: number; restingCalories: number; intensityMinutes: { moderate: number; vigorous: number; }; floorsClimbed?: number | undefined; kaiordRecordId?: string | undefined; sourceBridgeId?: string | undefined; externalId?: string | undefined; } | undefined; bodyComposition?: { kind: "bodyComposition"; version: string; measuredAt: string; bodyFatPercent?: number | undefined; leanMassKilograms?: number | undefined; boneMassKilograms?: number | undefined; bodyWaterPercent?: number | undefined; bmi?: number | undefined; visceralFatRating?: number | undefined; basalMetabolicRateKcal?: number | undefined; kaiordRecordId?: string | undefined; sourceBridgeId?: string | undefined; externalId?: string | undefined; } | undefined; stress?: { kind: "stress"; version: string; startTime: string; endTime: string; averageLevel: number; peakLevel: number; kaiordRecordId?: string | undefined; sourceBridgeId?: string | undefined; externalId?: string | undefined; } | undefined; } | undefined; } | undefined; }>; //#endregion //#region src/tests/fixtures/krd/metadata.fixtures.d.ts declare const buildKRDMetadata: import("rosie").IFactory<{ created: string; manufacturer?: string | undefined; product?: string | undefined; serialNumber?: string | undefined; sport?: string | undefined; subSport?: string | undefined; }>; //#endregion //#region src/tests/fixtures/krd/event.fixtures.d.ts declare const buildKRDEvent: import("rosie").IFactory<{ timestamp: string; eventType: "event_activity_start" | "event_lap" | "event_marker" | "event_pause" | "event_resume" | "event_session_start" | "event_start" | "event_stop" | "event_timer" | "event_workout_step_change"; eventGroup?: number | undefined; data?: number | undefined; message?: string | undefined; }>; //#endregion //#region src/tests/fixtures/krd/lap.fixtures.d.ts declare const buildKRDLap: import("rosie").IFactory<{ startTime: string; totalElapsedTime: number; totalTimerTime?: number | undefined; totalDistance?: number | undefined; avgHeartRate?: number | undefined; maxHeartRate?: number | undefined; avgCadence?: number | undefined; maxCadence?: number | undefined; avgPower?: number | undefined; maxPower?: number | undefined; normalizedPower?: number | undefined; avgSpeed?: number | undefined; maxSpeed?: number | undefined; totalAscent?: number | undefined; totalDescent?: number | undefined; totalCalories?: number | undefined; trigger?: "distance" | "fitness_equipment" | "manual" | "position" | "session_end" | "time" | undefined; sport?: "alpine_skiing" | "american_football" | "archery" | "baseball" | "basketball" | "boating" | "boxing" | "canoeing" | "cricket" | "cross_country_skiing" | "cycling" | "dance" | "disc_golf" | "diving" | "driving" | "e_biking" | "fishing" | "fitness_equipment" | "floor_climbing" | "flying" | "generic" | "geocaching" | "golf" | "grinding" | "hang_gliding" | "hiit" | "hiking" | "hockey" | "horseback_riding" | "hunting" | "ice_skating" | "inline_skating" | "jump_rope" | "jumpmaster" | "kayaking" | "kitesurfing" | "lacrosse" | "meditation" | "mixed_martial_arts" | "mobility" | "motor_sports" | "motorcycling" | "mountaineering" | "multisport" | "paddling" | "para_sport" | "pool_apnea" | "racket" | "rafting" | "rock_climbing" | "rowing" | "rugby" | "running" | "sailing" | "shooting" | "sky_diving" | "snorkeling" | "snowboarding" | "snowmobiling" | "snowshoeing" | "soccer" | "stand_up_paddleboarding" | "surfing" | "swimming" | "tactical" | "team_sport" | "tennis" | "training" | "transition" | "video_gaming" | "volleyball" | "wakeboarding" | "wakesurfing" | "walking" | "water_skiing" | "water_sport" | "water_tubing" | "wheelchair_push_run" | "wheelchair_push_walk" | "windsurfing" | "winter_sport" | undefined; subSport?: "all" | "apnea_diving" | "apnea_hunting" | "atv" | "backcountry" | "bike_to_run_transition" | "bmx" | "cardio_training" | "casual_walking" | "challenge" | "commuting" | "cyclocross" | "downhill" | "e_bike_fitness" | "e_bike_mountain" | "elliptical" | "exercise" | "flexibility_training" | "gauge_diving" | "generic" | "gravel_cycling" | "hand_cycling" | "indoor_cycling" | "indoor_rowing" | "indoor_running" | "indoor_skiing" | "indoor_walking" | "lap_swimming" | "map" | "match" | "mixed_surface" | "motocross" | "mountain" | "multi_gas_diving" | "navigate" | "obstacle" | "open_water" | "pilates" | "rc_drone" | "recumbent" | "resort" | "road" | "run_to_bike_transition" | "single_gas_diving" | "skate_skiing" | "speed_walking" | "spin" | "stair_climbing" | "street" | "strength_training" | "swim_to_bike_transition" | "track" | "track_cycling" | "track_me" | "trail" | "treadmill" | "virtual_activity" | "warm_up" | "whitewater" | "wingsuit" | "yoga" | undefined; workoutStepIndex?: number | undefined; numLengths?: number | undefined; swimStroke?: "backstroke" | "breaststroke" | "butterfly" | "drill" | "freestyle" | "im" | "mixed" | undefined; }>; //#endregion //#region src/tests/fixtures/krd/record.fixtures.d.ts declare const buildKRDRecord: import("rosie").IFactory<{ timestamp: string; position?: { lat: number; lon: number; } | undefined; altitude?: number | undefined; heartRate?: number | undefined; cadence?: number | undefined; power?: number | undefined; speed?: number | undefined; distance?: number | undefined; temperature?: number | undefined; verticalOscillation?: number | undefined; stanceTime?: number | undefined; stepLength?: number | undefined; }>; //#endregion //#region src/tests/fixtures/krd/session.fixtures.d.ts declare const buildKRDSession: import("rosie").IFactory<{ startTime: string; totalElapsedTime: number; totalTimerTime?: number | undefined; totalDistance?: number | undefined; sport: string; subSport?: string | undefined; avgHeartRate?: number | undefined; maxHeartRate?: number | undefined; avgCadence?: number | undefined; maxCadence?: number | undefined; avgPower?: number | undefined; maxPower?: number | undefined; normalizedPower?: number | undefined; trainingStressScore?: number | undefined; intensityFactor?: number | undefined; totalCalories?: number | undefined; totalAscent?: number | undefined; totalDescent?: number | undefined; avgSpeed?: number | undefined; maxSpeed?: number | undefined; }>; //#endregion //#region src/tests/fixtures/workout/workout-step.fixtures.d.ts declare const buildWorkoutStep: import("rosie").IFactory<{ stepIndex: number; name?: string | undefined; durationType: "calories" | "distance" | "heart_rate_less_than" | "open" | "power_greater_than" | "power_less_than" | "repeat_until_calories" | "repeat_until_distance" | "repeat_until_heart_rate_greater_than" | "repeat_until_heart_rate_less_than" | "repeat_until_power_greater_than" | "repeat_until_power_less_than" | "repeat_until_time" | "time"; duration: { type: "time"; seconds: number; } | { type: "distance"; meters: number; } | { type: "heart_rate_less_than"; bpm: number; } | { type: "repeat_until_heart_rate_greater_than"; bpm: number; repeatFrom: number; } | { type: "calories"; calories: number; } | { type: "power_less_than"; watts: number; } | { type: "power_greater_than"; watts: number; } | { type: "repeat_until_time"; seconds: number; repeatFrom: number; } | { type: "repeat_until_distance"; meters: number; repeatFrom: number; } | { type: "repeat_until_calories"; calories: number; repeatFrom: number; } | { type: "repeat_until_heart_rate_less_than"; bpm: number; repeatFrom: number; } | { type: "repeat_until_power_less_than"; watts: number; repeatFrom: number; } | { type: "repeat_until_power_greater_than"; watts: number; repeatFrom: number; } | { type: "open"; }; targetType: "cadence" | "heart_rate" | "open" | "pace" | "power" | "stroke_type"; target: { type: "power"; value: { unit: "range"; min: number; max: number; } | { unit: "watts"; value: number; } | { unit: "percent_ftp"; value: number; } | { unit: "zone"; value: number; }; } | { type: "heart_rate"; value: { unit: "range"; min: number; max: number; } | { unit: "bpm"; value: number; } | { unit: "zone"; value: number; } | { unit: "percent_max"; value: number; }; } | { type: "cadence"; value: { unit: "range"; min: number; max: number; } | { unit: "rpm"; value: number; }; } | { type: "pace"; value: { unit: "range"; min: number; max: number; } | { unit: "mps"; value: number; } | { unit: "zone"; value: number; }; } | { type: "stroke_type"; value: { unit: "swim_stroke"; value: number; }; } | { type: "open"; }; intensity?: "active" | "cooldown" | "interval" | "other" | "recovery" | "rest" | "warmup" | undefined; notes?: string | undefined; equipment?: "none" | "swim_fins" | "swim_kickboard" | "swim_paddles" | "swim_pull_buoy" | "swim_snorkel" | undefined; extensions?: Record | undefined; }>; //#endregion //#region src/tests/fixtures/workout/workout.fixtures.d.ts declare const buildWorkout: import("rosie").IFactory<{ name?: string | undefined; notes?: string | undefined; sport: "alpine_skiing" | "american_football" | "archery" | "baseball" | "basketball" | "boating" | "boxing" | "canoeing" | "cricket" | "cross_country_skiing" | "cycling" | "dance" | "disc_golf" | "diving" | "driving" | "e_biking" | "fishing" | "fitness_equipment" | "floor_climbing" | "flying" | "generic" | "geocaching" | "golf" | "grinding" | "hang_gliding" | "hiit" | "hiking" | "hockey" | "horseback_riding" | "hunting" | "ice_skating" | "inline_skating" | "jump_rope" | "jumpmaster" | "kayaking" | "kitesurfing" | "lacrosse" | "meditation" | "mixed_martial_arts" | "mobility" | "motor_sports" | "motorcycling" | "mountaineering" | "multisport" | "paddling" | "para_sport" | "pool_apnea" | "racket" | "rafting" | "rock_climbing" | "rowing" | "rugby" | "running" | "sailing" | "shooting" | "sky_diving" | "snorkeling" | "snowboarding" | "snowmobiling" | "snowshoeing" | "soccer" | "stand_up_paddleboarding" | "surfing" | "swimming" | "tactical" | "team_sport" | "tennis" | "training" | "transition" | "video_gaming" | "volleyball" | "wakeboarding" | "wakesurfing" | "walking" | "water_skiing" | "water_sport" | "water_tubing" | "wheelchair_push_run" | "wheelchair_push_walk" | "windsurfing" | "winter_sport"; subSport?: "all" | "apnea_diving" | "apnea_hunting" | "atv" | "backcountry" | "bike_to_run_transition" | "bmx" | "cardio_training" | "casual_walking" | "challenge" | "commuting" | "cyclocross" | "downhill" | "e_bike_fitness" | "e_bike_mountain" | "elliptical" | "exercise" | "flexibility_training" | "gauge_diving" | "generic" | "gravel_cycling" | "hand_cycling" | "indoor_cycling" | "indoor_rowing" | "indoor_running" | "indoor_skiing" | "indoor_walking" | "lap_swimming" | "map" | "match" | "mixed_surface" | "motocross" | "mountain" | "multi_gas_diving" | "navigate" | "obstacle" | "open_water" | "pilates" | "rc_drone" | "recumbent" | "resort" | "road" | "run_to_bike_transition" | "single_gas_diving" | "skate_skiing" | "speed_walking" | "spin" | "stair_climbing" | "street" | "strength_training" | "swim_to_bike_transition" | "track" | "track_cycling" | "track_me" | "trail" | "treadmill" | "virtual_activity" | "warm_up" | "whitewater" | "wingsuit" | "yoga" | undefined; poolLength?: number | undefined; poolLengthUnit?: "meters" | undefined; steps: ({ stepIndex: number; name?: string | undefined; durationType: "calories" | "distance" | "heart_rate_less_than" | "open" | "power_greater_than" | "power_less_than" | "repeat_until_calories" | "repeat_until_distance" | "repeat_until_heart_rate_greater_than" | "repeat_until_heart_rate_less_than" | "repeat_until_power_greater_than" | "repeat_until_power_less_than" | "repeat_until_time" | "time"; duration: { type: "time"; seconds: number; } | { type: "distance"; meters: number; } | { type: "heart_rate_less_than"; bpm: number; } | { type: "repeat_until_heart_rate_greater_than"; bpm: number; repeatFrom: number; } | { type: "calories"; calories: number; } | { type: "power_less_than"; watts: number; } | { type: "power_greater_than"; watts: number; } | { type: "repeat_until_time"; seconds: number; repeatFrom: number; } | { type: "repeat_until_distance"; meters: number; repeatFrom: number; } | { type: "repeat_until_calories"; calories: number; repeatFrom: number; } | { type: "repeat_until_heart_rate_less_than"; bpm: number; repeatFrom: number; } | { type: "repeat_until_power_less_than"; watts: number; repeatFrom: number; } | { type: "repeat_until_power_greater_than"; watts: number; repeatFrom: number; } | { type: "open"; }; targetType: "cadence" | "heart_rate" | "open" | "pace" | "power" | "stroke_type"; target: { type: "power"; value: { unit: "range"; min: number; max: number; } | { unit: "watts"; value: number; } | { unit: "percent_ftp"; value: number; } | { unit: "zone"; value: number; }; } | { type: "heart_rate"; value: { unit: "range"; min: number; max: number; } | { unit: "bpm"; value: number; } | { unit: "zone"; value: number; } | { unit: "percent_max"; value: number; }; } | { type: "cadence"; value: { unit: "range"; min: number; max: number; } | { unit: "rpm"; value: number; }; } | { type: "pace"; value: { unit: "range"; min: number; max: number; } | { unit: "mps"; value: number; } | { unit: "zone"; value: number; }; } | { type: "stroke_type"; value: { unit: "swim_stroke"; value: number; }; } | { type: "open"; }; intensity?: "active" | "cooldown" | "interval" | "other" | "recovery" | "rest" | "warmup" | undefined; notes?: string | undefined; equipment?: "none" | "swim_fins" | "swim_kickboard" | "swim_paddles" | "swim_pull_buoy" | "swim_snorkel" | undefined; extensions?: Record | undefined; } | { id?: string | undefined; repeatCount: number; steps: { stepIndex: number; name?: string | undefined; durationType: "calories" | "distance" | "heart_rate_less_than" | "open" | "power_greater_than" | "power_less_than" | "repeat_until_calories" | "repeat_until_distance" | "repeat_until_heart_rate_greater_than" | "repeat_until_heart_rate_less_than" | "repeat_until_power_greater_than" | "repeat_until_power_less_than" | "repeat_until_time" | "time"; duration: { type: "time"; seconds: number; } | { type: "distance"; meters: number; } | { type: "heart_rate_less_than"; bpm: number; } | { type: "repeat_until_heart_rate_greater_than"; bpm: number; repeatFrom: number; } | { type: "calories"; calories: number; } | { type: "power_less_than"; watts: number; } | { type: "power_greater_than"; watts: number; } | { type: "repeat_until_time"; seconds: number; repeatFrom: number; } | { type: "repeat_until_distance"; meters: number; repeatFrom: number; } | { type: "repeat_until_calories"; calories: number; repeatFrom: number; } | { type: "repeat_until_heart_rate_less_than"; bpm: number; repeatFrom: number; } | { type: "repeat_until_power_less_than"; watts: number; repeatFrom: number; } | { type: "repeat_until_power_greater_than"; watts: number; repeatFrom: number; } | { type: "open"; }; targetType: "cadence" | "heart_rate" | "open" | "pace" | "power" | "stroke_type"; target: { type: "power"; value: { unit: "range"; min: number; max: number; } | { unit: "watts"; value: number; } | { unit: "percent_ftp"; value: number; } | { unit: "zone"; value: number; }; } | { type: "heart_rate"; value: { unit: "range"; min: number; max: number; } | { unit: "bpm"; value: number; } | { unit: "zone"; value: number; } | { unit: "percent_max"; value: number; }; } | { type: "cadence"; value: { unit: "range"; min: number; max: number; } | { unit: "rpm"; value: number; }; } | { type: "pace"; value: { unit: "range"; min: number; max: number; } | { unit: "mps"; value: number; } | { unit: "zone"; value: number; }; } | { type: "stroke_type"; value: { unit: "swim_stroke"; value: number; }; } | { type: "open"; }; intensity?: "active" | "cooldown" | "interval" | "other" | "recovery" | "rest" | "warmup" | undefined; notes?: string | undefined; equipment?: "none" | "swim_fins" | "swim_kickboard" | "swim_paddles" | "swim_pull_buoy" | "swim_snorkel" | undefined; extensions?: Record | undefined; }[]; })[]; extensions?: Record | undefined; }>; //#endregion //#region src/tests/fixtures/workout/duration.fixtures.d.ts declare const buildDuration: import("rosie").IFactory<{ type: "time"; seconds: number; } | { type: "distance"; meters: number; } | { type: "heart_rate_less_than"; bpm: number; } | { type: "repeat_until_heart_rate_greater_than"; bpm: number; repeatFrom: number; } | { type: "calories"; calories: number; } | { type: "power_less_than"; watts: number; } | { type: "power_greater_than"; watts: number; } | { type: "repeat_until_time"; seconds: number; repeatFrom: number; } | { type: "repeat_until_distance"; meters: number; repeatFrom: number; } | { type: "repeat_until_calories"; calories: number; repeatFrom: number; } | { type: "repeat_until_heart_rate_less_than"; bpm: number; repeatFrom: number; } | { type: "repeat_until_power_less_than"; watts: number; repeatFrom: number; } | { type: "repeat_until_power_greater_than"; watts: number; repeatFrom: number; } | { type: "open"; }>; //#endregion //#region src/tests/fixtures/workout/target.fixtures.d.ts declare const buildTarget: import("rosie").IFactory<{ type: "power"; value: { unit: "range"; min: number; max: number; } | { unit: "watts"; value: number; } | { unit: "percent_ftp"; value: number; } | { unit: "zone"; value: number; }; } | { type: "heart_rate"; value: { unit: "range"; min: number; max: number; } | { unit: "bpm"; value: number; } | { unit: "zone"; value: number; } | { unit: "percent_max"; value: number; }; } | { type: "cadence"; value: { unit: "range"; min: number; max: number; } | { unit: "rpm"; value: number; }; } | { type: "pace"; value: { unit: "range"; min: number; max: number; } | { unit: "mps"; value: number; } | { unit: "zone"; value: number; }; } | { type: "stroke_type"; value: { unit: "swim_stroke"; value: number; }; } | { type: "open"; }>; //#endregion //#region src/protocol/profile-snapshot.d.ts declare const profileSnapshotSchema: z.ZodPipe; profile: z.ZodObject<{ name: z.ZodString; bodyWeight: z.ZodOptional; }, z.core.$strict>; activeSport: z.ZodOptional>; thresholds: z.ZodDefault; }, z.core.$strict>>; running: z.ZodOptional; lthr: z.ZodOptional; }, z.core.$strict>>; swimming: z.ZodOptional; }, z.core.$strict>>; }, z.core.$strict>>; heartRate: z.ZodDefault; lthr: z.ZodOptional; }, z.core.$strict>>; generatedAt: z.ZodISODateTime; }, z.core.$strict>>; type ProfileSnapshot = z.infer; //#endregion //#region src/test-utils/profile-snapshot-fixtures.d.ts declare const baselineSnapshot: ProfileSnapshot; declare const minimalSnapshot: ProfileSnapshot; declare const partialZoneSnapshot: ProfileSnapshot; declare const positiveSnapshotFixtures: readonly ProfileSnapshot[]; type NegativeSnapshotFixture = { readonly name: string; readonly value: unknown; readonly expectedError: RegExp; }; declare const negativeSnapshotFixtures: readonly NegativeSnapshotFixture[]; declare const snapshotFixtures: { readonly positive: readonly { schemaVersion: 1; profile: { name: string; bodyWeight?: number | undefined; }; activeSport?: "cycling" | "running" | "swimming" | undefined; thresholds: { cycling?: { ftp?: number | undefined; } | undefined; running?: { thresholdPaceSecPerKm?: number | undefined; lthr?: number | undefined; } | undefined; swimming?: { cssPaceSecPer100m?: number | undefined; } | undefined; }; heartRate: { max?: number | undefined; lthr?: number | undefined; }; generatedAt: string; }[]; readonly negative: readonly NegativeSnapshotFixture[]; }; //#endregion //#region src/test-utils/tolerance-constants.d.ts /** * Round-trip tolerance constants. * * These values mirror the documented tolerances from CLAUDE.md: * time ±1s, power ±1W or ±1%FTP, HR ±1bpm, cadence ±1rpm. * * Distance and pace tolerances are derived from the same domain * conventions used by the round-trip validator. * * Centralised so test files can reference named values instead of * sprinkling magic numbers across assertions. */ declare const TOLERANCE_TIME_SEC: 1; declare const TOLERANCE_POWER_WATTS: 1; declare const TOLERANCE_HR_BPM: 1; declare const TOLERANCE_CADENCE_RPM: 1; declare const TOLERANCE_DISTANCE_M: 1; declare const TOLERANCE_PACE_SEC_PER_M: 0.01; //#endregion //#region src/test-utils/round-trip-fixtures.d.ts /** * Round-trip test fixtures. * * Shared sample buffers and named domain constants used by * round-trip validation tests. Centralising these values keeps * `expect(...)` assertions self-documenting and removes inline * magic numbers from the test suite. * * Tolerance numeric values themselves live in `./tolerance-constants`. */ /** * Returns a fresh `Uint8Array([1, 2, 3, 4])` per call. * * Returning a new buffer per invocation prevents cross-test mutation * if a future test ever writes to the underlying bytes. */ declare const createFitBufferSample: () => Uint8Array; declare const POWER_EXPECTED: 250; declare const POWER_ACTUAL: 255; declare const POWER_ACTUAL_HIGH: 260; declare const HR_EXPECTED: 150; declare const HR_ACTUAL: 155; declare const HR_ACTUAL_HIGH: 160; declare const CADENCE_EXPECTED: 85; declare const CADENCE_ACTUAL: 90; declare const TIME_EXPECTED_SEC: 3600; declare const TIME_ACTUAL_SEC: 3602; declare const DISTANCE_EXPECTED_M: 10000; declare const DISTANCE_ACTUAL_M: 10005; declare const LAP_TIME_EXPECTED_SEC: 600; declare const LAP_TIME_ACTUAL_SEC: 605; declare const LAP_DISTANCE_EXPECTED_M: 1000; declare const LAP_DISTANCE_ACTUAL_M: 1010; declare const RECORD_DISTANCE_EXPECTED_M: 100; declare const RECORD_DISTANCE_ACTUAL_M: 105; declare const RECORD_SPEED_EXPECTED_MPS: 2.78; declare const RECORD_SPEED_ACTUAL_MPS: 2.85; declare const VIOLATION_COUNT_FULL_SESSION: 5; declare const VIOLATION_COUNT_LAP: 3; declare const VIOLATION_COUNT_RECORD: 5; declare const DEVIATION_POWER_5W: 5; declare const DEVIATION_POWER_10W: 10; declare const DEVIATION_HR_5BPM: 5; declare const DEVIATION_HR_10BPM: 10; declare const DEVIATION_CADENCE_5RPM: 5; declare const DEVIATION_DISTANCE_5M: 5; declare const DEVIATION_DISTANCE_10M: 10; declare const DEVIATION_TIME_2SEC: 2; declare const DEVIATION_TIME_5SEC: 5; declare const DEVIATION_PACE: 0.07; //#endregion export { CADENCE_ACTUAL, CADENCE_EXPECTED, DEVIATION_CADENCE_5RPM, DEVIATION_DISTANCE_10M, DEVIATION_DISTANCE_5M, DEVIATION_HR_10BPM, DEVIATION_HR_5BPM, DEVIATION_PACE, DEVIATION_POWER_10W, DEVIATION_POWER_5W, DEVIATION_TIME_2SEC, DEVIATION_TIME_5SEC, DISTANCE_ACTUAL_M, DISTANCE_EXPECTED_M, FIXTURE_NAMES, HR_ACTUAL, HR_ACTUAL_HIGH, HR_EXPECTED, LAP_DISTANCE_ACTUAL_M, LAP_DISTANCE_EXPECTED_M, LAP_TIME_ACTUAL_SEC, LAP_TIME_EXPECTED_SEC, type NegativeSnapshotFixture, POWER_ACTUAL, POWER_ACTUAL_HIGH, POWER_EXPECTED, RECORD_DISTANCE_ACTUAL_M, RECORD_DISTANCE_EXPECTED_M, RECORD_SPEED_ACTUAL_MPS, RECORD_SPEED_EXPECTED_MPS, TIME_ACTUAL_SEC, TIME_EXPECTED_SEC, TOLERANCE_CADENCE_RPM, TOLERANCE_DISTANCE_M, TOLERANCE_HR_BPM, TOLERANCE_PACE_SEC_PER_M, TOLERANCE_POWER_WATTS, TOLERANCE_TIME_SEC, VIOLATION_COUNT_FULL_SESSION, VIOLATION_COUNT_LAP, VIOLATION_COUNT_RECORD, baselineSnapshot, buildDuration, buildKRD, buildKRDEvent, buildKRDLap, buildKRDMetadata, buildKRDRecord, buildKRDSession, buildTarget, buildWorkout, buildWorkoutStep, createFitBufferSample, createMockLogger, getFixturePath, loadFitFixture, loadFixturePair, loadKrdFixture, loadKrdFixtureRaw, loadTcxFixture, loadZwoFixture, minimalSnapshot, negativeSnapshotFixtures, partialZoneSnapshot, positiveSnapshotFixtures, snapshotFixtures }; //# sourceMappingURL=index.d.ts.map