/** * `expo-persistent-background-location` — public API. * * Continuous background GPS that survives swipe-to-kill on Android (foreground * service + boot receiver) and resumes after termination on iOS (significant- * location-change + region monitoring). Fixes are buffered to a native SQLite * store and optionally synced to your backend by the native layer — so nothing * is lost while the JS runtime is gone. * * @packageDocumentation */ import { type EventSubscription } from "expo-modules-core"; import { type CurrentPositionOptions, type LocationErrorEvent, type LocationFix, type MotionChangeEvent, type PermissionResult, type ProviderChangeEvent, type RequestPermissionsOptions, type StartOptions, type SyncResult, type TrackingStatus } from "./ExpoPersistentBackgroundLocation.types"; import type { NativeStartConfig } from "./ExpoPersistentBackgroundLocationModule"; export * from "./ExpoPersistentBackgroundLocation.types"; /** * Normalize the user-facing {@link StartOptions} into the flat, fully-resolved * {@link NativeStartConfig}. This is the **single source of truth for every * default** — the native layers carry matching defaults only as a safety net. */ export declare function normalizeStartOptions(options?: StartOptions): NativeStartConfig; /** * Start continuous background tracking. Idempotent — calling `start` again * reconfigures the running tracker rather than spawning a second one. * * On **Android** this launches a `location`-typed foreground service (with the * configured notification) and, when `restartOnBoot` is set, arms a boot * receiver. On **iOS** it begins standard updates plus — when * `useSignificantChanges` is set — significant-location-change monitoring so * the OS can relaunch the app in the background after force-quit. * * @throws {@link LocationPermissionError} (from native) when authorization is missing. * @throws {@link UnsupportedPlatformError} on web. */ export declare function start(options?: StartOptions): Promise; /** Stop tracking, tear down the foreground service, and disarm boot restart. */ export declare function stop(): Promise; /** Whether the native tracker is currently running. */ export declare function isRunning(): boolean; /** Snapshot of the current tracker state, authorization, and buffer size. */ export declare function getStatus(): Promise; /** * Resolve a single fresh fix without starting continuous tracking. Useful for a * one-shot "where am I now" query. * * @throws {@link UnsupportedPlatformError} on web. */ export declare function getCurrentPosition(options?: CurrentPositionOptions): Promise; /** * Read buffered fixes from the native SQLite store, newest first. These are the * fixes captured while the app was killed or offline. Pass `0` for all rows. */ export declare function getBufferedLocations(limit?: number): Promise; /** Delete every buffered fix. Resolves with the number of rows removed. */ export declare function clearBuffer(): Promise; /** Force an immediate sync of the buffer to the configured `syncUrl`. */ export declare function flush(): Promise; /** Resolve the current foreground + background location authorization. */ export declare function getPermissionStatus(): Promise; /** * Prompt for location authorization. By default this also requests background * ("Always") access — on Android 11+ the OS mandates a two-step escalation * (foreground first, then a Settings trip for background), which the native * layer drives automatically. */ export declare function requestPermissions(options?: RequestPermissionsOptions): Promise; /** Open the host app's system settings page — use when permission is `blocked`. */ export declare function openSettings(): void; /** * Subscribe to location fixes. Fires while the app is foregrounded, * backgrounded, and — on Android — after the app is swiped away (delivered the * moment the JS runtime is re-attached, in addition to being buffered/synced * natively the whole time). * * @returns an `EventSubscription` — call `.remove()` to unsubscribe. */ export declare function onLocation(listener: (fix: LocationFix) => void): EventSubscription; /** Subscribe to moving ⇄ stationary transitions from the motion gate. */ export declare function onMotionChange(listener: (event: MotionChangeEvent) => void): EventSubscription; /** Subscribe to location-provider / authorization changes. */ export declare function onProviderChange(listener: (event: ProviderChangeEvent) => void): EventSubscription; /** Subscribe to buffer-sync results. */ export declare function onSync(listener: (event: SyncResult) => void): EventSubscription; /** Subscribe to recoverable and fatal tracker errors. */ export declare function onError(listener: (event: LocationErrorEvent) => void): EventSubscription; //# sourceMappingURL=index.d.ts.map