diff --git a/client/package.json b/client/package.json index 78eb8bd6d..6e0826757 100644 --- a/client/package.json +++ b/client/package.json @@ -143,11 +143,13 @@ "@testing-library/react": "^16.3.3", "@testing-library/user-event": "^14.6.13", "@trivago/prettier-plugin-sort-imports": "^6.0.3", + "@types/geojson": "^7946.0.16", "@types/leaflet": "^1.9.23", "@types/node": "^26.6.11", "@types/react": "^19.3.2", "@types/react-dom": "^19.3.0", "@types/topojson-client": "^3.1.5", + "@types/topojson-specification": "^1.0.5", "@vitejs/plugin-react": "^6.2.1", "@vitest/coverage-v8": "^5.1.2", "autoprefixer": "^10.7.0", diff --git a/client/src/components/AtlasGlobe/AtlasGlobe.tsx b/client/src/components/AtlasGlobe/AtlasGlobe.tsx index 58c6e39b0..271d57ef9 100644 --- a/client/src/components/AtlasGlobe/AtlasGlobe.tsx +++ b/client/src/components/AtlasGlobe/AtlasGlobe.tsx @@ -7,7 +7,7 @@ export interface AtlasGlobeHandle { engine: GlobeEngine | null; } -export interface AtlasGlobeProps { +interface AtlasGlobeProps { fetchJson: (path: string) => Promise; dark: boolean; /** Country name for a label, by ISO A2 (localised by the caller). */ diff --git a/client/src/components/AtlasGlobe/GlobeEngine.ts b/client/src/components/AtlasGlobe/GlobeEngine.ts index 409e7809b..ae6afb6e7 100644 --- a/client/src/components/AtlasGlobe/GlobeEngine.ts +++ b/client/src/components/AtlasGlobe/GlobeEngine.ts @@ -74,8 +74,8 @@ export type GlobeHit = | { kind: 'region'; a2: string; code: string | null; name: string | null }; /** Zoom from which regions crossfade in, and from which the finer region files load. */ -export const REGION_FADE_START = 5; -export const REGION_FADE_END = 6; +const REGION_FADE_START = 5; +const REGION_FADE_END = 6; /** * From here on the regions in view are fetched ahead, while the zoom is still * on its way, so they are drawn by the time they fade in instead of a beat later. diff --git a/client/src/components/AtlasGlobe/GlobeRenderer.ts b/client/src/components/AtlasGlobe/GlobeRenderer.ts index d62474c29..7dce07b48 100644 --- a/client/src/components/AtlasGlobe/GlobeRenderer.ts +++ b/client/src/components/AtlasGlobe/GlobeRenderer.ts @@ -10,8 +10,8 @@ import type { FrameParams } from './globeMath'; import type { BuiltLayer, FillMesh, LineMesh } from './globeMesh'; import { FILL_FS, FILL_VS, LINE_FS, LINE_VS, PICK_FS, RIM_FS, SKY_FS, SKY_VS } from './globeShaders'; -export const STATUS_TEX_W = 256; -export const STATUS_TEX_H = 64; +const STATUS_TEX_W = 256; +const STATUS_TEX_H = 64; export const MAX_FEATURES = STATUS_TEX_W * STATUS_TEX_H; export type Rgb = [number, number, number]; diff --git a/client/src/components/Dawarich/useDawarichAtlas.ts b/client/src/components/Dawarich/useDawarichAtlas.ts index f0d35f6af..f69e7d75d 100644 --- a/client/src/components/Dawarich/useDawarichAtlas.ts +++ b/client/src/components/Dawarich/useDawarichAtlas.ts @@ -14,7 +14,7 @@ export type DawarichAtlasTab = 'wishes' | 'countries'; * not an error the server reported (nothing was sent), and "something went * wrong" for a plane journey sends somebody looking for a bug in Dawarich. */ -export function dawarichFailureText(err: unknown, t: (key: string) => string): string { +function dawarichFailureText(err: unknown, t: (key: string) => string): string { if (err instanceof DawarichOfflineError) return t('dawarich.error.offline'); const data = (err as { response?: { data?: { error?: unknown } } })?.response?.data; return typeof data?.error === 'string' ? data.error : t('dawarich.error.unknown'); diff --git a/client/src/pages/atlas/atlasHubModel.ts b/client/src/pages/atlas/atlasHubModel.ts index c94c0b3e6..33d730026 100644 --- a/client/src/pages/atlas/atlasHubModel.ts +++ b/client/src/pages/atlas/atlasHubModel.ts @@ -16,7 +16,7 @@ import { A2_TO_A3, type AtlasData, type BucketItem } from './atlasModel'; * tabs and the phone sheet render this, each in its own markup. */ -export const CONTINENTS: Array<[string, string]> = [ +const CONTINENTS: Array<[string, string]> = [ ['Europe', 'atlas.europe'], ['Asia', 'atlas.asia'], ['North America', 'atlas.northAmerica'], diff --git a/client/src/pages/atlas/atlasModel.ts b/client/src/pages/atlas/atlasModel.ts index 7402dbe44..78e82a6ed 100644 --- a/client/src/pages/atlas/atlasModel.ts +++ b/client/src/pages/atlas/atlasModel.ts @@ -18,7 +18,7 @@ export interface AtlasCountry { status?: VisitStatus } -export interface AtlasStats { +interface AtlasStats { totalTrips: number totalPlaces: number totalCountries: number diff --git a/client/src/repo/atlasRepo.ts b/client/src/repo/atlasRepo.ts index a0d58490d..a4a9e9993 100644 --- a/client/src/repo/atlasRepo.ts +++ b/client/src/repo/atlasRepo.ts @@ -35,7 +35,7 @@ export interface AtlasRegionRow { manuallyMarked?: boolean; } -export interface AtlasFlightAirport { +interface AtlasFlightAirport { code: string | null; name: string; lat: number; diff --git a/client/src/sync/userMutationQueue.ts b/client/src/sync/userMutationQueue.ts index 786459fd8..855f8fd43 100644 --- a/client/src/sync/userMutationQueue.ts +++ b/client/src/sync/userMutationQueue.ts @@ -39,7 +39,7 @@ type Outcome = 'done' | 'parked' | 'stop'; let lastCreatedAt = 0; /** Fill `{name}` placeholders of a path from `ids`. */ -export function fillPath(url: string, ids: Record): string { +function fillPath(url: string, ids: Record): string { return Object.entries(ids).reduce((path, [name, id]) => path.replace(`{${name}}`, String(id)), url); } diff --git a/client/src/types.ts b/client/src/types.ts index a0673c430..fc6e168c1 100644 --- a/client/src/types.ts +++ b/client/src/types.ts @@ -409,22 +409,6 @@ export interface AtlasPlace { trip_id?: number } -// GeoJSON types (simplified for atlas map) -export interface GeoJsonFeature { - type: 'Feature' - properties: Record - geometry: { - type: string - coordinates: unknown - } - id?: string -} - -export interface GeoJsonFeatureCollection { - type: 'FeatureCollection' - features: GeoJsonFeature[] -} - // App config from /auth/app-config export interface AppConfig { has_users: boolean diff --git a/package-lock.json b/package-lock.json index 5ecf15fd4..9ce187987 100644 --- a/package-lock.json +++ b/package-lock.json @@ -122,11 +122,13 @@ "@testing-library/react": "^16.3.3", "@testing-library/user-event": "^14.6.13", "@trivago/prettier-plugin-sort-imports": "^6.0.3", + "@types/geojson": "^7946.0.16", "@types/leaflet": "^1.9.23", "@types/node": "^26.6.11", "@types/react": "^19.3.2", "@types/react-dom": "^19.3.0", "@types/topojson-client": "^3.1.5", + "@types/topojson-specification": "^1.0.5", "@vitejs/plugin-react": "^6.2.1", "@vitest/coverage-v8": "^5.1.2", "autoprefixer": "^10.7.0", diff --git a/scripts/ci/knip-baseline.json b/scripts/ci/knip-baseline.json index 147b30a6c..4ab720088 100644 --- a/scripts/ci/knip-baseline.json +++ b/scripts/ci/knip-baseline.json @@ -149,7 +149,6 @@ "client/src/components/shared/DialogShell.tsx": 1, "client/src/components/shared/SlidingTabs.tsx": 1, "client/src/components/shared/elevationProfileModel.ts": 1, - "client/src/db/offlineDb.ts": 1, "client/src/help/defineScreen.ts": 1, "client/src/help/types.ts": 1, "client/src/hooks/useDawarichConnection.ts": 1, @@ -174,7 +173,7 @@ "client/src/store/backgroundTasksStore.ts": 1, "client/src/store/helpStore.ts": 2, "client/src/theme/applyAppearance.ts": 1, - "client/src/types.ts": 5, + "client/src/types.ts": 4, "client/src/utils/connectionsVisibility.ts": 1, "client/src/utils/dayDeleteImpact.ts": 3, "client/src/utils/journeyLifecycle.ts": 1, diff --git a/server/src/nest/atlas/atlas-flights.service.ts b/server/src/nest/atlas/atlas-flights.service.ts index 6a43318a3..dcbe4cfa0 100644 --- a/server/src/nest/atlas/atlas-flights.service.ts +++ b/server/src/nest/atlas/atlas-flights.service.ts @@ -3,7 +3,7 @@ import type { ReservationEndpointsRepository } from '../../db/repositories/Reser import { InjectRepository } from '@mikro-orm/nestjs'; import { Injectable } from '@nestjs/common'; -export interface AtlasFlightRoute { +interface AtlasFlightRoute { /** Airports of the route, ordered alphabetically so A→B and B→A are one route. */ a: AtlasAirport; b: AtlasAirport; @@ -13,7 +13,7 @@ export interface AtlasFlightRoute { lastDate: string | null; } -export interface AtlasAirport { +interface AtlasAirport { code: string | null; name: string; lat: number;