@webspatial/core-sdk 1.6.1 → 2.0.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 (320) hide show
  1. package/CHANGELOG.md +84 -0
  2. package/README.md +10 -0
  3. package/dist/JSBCommand.d.ts +398 -0
  4. package/dist/JSBCommand.js +668 -0
  5. package/dist/JSBCommand.js.map +1 -0
  6. package/dist/Spatial.d.ts +63 -0
  7. package/dist/Spatial.js +60 -0
  8. package/dist/Spatial.js.map +1 -0
  9. package/dist/SpatialObject.d.ts +19 -0
  10. package/dist/SpatialObject.js +44 -0
  11. package/dist/SpatialObject.js.map +1 -0
  12. package/dist/SpatialScene.d.ts +51 -0
  13. package/dist/SpatialScene.js +74 -0
  14. package/dist/SpatialScene.js.map +1 -0
  15. package/dist/SpatialSession.d.ts +143 -0
  16. package/dist/SpatialSession.js +173 -0
  17. package/dist/SpatialSession.js.map +1 -0
  18. package/dist/SpatialWebEvent.d.ts +8 -0
  19. package/dist/SpatialWebEvent.js +18 -0
  20. package/dist/SpatialWebEvent.js.map +1 -0
  21. package/dist/SpatialWebEventCreator.d.ts +11 -0
  22. package/dist/SpatialWebEventCreator.js +11 -0
  23. package/dist/SpatialWebEventCreator.js.map +1 -0
  24. package/dist/Spatialized2DElement.d.ts +42 -0
  25. package/dist/Spatialized2DElement.js +47 -0
  26. package/dist/Spatialized2DElement.js.map +1 -0
  27. package/dist/SpatializedDynamic3DElement.d.ts +7 -0
  28. package/dist/SpatializedDynamic3DElement.js +43 -0
  29. package/dist/SpatializedDynamic3DElement.js.map +1 -0
  30. package/dist/SpatializedElement.d.ts +7 -0
  31. package/dist/SpatializedElement.js +206 -0
  32. package/dist/SpatializedElement.js.map +1 -0
  33. package/dist/SpatializedElementCreator.d.ts +15 -0
  34. package/dist/SpatializedElementCreator.js +47 -0
  35. package/dist/SpatializedElementCreator.js.map +1 -0
  36. package/dist/SpatializedStatic3DElement.d.ts +195 -0
  37. package/dist/SpatializedStatic3DElement.js +327 -0
  38. package/dist/SpatializedStatic3DElement.js.map +1 -0
  39. package/dist/WebMsgCommand.d.ts +7 -0
  40. package/dist/WebMsgCommand.js +23 -0
  41. package/dist/WebMsgCommand.js.map +1 -0
  42. package/dist/index.d.ts +35 -1101
  43. package/dist/index.js +21 -3393
  44. package/dist/index.js.map +1 -1
  45. package/dist/install-polyfills.d.ts +2 -0
  46. package/dist/install-polyfills.js +13 -0
  47. package/dist/install-polyfills.js.map +1 -0
  48. package/dist/isSSREnv.d.ts +3 -0
  49. package/dist/isSSREnv.js +6 -0
  50. package/dist/isSSREnv.js.map +1 -0
  51. package/dist/motion/AnimationObject.d.ts +7 -0
  52. package/dist/motion/AnimationObject.js +140 -0
  53. package/dist/motion/AnimationObject.js.map +1 -0
  54. package/dist/motion/compute/index.d.ts +10 -0
  55. package/dist/motion/compute/index.js +19 -0
  56. package/dist/motion/compute/index.js.map +1 -0
  57. package/dist/motion/compute/motionPropertyValues.d.ts +19 -0
  58. package/dist/motion/compute/motionPropertyValues.js +50 -0
  59. package/dist/motion/compute/motionPropertyValues.js.map +1 -0
  60. package/dist/motion/compute/normalize.d.ts +31 -0
  61. package/dist/motion/compute/normalize.js +201 -0
  62. package/dist/motion/compute/normalize.js.map +1 -0
  63. package/dist/motion/compute/validate.d.ts +22 -0
  64. package/dist/motion/compute/validate.js +103 -0
  65. package/dist/motion/compute/validate.js.map +1 -0
  66. package/dist/motion/index.d.ts +8 -0
  67. package/dist/motion/index.js +6 -0
  68. package/dist/motion/index.js.map +1 -0
  69. package/dist/motion/native/serializeMotionTimeline.d.ts +12 -0
  70. package/dist/motion/native/serializeMotionTimeline.js +21 -0
  71. package/dist/motion/native/serializeMotionTimeline.js.map +1 -0
  72. package/dist/physicalMetrics-W5uZ5xKb.d.ts +48 -0
  73. package/dist/physicalMetrics.d.ts +1 -0
  74. package/dist/physicalMetrics.js +58 -0
  75. package/dist/physicalMetrics.js.map +1 -0
  76. package/dist/platform-adapter/CommandResultUtils.d.ts +12 -0
  77. package/dist/platform-adapter/CommandResultUtils.js +21 -0
  78. package/dist/platform-adapter/CommandResultUtils.js.map +1 -0
  79. package/dist/platform-adapter/createPlatformSync.d.ts +16 -0
  80. package/dist/platform-adapter/createPlatformSync.js +30 -0
  81. package/dist/platform-adapter/createPlatformSync.js.map +1 -0
  82. package/dist/platform-adapter/index.d.ts +12 -0
  83. package/dist/platform-adapter/index.js +10 -0
  84. package/dist/platform-adapter/index.js.map +1 -0
  85. package/dist/platform-adapter/interface.d.ts +7 -0
  86. package/dist/platform-adapter/interface.js +1 -0
  87. package/dist/platform-adapter/interface.js.map +1 -0
  88. package/dist/platform-adapter/pico-os/PicoOSPlatform.d.ts +25 -0
  89. package/dist/platform-adapter/pico-os/PicoOSPlatform.js +168 -0
  90. package/dist/platform-adapter/pico-os/PicoOSPlatform.js.map +1 -0
  91. package/dist/platform-adapter/puppeteer/PuppeteerPlatform.d.ts +66 -0
  92. package/dist/platform-adapter/puppeteer/PuppeteerPlatform.js +372 -0
  93. package/dist/platform-adapter/puppeteer/PuppeteerPlatform.js.map +1 -0
  94. package/dist/platform-adapter/spatialRequestMetadata.d.ts +6 -0
  95. package/dist/platform-adapter/spatialRequestMetadata.js +39 -0
  96. package/dist/platform-adapter/spatialRequestMetadata.js.map +1 -0
  97. package/dist/platform-adapter/spatialSceneQuery.d.ts +12 -0
  98. package/dist/platform-adapter/spatialSceneQuery.js +12 -0
  99. package/dist/platform-adapter/spatialSceneQuery.js.map +1 -0
  100. package/dist/platform-adapter/vision-os/VisionOSPlatform.d.ts +19 -0
  101. package/dist/platform-adapter/vision-os/VisionOSPlatform.js +77 -0
  102. package/dist/platform-adapter/vision-os/VisionOSPlatform.js.map +1 -0
  103. package/dist/platform-runtime.d.ts +12 -0
  104. package/dist/platform-runtime.js +14 -0
  105. package/dist/platform-runtime.js.map +1 -0
  106. package/dist/reality/Attachment.d.ts +19 -0
  107. package/dist/reality/Attachment.js +39 -0
  108. package/dist/reality/Attachment.js.map +1 -0
  109. package/dist/reality/component/ModelComponent.d.ts +14 -0
  110. package/dist/reality/component/ModelComponent.js +11 -0
  111. package/dist/reality/component/ModelComponent.js.map +1 -0
  112. package/dist/reality/component/SpatialComponent.d.ts +8 -0
  113. package/dist/reality/component/SpatialComponent.js +19 -0
  114. package/dist/reality/component/SpatialComponent.js.map +1 -0
  115. package/dist/reality/component/index.d.ts +8 -0
  116. package/dist/reality/component/index.js +3 -0
  117. package/dist/reality/component/index.js.map +1 -0
  118. package/dist/reality/entity/SpatialEntity.d.ts +7 -0
  119. package/dist/reality/entity/SpatialEntity.js +291 -0
  120. package/dist/reality/entity/SpatialEntity.js.map +1 -0
  121. package/dist/reality/entity/SpatialModelEntity.d.ts +17 -0
  122. package/dist/reality/entity/SpatialModelEntity.js +17 -0
  123. package/dist/reality/entity/SpatialModelEntity.js.map +1 -0
  124. package/dist/reality/entity/index.d.ts +8 -0
  125. package/dist/reality/entity/index.js +3 -0
  126. package/dist/reality/entity/index.js.map +1 -0
  127. package/dist/reality/geometry/SpatialBoxGeometry.d.ts +16 -0
  128. package/dist/reality/geometry/SpatialBoxGeometry.js +13 -0
  129. package/dist/reality/geometry/SpatialBoxGeometry.js.map +1 -0
  130. package/dist/reality/geometry/SpatialConeGeometry.d.ts +16 -0
  131. package/dist/reality/geometry/SpatialConeGeometry.js +13 -0
  132. package/dist/reality/geometry/SpatialConeGeometry.js.map +1 -0
  133. package/dist/reality/geometry/SpatialCylinderGeometry.d.ts +16 -0
  134. package/dist/reality/geometry/SpatialCylinderGeometry.js +13 -0
  135. package/dist/reality/geometry/SpatialCylinderGeometry.js.map +1 -0
  136. package/dist/reality/geometry/SpatialGeometry.d.ts +7 -0
  137. package/dist/reality/geometry/SpatialGeometry.js +13 -0
  138. package/dist/reality/geometry/SpatialGeometry.js.map +1 -0
  139. package/dist/reality/geometry/SpatialPlaneGeometry.d.ts +16 -0
  140. package/dist/reality/geometry/SpatialPlaneGeometry.js +13 -0
  141. package/dist/reality/geometry/SpatialPlaneGeometry.js.map +1 -0
  142. package/dist/reality/geometry/SpatialSphereGeometry.d.ts +16 -0
  143. package/dist/reality/geometry/SpatialSphereGeometry.js +13 -0
  144. package/dist/reality/geometry/SpatialSphereGeometry.js.map +1 -0
  145. package/dist/reality/geometry/index.d.ts +12 -0
  146. package/dist/reality/geometry/index.js +7 -0
  147. package/dist/reality/geometry/index.js.map +1 -0
  148. package/dist/reality/index.d.ts +18 -0
  149. package/dist/reality/index.js +7 -0
  150. package/dist/reality/index.js.map +1 -0
  151. package/dist/reality/material/SpatialMaterial.d.ts +7 -0
  152. package/dist/reality/material/SpatialMaterial.js +13 -0
  153. package/dist/reality/material/SpatialMaterial.js.map +1 -0
  154. package/dist/reality/material/SpatialUnlitMaterial.d.ts +16 -0
  155. package/dist/reality/material/SpatialUnlitMaterial.js +16 -0
  156. package/dist/reality/material/SpatialUnlitMaterial.js.map +1 -0
  157. package/dist/reality/material/index.d.ts +8 -0
  158. package/dist/reality/material/index.js +3 -0
  159. package/dist/reality/material/index.js.map +1 -0
  160. package/dist/reality/realityCreator.d.ts +22 -0
  161. package/dist/reality/realityCreator.js +89 -0
  162. package/dist/reality/realityCreator.js.map +1 -0
  163. package/dist/reality/resource/SpatialModelAsset.d.ts +15 -0
  164. package/dist/reality/resource/SpatialModelAsset.js +12 -0
  165. package/dist/reality/resource/SpatialModelAsset.js.map +1 -0
  166. package/dist/reality/resource/SpatialTextureResource.d.ts +16 -0
  167. package/dist/reality/resource/SpatialTextureResource.js +16 -0
  168. package/dist/reality/resource/SpatialTextureResource.js.map +1 -0
  169. package/dist/reality/resource/index.d.ts +9 -0
  170. package/dist/reality/resource/index.js +3 -0
  171. package/dist/reality/resource/index.js.map +1 -0
  172. package/dist/runtime/WebSpatialRuntimeError.d.ts +10 -0
  173. package/dist/runtime/WebSpatialRuntimeError.js +14 -0
  174. package/dist/runtime/WebSpatialRuntimeError.js.map +1 -0
  175. package/dist/runtime/capability-data.d.ts +12 -0
  176. package/dist/runtime/capability-data.js +134 -0
  177. package/dist/runtime/capability-data.js.map +1 -0
  178. package/dist/runtime/index.d.ts +8 -0
  179. package/dist/runtime/index.js +27 -0
  180. package/dist/runtime/index.js.map +1 -0
  181. package/dist/runtime/jsbAdapterPlatform.d.ts +9 -0
  182. package/dist/runtime/jsbAdapterPlatform.js +38 -0
  183. package/dist/runtime/jsbAdapterPlatform.js.map +1 -0
  184. package/dist/runtime/keys.d.ts +34 -0
  185. package/dist/runtime/keys.js +122 -0
  186. package/dist/runtime/keys.js.map +1 -0
  187. package/dist/runtime/semver.d.ts +8 -0
  188. package/dist/runtime/semver.js +32 -0
  189. package/dist/runtime/semver.js.map +1 -0
  190. package/dist/runtime/supports.d.ts +22 -0
  191. package/dist/runtime/supports.js +78 -0
  192. package/dist/runtime/supports.js.map +1 -0
  193. package/dist/runtime/types.d.ts +12 -0
  194. package/dist/runtime/types.js +1 -0
  195. package/dist/runtime/types.js.map +1 -0
  196. package/dist/runtime/userAgent.d.ts +20 -0
  197. package/dist/runtime/userAgent.js +41 -0
  198. package/dist/runtime/userAgent.js.map +1 -0
  199. package/dist/scene-polyfill.d.ts +18 -0
  200. package/dist/scene-polyfill.js +480 -0
  201. package/dist/scene-polyfill.js.map +1 -0
  202. package/dist/spatial-host.d.ts +13 -0
  203. package/dist/spatial-host.js +18 -0
  204. package/dist/spatial-host.js.map +1 -0
  205. package/dist/spatial-window-polyfill.d.ts +3 -0
  206. package/dist/spatial-window-polyfill.js +155 -0
  207. package/dist/spatial-window-polyfill.js.map +1 -0
  208. package/dist/spatializedElementMotion-_0XWPQCE.d.ts +1009 -0
  209. package/dist/types/animation.d.ts +7 -0
  210. package/dist/types/animation.js +1 -0
  211. package/dist/types/animation.js.map +1 -0
  212. package/dist/types/global.d.ts +38 -0
  213. package/dist/types/global.js +1 -0
  214. package/dist/types/global.js.map +1 -0
  215. package/dist/types/internal.d.ts +7 -0
  216. package/dist/types/internal.js +12 -0
  217. package/dist/types/internal.js.map +1 -0
  218. package/dist/types/motion/index.d.ts +7 -0
  219. package/dist/types/motion/index.js +3 -0
  220. package/dist/types/motion/index.js.map +1 -0
  221. package/dist/types/motion/spatializedElementMotion.d.ts +7 -0
  222. package/dist/types/motion/spatializedElementMotion.js +1 -0
  223. package/dist/types/motion/spatializedElementMotion.js.map +1 -0
  224. package/dist/types/motion/spatializedMotion.d.ts +7 -0
  225. package/dist/types/motion/spatializedMotion.js +16 -0
  226. package/dist/types/motion/spatializedMotion.js.map +1 -0
  227. package/dist/types/motion/spatializedPlayback.d.ts +11 -0
  228. package/dist/types/motion/spatializedPlayback.js +1 -0
  229. package/dist/types/motion/spatializedPlayback.js.map +1 -0
  230. package/dist/types/motion/spatializedVisual.d.ts +35 -0
  231. package/dist/types/motion/spatializedVisual.js +1 -0
  232. package/dist/types/motion/spatializedVisual.js.map +1 -0
  233. package/dist/types/types.d.ts +7 -0
  234. package/dist/types/types.js +117 -0
  235. package/dist/types/types.js.map +1 -0
  236. package/dist/utils.d.ts +44 -0
  237. package/dist/utils.js +86 -0
  238. package/dist/utils.js.map +1 -0
  239. package/package.json +20 -4
  240. package/src/JSBCommand.ts +148 -91
  241. package/src/Spatial.ts +0 -21
  242. package/src/SpatialObject.ts +10 -0
  243. package/src/SpatialScene.ts +1 -5
  244. package/src/SpatialSession.ts +17 -3
  245. package/src/Spatialized2DElement.ts +5 -0
  246. package/src/SpatializedDynamic3DElement.ts +5 -1
  247. package/src/SpatializedElement.ts +29 -0
  248. package/src/SpatializedElementCreator.ts +6 -4
  249. package/src/SpatializedStatic3DElement.test.ts +99 -0
  250. package/src/SpatializedStatic3DElement.ts +141 -4
  251. package/src/WebMsgCommand.ts +50 -0
  252. package/src/coverage-boost.test.ts +258 -316
  253. package/src/index.ts +28 -12
  254. package/src/install-polyfills.ts +38 -0
  255. package/src/jsbcommand.coverage.test.ts +42 -48
  256. package/src/motion/AnimationObject.test.ts +421 -0
  257. package/src/motion/AnimationObject.ts +208 -0
  258. package/src/motion/compute/index.ts +10 -0
  259. package/src/motion/compute/motionPropertyValues.test.ts +55 -0
  260. package/src/motion/compute/motionPropertyValues.ts +70 -0
  261. package/src/motion/compute/normalize.test.ts +99 -0
  262. package/src/motion/compute/normalize.ts +289 -0
  263. package/src/motion/compute/validate.test.ts +229 -0
  264. package/src/motion/compute/validate.ts +156 -0
  265. package/src/motion/index.ts +2 -0
  266. package/src/motion/native/serializeMotionTimeline.test.ts +61 -0
  267. package/src/motion/native/serializeMotionTimeline.ts +27 -0
  268. package/src/platform-adapter/CommandResultUtils.ts +2 -2
  269. package/src/platform-adapter/createPlatformSync.ts +36 -0
  270. package/src/platform-adapter/index.ts +5 -51
  271. package/src/platform-adapter/interface.ts +35 -23
  272. package/src/platform-adapter/pico-os/PicoOSPlatform.ts +156 -59
  273. package/src/platform-adapter/puppeteer/PuppeteerPlatform.ts +37 -11
  274. package/src/platform-adapter/spatialRequestMetadata.test.ts +175 -0
  275. package/src/platform-adapter/spatialRequestMetadata.ts +48 -0
  276. package/src/platform-adapter/spatialSceneQuery.ts +17 -0
  277. package/src/platform-adapter/vision-os/VisionOSPlatform.ts +60 -24
  278. package/src/platform-runtime.ts +13 -0
  279. package/src/reality/Attachment.ts +2 -2
  280. package/src/reality/entity/SpatialEntity.ts +127 -2
  281. package/src/reality/realityCreator.ts +15 -1
  282. package/src/reality/resource/SpatialTextureResource.ts +16 -0
  283. package/src/reality/resource/index.ts +1 -0
  284. package/src/runtime/WebSpatialRuntimeError.ts +16 -0
  285. package/src/runtime/capability-data.ts +213 -0
  286. package/src/runtime/contract-review.test.ts +44 -0
  287. package/src/runtime/index.ts +17 -0
  288. package/src/runtime/jsbAdapterPlatform.test.ts +36 -0
  289. package/src/runtime/jsbAdapterPlatform.ts +51 -0
  290. package/src/runtime/keys.ts +140 -0
  291. package/src/runtime/semver.ts +33 -0
  292. package/src/runtime/supports.test.ts +346 -0
  293. package/src/runtime/supports.ts +112 -0
  294. package/src/runtime/types.ts +11 -0
  295. package/src/runtime/useAnimation.capability.test.ts +275 -0
  296. package/src/runtime/userAgent.ts +64 -0
  297. package/src/scene-polyfill.manifest.test.ts +312 -9
  298. package/src/scene-polyfill.request-metadata.test.ts +39 -0
  299. package/src/scene-polyfill.test.ts +33 -94
  300. package/src/scene-polyfill.ts +125 -92
  301. package/src/spatial-host.ts +25 -0
  302. package/src/spatial-window-polyfill.ts +18 -2
  303. package/src/transform-roundtrip.test.ts +90 -0
  304. package/src/types/animation.ts +224 -0
  305. package/src/types/{global.d.ts → global.ts} +10 -12
  306. package/src/types/motion/index.ts +10 -0
  307. package/src/types/motion/spatializedElementMotion.ts +49 -0
  308. package/src/types/motion/spatializedMotion.ts +147 -0
  309. package/src/types/motion/spatializedPlayback.ts +17 -0
  310. package/src/types/motion/spatializedVisual.ts +24 -0
  311. package/src/types/types.ts +12 -0
  312. package/src/utils.ts +54 -0
  313. package/tsup.config.ts +61 -36
  314. package/vitest.config.ts +5 -1
  315. package/dist/iife/index.d.ts +0 -1101
  316. package/dist/iife/index.global.js +0 -75
  317. package/dist/iife/index.global.js.map +0 -1
  318. package/src/platform-adapter/android/AndroidPlatform.ts +0 -133
  319. package/src/platform-adapter/ssr/SSRPlatform.ts +0 -43
  320. /package/src/{ssr-polyfill.ts → isSSREnv.ts} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,1101 +1,35 @@
