mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
Merge pull request #3212 from frewsxcv/geolocation
Fix outstanding type errors in `src/sharedHelpers/geolocationWrapper.ts`.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
import Geolocation, {
|
||||
GeolocationError,
|
||||
GeolocationOptions,
|
||||
GeolocationResponse
|
||||
} from "@react-native-community/geolocation";
|
||||
import {
|
||||
@@ -18,11 +19,7 @@ import {
|
||||
export function getCurrentPosition(
|
||||
success: ( position: GeolocationResponse ) => void,
|
||||
error?: ( error: GeolocationError ) => void,
|
||||
options?: {
|
||||
timeout?: number;
|
||||
maximumAge?: number;
|
||||
enableHighAccuracy?: boolean;
|
||||
}
|
||||
options?: GeolocationOptions
|
||||
) {
|
||||
return Geolocation.getCurrentPosition( success, error, options );
|
||||
}
|
||||
@@ -66,7 +63,7 @@ export const lowAccuracyOptions = {
|
||||
} as const;
|
||||
|
||||
export const getCurrentPositionWithOptions = (
|
||||
options
|
||||
options: GeolocationOptions
|
||||
): Promise<GeolocationResponse> => new Promise(
|
||||
( resolve, reject ) => {
|
||||
getCurrentPosition( resolve, reject, options );
|
||||
|
||||
Reference in New Issue
Block a user