Add mock GPS simulator and configurable location sources

This commit is contained in:
2026-03-24 14:24:53 +08:00
parent 0295893b56
commit 2cf0bb76b4
16 changed files with 2575 additions and 122 deletions

View File

@@ -0,0 +1,25 @@
export type LocationSourceMode = 'real' | 'mock'
export interface LocationSample {
latitude: number
longitude: number
accuracy?: number
speed?: number | null
headingDeg?: number | null
timestamp: number
sourceMode: LocationSourceMode
}
export interface LocationSourceCallbacks {
onLocation: (sample: LocationSample) => void
onStatus: (message: string) => void
onError: (message: string) => void
}
export interface LocationSource {
readonly mode: LocationSourceMode
readonly active: boolean
start(): void
stop(): void
destroy(): void
}