1
- /**
2
- * @hidden
3
- * Parent class of spatial objects, should not be used directly
4
- */
5
- declare class SpatialObject {
6
- /** @hidden */
7
- readonly id: string;
8
- /** @hidden */
9
- constructor(
10
- /** @hidden */
11
- id: string);
12
- name?: string;
13
- isDestroyed: boolean;
14
- inspect(): Promise<any>;
15
- destroy(): Promise<any>;
16
- protected onDestroy(): void;
17
- }
18
-
19
- interface CommandResult {
20
- success: boolean;
21
- data: any;
22
- errorCode: string | undefined;
23
- errorMessage: string | undefined;
24
- }
25
- interface WebSpatialProtocolResult extends CommandResult {
26
- success: boolean;
27
- data: {
28
- windowProxy: WindowProxy;
29
- id: string;
30
- } | undefined;
31
- errorCode: string | undefined;
32
- errorMessage: string | undefined;
33
- }
34
-
35
- declare class SpatialGeometry extends SpatialObject {
36
- id: string;
37
- options: SpatialGeometryOptions;
38
- static type: SpatialGeometryType;
39
- constructor(id: string, options: SpatialGeometryOptions);
40
- }
41
-
42
- declare abstract class SpatialMaterial extends SpatialObject {
43
- id: string;
44
- type: SpatialMaterialType;
45
- constructor(id: string, type: SpatialMaterialType);
46
- abstract updateProperties(properties: any): void;
47
- }
48
-
49
- declare enum SpatialWebMsgType {
50
- modelloaded = "modelloaded",
51
- modelloadfailed = "modelloadfailed",
52
- spatialtap = "spatialtap",
53
- spatialdragstart = "spatialdragstart",
54
- spatialdrag = "spatialdrag",
55
- spatialdragend = "spatialdragend",
56
- spatialrotate = "spatialrotate",
57
- spatialrotateend = "spatialrotateend",
58
- spatialmagnify = "spatialmagnify",
59
- spatialmagnifyend = "spatialmagnifyend",
60
- animationstatechange = "animationstatechange",
61
- objectdestroy = "objectdestroy"
62
- }
63
- interface ObjectDestroyMsg {
64
- type: SpatialWebMsgType.objectdestroy;
65
- }
66
- interface SpatialTapMsg {
67
- type: SpatialWebMsgType.spatialtap;
68
- detail: SpatialTapEventDetail;
69
- }
70
- interface SpatialDragStartMsg {
71
- type: SpatialWebMsgType.spatialdragstart;
72
- detail: SpatialDragStartEventDetail;
73
- }
74
- interface SpatialDragMsg {
75
- type: SpatialWebMsgType.spatialdrag;
76
- detail: SpatialDragEventDetail;
77
- }
78
- interface SpatialDragEndMsg {
79
- type: SpatialWebMsgType.spatialdragend;
80
- detail: SpatialDragEndEventDetail;
81
- }
82
- interface SpatialRotateMsg {
83
- type: SpatialWebMsgType.spatialrotate;
84
- detail: SpatialRotateEventDetail;
85
- }
86
- interface SpatialRotateEndMsg {
87
- type: SpatialWebMsgType.spatialrotateend;
88
- detail: SpatialRotateEventDetail;
89
- }
90
- interface ModelLoadSuccess {
91
- type: SpatialWebMsgType.modelloaded;
92
- detail?: {
93
- src: string;
94
- };
95
- }
96
- interface ModelLoadFailure {
97
- type: SpatialWebMsgType.modelloadfailed;
98
- }
99
- interface AnimationStateChangeDetail {
100
- paused: boolean;
101
- duration: number;
102
- }
103
- interface AnimationStateChangeMsg {
104
- type: SpatialWebMsgType.animationstatechange;
105
- detail: AnimationStateChangeDetail;
106
- }
107
-
108
- /**
109
- * Abstract base class for all spatialized elements in the WebSpatial environment.
110
- * Provides common functionality for elements that can exist in 3D space,
111
- * including transformation handling and gesture event processing.
112
- */
113
- declare abstract class SpatializedElement extends SpatialObject {
114
- readonly id: string;
115
- /**
116
- * Creates a new spatialized element with the specified ID.
117
- * Registers the element to receive spatial events.
118
- * @param id Unique identifier for this element
119
- */
120
- constructor(id: string);
121
- /**
122
- * Updates the properties of this spatialized element.
123
- * Must be implemented by derived classes to handle specific property updates.
124
- * @param properties Partial set of properties to update
125
- * @returns Promise resolving to the result of the update operation
126
- */
127
- abstract updateProperties(properties: Partial<SpatializedElementProperties>): Promise<WebSpatialProtocolResult>;
128
- /**
129
- * Updates the transformation matrix of this element in 3D space.
130
- * This affects the position, rotation, and scale of the element.
131
- * @param matrix The new transformation matrix
132
- * @returns Promise resolving when the transform is updated
133
- */
134
- updateTransform(matrix: DOMMatrix): Promise<CommandResult>;
135
- /**
136
- * Information about the element's bounding cube.
137
- * Used for spatial calculations and hit testing.
138
- */
139
- private _cubeInfo?;
140
- /**
141
- * Gets the current cube information for this element.
142
- * @returns The current CubeInfo or undefined if not set
143
- */
144
- get cubeInfo(): CubeInfo | undefined;
145
- /**
146
- * The current transformation matrix of this element.
147
- */
148
- private _transform?;
149
- /**
150
- * The inverse of the current transformation matrix.
151
- * Used for converting world coordinates to local coordinates.
152
- */
153
- private _transformInv?;
154
- /**
155
- * Gets the current transformation matrix.
156
- * @returns The current transformation matrix or undefined if not set
157
- */
158
- get transform(): DOMMatrix | undefined;
159
- /**
160
- * Gets the inverse of the current transformation matrix.
161
- * @returns The inverse transformation matrix or undefined if not set
162
- */
163
- get transformInv(): DOMMatrix | undefined;
164
- /**
165
- * Processes events received from the WebSpatial environment.
166
- * Handles various spatial events like transforms, gestures, and interactions.
167
- * @param data The event data received from the WebSpatial system
168
- */
169
- protected onReceiveEvent(data: ReceiveEventData): void;
170
- private _onSpatialTap?;
171
- set onSpatialTap(value: (event: SpatialTapEvent) => void | undefined);
172
- private _onSpatialDragStart?;
173
- set onSpatialDragStart(value: (event: SpatialDragStartEvent) => void | undefined);
174
- private _onSpatialDrag?;
175
- set onSpatialDrag(value: (event: SpatialDragEvent) => void | undefined);
176
- private _onSpatialDragEnd?;
177
- set onSpatialDragEnd(value: ((event: SpatialDragEndEvent) => void) | undefined);
178
- private _onSpatialRotate?;
179
- set onSpatialRotate(value: ((event: SpatialRotateEvent) => void) | undefined);
180
- private _onSpatialRotateEnd?;
181
- set onSpatialRotateEnd(value: ((event: SpatialRotateEndEvent) => void) | undefined);
182
- private _onSpatialMagnify?;
183
- set onSpatialMagnify(value: ((event: SpatialMagnifyEvent) => void) | undefined);
184
- private _onSpatialMagnifyEnd?;
185
- set onSpatialMagnifyEnd(value: ((event: SpatialMagnifyEndEvent) => void) | undefined);
186
- /**
187
- * Cleans up resources when this element is destroyed.
188
- * Removes event receivers to prevent memory leaks.
189
- */
190
- onDestroy(): void;
191
- }
192
- type ReceiveEventData = SpatialTapMsg | SpatialDragStartMsg | SpatialDragMsg | SpatialDragEndMsg | SpatialRotateMsg | SpatialRotateEndMsg | ObjectDestroyMsg;
193
-
194
- declare class SpatializedDynamic3DElement extends SpatializedElement {
195
- children: SpatialEntityOrReality[];
196
- events: Record<string, (data: any) => void>;
197
- constructor(id: string);
198
- addEntity(entity: SpatialEntity): Promise<CommandResult>;
199
- addEvent(type: SpatialEntityEventType, callback: (data: any) => void): void;
200
- removeEvent(eventName: SpatialEntityEventType): void;
201
- dispatchEvent(evt: CustomEvent): void;
202
- updateProperties(properties: Partial<SpatializedElementProperties>): Promise<CommandResult>;
203
- }
204
-
205
- interface Vec3 {
206
- x: number;
207
- y: number;
208
- z: number;
209
- }
210
- type Point3D = Vec3;
211
- interface Quaternion {
212
- x: number;
213
- y: number;
214
- z: number;
215
- w: number;
216
- }
217
- /**
218
- * Material type for SpatialDiv or HTML document.
219
- *
220
- * This type defines the background material options for both SpatialDiv elements and HTML documents.
221
- *
222
- * - `'none'`: This is the default value.
223
- * - For HTML documents, the web page window will have the default native background.
224
- * - For SpatialDiv, the window will have a transparent background.
225
- * - `'translucent'`: Represents a glass-like material in AVP (Apple Vision Pro).
226
- * - `'thick'`: Represents a thick material in AVP.
227
- * - `'regular'`: Represents a regular material in AVP.
228
- * - `'thin'`: Represents a thin material in AVP.
229
- * - `'transparent'`: Represents a fully transparent background.
230
- */
231
- type BackgroundMaterialType = 'none' | 'translucent' | 'thick' | 'regular' | 'thin' | 'transparent';
232
- type CornerRadius = {
233
- topLeading: number;
234
- bottomLeading: number;
235
- topTrailing: number;
236
- bottomTrailing: number;
237
- };
238
- interface SpatialSceneProperties {
239
- cornerRadius: CornerRadius;
240
- material: BackgroundMaterialType;
241
- opacity: number;
242
- }
243
- declare enum SpatializedElementType {
244
- Spatialized2DElement = 0,
245
- SpatializedStatic3DElement = 1,
246
- SpatializedDynamic3DElement = 2
247
- }
248
- interface SpatializedElementProperties {
249
- name: string;
250
- clientX: number;
251
- clientY: number;
252
- width: number;
253
- height: number;
254
- depth: number;
255
- opacity: number;
256
- visible: boolean;
257
- scrollWithParent: boolean;
258
- zIndex: number;
259
- backOffset: number;
260
- rotationAnchor: Point3D;
261
- enableTapGesture: boolean;
262
- enableDragStartGesture: boolean;
263
- enableDragGesture: boolean;
264
- enableDragEndGesture: boolean;
265
- enableRotateGesture: boolean;
266
- enableRotateEndGesture: boolean;
267
- enableMagnifyGesture: boolean;
268
- enableMagnifyEndGesture: boolean;
269
- /**
270
- * Optional world-space axis for spatial rotate gesture. Omitted or zero vector
271
- * means unconstrained rotation (platform default).
272
- */
273
- rotateConstrainedToAxis?: Vec3;
274
- }
275
- interface Spatialized2DElementProperties extends SpatializedElementProperties {
276
- scrollPageEnabled: boolean;
277
- cornerRadius: CornerRadius;
278
- material: BackgroundMaterialType;
279
- scrollEdgeInsetsMarginRight: number;
280
- }
281
- interface ModelSource {
282
- src: string;
283
- type?: string;
284
- }
285
- interface SpatializedStatic3DElementProperties extends SpatializedElementProperties {
286
- modelURL: string;
287
- sources?: ModelSource[];
288
- modelTransform?: number[];
289
- autoplay?: boolean;
290
- loop?: boolean;
291
- animationPaused?: boolean;
292
- playbackRate?: number;
293
- }
294
- interface SpatialSceneCreationOptions$1 {
295
- defaultSize?: {
296
- width: number | string;
297
- height: number | string;
298
- depth?: number | string;
299
- };
300
- resizability?: {
301
- minWidth?: number | string;
302
- minHeight?: number | string;
303
- maxWidth?: number | string;
304
- maxHeight?: number | string;
305
- };
306
- worldScaling?: WorldScalingType;
307
- worldAlignment?: WorldAlignmentType;
308
- baseplateVisibility?: BaseplateVisibilityType;
309
- }
310
- type SpatialEntityEventType = 'spatialtap' | 'spatialdragstart' | 'spatialdrag' | 'spatialdragend' | 'spatialrotate' | 'spatialrotateend' | 'spatialmagnify' | 'spatialmagnifyend';
311
- declare const BaseplateVisibilityValues: readonly ["automatic", "visible", "hidden"];
312
- type BaseplateVisibilityType = (typeof BaseplateVisibilityValues)[number];
313
- declare function isValidBaseplateVisibilityType(type: string): Boolean;
314
- declare const WorldScalingValues: readonly ["automatic", "dynamic"];
315
- type WorldScalingType = (typeof WorldScalingValues)[number];
316
- declare function isValidWorldScalingType(type: string): Boolean;
317
- declare const WorldAlignmentValues: readonly ["adaptive", "automatic", "gravityAligned"];
318
- type WorldAlignmentType = (typeof WorldAlignmentValues)[number];
319
- declare function isValidWorldAlignmentType(type: string): Boolean;
320
- declare const SpatialSceneValues: readonly ["window", "volume"];
321
- type SpatialSceneType$1 = (typeof SpatialSceneValues)[number];
322
- declare function isValidSpatialSceneType(type: string): Boolean;
323
- /**
324
- * check px,m and number, number must be >= 0
325
- *
326
- * */
327
- declare function isValidSceneUnit(val: string | number): boolean;
328
- interface SpatialEntityProperties {
329
- position: Vec3;
330
- rotation: Vec3;
331
- scale: Vec3;
332
- }
333
- type SpatialGeometryType = 'BoxGeometry' | 'PlaneGeometry' | 'SphereGeometry' | 'CylinderGeometry' | 'ConeGeometry';
334
- interface SpatialBoxGeometryOptions {
335
- width?: number;
336
- height?: number;
337
- depth?: number;
338
- cornerRadius?: number;
339
- splitFaces?: boolean;
340
- }
341
- interface SpatialPlaneGeometryOptions {
342
- width?: number;
343
- height?: number;
344
- cornerRadius?: number;
345
- }
346
- interface SpatialSphereGeometryOptions {
347
- radius?: number;
348
- }
349
- interface SpatialConeGeometryOptions {
350
- radius?: number;
351
- height?: number;
352
- }
353
- interface SpatialCylinderGeometryOptions {
354
- radius?: number;
355
- height?: number;
356
- }
357
- type SpatialGeometryOptions = SpatialBoxGeometryOptions | SpatialPlaneGeometryOptions | SpatialSphereGeometryOptions | SpatialCylinderGeometryOptions | SpatialConeGeometryOptions;
358
- type SpatialMaterialType = 'unlit';
359
- interface SpatialUnlitMaterialOptions {
360
- color?: string;
361
- textureId?: string;
362
- transparent?: boolean;
363
- opacity?: number;
364
- }
365
- interface ModelComponentOptions {
366
- mesh: SpatialGeometry;
367
- materials: SpatialMaterial[];
368
- }
369
- interface SpatialEntityUserData {
370
- id?: string;
371
- name?: string;
372
- }
373
- interface SpatialModelEntityCreationOptions {
374
- modelAssetId: string;
375
- name?: string;
376
- }
377
- interface ModelAssetOptions {
378
- url: string;
379
- }
380
- declare enum SpatialSceneState$1 {
381
- idle = "idle",
382
- pending = "pending",
383
- willVisible = "willVisible",
384
- visible = "visible",
385
- fail = "fail"
386
- }
387
- /**
388
- * Translate event, matching similar behavior to https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drag_event
389
- */
390
- type SpatialModelDragEvent = {
391
- eventType: 'dragstart' | 'dragend' | 'drag';
392
- translation3D: Vec3;
393
- startLocation3D: Vec3;
394
- };
395
- interface Size {
396
- width: number;
397
- height: number;
398
- }
399
- interface Size3D extends Size {
400
- depth: number;
401
- }
402
- declare class CubeInfo {
403
- size: Size3D;
404
- origin: Vec3;
405
- constructor(size: Size3D, origin: Vec3);
406
- get x(): number;
407
- get y(): number;
408
- get z(): number;
409
- get width(): number;
410
- get height(): number;
411
- get depth(): number;
412
- get left(): number;
413
- get top(): number;
414
- get right(): number;
415
- get bottom(): number;
416
- get back(): number;
417
- get front(): number;
418
- }
419
- interface SpatialTapEventDetail {
420
- location3D: Point3D;
421
- globalLocation3D?: Point3D;
422
- }
423
- type SpatialTapEvent = CustomEvent<SpatialTapEventDetail>;
424
- interface SpatialDragStartEventDetail {
425
- startLocation3D: Point3D;
426
- globalLocation3D?: Point3D;
427
- }
428
- interface SpatialDragEventDetail {
429
- translation3D: Vec3;
430
- }
431
- interface SpatialDragEndEventDetail {
432
- }
433
- type SpatialDragStartEvent = CustomEvent<SpatialDragStartEventDetail>;
434
- type SpatialDragEvent = CustomEvent<SpatialDragEventDetail>;
435
- type SpatialDragEndEvent = CustomEvent<SpatialDragEndEventDetail>;
436
- interface SpatialRotateEventDetail {
437
- quaternion: Quaternion;
438
- }
439
- interface SpatialRotateEndEventDetail {
440
- }
441
- type SpatialRotateEvent = CustomEvent<SpatialRotateEventDetail>;
442
- type SpatialRotateEndEvent = CustomEvent<SpatialRotateEndEventDetail>;
443
- interface SpatialMagnifyEventDetail {
444
- magnification: number;
445
- }
446
- interface SpatialMagnifyEndEventDetail {
447
- }
448
- type SpatialMagnifyEvent = CustomEvent<SpatialMagnifyEventDetail>;
449
- type SpatialMagnifyEndEvent = CustomEvent<SpatialMagnifyEndEventDetail>;
450
- type SpatialEntityOrReality = SpatialEntity | SpatializedDynamic3DElement;
451
- interface AttachmentEntityOptions {
452
- parentEntityId: string;
453
- position?: [number, number, number];
454
- size: {
455
- width: number;
456
- height: number;
457
- };
458
- ownerViewId: string;
459
- }
460
- interface AttachmentEntityUpdateOptions {
461
- position?: [number, number, number];
462
- size?: {
463
- width: number;
464
- height: number;
465
- };
466
- }
467
- type SceneUnitPx = `${number}px`;
468
- type SceneUnitM = `${number}m`;
469
- type SceneUnit = number | SceneUnitPx | SceneUnitM;
470
- interface XRSceneSize {
471
- width: SceneUnit;
472
- height: SceneUnit;
473
- depth?: SceneUnit;
474
- }
475
- interface XRSceneResizability {
476
- minWidth?: SceneUnit;
477
- minHeight?: SceneUnit;
478
- maxWidth?: SceneUnit;
479
- maxHeight?: SceneUnit;
480
- }
481
- interface XRMainSceneConfig extends XRSpatialSceneDefaults {
482
- type?: SpatialSceneType$1;
483
- }
484
- interface XRSpatialSceneDefaults {
485
- default_size?: XRSceneSize;
486
- resizability?: XRSceneResizability;
487
- worldScaling?: WorldScalingType;
488
- worldAlignment?: WorldAlignmentType;
489
- baseplateVisibility?: BaseplateVisibilityType;
490
- }
491
- interface XRSpatialSceneOverrides {
492
- window_scene?: XRSpatialSceneDefaults;
493
- volume_scene?: XRSpatialSceneDefaults;
494
- }
495
- interface XRSpatialSceneConfig extends XRSpatialSceneDefaults {
496
- overrides?: XRSpatialSceneOverrides;
497
- }
498
- interface XRPrdConfig {
499
- xr_main_scene?: XRMainSceneConfig;
500
- xr_spatial_scene?: XRSpatialSceneConfig;
501
- }
502
- interface PWAManifest extends XRPrdConfig {
503
- name?: string;
504
- short_name?: string;
505
- start_url?: string;
506
- display?: string;
507
- icons?: Array<{
508
- src: string;
509
- sizes?: string;
510
- type?: string;
511
- purpose?: string;
512
- }>;
513
- id?: string;
514
- scope?: string;
515
- [key: string]: any;
516
- }
517
-
518
- declare class SpatialComponent extends SpatialObject {
519
- constructor(id: string);
520
- private onReceiveEvent;
521
- }
522
-
523
- declare class SpatialEntity extends SpatialObject {
524
- userData?: SpatialEntityUserData | undefined;
525
- position: Vec3;
526
- rotation: Vec3;
527
- scale: Vec3;
528
- events: Record<string, (data: any) => void>;
529
- children: SpatialEntity[];
530
- parent: SpatialEntityOrReality | null;
531
- private _enableInput;
532
- get enableInput(): boolean;
533
- set enableInput(value: boolean);
534
- constructor(id: string, userData?: SpatialEntityUserData | undefined);
535
- addComponent(component: SpatialComponent): Promise<CommandResult>;
536
- removeComponent(component: SpatialComponent): Promise<CommandResult>;
537
- setPosition(position: Vec3): Promise<CommandResult>;
538
- setRotation(rotation: Vec3): Promise<CommandResult>;
539
- setScale(scale: Vec3): Promise<CommandResult>;
540
- addEntity(ent: SpatialEntity): Promise<CommandResult>;
541
- removeFromParent(): Promise<CommandResult>;
542
- updateTransform(properties: Partial<SpatialEntityProperties>): Promise<CommandResult>;
543
- addEvent(type: SpatialEntityEventType, callback: (data: any) => void): Promise<void>;
544
- removeEvent(eventName: SpatialEntityEventType): Promise<void>;
545
- updateEntityEvent(eventName: SpatialEntityEventType, isEnable: boolean): Promise<CommandResult>;
546
- private onReceiveEvent;
547
- dispatchEvent(evt: CustomEvent): void;
548
- protected onDestroy(): void;
549
- convertFromEntityToEntity(fromEntityId: string, toEntityId: string, position: Vec3): Promise<CommandResult>;
550
- convertFromEntityToScene(fromEntityId: string, position: Vec3): Promise<CommandResult>;
551
- convertFromSceneToEntity(entityId: string, position: Vec3): Promise<CommandResult>;
552
- }
553
-
554
- declare class SpatialModelEntity extends SpatialEntity {
555
- id: string;
556
- options?: SpatialModelEntityCreationOptions | undefined;
557
- userData?: SpatialEntityUserData | undefined;
558
- constructor(id: string, options?: SpatialModelEntityCreationOptions | undefined, userData?: SpatialEntityUserData | undefined);
559
- setMaterials(materials: SpatialMaterial[]): Promise<CommandResult>;
560
- }
561
-
562
- declare class ModelComponent extends SpatialComponent {
563
- options: ModelComponentOptions;
564
- constructor(id: string, options: ModelComponentOptions);
565
- }
566
-
567
- declare class SpatialUnlitMaterial extends SpatialMaterial {
568
- id: string;
569
- options: SpatialUnlitMaterialOptions;
570
- constructor(id: string, options: SpatialUnlitMaterialOptions);
571
- updateProperties(properties: Partial<SpatialUnlitMaterialOptions>): Promise<CommandResult>;
572
- }
573
-
574
- declare class SpatialBoxGeometry extends SpatialGeometry {
575
- id: string;
576
- options: SpatialBoxGeometryOptions;
577
- static type: SpatialGeometryType;
578
- constructor(id: string, options: SpatialBoxGeometryOptions);
579
- }
580
-
581
- declare class SpatialSphereGeometry extends SpatialGeometry {
582
- id: string;
583
- options: SpatialSphereGeometryOptions;
584
- static type: SpatialGeometryType;
585
- constructor(id: string, options: SpatialSphereGeometryOptions);
586
- }
587
-
588
- declare class SpatialCylinderGeometry extends SpatialGeometry {
589
- id: string;
590
- options: SpatialCylinderGeometryOptions;
591
- static type: SpatialGeometryType;
592
- constructor(id: string, options: SpatialCylinderGeometryOptions);
593
- }
594
-
595
- declare class SpatialPlaneGeometry extends SpatialGeometry {
596
- id: string;
597
- options: SpatialPlaneGeometryOptions;
598
- static type: SpatialGeometryType;
599
- constructor(id: string, options: SpatialPlaneGeometryOptions);
600
- }
601
-
602
- declare class SpatialConeGeometry extends SpatialGeometry {
603
- id: string;
604
- options: SpatialConeGeometryOptions;
605
- static type: SpatialGeometryType;
606
- constructor(id: string, options: SpatialConeGeometryOptions);
607
- }
608
-
609
- declare class SpatialModelAsset extends SpatialObject {
610
- id: string;
611
- options: ModelAssetOptions;
612
- constructor(id: string, options: ModelAssetOptions);
613
- }
614
-
615
- declare class Attachment extends SpatialObject {
616
- private readonly windowProxy;
617
- private options;
618
- constructor(id: string, windowProxy: WindowProxy, options: AttachmentEntityOptions);
619
- getContainer(): HTMLElement;
620
- getWindowProxy(): WindowProxy;
621
- update(options: AttachmentEntityUpdateOptions): Promise<CommandResult | undefined>;
622
- }
623
- declare function createAttachmentEntity(options: AttachmentEntityOptions): Promise<Attachment>;
624
-
625
- type SpatialSceneCreationOptionsInternal = SpatialSceneCreationOptions$1 & {
626
- type: SpatialSceneType$1;
627
- };
628
- declare enum SpatialSceneState {
629
- idle = "idle",
630
- pending = "pending",
631
- willVisible = "willVisible",
632
- visible = "visible",
633
- fail = "fail"
634
- }
635
-
636
- declare function initScene(name: string, callback: (pre: SpatialSceneCreationOptions$1) => SpatialSceneCreationOptions$1, options?: {
637
- type: SpatialSceneType$1;
638
- }): void;
639
-
640
- /**
641
- * Represents the spatial scene that contains all spatialized elements.
642
- * This class follows the singleton pattern - only one instance exists per application.
643
- * The scene manages the overall spatial environment properties and contains all spatial elements.
644
- */
645
- declare class SpatialScene extends SpatialObject {
646
- /**
647
- * Gets the singleton instance of the SpatialScene.
648
- * Creates a new instance if one doesn't exist yet.
649
- * @returns The singleton SpatialScene instance
650
- */
651
- static getInstance(): SpatialScene;
652
- convertCoordinate(position: Vec3, fromId: string, toId: string): Promise<Vec3>;
653
- /**
654
- * Updates the properties of the spatial scene.
655
- * This can include background settings, lighting, and other scene-wide properties.
656
- * @param properties Partial set of properties to update
657
- * @returns Promise resolving when the update is complete
658
- */
659
- updateSpatialProperties(properties: Partial<SpatialSceneProperties>): Promise<CommandResult>;
660
- /**
661
- * Adds a spatialized element to the scene.
662
- * This makes the element visible and interactive in the spatial environment.
663
- * @param element The SpatializedElement to add to the scene
664
- * @returns Promise resolving when the element is added
665
- */
666
- addSpatializedElement(element: SpatializedElement): Promise<CommandResult>;
667
- /**
668
- * Updates the scene creation configuration.
669
- * This allows changing scene parameters after initial creation.
670
- * @param config The new scene creation configuration
671
- * @returns Promise resolving when the update is complete
672
- */
673
- updateSceneCreationConfig(config: SpatialSceneCreationOptionsInternal): Promise<CommandResult>;
674
- /**
675
- * Gets the current state of the spatial scene.
676
- * This includes information about active elements and scene configuration.
677
- * @returns Promise resolving to the current SpatialSceneState
678
- */
679
- getState(): Promise<SpatialSceneState>;
680
- }
681
-
682
- /**
683
- * Represents a 2D HTML element that has been spatialized in 3D space.
684
- * This class handles the integration between 2D web content and the 3D spatial environment,
685
- * allowing HTML elements to be positioned and interacted with in spatial applications.
686
- */
687
- declare class Spatialized2DElement extends SpatializedElement {
688
- readonly windowProxy: WindowProxy;
689
- /**
690
- * Creates a new spatialized 2D element.
691
- * @param id Unique identifier for this element
692
- * @param windowProxy Reference to the window object containing the 2D content
693
- */
694
- constructor(id: string, windowProxy: WindowProxy);
695
- /**
696
- * Updates the properties of this 2D element.
697
- * This can include size, position, background, and other visual properties.
698
- * @param properties Partial set of properties to update
699
- * @returns Promise resolving when the update is complete
700
- */
701
- updateProperties(properties: Partial<Spatialized2DElementProperties>): Promise<CommandResult>;
702
- /**
703
- * Adds a child spatialized element to this 2D element.
704
- * This allows for creating hierarchical structures of spatial elements.
705
- * @param element The child element to add
706
- * @returns Promise resolving when the element is added
707
- */
708
- addSpatializedElement(element: SpatializedElement): Promise<CommandResult>;
709
- }
710
-
711
- /**
712
- * Represents a static 3D model element in the spatial environment.
713
- * This class handles loading and displaying pre-built 3D models from URLs,
714
- * and provides events for load success and failure.
715
- */
716
- declare class SpatializedStatic3DElement extends SpatializedElement {
717
- /**
718
- * Creates a new spatialized static 3D element with the specified ID and URL.
719
- * Registers the element to receive spatial events.
720
- * @param id Unique identifier for this element
721
- * @param modelURL URL of the 3D model
722
- * @param sources Optional fallback model sources
723
- */
724
- constructor(id: string, modelURL?: string, sources?: ModelSource[]);
725
- /**
726
- * Promise resolver for the ready state.
727
- * Used to resolve the ready promise when the model is loaded.
728
- */
729
- private _readyResolve?;
730
- /**
731
- * Caches the last model URL to detect changes.
732
- * Used to reset the ready promise when the model URL changes.
733
- */
734
- private modelURL?;
735
- /**
736
- * Caches the last sources array to detect changes.
737
- */
738
- private sources?;
739
- /**
740
- * The model URL that was successfully loaded by the native runtime.
741
- */
742
- private _currentSrc;
743
- get currentSrc(): string;
744
- /**
745
- * Creates a new promise for tracking the ready state of the model.
746
- * @returns Promise that resolves when the model is loaded (true) or fails to load (false)
747
- */
748
- private createReadyPromise;
749
- /**
750
- * Promise that resolves when the model is loaded.
751
- * Resolves to true on successful load, false on failure.
752
- */
753
- ready: Promise<boolean>;
754
- /**
755
- * Updates the properties of this static 3D element.
756
- * Handles special case for modelURL changes by resetting the ready promise.
757
- * @param properties Partial set of properties to update
758
- * @returns Promise resolving when the update is complete
759
- */
760
- updateProperties(properties: Partial<SpatializedStatic3DElementProperties>): Promise<CommandResult>;
761
- /**
762
- * Total animation duration in seconds, synced from native.
763
- */
764
- private _duration;
765
- /**
766
- * Returns the total animation duration in seconds.
767
- */
768
- get duration(): number;
769
- /**
770
- * Playback speed multiplier.
771
- */
772
- private _playbackRate;
773
- /**
774
- * Returns the current playback rate.
775
- */
776
- get playbackRate(): number;
777
- /**
778
- * Sets the playback rate and sends it to native.
779
- */
780
- set playbackRate(value: number);
781
- /**
782
- * Whether the animation is currently paused.
783
- */
784
- private _paused;
785
- /**
786
- * Returns whether the animation is currently paused.
787
- */
788
- get paused(): boolean;
789
- /**
790
- * Callback for animation state changes.
791
- */
792
- private _onAnimationStateChangeCallback?;
793
- /**
794
- * Sets the callback for animation state changes.
795
- */
796
- set onAnimationStateChangeCallback(callback: undefined | ((detail: AnimationStateChangeDetail) => void));
797
- /**
798
- * Starts or resumes animation playback.
799
- * @returns Promise resolving when the command is sent
800
- */
801
- play(): Promise<void>;
802
- /**
803
- * Pauses animation playback.
804
- * @returns Promise resolving when the command is sent
805
- */
806
- pause(): Promise<void>;
807
- /**
808
- * Processes events received from the WebSpatial environment.
809
- * Handles model loading events in addition to base spatial events.
810
- * @param data The event data received from the WebSpatial system
811
- */
812
- onReceiveEvent(data: Static3DReceiveEventData): void;
813
- /**
814
- * Whether the model should automatically play its first animation on load.
815
- */
816
- private _autoplay;
817
- /**
818
- * Returns whether autoplay is enabled for this element.
819
- */
820
- get autoplay(): boolean;
821
- /**
822
- * Whether the model animation should loop continuously.
823
- */
824
- private _loop;
825
- /**
826
- * Returns whether loop is enabled for this element.
827
- */
828
- get loop(): boolean;
829
- /**
830
- * Callback function for successful model loading.
831
- */
832
- private _onLoadCallback?;
833
- /**
834
- * Sets the callback function for successful model loading.
835
- * @param callback Function to call when the model is loaded successfully
836
- */
837
- set onLoadCallback(callback: undefined | (() => void));
838
- /**
839
- * Callback function for model loading failure.
840
- */
841
- private _onLoadFailureCallback?;
842
- /**
843
- * Sets the callback function for model loading failure.
844
- * @param callback Function to call when the model fails to load
845
- */
846
- set onLoadFailureCallback(callback: undefined | (() => void));
847
- updateModelTransform(transform: DOMMatrixReadOnly): void;
848
- }
849
- type Static3DReceiveEventData = ModelLoadSuccess | ModelLoadFailure | ReceiveEventData | AnimationStateChangeMsg;
850
-
851
- /**
852
- * Session used to establish a connection to the spatial renderer of the system.
853
- * All spatial resources must be created through this session object.
854
- * This class serves as the main factory for creating spatial elements and geometries.
855
- */
856
- declare class SpatialSession {
857
- /**
858
- * Gets the singleton instance of the spatial scene.
859
- * The spatial scene is the root container for all spatial elements.
860
- * @returns The SpatialScene singleton instance
861
- */
862
- getSpatialScene(): SpatialScene;
863
- /**
864
- * Creates a new 2D element that can be spatialized in the 3D environment.
865
- * 2D elements represent HTML content that can be positioned in 3D space.
866
- * @returns Promise resolving to a new Spatialized2DElement instance
867
- */
868
- createSpatialized2DElement(): Promise<Spatialized2DElement>;
869
- /**
870
- * Creates a new static 3D element with an optional model URL.
871
- * Static 3D elements represent pre-built 3D models that can be loaded from a URL.
872
- * @param modelURL Optional URL to the 3D model to load
873
- * @returns Promise resolving to a new SpatializedStatic3DElement instance
874
- */
875
- createSpatializedStatic3DElement(modelURL?: string, sources?: ModelSource[]): Promise<SpatializedStatic3DElement>;
876
- /**
877
- * Initializes the spatial scene with custom configuration.
878
- * This is a reference to the initScene function from scene-polyfill.
879
- */
880
- initScene: typeof initScene;
881
- /**
882
- * Creates a new dynamic 3D element that can be manipulated at runtime.
883
- * Dynamic 3D elements allow for programmatic creation and modification of 3D content.
884
- * @returns Promise resolving to a new SpatializedDynamic3DElement instance
885
- */
886
- createSpatializedDynamic3DElement(): Promise<SpatializedDynamic3DElement>;
887
- /**
888
- * Creates a new spatial entity with an optional name.
889
- * Entities are the basic building blocks for creating custom 3D content.
890
- * @param name Optional name for the entity
891
- * @returns Promise resolving to a new SpatialEntity instance
892
- */
893
- createEntity(userData?: SpatialEntityUserData): Promise<SpatialEntity>;
894
- /**
895
- * Creates a box geometry with optional configuration.
896
- * @param options Configuration options for the box geometry
897
- * @returns Promise resolving to a new SpatialBoxGeometry instance
898
- */
899
- createBoxGeometry(options?: SpatialBoxGeometryOptions): Promise<SpatialBoxGeometry>;
900
- /**
901
- * Creates a plane geometry with optional configuration.
902
- * @param options Configuration options for the plane geometry
903
- * @returns Promise resolving to a new SpatialPlaneGeometry instance
904
- */
905
- createPlaneGeometry(options?: SpatialPlaneGeometryOptions): Promise<SpatialPlaneGeometry>;
906
- /**
907
- * Creates a sphere geometry with optional configuration.
908
- * @param options Configuration options for the sphere geometry
909
- * @returns Promise resolving to a new SpatialSphereGeometry instance
910
- */
911
- createSphereGeometry(options?: SpatialSphereGeometryOptions): Promise<SpatialSphereGeometry>;
912
- /**
913
- * Creates a cone geometry with the specified configuration.
914
- * @param options Configuration options for the cone geometry
915
- * @returns Promise resolving to a new SpatialConeGeometry instance
916
- */
917
- createConeGeometry(options: SpatialConeGeometryOptions): Promise<SpatialConeGeometry>;
918
- /**
919
- * Creates a cylinder geometry with the specified configuration.
920
- * @param options Configuration options for the cylinder geometry
921
- * @returns Promise resolving to a new SpatialCylinderGeometry instance
922
- */
923
- createCylinderGeometry(options: SpatialCylinderGeometryOptions): Promise<SpatialCylinderGeometry>;
924
- /**
925
- * Creates a model component with the specified configuration.
926
- * Model components are used to add 3D model rendering capabilities to entities.
927
- * @param options Configuration options for the model component
928
- * @returns Promise resolving to a new ModelComponent instance
929
- */
930
- createModelComponent(options: ModelComponentOptions): Promise<ModelComponent>;
931
- /**
932
- * Creates an unlit material with the specified configuration.
933
- * Unlit materials don't respond to lighting in the scene.
934
- * @param options Configuration options for the unlit material
935
- * @returns Promise resolving to a new SpatialUnlitMaterial instance
936
- */
937
- createUnlitMaterial(options: SpatialUnlitMaterialOptions): Promise<SpatialUnlitMaterial>;
938
- /**
939
- * Creates a model asset with the specified configuration.
940
- * Model assets represent 3D model resources that can be used by entities.
941
- * @param options Configuration options for the model asset
942
- * @returns Promise resolving to a new SpatialModelAsset instance
943
- */
944
- createModelAsset(options: ModelAssetOptions): Promise<SpatialModelAsset>;
945
- /**
946
- * Creates a spatial model entity with the specified configuration.
947
- * This is a convenience method for creating an entity with a model component.
948
- * @param options Configuration options for the spatial model entity
949
- * @returns Promise resolving to a new SpatialModelEntity instance
950
- */
951
- createSpatialModelEntity(options: SpatialModelEntityCreationOptions, userData?: SpatialEntityUserData): Promise<SpatialModelEntity>;
952
- /**
953
- * Creates an attachment entity that renders 2D HTML content as a child
954
- * of a 3D entity in the scene graph.
955
- * @param options Configuration options including parent entity ID, position, and size
956
- * @returns Promise resolving to a new Attachment instance
957
- */
958
- createAttachmentEntity(options: AttachmentEntityOptions): Promise<Attachment>;
959
- }
960
-
961
- /**
962
- * Base object designed to be placed on navigator.spatial to mirror navigator.xr for webxr.
963
- * This is the main entry point for the WebSpatial SDK, providing access to spatial capabilities.
964
- */
965
- declare class Spatial {
966
- private wsAppShellVersionFromUA;
967
- /**
968
- * Requests a spatial session object from the browser.
969
- * This is the primary method to initialize spatial functionality.
970
- * @returns The SpatialSession instance or null if not available in the current browser
971
- * [TODO] discuss implications of this not being async
972
- */
973
- requestSession(): SpatialSession | null;
974
- /**
975
- * Checks if the current page is running in a spatial web environment.
976
- * This method detects if the application is running in a WebSpatial-compatible browser.
977
- * @returns True if running in a spatial web environment, false otherwise
978
- */
979
- runInSpatialWeb(): boolean;
980
- getShellVersionFromUA(): string | null;
981
- /** @deprecated
982
- * Checks if WebSpatial is supported in the current environment.
983
- * Verifies compatibility between native and client versions.
984
- * @returns True if web spatial is supported by this webpage
985
- */
986
- isSupported(): boolean;
987
- /** @deprecated
988
- * Gets the native WebSpatial version from the browser environment.
989
- * The version format follows semantic versioning (x.x.x).
990
- * @returns Native version string in format "x.x.x"
991
- */
992
- getNativeVersion(): any;
993
- /** @deprecated
994
- * Gets the client SDK version.
995
- * The version format follows semantic versioning (x.x.x).
996
- * @returns Client SDK version string in format "x.x.x"
997
- */
998
- getClientVersion(): string;
999
- }
1000
-
1001
- type PhysicalMetricsValueShape = {
1002
- meterToPtUnscaled: number;
1003
- meterToPtScaled: number;
1004
- };
1005
- type WorldScalingCompensation = 'unscaled' | 'scaled';
1006
- type ConvertOption = {
1007
- worldScalingCompensation: WorldScalingCompensation;
1008
- };
1009
- /**
1010
- * Converts scene points (pt) to physical meters (m).
1011
- *
1012
- * @param point Points value to convert.
1013
- * @param options Optional conversion options to select world scaling compensation.
1014
- * @returns Physical length in meters.
1015
- */
1016
- declare function pointToPhysical(point: number, options?: ConvertOption): number;
1017
- /**
1018
- * Converts physical meters (m) to scene points (pt).
1019
- *
1020
- * @param physical Physical length in meters to convert.
1021
- * @param options Optional conversion options to select world scaling compensation.
1022
- * @returns Points length in the scene.
1023
- */
1024
- declare function physicalToPoint(physical: number, options?: ConvertOption): number;
1025
- /**
1026
- * Returns the current physical metrics used for conversions.
1027
- *
1028
- * @returns The current metrics snapshot `{ meterToPtUnscaled, meterToPtScaled }`.
1029
- */
1030
- declare function getValue(): PhysicalMetricsValueShape;
1031
- /**
1032
- * Subscribes to physical metrics changes.
1033
- *
1034
- * @param cb Callback invoked when metrics update is detected.
1035
- * @returns Unsubscribe function to remove the listener.
1036
- */
1037
- declare function subscribe(cb: () => void): () => void;
1038
-
1039
- type physicalMetrics_PhysicalMetricsValueShape = PhysicalMetricsValueShape;
1040
- declare const physicalMetrics_getValue: typeof getValue;
1041
- declare const physicalMetrics_physicalToPoint: typeof physicalToPoint;
1042
- declare const physicalMetrics_pointToPhysical: typeof pointToPhysical;
1043
- declare const physicalMetrics_subscribe: typeof subscribe;
1044
- declare namespace physicalMetrics {
1045
- export { type physicalMetrics_PhysicalMetricsValueShape as PhysicalMetricsValueShape, physicalMetrics_getValue as getValue, physicalMetrics_physicalToPoint as physicalToPoint, physicalMetrics_pointToPhysical as pointToPhysical, physicalMetrics_subscribe as subscribe };
1046
- }
1047
-
1048
- declare global {
1049
- declare const __WEBSPATIAL_CORE_SDK_VERSION__: string
1050
-
1051
- interface Window {
1052
- xrCurrentSceneType: SpatialSceneType
1053
- xrCurrentSceneDefaults: (
1054
- defaultConfig: SpatialSceneCreationOptions,
1055
- ) => Promise<SpatialSceneCreationOptions>
1056
-
1057
- // Location for webspatial custom functions
1058
- __WebSpatialData: {
1059
- androidNativeMessage: Function
1060
- getNativeVersion: Function
1061
- }
1062
-
1063
- // Location for webspatial internal callbacks (eg. completion events)
1064
- __SpatialWebEvent: Function
1065
-
1066
- // Used to access webkit specific api
1067
- webkit: any
1068
- webspatialBridge: any
1069
-
1070
- // Project Pico OS browser injects this global object to provide internal capabilities.
1071
- webSpatial?: {
1072
- genToken?: () => string
1073
- }
1074
- __webspatialShell__?: {
1075
- genToken?: () => string
1076
- }
1077
-
1078
- // Will be removed in favor of __WebSpatialData
1079
- WebSpatailNativeVersion: string
1080
-
1081
- __webspatialsdk__?: {
1082
- XR_ENV?: string
1083
- 'natvie-version'?: string
1084
- 'react-sdk-version'?: string
1085
- 'core-sdk-version'?: string
1086
- physicalMetrics?: PhysicalMetricsValueShape
1087
- }
1088
-
1089
- xrInnerDepth: number
1090
- xrOuterDepth: number
1091
- }
1092
-
1093
- interface HTMLElement {
1094
- xrOffsetBack: number
1095
- xrClientDepth: number
1096
- }
1097
- }
1098
-
1099
- declare const isSSREnv: () => boolean;
1100
-
1101
- export { Attachment, type AttachmentEntityOptions, type AttachmentEntityUpdateOptions, type BackgroundMaterialType, type BaseplateVisibilityType, BaseplateVisibilityValues, type CornerRadius, CubeInfo, type ModelAssetOptions, ModelComponent, type ModelComponentOptions, type ModelSource, type PWAManifest, physicalMetrics as PhysicalMetrics, type Point3D, type Quaternion, type SceneUnit, type SceneUnitM, type SceneUnitPx, type Size, type Size3D, Spatial, SpatialBoxGeometry, type SpatialBoxGeometryOptions, SpatialComponent, SpatialConeGeometry, type SpatialConeGeometryOptions, SpatialCylinderGeometry, type SpatialCylinderGeometryOptions, type SpatialDragEndEvent, type SpatialDragEndEventDetail, type SpatialDragEvent, type SpatialDragEventDetail, type SpatialDragStartEvent, type SpatialDragStartEventDetail, SpatialEntity, type SpatialEntityEventType, type SpatialEntityOrReality, type SpatialEntityProperties, type SpatialEntityUserData, SpatialGeometry, type SpatialGeometryOptions, type SpatialGeometryType, type SpatialMagnifyEndEvent, type SpatialMagnifyEndEventDetail, type SpatialMagnifyEvent, type SpatialMagnifyEventDetail, SpatialMaterial, type SpatialMaterialType, SpatialModelAsset, type SpatialModelDragEvent, SpatialModelEntity, type SpatialModelEntityCreationOptions, SpatialObject, SpatialPlaneGeometry, type SpatialPlaneGeometryOptions, type SpatialRotateEndEvent, type SpatialRotateEndEventDetail, type SpatialRotateEvent, type SpatialRotateEventDetail, SpatialScene, type SpatialSceneCreationOptions$1 as SpatialSceneCreationOptions, type SpatialSceneProperties, SpatialSceneState$1 as SpatialSceneState, type SpatialSceneType$1 as SpatialSceneType, SpatialSceneValues, SpatialSession, SpatialSphereGeometry, type SpatialSphereGeometryOptions, type SpatialTapEvent, type SpatialTapEventDetail, SpatialUnlitMaterial, type SpatialUnlitMaterialOptions, Spatialized2DElement, type Spatialized2DElementProperties, SpatializedDynamic3DElement, SpatializedElement, type SpatializedElementProperties, SpatializedElementType, SpatializedStatic3DElement, type SpatializedStatic3DElementProperties, type Vec3, type WorldAlignmentType, WorldAlignmentValues, type WorldScalingType, WorldScalingValues, type XRMainSceneConfig, type XRPrdConfig, type XRSceneResizability, type XRSceneSize, type XRSpatialSceneConfig, type XRSpatialSceneDefaults, type XRSpatialSceneOverrides, createAttachmentEntity, isSSREnv, isValidBaseplateVisibilityType, isValidSceneUnit, isValidSpatialSceneType, isValidWorldAlignmentType, isValidWorldScalingType };
1
+ import './types/global.js';
2
+ export { SpatialObject } from './SpatialObject.js';
3
+ export { Spatial } from './Spatial.js';
4
+ export { SpatialSession } from './SpatialSession.js';
5
+ export { SpatialScene } from './SpatialScene.js';
6
+ export { A as AnimateTransformCommand, a as AnimateTransformResult, b as AnimatedProps, c as AnimatedPropsInternal, d as AnimationApi, e as AnimationConfig, f as AnimationError, g as AnimationPlayState, h as AttachmentEntityOptions, i as AttachmentEntityUpdateOptions, B as BackgroundMaterialType, j as BaseplateVisibilityType, k as BaseplateVisibilityValues, C as CornerRadius, l as CubeInfo, F as Float4x4, M as ModelAssetOptions, m as ModelComponentOptions, n as ModelLoadingMode, o as ModelSource, P as PWAManifest, p as Point3D, Q as Quaternion, S as SceneUnit, q as SceneUnitM, r as SceneUnitPx, s as Size, t as Size3D, u as SpatialBoxGeometryOptions, v as SpatialConeGeometryOptions, w as SpatialCylinderGeometryOptions, x as SpatialDragEndEvent, y as SpatialDragEndEventDetail, z as SpatialDragEvent, D as SpatialDragEventDetail, E as SpatialDragStartEvent, G as SpatialDragStartEventDetail, H as SpatialEntity, I as SpatialEntityEventType, J as SpatialEntityOrReality, K as SpatialEntityProperties, L as SpatialEntityUserData, N as SpatialGeometry, O as SpatialGeometryOptions, R as SpatialGeometryType, T as SpatialMagnifyEndEvent, U as SpatialMagnifyEndEventDetail, V as SpatialMagnifyEvent, W as SpatialMagnifyEventDetail, X as SpatialMaterial, Y as SpatialMaterialType, Z as SpatialModelDragEvent, _ as SpatialModelEntityCreationOptions, $ as SpatialPlaneGeometryOptions, a0 as SpatialRotateEndEvent, a1 as SpatialRotateEndEventDetail, a2 as SpatialRotateEvent, a3 as SpatialRotateEventDetail, a4 as SpatialSceneCreationOptions, a5 as SpatialSceneProperties, a6 as SpatialSceneState, a7 as SpatialSceneType, a8 as SpatialSceneValues, a9 as SpatialSphereGeometryOptions, aa as SpatialTapEvent, ab as SpatialTapEventDetail, ac as SpatialTextureResourceOptions, ad as SpatialUnlitMaterialOptions, ae as Spatialized2DElementProperties, af as SpatializedDynamic3DElement, ag as SpatializedElement, ah as SpatializedElementProperties, ai as SpatializedElementType, aj as SpatializedMotionConfig, ak as SpatializedMotionKind, al as SpatializedMotionPlayState, am as SpatializedMotionSegmentConfig, an as SpatializedMotionTimelineConfig, ao as SpatializedPlaybackApi, ap as SpatializedStatic3DElementProperties, aq as StageMode, ar as TimingFunction, as as TransformValues, at as Vec3, au as WorldAlignmentType, av as WorldAlignmentValues, aw as WorldScalingType, ax as WorldScalingValues, ay as XRMainSceneConfig, az as XRPrdConfig, aA as XRSceneResizability, aB as XRSceneSize, aC as XRSpatialSceneConfig, aD as XRSpatialSceneDefaults, aE as XRSpatialSceneOverrides, aF as isValidBaseplateVisibilityType, aG as isValidSceneUnit, aH as isValidSpatialSceneType, aI as isValidWorldAlignmentType, aJ as isValidWorldScalingType } from './spatializedElementMotion-_0XWPQCE.js';
7
+ export { Spatialized2DElement } from './Spatialized2DElement.js';
8
+ export { SpatializedStatic3DElement } from './SpatializedStatic3DElement.js';
9
+ export { p as PhysicalMetrics } from './physicalMetrics-W5uZ5xKb.js';
10
+ export { SpatialModelEntity } from './reality/entity/SpatialModelEntity.js';
11
+ export { SpatialComponent } from './reality/component/SpatialComponent.js';
12
+ export { ModelComponent } from './reality/component/ModelComponent.js';
13
+ export { SpatialUnlitMaterial } from './reality/material/SpatialUnlitMaterial.js';
14
+ export { SpatialBoxGeometry } from './reality/geometry/SpatialBoxGeometry.js';
15
+ export { SpatialSphereGeometry } from './reality/geometry/SpatialSphereGeometry.js';
16
+ export { SpatialCylinderGeometry } from './reality/geometry/SpatialCylinderGeometry.js';
17
+ export { SpatialPlaneGeometry } from './reality/geometry/SpatialPlaneGeometry.js';
18
+ export { SpatialConeGeometry } from './reality/geometry/SpatialConeGeometry.js';
19
+ export { SpatialModelAsset } from './reality/resource/SpatialModelAsset.js';
20
+ export { SpatialTextureResource } from './reality/resource/SpatialTextureResource.js';
21
+ export { Attachment, createAttachmentEntity } from './reality/Attachment.js';
22
+ export { SpatializedVisualTransform, SpatializedVisualValues } from './types/motion/spatializedVisual.js';
23
+ export { SpatializedPlaybackError } from './types/motion/spatializedPlayback.js';
24
+ export { validateSpatializedMotionConfig } from './motion/compute/validate.js';
25
+ export { WebSpatialRuntimeSnapshot, WebSpatialRuntimeType } from './runtime/types.js';
26
+ export { WebSpatialRuntimeError } from './runtime/WebSpatialRuntimeError.js';
27
+ export { VISIONOS_DEBUG_SHELL_VERSION_PLACEHOLDER, getRuntime, resetRuntimeCacheForTests, supports } from './runtime/supports.js';
28
+ export { compareSemver, parseSemverOrNull } from './runtime/semver.js';
29
+ export { computeRuntimeFromUserAgent, parseShellToken } from './runtime/userAgent.js';
30
+ export { JsbAdapterPlatformKind, resolveJsbAdapterPlatform } from './runtime/jsbAdapterPlatform.js';
31
+ export { CAPABILITY_TABLE, CapabilityVersionRow } from './runtime/capability-data.js';
32
+ export { CapabilityKey } from './runtime/keys.js';
33
+ export { composeSRT, decomposeSRT } from './utils.js';
34
+ export { isSSREnv } from './isSSREnv.js';
35
+ import './scene-polyfill.js';