import type { UUID } from 'crypto'; import type { WorkoutExerciseCTO } from '../../../ctos/workout/WorkoutExerciseCTO.js'; import type { WorkoutExerciseCalibration } from '../../../documents/workout/WorkoutExerciseCalibration.js'; /** * A service for handling operations related to {@link WorkoutExerciseCalibration}s. */ export default class WorkoutExerciseCalibrationService { #private; /** * Calculates the 1 Rep Max using the NASM formula. * * Formula: (Weight Lifted × Reps / 30.48) + Weight Lifted * * @param calibration The workout exercise calibration. */ static get1RM(calibration: WorkoutExerciseCalibration): number; /** * Calculates the 1 Rep Max using the NASM formula based on provided weight and reps. * * @param weight The weight lifted. * @param reps The number of reps performed. */ static get1RMRaw(weight: number, reps: number): number; /** * Returns the NASM 1RM formula as a MongoDB aggregation expression. * This is the MongoDB-equivalent of {@link get1RMRaw} and must be kept * in sync with it. * * @param weightField The MongoDB field reference for weight (e.g. `'$weight'`). * @param repsField The MongoDB field reference for reps (e.g. `'$reps'`). */ static get1RMMongoExpr(weightField: string, repsField: string): { $add: (string | { $divide: (number | { $multiply: string[]; })[]; })[]; }; /** * Calculates the target weight for a set based on target reps and 1RM. * * Returns the calculated weight without rounding. Consumer can use * WorkoutEquipmentTypeService.findNearestWeight() to round if needed. * * @param calibration The workout exercise calibration. * @param targetReps The target number of reps. */ static getTargetWeight(calibration: WorkoutExerciseCalibration, targetReps: number): number; /** * Calculates the target weight from a raw 1RM value and a target rep count. * * This applies the same targetPercentage formula as {@link getTargetWeight} * but accepts a pre-computed 1RM instead of a calibration document. Useful * when the effective 1RM is derived from multiple sources (calibrations and * actual sets). * * Returns the calculated weight without rounding. Consumer can use * WorkoutEquipmentTypeService.findNearestWeight() to round if needed. * * @param effective1RM The effective 1 Rep Max value. * @param targetReps The target number of reps. */ static getTargetWeightFrom1RM(effective1RM: number, targetReps: number): number; /** * Generates auto-calibrations from exercise CTOs whose best set 1RM exceeds * their best calibration 1RM. * * The CTO already provides `bestCalibration` and `bestSet` per exercise, so * this method just compares those two pre-computed values and creates new * calibrations where the set wins. * * @param exerciseCTOs The exercise CTOs to evaluate. * @param userId The user ID for the new calibrations. * @param dateRecorded The date to use as dateRecorded for new calibrations. */ static generateAutoCalibrations(exerciseCTOs: WorkoutExerciseCTO[], userId: UUID, dateRecorded: Date): WorkoutExerciseCalibration[]; } //# sourceMappingURL=WorkoutExerciseCalibration.service.d.ts.map