UNPKG

beautiful-react-hooks

Version:

A collection of beautiful (and hopefully useful) React hooks to speed-up your components and hooks development

17 lines (16 loc) 859 B
/** * Returns an array where the first item is the geolocation state from the `useGeolocationState` hook and the * second one is the object of callback setters from the `useGeolocationEvents` hook. * It is intended as a shortcut to those hooks. */ declare const useGeolocation: (options?: PositionOptions) => (Readonly<{ isSupported: true; onChange: import("./shared/types").CallbackSetter<import("./shared/types").BRHGeolocationPosition>; onError: import("./shared/types").CallbackSetter<import("./shared/types").BRHGeolocationPositionError>; }> | Readonly<{ onError: (callback: import("./shared/types").SomeCallback<import("./shared/types").BRHGeolocationPositionError, void>) => void; isSupported: true; isRetrieving: boolean; position: import("./shared/types").BRHGeolocationPosition; }>)[]; export default useGeolocation;