Skip to content

kindFromAndroidExerciseType — @gj-kit/expo-workouts

A public function from @gj-kit/expo-workouts. The signature below is taken directly from the 0.1.1 release declaration.

import { kindFromAndroidExerciseType } from '@gj-kit/expo-workouts';
/**
* Health Connect exerciseType → WorkoutKind + indoor. TOTAL over `number`, same contract as above.
*
* ⚠ **The raw value is already destroyed before it reaches us.** Health Connect's
* `IntDefMappingsKt` collapses any unmapped int to 0 (`EXERCISE_TYPE_OTHER_WORKOUT`) on BOTH the
* read and the write IPC path. So for a future activity `platformData.android.exerciseType` reads
* 0, not the real value, and `'other'` is all the information that exists.
*
* `indoor` is only decidable for the four kinds with a constant PAIR; for the other five it is
* `undefined` because Health Connect stores the fact nowhere.
*
* Android has no read-aliases: every Health Connect constant we accept, we also emit.
*/
declare function kindFromAndroidExerciseType(raw: number): {
kind: WorkoutKind;
indoor?: boolean | undefined;
};

This declaration is the source of truth for parameters, optionality, generics, return values, and public union/type contracts. Check the package golden path and this subpath’s import conditions for required environment, permission, and error boundaries before calling it.

  • Package: @gj-kit/expo-workouts
  • Version: 0.1.1
  • Public entry: .
  • Source: GitHub