Skip to content

kindFromIosActivityType — @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 { kindFromIosActivityType } from '@gj-kit/expo-workouts';
/**
* Raw HKWorkoutActivityType → WorkoutKind. TOTAL over `number`: anything not in the table —
* including negative, non-integer and huge values that only the JS boundary can produce — returns
* `{ kind: 'other' }` with `indoor` left `undefined`.
*
* ⚠ **`indoor` never comes from this function on iOS.** HealthKit carries it in the
* `HKIndoorWorkout` metadata key (and, for swimming, in `HKMetadataKeySwimmingLocationType`),
* orthogonally to the activity type. The return shape keeps `indoor` for symmetry with the
* Android mapper and is always `undefined` here.
*
* ⚠ **Nothing collapses on iOS.** `HKWorkoutActivityType` is a plain `NSUInteger`, so an unknown
* value (e.g. 16 = Elliptical) arrives intact and IS preserved in
* `platformData.ios.activityTypeRaw` — an app can recover it. Contrast
* `kindFromAndroidExerciseType`.
*
* READ-ALIASES: 20 (FunctionalStrengthTraining) → `'strength'` and 71 (WheelchairRunPace) →
* `'wheelchair'` map INTO kinds the write direction never emits, so the two mapper directions are
* NOT literal inverses. The asserted property is write-then-read only.
*/
declare function kindFromIosActivityType(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