Skip to content

WorkoutsApi — @gj-kit/expo-workouts

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

import { WorkoutsApi } from '@gj-kit/expo-workouts';
/**
* Every function of `.`, as one interface. `.`'s `workouts` and `./testing`'s `api` are both
* instances of it, produced by the SAME factory.
*/
interface WorkoutsApi {
getAvailability(): Promise<Availability>;
requestAuthorization(request: AuthorizationRequest): Promise<AuthorizationResult>;
getAuthorizationState(): Promise<AuthorizationState>;
listWorkouts(query: ListQuery): Promise<WorkoutPage>;
syncWorkouts(cursor: WorkoutsSyncCursor | null): Promise<SyncResult>;
getRoute(workoutId: string, options?: GetRouteOptions): AsyncIterable<readonly RoutePoint[]>;
readHeartRate(window: TimeWindow): Promise<readonly HeartRateSample[]>;
readSteps(window: TimeWindow): Promise<StepTotal>;
saveWorkout(workout: WorkoutWrite): Promise<SaveResult>;
deleteWorkout(ref: WorkoutRef): Promise<DeleteResult>;
openSettings(): Promise<void>;
openStoreListing(): Promise<void>;
}

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