import { ExerciseType, GeospatialPoint, MuscleGroup, PreviewWorkoutLike, RPE, SetPersonalRecordType, SetType, WorkoutBiometrics, WorkoutComment, WorkoutMedia } from '..'; import { LocalizedExerciseTitles } from './shared'; export interface UserWorkout { id: string; short_id: string | null; index: number; name: string; description?: string; like_count: number; preview_workout_likes: PreviewWorkoutLike[]; comment_count: number; comments: WorkoutComment[]; media: WorkoutMedia[]; is_liked_by_user: boolean; start_time: number; end_time: number; user_id: string; username: string; profile_image: string; exercises: UserWorkoutExercise[]; routine_id?: string; apple_watch: boolean; wearos_watch: boolean; verified: boolean; updated_at: string; nth_workout: number; /** * See https://github.com/hevyapp/hevy-backend/pull/193 to understand * why we added estimated_volume_kg */ estimated_volume_kg: number; /** * Whether to include warmup sets in various calculations. * https://github.com/hevyapp/hevy-shared/pull/312 */ include_warmup_sets: boolean; is_private: boolean; biometrics?: WorkoutBiometrics; is_biometrics_public: boolean; userGym: UserWorkoutGym | undefined; } export interface UserWorkoutExercise extends LocalizedExerciseTitles { id: string; exercise_template_id: string; title: string; superset_id: number | null; rest_seconds: number | null; notes: string; muscle_group: MuscleGroup; other_muscles: MuscleGroup[]; exercise_type: ExerciseType; thumbnail_url?: string | null; /** * for exercises with two dumbbells * * `true` if the weight of each set is the weight of _one_ dumbbell, but the * exercise was performed with _two_ dumbbells of that weight */ volume_doubling_enabled: boolean; sets: UserWorkoutExerciseSet[]; } export interface UserWorkoutExerciseSet { /** * id can be a string or a number because we used * to store it as int4 and now we store it as int8 * which is too big to store (accurately) in a JS * number. */ id: number | string; index: number; indicator: SetType; weight_kg?: number | null; reps?: number | null; distance_meters?: number | null; duration_seconds?: number | null; custom_metric?: number | null; rpe?: RPE | null; prs: { type: SetPersonalRecordType; value: number; }[]; completed_at: string | null; geospatial_data: GeospatialPoint[] | null; } type CommercialGym = { type: 'commercial'; name: string; city: string; }; type HomeGym = { type: 'home'; }; export type UserWorkoutGym = CommercialGym | HomeGym; export {};