fix(types): GeoJSON via explizite geojson-Imports
Deploy / verify (push) Successful in 1m12s
Deploy / deploy (push) Successful in 2m9s

Kit-Bump auf 2.65 entfernte transitives @types/geojson aus dem Lockfile —
CI-tsc fand den globalen GeoJSON-Namespace nicht mehr. @types/geojson als
devDependency + explizite Type-Imports statt UMD-Namespace.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Peter Meier
2026-06-12 23:06:25 +02:00
parent 77ff44f6ef
commit eee25e8275
4 changed files with 8 additions and 3 deletions
+1
View File
@@ -31,6 +31,7 @@
"@sveltejs/kit": "^2.65.0",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/vite": "^4.1.18",
"@types/geojson": "^7946.0.16",
"@types/node": "^22.10.0",
"@types/qrcode": "^1.5.6",
"@types/sanitize-html": "^2.13.0",
+1
View File
@@ -25,6 +25,7 @@
"@sveltejs/kit": "^2.65.0",
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"@tailwindcss/vite": "^4.1.18",
"@types/geojson": "^7946.0.16",
"@types/node": "^22.10.0",
"@types/qrcode": "^1.5.6",
"@types/sanitize-html": "^2.13.0",
+3 -2
View File
@@ -1,4 +1,5 @@
import { env } from '$env/dynamic/public';
import type { FeatureCollection, Geometry } from 'geojson';
import type { WindArea } from '$lib/windkarte';
const CMS_BASE = () =>
@@ -17,7 +18,7 @@ export function filterByGebietsNr(areas: WindArea[], id: string | null): WindAre
return areas.filter((a) => a.gebiets_nr === id);
}
export function toGeoJSON(areas: WindArea[]): GeoJSON.FeatureCollection {
export function toGeoJSON(areas: WindArea[]): FeatureCollection {
return {
type: 'FeatureCollection',
features: areas
@@ -51,7 +52,7 @@ function coordsToKml(ring: number[][]): string {
return ring.map(([lng, lat]) => `${lng},${lat},0`).join(' ');
}
function geometryToKml(geom: GeoJSON.Geometry): string {
function geometryToKml(geom: Geometry): string {
if (geom.type === 'Polygon') {
const [outer, ...holes] = geom.coordinates;
return `<Polygon>
+3 -1
View File
@@ -1,3 +1,5 @@
import type { Geometry } from 'geojson';
export type TextFragment = {
_slug: string;
id?: string;
@@ -22,5 +24,5 @@ export type WindArea = {
stellungnahmeUrl?: string | null;
stellungnahme_kriterien?: Array<TextFragment | { _slug: string } | string> | null;
notizen?: string;
geometry?: GeoJSON.Geometry;
geometry?: Geometry;
};