mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-06 06:19:58 +08:00
Add issue link and fix Geolocation options type
This commit is contained in:
1
types/react-native/globals.d.ts
vendored
1
types/react-native/globals.d.ts
vendored
@@ -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
|
||||
*/
|
||||
|
||||
//
|
||||
|
||||
22
types/react-native/index.d.ts
vendored
22
types/react-native/index.d.ts
vendored
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user