@omnidotdev/rdk 0.5.2 → 0.7.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.
Files changed (46) hide show
  1. package/build/engine/useXRStore.d.ts +4 -12
  2. package/build/engine/useXRStore.d.ts.map +1 -1
  3. package/build/fiducial/FiducialAnchor.d.ts.map +1 -1
  4. package/build/fiducial/FiducialSession.d.ts +1 -4
  5. package/build/fiducial/FiducialSession.d.ts.map +1 -1
  6. package/build/fiducial/fiducialBackend.d.ts +18 -1
  7. package/build/fiducial/fiducialBackend.d.ts.map +1 -1
  8. package/build/fiducial/index.d.ts +2 -1
  9. package/build/fiducial/index.d.ts.map +1 -1
  10. package/build/fiducial/useFiducialBackend.d.ts +17 -0
  11. package/build/fiducial/useFiducialBackend.d.ts.map +1 -0
  12. package/build/geolocation/GeolocationAnchor.d.ts.map +1 -1
  13. package/build/geolocation/GeolocationSession.d.ts +1 -4
  14. package/build/geolocation/GeolocationSession.d.ts.map +1 -1
  15. package/build/geolocation/geolocationBackend.d.ts +37 -8
  16. package/build/geolocation/geolocationBackend.d.ts.map +1 -1
  17. package/build/geolocation/index.d.ts +2 -1
  18. package/build/geolocation/index.d.ts.map +1 -1
  19. package/build/geolocation/useGeolocationBackend.d.ts +17 -0
  20. package/build/geolocation/useGeolocationBackend.d.ts.map +1 -0
  21. package/build/immersive/ImmersiveSession.d.ts.map +1 -1
  22. package/build/index.cjs +1 -1
  23. package/build/index.d.ts +2 -1
  24. package/build/index.d.ts.map +1 -1
  25. package/build/index.js +403 -370
  26. package/build/lib/types/engine/backend/Backend.interface.d.ts +20 -4
  27. package/build/lib/types/engine/backend/Backend.interface.d.ts.map +1 -1
  28. package/build/lib/types/engine/backend/index.d.ts +2 -1
  29. package/build/lib/types/engine/backend/index.d.ts.map +1 -1
  30. package/build/lib/types/engine/index.d.ts +2 -2
  31. package/build/lib/types/engine/index.d.ts.map +1 -1
  32. package/package.json +15 -17
  33. package/build/lib/types/engine/context/ContextValue.interface.d.ts +0 -16
  34. package/build/lib/types/engine/context/ContextValue.interface.d.ts.map +0 -1
  35. package/build/lib/types/engine/context/index.d.ts +0 -2
  36. package/build/lib/types/engine/context/index.d.ts.map +0 -1
  37. package/build/lib/types/index.d.ts +0 -3
  38. package/build/lib/types/index.d.ts.map +0 -1
  39. package/build/lib/util/immersive/fromWebXRSessionMode.d.ts +0 -7
  40. package/build/lib/util/immersive/fromWebXRSessionMode.d.ts.map +0 -1
  41. package/build/lib/util/immersive/index.d.ts +0 -4
  42. package/build/lib/util/immersive/index.d.ts.map +0 -1
  43. package/build/lib/util/immersive/isImmersiveModeSupported.d.ts +0 -7
  44. package/build/lib/util/immersive/isImmersiveModeSupported.d.ts.map +0 -1
  45. package/build/lib/util/immersive/toWebXRSessionMode.d.ts +0 -7
  46. package/build/lib/util/immersive/toWebXRSessionMode.d.ts.map +0 -1
@@ -1,9 +1,25 @@
1
1
  import { BackendInitArgs } from './BackendInitArgs.interface';
2
2
  /**
3
- * Backend interface.
4
- * Defines the contract for backend implementations (fiducial, geolocation, WebXR, etc.).
3
+ * Backend type constants.
5
4
  */
