commit 97931392f2b6da9aca0757b207edc9e675c11b6c
parent 0bbd845b272d6ce7f81891ab7832d7b95cdc9ec4
Author: triesap <triesap@radroots.dev>
Date: Mon, 22 Dec 2025 15:09:03 +0000
geocoder: introduce `@radroots/geo` and migrate geospatial type imports
Diffstat:
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/geocoder/package.json b/geocoder/package.json
@@ -32,8 +32,9 @@
"access": "public"
},
"dependencies": {
+ "@radroots/geo": "*",
"@radroots/utils": "*",
"@radroots/types-bindings": "*",
"sql.js": "1.13.0"
}
-}
-\ No newline at end of file
+}
diff --git a/geocoder/src/geocoder.ts b/geocoder/src/geocoder.ts
@@ -1,4 +1,5 @@
-import { err_msg, type GeolocationPoint } from "@radroots/utils";
+import type { GeolocationPoint } from "@radroots/geo";
+import { err_msg } from "@radroots/utils";
import type { Database } from "sql.js";
import type { GeocoderReverseResult, IGeocoder, IGeocoderConnectResolve, IGeocoderCountryCenter, IGeocoderCountryCenterResolve, IGeocoderCountryListResolve, IGeocoderCountryListResult, IGeocoderCountryResolve, IGeocoderReverseOpts, IGeocoderReverseResolve } from "./types.js";
import { parse_geocode_country_center_result, parse_geocode_country_list_result, parse_geocode_reverse_result } from "./utils.js";
@@ -113,4 +114,3 @@ export class Geocoder implements IGeocoder {
};
}
}
-
diff --git a/geocoder/src/types.ts b/geocoder/src/types.ts
@@ -1,5 +1,6 @@
import { IError } from "@radroots/types-bindings";
-import type { GeolocationPoint, ResultObj, ResultsList } from "@radroots/utils";
+import type { GeolocationPoint } from "@radroots/geo";
+import type { ResultObj, ResultsList } from "@radroots/utils";
export type GeocoderIError =
| `*-result`
@@ -43,4 +44,4 @@ export type IGeocoder = {
country(opts: IGeocoderCountryCenter): Promise<IGeocoderCountryResolve>;
country_list(): Promise<IGeocoderCountryListResolve>;
country_center(opts: IGeocoderCountryCenter): Promise<IGeocoderCountryCenterResolve>;
-}
-\ No newline at end of file
+}
diff --git a/geocoder/src/utils.ts b/geocoder/src/utils.ts
@@ -1,4 +1,4 @@
-import type { GeolocationPoint } from "@radroots/utils";
+import type { GeolocationPoint } from "@radroots/geo";
import type { GeocoderReverseResult, IGeocoderCountryListResult } from "./types.js";
export const parse_geocode_reverse_result = (obj: any): GeocoderReverseResult | undefined => {
@@ -60,4 +60,4 @@ export const parse_geocode_country_center_result = (obj: any): GeolocationPoint
};
}
return undefined;
-};
-\ No newline at end of file
+};