From e7f0291038735b1e61580568cccbfedbcfa744da Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 26 Dec 2024 22:47:48 +0100 Subject: [PATCH] Chore: improve typing --- src/Logic/Osm/OsmObjectDownloader.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Logic/Osm/OsmObjectDownloader.ts b/src/Logic/Osm/OsmObjectDownloader.ts index b0e9f9cec..9b1644dbb 100644 --- a/src/Logic/Osm/OsmObjectDownloader.ts +++ b/src/Logic/Osm/OsmObjectDownloader.ts @@ -127,7 +127,9 @@ export default class OsmObjectDownloader { * Beware: their geometry will be incomplete! */ public async DownloadReferencingWays(id: string): Promise { - const data = await Utils.downloadJsonCached(`${this.backend}api/0.6/${id}/ways`, 60 * 1000) + const data = await Utils.downloadJsonCached<{ + elements: { id: number }[] + }>(`${this.backend}api/0.6/${id}/ways`, 60 * 1000) return data.elements.map((wayInfo) => new OsmWay(wayInfo.id, wayInfo)) } @@ -136,7 +138,7 @@ export default class OsmObjectDownloader { * Beware: their geometry will be incomplete! */ public async DownloadReferencingRelations(id: string): Promise { - const data = await Utils.downloadJsonCached( + const data = await Utils.downloadJsonCached<{ elements: { id: number }[] }>( `${this.backend}api/0.6/${id}/relations`, 60 * 1000 )