6
- export interface Backend {
5
+ export declare const BACKEND_TYPES: {
6
+ readonly FIDUCIAL: "fiducial";
7
+ readonly GEOLOCATION: "geolocation";
8
+ readonly IMMERSIVE: "immersive";
9
+ };
10
+ /**
11
+ * Backend type discriminator.
12
+ */
13
+ export type BackendType = (typeof BACKEND_TYPES)[keyof typeof BACKEND_TYPES];
14
+ /**
15
+ * Backend interface that defines the contract for backend implementations (fiducial, geolocation, WebXR, etc.).
16
+ * @template T type returned by `getInternal()``
17
+ */
18
+ export interface Backend<T = unknown> {
19
+ /**
20
+ * Backend type discriminator for type-safe discovery.
21
+ */
22
+ readonly type: BackendType;
7
23
  /**
8
24
  * Initialize the backend with the provided arguments.
9
25
  * @param args initialization arguments containing scene, camera, and renderer
@@ -23,6 +39,6 @@ export interface Backend {
23
39
  * Get internal SDK objects for advanced use cases.
24
40
  * @returns internal objects specific to the backend implementation
25
41
  */
26
- getInternal?(): unknown;
42
+ getInternal(): T;
27
43
  }
28
44
  //# sourceMappingURL=Backend.interface.d.ts.map
@@ -1 +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;IAClD;;;OAGG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,IAAI,OAAO,CAAC;CACzB"}
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;;GAEG;AACH,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE7E;;;GAGG;AACH,MAAM,WAAW,OAAO,CAAC,CAAC,GAAG,OAAO;IAClC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAClD;;;OAGG;IACH,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B;;OAEG;IACH,OAAO,CAAC,IAAI,IAAI,CAAC;IACjB;;;OAGG;IACH,WAAW,IAAI,CAAC,CAAC;CAClB"}
@@ -1,3 +1,4 @@
1
- export type { Backend } from './Backend.interface';
1
+ export { BACKEND_TYPES } from './Backend.interface';
2
+ export type { Backend, BackendType } from './Backend.interface';
2
3
  export type { BackendInitArgs } from './BackendInitArgs.interface';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/engine/backend/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAChE,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,3 +1,3 @@
1
- export type { Backend, BackendInitArgs } from './backend';
2
- export type { ContextValue } from './context';
1
+ export { BACKEND_TYPES } from './backend';
2
+ export type { Backend, BackendInitArgs, BackendType } from './backend';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,YAAY,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,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.5.2",
4
+ "version": "0.7.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "build/index.js",
@@ -45,9 +45,9 @@
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@ar-js-org/ar.js": "^3.4.7",
48
- "@react-three/fiber": "^9.4.0",
49
- "@react-three/xr": "^6.6.28",
50
- "locar": "0.1.5",
48
+ "@react-three/fiber": "^9.5.0",
49
+ "@react-three/xr": "^6.6.29",
50
+ "locar": "^0.1.8",
51
51
  "react": "^19.2.0",
52
52
  "react-dom": "^19.2.0",
53
53
  "three": "^0.182.0"
@@ -65,28 +65,26 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "@ar-js-org/ar.js": "^3.4.7",
68
- "@biomejs/biome": "^2.3.8",
69
- "@react-three/fiber": "^9.4.2",
68
+ "@biomejs/biome": "^2.3.11",
69
+ "@react-three/fiber": "^9.5.0",
70
70
  "@testing-library/jest-dom": "^6.9.1",
71
- "@testing-library/react": "^16.3.0",
72
- "@types/node": "^25.0.0",
71
+ "@testing-library/react": "^16.3.1",
72
+ "@types/node": "^25.0.3",
73
73
  "@types/react": "^19.2.7",
74
74
  "@types/react-dom": "^19.2.3",
75
75
  "@types/three": "^0.182.0",
76
- "@types/webxr": "^0.5.24",
77
- "jsdom": "^27.3.0",
78
- "locar": "^0.1.7",
79
- "react": "^19.2.1",
80
- "react-dom": "^19.2.1",
76
+ "jsdom": "^27.4.0",
77
+ "locar": "^0.1.8",
78
+ "react": "^19.2.3",
79
+ "react-dom": "^19.2.3",
81
80
  "three": "^0.182.0",
82
81
  "typescript": "^5.9.3",
83
- "vite": "^7.2.7",
82
+ "vite": "^7.3.0",
84
83
  "vite-plugin-dts": "^4.5.4",
85
- "vite-tsconfig-paths": "^5.1.4",
86
- "vitest": "^4.0.15"
84
+ "vite-tsconfig-paths": "^6.0.3",
85
+ "vitest": "^4.0.16"
87
86
  },
