import type { WorkoutSessionExercise } from '../../../documents/workout/WorkoutSessionExercise.js'; import type { WorkoutSet } from '../../../documents/workout/WorkoutSet.js'; /** * A service for handling operations related to {@link WorkoutSessionExercise}s. */ export default class WorkoutSessionExerciseService { #private; /** * Calculates the total Raw Stimulus Magnitude for a specific exercise within a session. * * @param sessionExercise The workout session exercise. */ static getRsmTotal(sessionExercise: WorkoutSessionExercise): number | null; /** * Calculates the total fatigue score for a specific exercise within a session. * * @param sessionExercise The workout session exercise. */ static getFatigueTotal(sessionExercise: WorkoutSessionExercise): number | null; /** * Calculates the Stimulus to Fatigue Ratio (SFR) for a specific exercise. * * @param sessionExercise The workout session exercise. */ static getSFR(sessionExercise: WorkoutSessionExercise): number | null; /** * Calculates the performance score (0-3) for an exercise based on its sets. * * For each set with complete data, a surplus is computed via * {@link calculateSetSurplus}. The per-set score is: * - 0: surplus >= 2 (exceeded expectations) * - 1: surplus 0-1 (on target) * - 2: surplus < 0 but hit target reps (declining) * - 3: did not hit target reps * * The exercise score is the rounded average of all per-set scores. Returns * `null` if no sets have complete planned and actual data. */ static getPerformanceScore(sets: WorkoutSet[]): number | null; /** * Calculates the average surplus across an array of sets. Sets missing * required planned/actual data are skipped. Returns null if no sets * have complete data. * * Surplus formula per set: `(actualReps - plannedReps) + (rir - plannedRir)` * * @param sets The sets to calculate average surplus for. */ static calculateAverageSurplus(sets: WorkoutSet[]): number | null; /** * Uses the soreness/performance table from the workout model notes to recommend whether to add * sets next microcycle or employ recovery sessions. * * Interpretation: * - Returns `-1` when recovery sessions should be employed. * - Returns `0` when no sets should be added. * - Returns a non-negative integer when sets should be added. * - Returns `null` when insufficient data is available. * * The table is: * * | Soreness Score ↓ \ Performance Score → | 0 | 1 | 2 | 3 | |---|---|---|---|---| | **0** | Add 1–3 sets | Add 0–2 sets | Do not add sets | Employ recovery sessions (see Fatigue Management) | | **1** | Add 1–2 sets | Add 1 set | Do not add sets | Employ recovery sessions (see Fatigue Management) | | **2** | Do not add sets | Do not add sets | Do not add sets | Employ recovery sessions (see Fatigue Management) | | **3** | Do not add sets | Do not add sets | Do not add sets | Employ recovery sessions (see Fatigue Management) | */ static getRecommendedSetAdditionsOrRecovery(workoutSessionExercise: WorkoutSessionExercise): number | null; /** * Returns true if the exercise is a deload exercise (all sets have plannedRir == null). */ static isDeloadExercise(exerciseSets: WorkoutSet[]): boolean; /** * Returns true if all mid-session metrics are filled out for the session exercise. * Mid-session metrics are filled out right after performing the exercise: * mindMuscleConnection, pump, unusedMusclePerformance, * and performanceScore. Deload exercises are always considered filled. */ static hasMidSessionMetricsFilled(sessionExercise: WorkoutSessionExercise, exerciseSets: WorkoutSet[]): boolean; /** * Returns true if all session metrics (both mid-session and post-session) are filled out. * Post-session metrics are disruption, jointAndTissueDisruption, perceivedEffort, * and sorenessScore. Deload exercises are always considered filled. */ static hasAllSessionMetricsFilled(sessionExercise: WorkoutSessionExercise, exerciseSets: WorkoutSet[]): boolean; } //# sourceMappingURL=WorkoutSessionExercise.service.d.ts.map