diff --git a/furniture-3d-system/src/app/installation-demo-share/[token]/InstallationDemoShareViewerClient.tsx b/furniture-3d-system/src/app/installation-demo-share/[token]/InstallationDemoShareViewerClient.tsx index 0c9787ff..7cd0a3bf 100644 --- a/furniture-3d-system/src/app/installation-demo-share/[token]/InstallationDemoShareViewerClient.tsx +++ b/furniture-3d-system/src/app/installation-demo-share/[token]/InstallationDemoShareViewerClient.tsx @@ -5,6 +5,7 @@ import type { ThreeDEngine } from '@/lib/3d/engine' import type { InstallationDemoShareSnapshot } from '@/lib/installation-demo-share-types' import type { InstallationDetailView, + InstallationPartItem, InstallationPartRole, InstallationStepDraft, InstallationWorkbenchMode, @@ -223,7 +224,7 @@ export function InstallationDemoShareViewerClient({ return stepMaterialMarkerParts } - const filteredMarkerParts = stepMaterialItems.flatMap((item) => { + const filteredMarkerParts: InstallationPartItem[] = stepMaterialItems.flatMap((item) => { if (!item.roles.includes('hardware')) { return item.markerParts } diff --git a/furniture-3d-system/src/app/installation-demo-workbench/InstallationDemoWorkbenchClient.tsx b/furniture-3d-system/src/app/installation-demo-workbench/InstallationDemoWorkbenchClient.tsx index 69aeb9b0..d40c1a99 100644 --- a/furniture-3d-system/src/app/installation-demo-workbench/InstallationDemoWorkbenchClient.tsx +++ b/furniture-3d-system/src/app/installation-demo-workbench/InstallationDemoWorkbenchClient.tsx @@ -232,7 +232,7 @@ export default function InstallationDemoWorkbenchClient({ return stepMaterialMarkerParts } - const filteredMarkerParts = stepMaterialItems.flatMap((item) => { + const filteredMarkerParts: InstallationPartItem[] = stepMaterialItems.flatMap((item) => { if (!item.roles.includes('hardware')) { return item.markerParts } diff --git a/furniture-3d-system/src/app/installation-demo-workbench/lib/installationHardwareFocusCamera.ts b/furniture-3d-system/src/app/installation-demo-workbench/lib/installationHardwareFocusCamera.ts index 07e1a161..d37e2ed4 100644 --- a/furniture-3d-system/src/app/installation-demo-workbench/lib/installationHardwareFocusCamera.ts +++ b/furniture-3d-system/src/app/installation-demo-workbench/lib/installationHardwareFocusCamera.ts @@ -717,6 +717,15 @@ function resolveRepresentativeHardwareFocus(params: { } } +type HardwareFocusFrame = { + nodeName: string + center: THREE.Vector3 + maxDimension: number + nearestContextPoint: THREE.Vector3 | null + resolvedContextPoint: THREE.Vector3 + nearestDistance: number +} + function selectHardwareFocusNodeNames(params: { engine: ThreeDEngine hardwareNodeNames: string[] @@ -744,7 +753,7 @@ function selectHardwareFocusNodeNames(params: { : contextUnionBox.getCenter(new THREE.Vector3()) const focusFrames = params.hardwareNodeNames - .map((nodeName) => { + .map((nodeName) => { const box = resolveObjectBounds(params.engine, nodeName) if (!box) return null @@ -785,18 +794,7 @@ function selectHardwareFocusNodeNames(params: { nearestDistance, } }) - .filter( - ( - item, - ): item is { - nodeName: string - center: THREE.Vector3 - maxDimension: number - nearestContextPoint: THREE.Vector3 | null - resolvedContextPoint: THREE.Vector3 - nearestDistance: number - } => Boolean(item), - ) + .filter((item): item is HardwareFocusFrame => item !== null) if (focusFrames.length === 0) return []