Skip to content

Commit 0f5784a

Browse files
authored
Merge pull request #1080 from SlideRuleEarth/issue-1079-fix-deck3d-typecheck
Fix TS2742 typecheck failure in deck3DConfigStore
2 parents b3ae259 + b524968 commit 0f5784a

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

web-client/src/stores/deck3DConfigStore.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ import { defineStore } from 'pinia'
33
import { ref, reactive } from 'vue'
44
import type { OrbitViewState } from '@deck.gl/core'
55

6+
// Portable shape for the live orbit view state we expose from this store.
7+
// We intentionally do NOT use OrbitViewState as the reactive() generic: reactive()
8+
// unwraps it structurally, which drags in @deck.gl/core's internal (non-exported)
9+
// transitions/transition type and trips TS2742 on the store's inferred public type.
10+
// OrbitViewState is still fine as a parameter type below since it's referenced by
11+
// its public name, not structurally expanded.
12+
interface Deck3DViewState {
13+
target: number[]
14+
zoom: number
15+
rotationX: number
16+
rotationOrbit: number
17+
}
18+
619
export const useDeck3DConfigStore = defineStore('deckConfig', () => {
720
const deckContainer = ref<HTMLDivElement | null>(null)
821

@@ -41,7 +54,7 @@ export const useDeck3DConfigStore = defineStore('deckConfig', () => {
4154
const hoverMarkerScale = ref(2.0) // User-adjustable scale factor (percentage of data extent)
4255
// — LIVE VIEW STATE —
4356
// these will be updated in onViewStateChange
44-
const viewState = reactive<OrbitViewState>({
57+
const viewState = reactive<Deck3DViewState>({
4558
target: [...centroid.value],
4659
zoom: 5,
4760
rotationX: 45,

0 commit comments

Comments
 (0)