Skip to content

Commit e4db1be

Browse files
authored
Geolocation types refinement (#41)
* build(deps): upgrade dependencies * build(deps): upgrade dependencies * build(deps): upgrade Knip * build(deps): upgrade dependencies * test: remove `cameraSource` usage * refactor: migrate from namespace imports to direct imports * refactor(fiducial): replace `this` internals with closure vars * refactor(geo): remove explicit type casts * test: fix tests for undefined options * refactor(geo): update types structure * chore(geo): remove comment * ci: add changeset
1 parent 0df416d commit e4db1be

File tree

20 files changed

+296
-368
lines changed

20 files changed

+296
-368
lines changed

.changeset/huge-pets-take.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@omnidotdev/rdk": patch
3+
---
4+
5+
Improve geolocation module types

apps/fiducial-demo/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
"@biomejs/biome": "^2.3.8",
1616
"@types/react": "^19.2.7",
1717
"@types/react-dom": "^19.2.3",
18-
"@types/three": "^0.181.0",
19-
"@vitejs/plugin-react": "^5.1.1",
18+
"@types/three": "^0.182.0",
19+
"@vitejs/plugin-react": "^5.1.2",
2020
"typescript": "^5.9.3",
21-
"vite": "^7.2.6",
21+
"vite": "^7.2.7",
2222
"vite-plugin-mkcert": "^1.17.9",
2323
"vite-tsconfig-paths": "^5.1.4"
2424
},
2525
"dependencies": {
2626
"@ar-js-org/ar.js": "^3.4.7",
2727
"@omnidotdev/rdk": "workspace:*",
2828
"@react-three/fiber": "^9.4.2",
29-
"react": "^19.2.0",
30-
"react-dom": "^19.2.0",
31-
"three": "^0.181.2"
29+
"react": "^19.2.1",
30+
"react-dom": "^19.2.1",
31+
"three": "^0.182.0"
3232
}
3333
}

apps/geolocation-demo/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
"@biomejs/biome": "^2.3.8",
1616
"@types/react": "^19.2.7",
1717
"@types/react-dom": "^19.2.3",
18-
"@types/three": "^0.181.0",
19-
"@vitejs/plugin-react": "^5.1.1",
18+
"@types/three": "^0.182.0",
19+
"@vitejs/plugin-react": "^5.1.2",
2020
"typescript": "^5.9.3",
21-
"vite": "^7.2.6",
21+
"vite": "^7.2.7",
2222
"vite-plugin-mkcert": "^1.17.9",
2323
"vite-tsconfig-paths": "^5.1.4"
2424
},
2525
"dependencies": {
2626
"@omnidotdev/rdk": "workspace:*",
2727
"@react-three/fiber": "^9.4.2",
28-
"locar": "^0.1.6",
29-
"react": "^19.2.0",
30-
"react-dom": "^19.2.0",
31-
"three": "^0.181.2"
28+
"locar": "^0.1.7",
29+
"react": "^19.2.1",
30+
"react-dom": "^19.2.1",
31+
"three": "^0.182.0"
3232
}
3333
}

apps/geolocation-demo/src/components/Compass.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useFrame } from "@react-three/fiber";
22
import { useRef } from "react";
33

4-
import type * as THREE from "three";
4+
import type { Group } from "three";
55

