diff --git a/index.d.ts b/index.d.ts index b3ac931..b9998fc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,10 +1,17 @@ declare module 'react-native-compass-heading' { - export const start: ( - threshold: number, - callback: ({ heading: number, accuracy: number }) => void - ) => Promise; + interface CompassData { + heading: number; + accuracy: number; + } - export const stop: () => Promise; + type CompassCallback = (data: CompassData) => void; - export const hasCompass: () => Promise; + interface CompassHeading { + start(degreeUpdateRate: number, callback: CompassCallback): void; + stop(): void; + } + + const CompassHeading: CompassHeading; + + export default CompassHeading; }