Skip to content

Commit

Permalink
Update index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
firofame authored Jul 1, 2024
1 parent 52ecbd8 commit 77613ae
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
declare module 'react-native-compass-heading' {
export const start: (
threshold: number,
callback: ({ heading: number, accuracy: number }) => void
) => Promise<boolean>;
interface CompassData {
heading: number;
accuracy: number;
}

export const stop: () => Promise<void>;
type CompassCallback = (data: CompassData) => void;

export const hasCompass: () => Promise<boolean>;
interface CompassHeading {
start(degreeUpdateRate: number, callback: CompassCallback): void;
stop(): void;
}

const CompassHeading: CompassHeading;

export default CompassHeading;
}

0 comments on commit 77613ae

Please sign in to comment.