From 77613aec1b1622b9e456a52194475a1a5cc598a4 Mon Sep 17 00:00:00 2001 From: Firoz Ahmed Date: Mon, 1 Jul 2024 14:21:24 +0530 Subject: [PATCH] Update index.d.ts --- index.d.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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; }