88
87
  "dependencies": {
89
- "ts-pattern": "^5.9.0",
90
88
  "zustand": "^5.0.9"
91
89
  }
92
90
  }
@@ -1,16 +0,0 @@
1
- import { Backend } from '../backend';
2
- /**
3
- * Context value provided by session providers.
4
- * Supports session-based architecture with shared camera/video resources.
5
- */
6
- export interface ContextValue {
7
- /** Shared video element. */
8
- video?: HTMLVideoElement | null;
9
- /** Active backends registered by sessions. */
10
- backends: Backend[];
11
- /** Register a backend (called by sessions). */
12
- registerBackend: (backend: Backend, sessionType?: string) => void;
13
- /** Unregister a backend (called by sessions). */
14
- unregisterBackend: (backend: Backend, sessionType?: string) => void;
15
- }
16
- //# sourceMappingURL=ContextValue.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ContextValue.interface.d.ts","sourceRoot":"","sources":["../../../../../src/lib/types/engine/context/ContextValue.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,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"}
@@ -1,2 +0,0 @@
1
- export type { ContextValue } from './ContextValue.interface';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,3 +0,0 @@
1
- export * from './engine';
2
- export * from './immersive';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
@@ -1,7 +0,0 @@
1
- import { ImmersiveMode } from 'lib/types';
2
- /**
3
- * Maps official WebXR session modes to simplified immersive modes.
4
- */
5
- declare const fromWebXRSessionMode: (mode: XRSessionMode) => ImmersiveMode;
6
- export default fromWebXRSessionMode;
7
- //# sourceMappingURL=fromWebXRSessionMode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fromWebXRSessionMode.d.ts","sourceRoot":"","sources":["../../../../src/lib/util/immersive/fromWebXRSessionMode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,QAAA,MAAM,oBAAoB,GAAI,MAAM,aAAa,KAAG,aAKnC,CAAC;AAElB,eAAe,oBAAoB,CAAC"}
@@ -1,4 +0,0 @@
1
- export { default as fromWebXRSessionMode } from './fromWebXRSessionMode';
2
- export { default as isImmersiveModeSupported } from './isImmersiveModeSupported';
3
- export { default as toWebXRSessionMode } from './toWebXRSessionMode';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/util/immersive/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Check if a specific immersive mode is supported.
3
- * Uses real WebXR API calls for accurate detection.
4
- */
5
- declare function isImmersiveModeSupported(mode: "ar" | "vr" | "inline"): Promise<boolean>;
6
- export default isImmersiveModeSupported;
7
- //# sourceMappingURL=isImmersiveModeSupported.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"isImmersiveModeSupported.d.ts","sourceRoot":"","sources":["../../../../src/lib/util/immersive/isImmersiveModeSupported.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,iBAAe,wBAAwB,CACrC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,QAAQ,GAC3B,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED,eAAe,wBAAwB,CAAC"}
@@ -1,7 +0,0 @@
1
- import { ImmersiveMode } from 'lib/types';
2
- /**
3
- * Map simplified immersive modes to official WebXR session modes.
4
- */
5
- declare const toWebXRSessionMode: (mode: ImmersiveMode) => XRSessionMode;
6
- export default toWebXRSessionMode;
7
- //# sourceMappingURL=toWebXRSessionMode.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toWebXRSessionMode.d.ts","sourceRoot":"","sources":["../../../../src/lib/util/immersive/toWebXRSessionMode.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,QAAA,MAAM,kBAAkB,GAAI,MAAM,aAAa,KAAG,aAKjC,CAAC;AAElB,eAAe,kBAAkB,CAAC"}