콘텐츠로 이동

RoutePoint — @gj-kit/expo-workouts

@gj-kit/expo-workouts에서 공개하는 interface입니다. package version 0.1.1의 release declaration을 그대로 표시합니다.

import { RoutePoint } from '@gj-kit/expo-workouts';
/**
* One GPS fix. SI units, unit in the field name.
*
* Negative CoreLocation sentinels (`-1`) are mapped to `undefined` for `hAccM`, `vAccM`, `speedMps`
* and `courseDeg`; an explicit `0` is PRESERVED as `0`, because HealthKit preserves it.
* `altM` is passed through verbatim — a negative altitude is a legal value (Dead Sea), not a
* sentinel; `vAccM` is the actual validity flag for it.
*/
interface RoutePoint {
/** Epoch MILLISECONDS. Strictly increasing after our normalisation. */
readonly t: number;
/** WGS84 degrees, -90..90. Out of range is `invalidArgument` on BOTH platforms. */
readonly lat: number;
/** WGS84 degrees, -180..180. */
readonly lon: number;
readonly altM?: number | undefined;
/** Horizontal accuracy, metres. */
readonly hAccM?: number | undefined;
/** Vertical accuracy, metres. */
readonly vAccM?: number | undefined;
/** iOS only — Health Connect's `ExerciseRoute.Location` has no speed field. */
readonly speedMps?: number | undefined;
/** iOS only. */
readonly courseDeg?: number | undefined;
}

이 선언은 매개변수, optionality, 제네릭, 반환값, 공개 union/type 계약의 정본입니다. 호출 전 필요한 환경·권한·오류 경계는 패키지 Golden path와 이 subpath의 import 조건을 함께 확인하세요.

  • 패키지: @gj-kit/expo-workouts
  • 버전: 0.1.1
  • 공개 entry: .
  • 소스: GitHub

One GPS fix. SI units, unit in the field name.

Negative CoreLocation sentinels (-1) are mapped to undefined for hAccM, vAccM, speedMps and courseDeg; an explicit 0 is PRESERVED as 0, because HealthKit preserves it. altM is passed through verbatim — a negative altitude is a legal value (Dead Sea), not a sentinel; vAccM is the actual validity flag for it.