Port navigate and weather

This commit is contained in:
James Babcock committed 2026-09-18 23:46:27 -07:00
1 parent 2b3e068a23
commit 9e18745e53
33 files changed
+630 -60

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { type CurrentLocation } from './location-types'
export { type CurrentLocation } from './location-types'
declare const FaceclawLocationUpdates: any
/** Main-thread one-shot lookup, independent of navigation and compass managers. */
export function getCurrentLocation(): Promise<CurrentLocation> {
return new Promise((resolve, reject) => {
const provider = FaceclawLocationUpdates.new()
provider.eventHandler = (json: string) => {
try {
const event = JSON.parse(json)
if (event.error) reject(new Error(event.error))
else resolve(event)
} catch (error) { reject(error) }
finally { provider.stop() }
}
provider.startOnce()
})
}