fix(types): GeoJSON via explizite geojson-Imports
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:
Generated
+1
@@ -31,6 +31,7 @@
|
|||||||
"@sveltejs/kit": "^2.65.0",
|
"@sveltejs/kit": "^2.65.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||||
"@tailwindcss/vite": "^4.1.18",
|
"@tailwindcss/vite": "^4.1.18",
|
||||||
|
"@types/geojson": "^7946.0.16",
|
||||||
"@types/node": "^22.10.0",
|
"@types/node": "^22.10.0",
|
||||||
"@types/qrcode": "^1.5.6",
|
"@types/qrcode": "^1.5.6",
|
||||||
"@types/sanitize-html": "^2.13.0",
|
"@types/sanitize-html": "^2.13.0",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
"@sveltejs/kit": "^2.65.0",
|
"@sveltejs/kit": "^2.65.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||||
"@tailwindcss/vite": "^4.1.18",
|
"@tailwindcss/vite": "^4.1.18",
|
||||||
|
"@types/geojson": "^7946.0.16",
|
||||||
"@types/node": "^22.10.0",
|
"@types/node": "^22.10.0",
|
||||||
"@types/qrcode": "^1.5.6",
|
"@types/qrcode": "^1.5.6",
|
||||||
"@types/sanitize-html": "^2.13.0",
|
"@types/sanitize-html": "^2.13.0",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { env } from '$env/dynamic/public';
|
import { env } from '$env/dynamic/public';
|
||||||
|
import type { FeatureCollection, Geometry } from 'geojson';
|
||||||
import type { WindArea } from '$lib/windkarte';
|
import type { WindArea } from '$lib/windkarte';
|
||||||
|
|
||||||
const CMS_BASE = () =>
|
const CMS_BASE = () =>
|
||||||
@@ -17,7 +18,7 @@ export function filterByGebietsNr(areas: WindArea[], id: string | null): WindAre
|
|||||||
return areas.filter((a) => a.gebiets_nr === id);
|
return areas.filter((a) => a.gebiets_nr === id);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function toGeoJSON(areas: WindArea[]): GeoJSON.FeatureCollection {
|
export function toGeoJSON(areas: WindArea[]): FeatureCollection {
|
||||||
return {
|
return {
|
||||||
type: 'FeatureCollection',
|
type: 'FeatureCollection',
|
||||||
features: areas
|
features: areas
|
||||||
@@ -51,7 +52,7 @@ function coordsToKml(ring: number[][]): string {
|
|||||||
return ring.map(([lng, lat]) => `${lng},${lat},0`).join(' ');
|
return ring.map(([lng, lat]) => `${lng},${lat},0`).join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
function geometryToKml(geom: GeoJSON.Geometry): string {
|
function geometryToKml(geom: Geometry): string {
|
||||||
if (geom.type === 'Polygon') {
|
if (geom.type === 'Polygon') {
|
||||||
const [outer, ...holes] = geom.coordinates;
|
const [outer, ...holes] = geom.coordinates;
|
||||||
return `<Polygon>
|
return `<Polygon>
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import type { Geometry } from 'geojson';
|
||||||
|
|
||||||
export type TextFragment = {
|
export type TextFragment = {
|
||||||
_slug: string;
|
_slug: string;
|
||||||
id?: string;
|
id?: string;
|
||||||
@@ -22,5 +24,5 @@ export type WindArea = {
|
|||||||
stellungnahmeUrl?: string | null;
|
stellungnahmeUrl?: string | null;
|
||||||
stellungnahme_kriterien?: Array<TextFragment | { _slug: string } | string> | null;
|
stellungnahme_kriterien?: Array<TextFragment | { _slug: string } | string> | null;
|
||||||
notizen?: string;
|
notizen?: string;
|
||||||
geometry?: GeoJSON.Geometry;
|
geometry?: Geometry;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user