Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
HideBa committed Apr 16, 2022
1 parent 41b8eab commit 3d90e54
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type GeolocationPositionError = {
readonly PERMISSION_DENIED: number;
readonly POSITION_UNAVAILABLE: number;
readonly TIMEOUT: number;
}
};

type GeolocationCoordinates = {
readonly accuracy: number;
Expand All @@ -14,15 +14,14 @@ type GeolocationCoordinates = {
readonly latitude: number;
readonly longitude: number;
readonly speed: number | null;
}
};

type EpochTimeStamp = number;


export type GeolocationPosition = {
readonly coords: GeolocationCoordinates;
readonly timestamp: EpochTimeStamp;
}
};

export type Location = {
latitude: number;
Expand All @@ -37,7 +36,6 @@ export type MetaInfo = {
speed: number | null;
};


export type ErrType =
| 'PERMISSION_DENIED'
| 'POSITION_UNAVAILABLE'
Expand Down
10 changes: 9 additions & 1 deletion src/use-geolocation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import { useCallback, useEffect, useState } from 'react';
import {Args, Err, ErrType, MetaInfo, GeolocationPosition, GeolocationPositionError, Location} from "./types"
import {
Args,
Err,
ErrType,
MetaInfo,
GeolocationPosition,
GeolocationPositionError,
Location,
} from './types';

export default ({
geolocation = navigator.geolocation,
Expand Down

0 comments on commit 3d90e54

Please sign in to comment.