From db485fd27b50f392a56104b2fdb111e60ccc19cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Poljanc?= Date: Tue, 30 Apr 2019 19:16:24 +0200 Subject: [PATCH] [expo] Add BackgroundFetch and fix bug with Location.startLocationUpdatesAsync (#34987) * Add BackgorundFetch and fix function name in Location namespace * Add missing options to Location.startLocationUpdatesAsync function --- types/expo/index.d.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 380ea43625..c1e0b8c966 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -19,6 +19,7 @@ // Vinit Sood // Mattias Sämskar // Julian Hundeloh +// Matevz Poljanc // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 @@ -720,6 +721,24 @@ export class PlaybackObject { } // #endregion +// #region BackgroundFetch +/** + * BackgroundFetch + */ +export namespace BackgroundFetch { + function getStatusAsync(): Promise; + function registerTaskAsync(taskName: string): Promise; + function unregisterTaskAsync(taskName: string): Promise; + function setMinimumIntervalAsync(minimumInterval: number): Promise; + + enum Status { + Restricted = 1, + Denied = 2, + Available = 3 + } +} +// #endregion + // #region BarCodeScanner /** * BarCodeScanner @@ -2221,6 +2240,8 @@ export namespace Location { interface LocationTaskOptions { accuracy?: number; + timeInterval: number; + distanceInterval: number; showsBackgroundLocationIndicator?: boolean; } @@ -2244,7 +2265,7 @@ export namespace Location { function reverseGeocodeAsync(location: LocationProps): Promise; function requestPermissionsAsync(): Promise; function hasServicesEnabledAsync(): Promise; - function startgeocodUpdatesAsync(taskName: string, options: LocationTaskOptions): Promise; + function startLocationUpdatesAsync(taskName: string, options: LocationTaskOptions): Promise; function stopLocationUpdatesAsync(taskName: string): Promise; function hasStartedLocationUpdatesAsync(taskName: string): Promise; function startGeofencingAsync(taskName: string, regions: Region[]): Promise;