diff --git a/types/react-native/globals.d.ts b/types/react-native/globals.d.ts index 8ab096406f..3ac46ecd66 100644 --- a/types/react-native/globals.d.ts +++ b/types/react-native/globals.d.ts @@ -1,6 +1,7 @@ /* * This file is necessary to declare global functions that might also be included by `--lib dom`. * Due to a TypeScript bug, these cannot be placed inside a `declare global` block in index.d.ts. + * https://github.com/Microsoft/TypeScript/issues/16430 */ // diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 5af1f6e9b6..00a88ec6b8 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -626,18 +626,12 @@ export interface ShadowPropTypesIOSStatic { shadowRadius: number } -type GetCurrentPositionOptions = { - timeout: number - maximumAge: number - enableHighAccuracy: boolean - distanceFilter: number -} - -type WatchPositionOptions = { - timeout: number - maximumAge: number - enableHighAccuracy: boolean - distanceFilter: number +type GeoOptions = { + timeout?: number, + maximumAge?: number, + enableHighAccuracy?: boolean, + distanceFilter?: number, + useSignificantChanges?: boolean, } type GeolocationReturnType = { @@ -8389,13 +8383,13 @@ export interface GeolocationStatic { * On Android, this can return almost immediately if the location is cached or * request an update, which might take a while. */ - getCurrentPosition(geo_success: (position: GeolocationReturnType) => void, geo_error?: (error: GeolocationError) => void, geo_options?: GetCurrentPositionOptions): void + getCurrentPosition(geo_success: (position: GeolocationReturnType) => void, geo_error?: (error: GeolocationError) => void, geo_options?: GeoOptions): void /** * Invokes the success callback whenever the location changes. Supported * options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool), distanceFilter(m) */ - watchPosition(success: (position: GeolocationReturnType) => void, error?: (error: GeolocationError) => void, options?: WatchPositionOptions): number + watchPosition(success: (position: GeolocationReturnType) => void, error?: (error: GeolocationError) => void, options?: GeoOptions): number clearWatch(watchID: number): void