beautiful-react-hooks
Version:
A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development
14 lines (13 loc) • 770 B
TypeScript
import { BRHGeolocationPosition, BRHGeolocationPositionError } from './shared/types';
/**
* Returns a frozen object of callback setters to handle the geolocation events.<br/>
* So far, the supported methods are: `onChange`, invoked when the position changes and `onError`, invoked when
* an error occur while retrieving the position.<br/>
* The returned object also contains the `isSupported` boolean flag reporting whether the geolocation API is supported.
*/
declare const useGeolocationEvents: (options?: PositionOptions) => Readonly<{
isSupported: true;
onChange: import("./shared/types").CallbackSetter<BRHGeolocationPosition>;
onError: import("./shared/types").CallbackSetter<BRHGeolocationPositionError>;
}>;
export default useGeolocationEvents;