GPS.js
GPS.js copied to clipboard
gps.d.ts has wrong definition
gps.d.ts type definition on quality is wrong. I was looking at the object passed back, in regards to GGAQuality it is defined as an enum, but the type is a string
{ time: 2025-01-16T22:53:29.000Z, lat: 40.11207233333333, lon: -111.65509333333333, alt: 1385.1, quality: 'dgps-fix', satellites: 10, hdop: 0.82, geoidal: -18.8, age: null, stationID: 0, raw: '$GPGGA,225329.00,4006.72434,N,11139.30560,W,2,10,0.82,1385.1,M,-18.8,M,,0000*56', valid: true, type: 'GGA' }
defined as export enum GGAQuality { 'fix' = 1, 'dgps-fix' = 2, 'pps-fix' = 3, 'rtk' = 4, 'rtk-float' = 5, 'estimated' = 6, 'manual' = 7, 'simulated' = 8 } which means a forced typecast or ts-ignore
Thanks for reporting, could you please try the current .d.ts file? If everything works, I'll release it to npm.
Sorry for the long time it took, I just released a new version where this issue is fixed now.