From b524968376b24534ac957f2861d8b98d95af32c0 Mon Sep 17 00:00:00 2001 From: "Carlos E. Ugarte" Date: Tue, 9 Jun 2026 08:01:01 -0400 Subject: [PATCH] Fix TS2742 typecheck failure in deck3DConfigStore (#1079) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reactive() structurally unwraps the deck.gl type, dragging in @deck.gl/core's internal (non-exported) transitions/transition type and tripping TS2742 on the store's inferred public type, which made `make typecheck` red on main. Type the reactive viewState with a local, portable Deck3DViewState interface covering the fields actually used (target, zoom, rotationX, rotationOrbit). OrbitViewState is retained as the updateViewState() parameter type — it is referenced by its public name there, not structurally expanded, so the deck.gl onViewStateChange callback still passes through unchanged. No runtime behavior change. Co-Authored-By: Claude Opus 4.8 --- web-client/src/stores/deck3DConfigStore.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/web-client/src/stores/deck3DConfigStore.ts b/web-client/src/stores/deck3DConfigStore.ts index f0cd0fa6..4d6896b3 100644 --- a/web-client/src/stores/deck3DConfigStore.ts +++ b/web-client/src/stores/deck3DConfigStore.ts @@ -3,6 +3,19 @@ import { defineStore } from 'pinia' import { ref, reactive } from 'vue' import type { OrbitViewState } from '@deck.gl/core' +// Portable shape for the live orbit view state we expose from this store. +// We intentionally do NOT use OrbitViewState as the reactive() generic: reactive() +// unwraps it structurally, which drags in @deck.gl/core's internal (non-exported) +// transitions/transition type and trips TS2742 on the store's inferred public type. +// OrbitViewState is still fine as a parameter type below since it's referenced by +// its public name, not structurally expanded. +interface Deck3DViewState { + target: number[] + zoom: number + rotationX: number + rotationOrbit: number +} + export const useDeck3DConfigStore = defineStore('deckConfig', () => { const deckContainer = ref(null) @@ -41,7 +54,7 @@ export const useDeck3DConfigStore = defineStore('deckConfig', () => { const hoverMarkerScale = ref(2.0) // User-adjustable scale factor (percentage of data extent) // — LIVE VIEW STATE — // these will be updated in onViewStateChange - const viewState = reactive({ + const viewState = reactive({ target: [...centroid.value], zoom: 5, rotationX: 45,