Skip to content

Commit c56eb04

Browse files
authored
Merge pull request #30 from nathanmmiller/typescript
Adding Typescript Types
2 parents c740d0b + cd82526 commit c56eb04

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare module "react-hook-geolocation" {
2+
export interface EnrichedGeolocationCoordinates extends GeolocationCoordinates {
3+
timestamp: GeolocationPosition["timestamp"] | null;
4+
error: GeolocationPositionError | null;
5+
}
6+
7+
export default function useGeolocation(positionOptions?: PositionOptions, callback?: (geolocation: EnrichedGeolocationCoordinates) => void): EnrichedGeolocationCoordinates;
8+
}

0 commit comments

Comments
 (0)