66
interface CompassProps {
77
/**
@@ -23,8 +23,8 @@ const Compass = ({
2323
color = "#c0392b",
2424
scale = 1,
2525
}: CompassProps) => {
26-
const groupRef = useRef<THREE.Group>(null),
27-
needleRef = useRef<THREE.Group>(null);
26+
const groupRef = useRef<Group>(null),
27+
needleRef = useRef<Group>(null);
2828

2929
// gentle floating and needle rotation animation
3030
useFrame((state) => {

apps/geolocation-demo/src/components/GPSPin.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useFrame } from "@react-three/fiber";
22
import { useRef } from "react";
33

4-
import type * as THREE from "three";
4+
import type { Group } from "three";
55

66
interface GPSPinProps {
77
/**
@@ -23,7 +23,7 @@ const GPSPin = ({
2323
color = "#ff4444",
2424
scale = 1,
2525
}: GPSPinProps) => {
26-
const groupRef = useRef<THREE.Group>(null);
26+
const groupRef = useRef<Group>(null);
2727

2828
// gentle floating animation
2929
useFrame((state) => {

apps/geolocation-demo/src/components/Landmark.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useFrame } from "@react-three/fiber";
22
import { useRef } from "react";
33

4-
import type * as THREE from "three";
4+
import type { Group } from "three";
55

66
interface LandmarkProps {
77
/**
@@ -26,7 +26,7 @@ const Landmark = ({
2626
color = "#4a90e2",
2727
scale = 1,
2828
}: LandmarkProps) => {
29-
const groupRef = useRef<THREE.Group>(null);
29+
const groupRef = useRef<Group>(null);
3030

3131
// subtle rotation animation
3232
useFrame((state) => {
@@ -86,6 +86,7 @@ const Landmark = ({
8686
))}
8787

8888
{[...Array(3)].map((_, idx) => (
89+
// biome-ignore lint/suspicious/noArrayIndexKey: fixed-length, static
8990
<mesh key={idx + 3} position={[0.25, 0.3 + idx * 0.4, 0.31]}>
9091
<planeGeometry args={[0.15, 0.15]} />
9192
<meshStandardMaterial color="#87ceeb" />

apps/immersive-demo/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"@biomejs/biome": "2.3.8",
1616
"@types/react": "^19.2.7",
1717
"@types/react-dom": "^19.2.3",
18-
"@types/three": "^0.181.0",
19-
"@vitejs/plugin-react": "^5.1.1",
18+
"@types/three": "^0.182.0",
19+
"@vitejs/plugin-react": "^5.1.2",
2020
"typescript": "~5.9.3",
21-
"vite": "^7.2.6",
21+
"vite": "^7.2.7",
2222
"vite-plugin-mkcert": "^1.17.9",
2323
"vite-tsconfig-paths": "^5.1.4"
2424
},
@@ -27,8 +27,8 @@
2727
"@react-three/drei": "^10.7.7",
2828
"@react-three/fiber": "^9.4.2",
2929
"@react-three/xr": "^6.6.28",
30-
"react": "^19.2.0",
31-
"react-dom": "^19.2.0",
32-
"three": "^0.181.2"
30+
"react": "^19.2.1",
31+
"react-dom": "^19.2.1",
32+
"three": "^0.182.0"
3333
}
3434
}

apps/immersive-demo/src/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Box, Center, Sphere, Text, Torus } from "@react-three/drei";
33
import { Canvas, useFrame } from "@react-three/fiber";
44
import { useRef } from "react";
55

6-
import type * as THREE from "three";
6+
import type { Mesh } from "three";
77

88
const BUTTON_STYLES = {
99
padding: "12px 24px",
@@ -16,7 +16,7 @@ const BUTTON_STYLES = {
1616
};
1717

1818
const RotatingTorus = () => {
19-
const meshRef = useRef<THREE.Mesh>(null);
19+
const meshRef = useRef<Mesh>(null);
2020

2121
useFrame((state) => {
2222
if (meshRef.current) {
@@ -39,7 +39,7 @@ const RotatingTorus = () => {
3939
};
4040

4141
const FloatingSphere = () => {
42-
const meshRef = useRef<THREE.Mesh>(null);
42+
const meshRef = useRef<Mesh>(null);
4343

4444
useFrame((state) => {
4545
if (meshRef.current) {
@@ -62,7 +62,7 @@ const FloatingSphere = () => {
6262
};
6363

6464
const PulsatingBox = () => {
65-
const meshRef = useRef<THREE.Mesh>(null);
65+
const meshRef = useRef<Mesh>(null);
6666

6767
useFrame((state) => {
6868
if (meshRef.current) {

0 commit comments

Comments
 (0)