Usage

Persist each batch of positions delivered to a background location task.

tsx
// Persist each batch of positions delivered to a background location task.
import { location, storage } from 'kuito';

location.defineUpdates('trip', async (run: location.LocationTaskRun) => {
  await storage.set('latest-trip-batch', JSON.stringify(run.locations));
});
// Register at module scope. Declare background location and obtain permission
// before calling location.startUpdates('trip').

Type declaration

ts
export type LocationTaskRun = {
  name: string;
  /** When the platform stops waiting for the run, in milliseconds since the epoch. */
  deadline: number;
  locations: LocationObject[];
};

Members 3

NameTypeRequiredDescription
namestringYes—
deadlinenumberYesWhen the platform stops waiting for the run, in milliseconds since the epoch.
locationsFix[]Yes—
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.