@omnidotdev/rdk 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/engine/XR.d.ts.map +1 -1
- package/build/engine/XRSessionProvider.d.ts +2 -7
- package/build/engine/XRSessionProvider.d.ts.map +1 -1
- package/build/engine/index.d.ts +2 -0
- package/build/engine/index.d.ts.map +1 -1
- package/build/engine/useXRStore.d.ts +53 -0
- package/build/engine/useXRStore.d.ts.map +1 -0
- package/build/fiducial/FiducialAnchor.d.ts.map +1 -1
- package/build/fiducial/FiducialSession.d.ts +2 -2
- package/build/fiducial/FiducialSession.d.ts.map +1 -1
- package/build/fiducial/fiducialBackend.d.ts +2 -2
- package/build/fiducial/fiducialBackend.d.ts.map +1 -1
- package/build/fiducial/index.d.ts +1 -1
- package/build/fiducial/index.d.ts.map +1 -1
- package/build/geolocation/GeolocationAnchor.d.ts.map +1 -1
- package/build/geolocation/GeolocationSession.d.ts +2 -2
- package/build/geolocation/GeolocationSession.d.ts.map +1 -1
- package/build/geolocation/geolocationBackend.d.ts +2 -2
- package/build/geolocation/geolocationBackend.d.ts.map +1 -1
- package/build/geolocation/index.d.ts +1 -1
- package/build/geolocation/index.d.ts.map +1 -1
- package/build/index.cjs +20 -20
- package/build/index.d.ts +3 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2185 -2132
- package/build/lib/types/engine/CameraSource.type.d.ts +7 -0
- package/build/lib/types/engine/CameraSource.type.d.ts.map +1 -0
- package/build/lib/types/{xr/XRBackend.interface.d.ts → engine/backend/Backend.interface.d.ts} +8 -8
- package/build/lib/types/engine/backend/Backend.interface.d.ts.map +1 -0
- package/build/lib/types/engine/backend/BackendInitArgs.interface.d.ts +14 -0
- package/build/lib/types/engine/backend/BackendInitArgs.interface.d.ts.map +1 -0
- package/build/lib/types/engine/backend/index.d.ts +3 -0
- package/build/lib/types/engine/backend/index.d.ts.map +1 -0
- package/build/lib/types/engine/context/ContextValue.interface.d.ts +19 -0
- package/build/lib/types/engine/context/ContextValue.interface.d.ts.map +1 -0
- package/build/lib/types/engine/context/index.d.ts +2 -0
- package/build/lib/types/engine/context/index.d.ts.map +1 -0
- package/build/lib/types/engine/index.d.ts +4 -0
- package/build/lib/types/engine/index.d.ts.map +1 -0
- package/package.json +14 -12
- package/build/lib/types/xr/XRBackend.interface.d.ts.map +0 -1
- package/build/lib/types/xr/XRBackendInitArgs.interface.d.ts +0 -14
- package/build/lib/types/xr/XRBackendInitArgs.interface.d.ts.map +0 -1
- package/build/lib/types/xr/XRContextValue.interface.d.ts +0 -20
- package/build/lib/types/xr/XRContextValue.interface.d.ts.map +0 -1
- package/build/lib/types/xr/index.d.ts +0 -4
- package/build/lib/types/xr/index.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CameraSource.type.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/engine/CameraSource.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC"}
|
package/build/lib/types/{xr/XRBackend.interface.d.ts → engine/backend/Backend.interface.d.ts}
RENAMED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BackendInitArgs } from './BackendInitArgs.interface';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* Defines the contract for
|
|
3
|
+
* Backend interface.
|
|
4
|
+
* Defines the contract for backend implementations (fiducial, geolocation, WebXR, etc.).
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface Backend {
|
|
7
7
|
/**
|
|
8
|
-
* Initialize the
|
|
8
|
+
* Initialize the backend with the provided arguments.
|
|
9
9
|
* @param args initialization arguments containing scene, camera, and renderer
|
|
10
10
|
* @returns promise that resolves when initialization is complete, or void for synchronous init
|
|
11
11
|
*/
|
|
12
|
-
init(args:
|
|
12
|
+
init(args: BackendInitArgs): Promise<void> | void;
|
|
13
13
|
/**
|
|
14
|
-
* Update the
|
|
14
|
+
* Update the backend on each frame.
|
|
15
15
|
* @param dt delta time since last frame in seconds
|
|
16
16
|
*/
|
|
17
17
|
update?(dt?: number): void;
|
|
@@ -25,4 +25,4 @@ export interface XRBackend {
|
|
|
25
25
|
*/
|
|
26
26
|
getInternal?(): unknown;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=Backend.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Backend.interface.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/engine/backend/Backend.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,OAAO;IACtB;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAElD;;;OAGG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,IAAI,IAAI,CAAC;IAEjB;;;OAGG;IACH,WAAW,CAAC,IAAI,OAAO,CAAC;CACzB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* Initialization arguments for backends.
|
|
4
|
+
* Contains the Three.js objects required to initialize any backend.
|
|
5
|
+
*/
|
|
6
|
+
export interface BackendInitArgs {
|
|
7
|
+
/** The Three.js scene to render content into. */
|
|
8
|
+
scene: THREE.Scene;
|
|
9
|
+
/** The Three.js camera used for rendering. */
|
|
10
|
+
camera: THREE.Camera;
|
|
11
|
+
/** The WebGL renderer instance. */
|
|
12
|
+
renderer: THREE.WebGLRenderer;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=BackendInitArgs.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BackendInitArgs.interface.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/engine/backend/BackendInitArgs.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,8CAA8C;IAC9C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IACrB,mCAAmC;IACnC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/engine/backend/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CameraSource } from '..';
|
|
2
|
+
import { Backend } from '../backend';
|
|
3
|
+
/**
|
|
4
|
+
* Context value provided by session providers.
|
|
5
|
+
* Supports session-based architecture with shared camera/video resources.
|
|
6
|
+
*/
|
|
7
|
+
export interface ContextValue {
|
|
8
|
+
/** Camera source type. */
|
|
9
|
+
camera: CameraSource;
|
|
10
|
+
/** Shared video element when using video camera source. */
|
|
11
|
+
video?: HTMLVideoElement | null;
|
|
12
|
+
/** Active backends registered by sessions. */
|
|
13
|
+
backends: Backend[];
|
|
14
|
+
/** Register a backend (called by sessions). */
|
|
15
|
+
registerBackend: (backend: Backend, sessionType?: string) => void;
|
|
16
|
+
/** Unregister a backend (called by sessions). */
|
|
17
|
+
unregisterBackend: (backend: Backend, sessionType?: string) => void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ContextValue.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextValue.interface.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/engine/context/ContextValue.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,0BAA0B;IAC1B,MAAM,EAAE,YAAY,CAAC;IACrB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,+CAA+C;IAC/C,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClE,iDAAiD;IACjD,iBAAiB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/engine/context/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/engine/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC1D,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnidotdev/rdk",
|
|
3
3
|
"description": "AR.js with react-three-fiber",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"format": "biome format --write .",
|
|
41
41
|
"lint": "biome check .",
|
|
42
42
|
"lint:fix": "biome check --write .",
|
|
43
|
-
"test": "vitest",
|
|
43
|
+
"test": "vitest run",
|
|
44
44
|
"release": "bun run build && changeset publish"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -53,24 +53,26 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@ar-js-org/ar.js": "^3.4.7",
|
|
56
|
-
"@biomejs/biome": "^2.3.
|
|
56
|
+
"@biomejs/biome": "^2.3.7",
|
|
57
57
|
"@react-three/fiber": "^9.4.0",
|
|
58
58
|
"@testing-library/jest-dom": "^6.9.1",
|
|
59
59
|
"@testing-library/react": "^16.3.0",
|
|
60
|
-
"@types/node": "^24.
|
|
61
|
-
"@types/react": "^19.2.
|
|
62
|
-
"@types/react-dom": "^19.2.
|
|
63
|
-
"@types/three": "^0.
|
|
64
|
-
"jsdom": "^27.0
|
|
60
|
+
"@types/node": "^24.10.1",
|
|
61
|
+
"@types/react": "^19.2.7",
|
|
62
|
+
"@types/react-dom": "^19.2.3",
|
|
63
|
+
"@types/three": "^0.181.0",
|
|
64
|
+
"jsdom": "^27.2.0",
|
|
65
65
|
"locar": "^0.1.4",
|
|
66
66
|
"react": "^19.2.0",
|
|
67
67
|
"react-dom": "^19.2.0",
|
|
68
|
-
"three": "^0.
|
|
69
|
-
"ts-pattern": "^5.9.0",
|
|
68
|
+
"three": "^0.181.2",
|
|
70
69
|
"typescript": "^5.9.3",
|
|
71
|
-
"vite": "^7.
|
|
70
|
+
"vite": "^7.2.4",
|
|
72
71
|
"vite-plugin-dts": "^4.5.4",
|
|
73
72
|
"vite-tsconfig-paths": "^5.1.4",
|
|
74
|
-
"vitest": "^4.0.
|
|
73
|
+
"vitest": "^4.0.13"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"zustand": "^5.0.8"
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XRBackend.interface.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/xr/XRBackend.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAEpD;;;OAGG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;OAEG;IACH,OAAO,CAAC,IAAI,IAAI,CAAC;IAEjB;;;OAGG;IACH,WAAW,CAAC,IAAI,OAAO,CAAC;CACzB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type * as THREE from "three";
|
|
2
|
-
/**
|
|
3
|
-
* Initialization arguments for XR backends.
|
|
4
|
-
* Contains the Three.js objects required to initialize any XR backend.
|
|
5
|
-
*/
|
|
6
|
-
export interface XRBackendInitArgs {
|
|
7
|
-
/** The Three.js scene to render XR content into. */
|
|
8
|
-
scene: THREE.Scene;
|
|
9
|
-
/** The Three.js camera used for rendering. */
|
|
10
|
-
camera: THREE.Camera;
|
|
11
|
-
/** The WebGL renderer instance. */
|
|
12
|
-
renderer: THREE.WebGLRenderer;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=XRBackendInitArgs.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XRBackendInitArgs.interface.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/xr/XRBackendInitArgs.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAEpC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,oDAAoD;IACpD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;IACnB,8CAA8C;IAC9C,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;IACrB,mCAAmC;IACnC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;CAC/B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { XRBackend } from './XRBackend.interface';
|
|
2
|
-
/**
|
|
3
|
-
* Context value provided by XRSessionProvider.
|
|
4
|
-
* Supports session-based architecture with shared camera/video resources.
|
|
5
|
-
*/
|
|
6
|
-
export interface XRContextValue {
|
|
7
|
-
/** Whether the XR system is ready. */
|
|
8
|
-
isReady: boolean;
|
|
9
|
-
/** Camera source type; video uses shared `getUserMedia`, `webxr` reserved for future `@react-three/xr` */
|
|
10
|
-
camera: "video" | "webxr";
|
|
11
|
-
/** Shared video element when using video camera source. */
|
|
12
|
-
video?: HTMLVideoElement | null;
|
|
13
|
-
/** Active XR backends registered by sessions. */
|
|
14
|
-
backends: XRBackend[];
|
|
15
|
-
/** Register a backend (called by sessions). */
|
|
16
|
-
registerBackend: (backend: XRBackend, sessionType?: string) => void;
|
|
17
|
-
/** Unregister a backend (called by sessions). */
|
|
18
|
-
unregisterBackend: (backend: XRBackend, sessionType?: string) => void;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=XRContextValue.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XRContextValue.interface.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/xr/XRContextValue.interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,0GAA0G;IAC1G,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1B,2DAA2D;IAC3D,KAAK,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAChC,iDAAiD;IACjD,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,+CAA+C;IAC/C,eAAe,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,iDAAiD;IACjD,iBAAiB,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CACvE;AAED,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/xr/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,YAAY,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC"}
|