@webspatial/core-sdk 1.7.0 → 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 (296) hide show
  1. package/CHANGELOG.md +61 -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 -1251
  43. package/dist/index.js +21 -3650
  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 +132 -5
  241. package/src/SpatialObject.ts +10 -0
  242. package/src/Spatialized2DElement.ts +5 -0
  243. package/src/SpatializedDynamic3DElement.ts +5 -0
  244. package/src/SpatializedElement.ts +29 -0
  245. package/src/SpatializedStatic3DElement.ts +42 -3
  246. package/src/WebMsgCommand.ts +40 -0
  247. package/src/coverage-boost.test.ts +239 -216
  248. package/src/index.ts +25 -11
  249. package/src/install-polyfills.ts +38 -0
  250. package/src/jsbcommand.coverage.test.ts +23 -0
  251. package/src/motion/AnimationObject.test.ts +421 -0
  252. package/src/motion/AnimationObject.ts +208 -0
  253. package/src/motion/compute/index.ts +10 -0
  254. package/src/motion/compute/motionPropertyValues.test.ts +55 -0
  255. package/src/motion/compute/motionPropertyValues.ts +70 -0
  256. package/src/motion/compute/normalize.test.ts +99 -0
  257. package/src/motion/compute/normalize.ts +289 -0
  258. package/src/motion/compute/validate.test.ts +229 -0
  259. package/src/motion/compute/validate.ts +156 -0
  260. package/src/motion/index.ts +2 -0
  261. package/src/motion/native/serializeMotionTimeline.test.ts +61 -0
  262. package/src/motion/native/serializeMotionTimeline.ts +27 -0
  263. package/src/platform-adapter/createPlatformSync.ts +5 -3
  264. package/src/platform-adapter/pico-os/PicoOSPlatform.ts +76 -11
  265. package/src/platform-adapter/spatialRequestMetadata.test.ts +175 -0
  266. package/src/platform-adapter/spatialRequestMetadata.ts +48 -0
  267. package/src/platform-adapter/vision-os/VisionOSPlatform.ts +6 -1
  268. package/src/reality/entity/SpatialEntity.ts +127 -0
  269. package/src/runtime/capability-data.ts +104 -4
  270. package/src/runtime/index.ts +0 -11
  271. package/src/runtime/keys.ts +12 -1
  272. package/src/runtime/supports.test.ts +143 -4
  273. package/src/runtime/supports.ts +3 -1
  274. package/src/runtime/useAnimation.capability.test.ts +275 -0
  275. package/src/scene-polyfill.manifest.test.ts +306 -5
  276. package/src/scene-polyfill.request-metadata.test.ts +39 -0
  277. package/src/scene-polyfill.test.ts +33 -94
  278. package/src/scene-polyfill.ts +117 -87
  279. package/src/spatial-window-polyfill.ts +18 -2
  280. package/src/transform-roundtrip.test.ts +90 -0
  281. package/src/types/animation.ts +224 -0
  282. package/src/types/global.ts +1 -8
  283. package/src/types/motion/index.ts +10 -0
  284. package/src/types/motion/spatializedElementMotion.ts +49 -0
  285. package/src/types/motion/spatializedMotion.ts +147 -0
  286. package/src/types/motion/spatializedPlayback.ts +17 -0
  287. package/src/types/motion/spatializedVisual.ts +24 -0
  288. package/src/types/types.ts +3 -0
  289. package/src/utils.ts +54 -0
  290. package/tsup.config.ts +61 -36
  291. package/vitest.config.ts +5 -1
  292. package/dist/iife/index.d.ts +0 -1251
  293. package/dist/iife/index.global.js +0 -75
  294. package/dist/iife/index.global.js.map +0 -1
  295. package/src/platform-adapter/ssr/SSRPlatform.ts +0 -52
  296. /package/src/{ssr-polyfill.ts → isSSREnv.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/entity/SpatialModelEntity.ts"],"sourcesContent":["import {\n SpatialEntityUserData,\n SpatialModelEntityCreationOptions,\n} from '../../types/types'\nimport { SetMaterialsOnEntityCommand } from '../../JSBCommand'\nimport { SpatialMaterial } from '../material/SpatialMaterial'\nimport { SpatialEntity } from './SpatialEntity'\n\nexport class SpatialModelEntity extends SpatialEntity {\n constructor(\n public id: string,\n public options?: SpatialModelEntityCreationOptions,\n public userData?: SpatialEntityUserData,\n ) {\n super(id, userData)\n }\n\n async setMaterials(materials: SpatialMaterial[]) {\n return new SetMaterialsOnEntityCommand(this.id, materials).execute()\n }\n}\n"],"mappings":"AAIA,SAAS,mCAAmC;AAE5C,SAAS,qBAAqB;AAEvB,MAAM,2BAA2B,cAAc;AAAA,EACpD,YACS,IACA,SACA,UACP;AACA,UAAM,IAAI,QAAQ;AAJX;AACA;AACA;AAAA,EAGT;AAAA,EAEA,MAAM,aAAa,WAA8B;AAC/C,WAAO,IAAI,4BAA4B,KAAK,IAAI,SAAS,EAAE,QAAQ;AAAA,EACrE;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ export { H as SpatialEntity } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ export { SpatialModelEntity } from './SpatialModelEntity.js';
3
+ import '../../types/motion/spatializedVisual.js';
4
+ import '../../types/motion/spatializedPlayback.js';
5
+ import '../../types/global.js';
6
+ import '../../physicalMetrics-W5uZ5xKb.js';
7
+ import '../../SpatialObject.js';
8
+ import '../component/SpatialComponent.js';
@@ -0,0 +1,3 @@
1
+ export * from "./SpatialEntity";
2
+ export * from "./SpatialModelEntity";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/entity/index.ts"],"sourcesContent":["export * from './SpatialEntity'\nexport * from './SpatialModelEntity'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,16 @@
1
+ import { N as SpatialGeometry, u as SpatialBoxGeometryOptions, R as SpatialGeometryType } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ import '../../types/motion/spatializedVisual.js';
3
+ import '../../types/motion/spatializedPlayback.js';
4
+ import '../../types/global.js';
5
+ import '../../physicalMetrics-W5uZ5xKb.js';
6
+ import '../../SpatialObject.js';
7
+ import '../component/SpatialComponent.js';
8
+
9
+ declare class SpatialBoxGeometry extends SpatialGeometry {
10
+ id: string;
11
+ options: SpatialBoxGeometryOptions;
12
+ static type: SpatialGeometryType;
13
+ constructor(id: string, options: SpatialBoxGeometryOptions);
14
+ }
15
+
16
+ export { SpatialBoxGeometry };
@@ -0,0 +1,13 @@
1
+ import { SpatialGeometry } from "./SpatialGeometry";
2
+ class SpatialBoxGeometry extends SpatialGeometry {
3
+ constructor(id, options) {
4
+ super(id, options);
5
+ this.id = id;
6
+ this.options = options;
7
+ }
8
+ static type = "BoxGeometry";
9
+ }
10
+ export {
11
+ SpatialBoxGeometry
12
+ };
13
+ //# sourceMappingURL=SpatialBoxGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/geometry/SpatialBoxGeometry.ts"],"sourcesContent":["import {\n SpatialBoxGeometryOptions,\n SpatialGeometryType,\n} from '../../types/types'\nimport { SpatialGeometry } from './SpatialGeometry'\n\nexport class SpatialBoxGeometry extends SpatialGeometry {\n static type: SpatialGeometryType = 'BoxGeometry'\n constructor(\n public id: string,\n public options: SpatialBoxGeometryOptions,\n ) {\n super(id, options)\n }\n}\n"],"mappings":"AAIA,SAAS,uBAAuB;AAEzB,MAAM,2BAA2B,gBAAgB;AAAA,EAEtD,YACS,IACA,SACP;AACA,UAAM,IAAI,OAAO;AAHV;AACA;AAAA,EAGT;AAAA,EANA,OAAO,OAA4B;AAOrC;","names":[]}
@@ -0,0 +1,16 @@
1
+ import { N as SpatialGeometry, v as SpatialConeGeometryOptions, R as SpatialGeometryType } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ import '../../types/motion/spatializedVisual.js';
3
+ import '../../types/motion/spatializedPlayback.js';
4
+ import '../../types/global.js';
5
+ import '../../physicalMetrics-W5uZ5xKb.js';
6
+ import '../../SpatialObject.js';
7
+ import '../component/SpatialComponent.js';
8
+
9
+ declare class SpatialConeGeometry extends SpatialGeometry {
10
+ id: string;
11
+ options: SpatialConeGeometryOptions;
12
+ static type: SpatialGeometryType;
13
+ constructor(id: string, options: SpatialConeGeometryOptions);
14
+ }
15
+
16
+ export { SpatialConeGeometry };
@@ -0,0 +1,13 @@
1
+ import { SpatialGeometry } from "./SpatialGeometry";
2
+ class SpatialConeGeometry extends SpatialGeometry {
3
+ constructor(id, options) {
4
+ super(id, options);
5
+ this.id = id;
6
+ this.options = options;
7
+ }
8
+ static type = "ConeGeometry";
9
+ }
10
+ export {
11
+ SpatialConeGeometry
12
+ };
13
+ //# sourceMappingURL=SpatialConeGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/geometry/SpatialConeGeometry.ts"],"sourcesContent":["import {\n SpatialGeometryType,\n SpatialConeGeometryOptions,\n} from '../../types/types'\nimport { SpatialGeometry } from './SpatialGeometry'\n\nexport class SpatialConeGeometry extends SpatialGeometry {\n static type: SpatialGeometryType = 'ConeGeometry'\n constructor(\n public id: string,\n public options: SpatialConeGeometryOptions,\n ) {\n super(id, options)\n }\n}\n"],"mappings":"AAIA,SAAS,uBAAuB;AAEzB,MAAM,4BAA4B,gBAAgB;AAAA,EAEvD,YACS,IACA,SACP;AACA,UAAM,IAAI,OAAO;AAHV;AACA;AAAA,EAGT;AAAA,EANA,OAAO,OAA4B;AAOrC;","names":[]}
@@ -0,0 +1,16 @@
1
+ import { N as SpatialGeometry, w as SpatialCylinderGeometryOptions, R as SpatialGeometryType } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ import '../../types/motion/spatializedVisual.js';
3
+ import '../../types/motion/spatializedPlayback.js';
4
+ import '../../types/global.js';
5
+ import '../../physicalMetrics-W5uZ5xKb.js';
6
+ import '../../SpatialObject.js';
7
+ import '../component/SpatialComponent.js';
8
+
9
+ declare class SpatialCylinderGeometry extends SpatialGeometry {
10
+ id: string;
11
+ options: SpatialCylinderGeometryOptions;
12
+ static type: SpatialGeometryType;
13
+ constructor(id: string, options: SpatialCylinderGeometryOptions);
14
+ }
15
+
16
+ export { SpatialCylinderGeometry };
@@ -0,0 +1,13 @@
1
+ import { SpatialGeometry } from "./SpatialGeometry";
2
+ class SpatialCylinderGeometry extends SpatialGeometry {
3
+ constructor(id, options) {
4
+ super(id, options);
5
+ this.id = id;
6
+ this.options = options;
7
+ }
8
+ static type = "CylinderGeometry";
9
+ }
10
+ export {
11
+ SpatialCylinderGeometry
12
+ };
13
+ //# sourceMappingURL=SpatialCylinderGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/geometry/SpatialCylinderGeometry.ts"],"sourcesContent":["import {\n SpatialGeometryType,\n SpatialCylinderGeometryOptions,\n} from '../../types/types'\nimport { SpatialGeometry } from './SpatialGeometry'\n\nexport class SpatialCylinderGeometry extends SpatialGeometry {\n static type: SpatialGeometryType = 'CylinderGeometry'\n constructor(\n public id: string,\n public options: SpatialCylinderGeometryOptions,\n ) {\n super(id, options)\n }\n}\n"],"mappings":"AAIA,SAAS,uBAAuB;AAEzB,MAAM,gCAAgC,gBAAgB;AAAA,EAE3D,YACS,IACA,SACP;AACA,UAAM,IAAI,OAAO;AAHV;AACA;AAAA,EAGT;AAAA,EANA,OAAO,OAA4B;AAOrC;","names":[]}
@@ -0,0 +1,7 @@
1
+ import '../../SpatialObject.js';
2
+ export { N as SpatialGeometry } from '../../spatializedElementMotion-_0XWPQCE.js';
3
+ import '../../types/motion/spatializedVisual.js';
4
+ import '../../types/motion/spatializedPlayback.js';
5
+ import '../../types/global.js';
6
+ import '../../physicalMetrics-W5uZ5xKb.js';
7
+ import '../component/SpatialComponent.js';
@@ -0,0 +1,13 @@
1
+ import { SpatialObject } from "../../SpatialObject";
2
+ class SpatialGeometry extends SpatialObject {
3
+ constructor(id, options) {
4
+ super(id);
5
+ this.id = id;
6
+ this.options = options;
7
+ }
8
+ static type;
9
+ }
10
+ export {
11
+ SpatialGeometry
12
+ };
13
+ //# sourceMappingURL=SpatialGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/geometry/SpatialGeometry.ts"],"sourcesContent":["import { SpatialObject } from '../../SpatialObject'\nimport { SpatialGeometryOptions, SpatialGeometryType } from '../../types/types'\n\nexport class SpatialGeometry extends SpatialObject {\n static type: SpatialGeometryType\n constructor(\n public id: string,\n public options: SpatialGeometryOptions,\n ) {\n super(id)\n }\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAGvB,MAAM,wBAAwB,cAAc;AAAA,EAEjD,YACS,IACA,SACP;AACA,UAAM,EAAE;AAHD;AACA;AAAA,EAGT;AAAA,EANA,OAAO;AAOT;","names":[]}
@@ -0,0 +1,16 @@
1
+ import { N as SpatialGeometry, $ as SpatialPlaneGeometryOptions, R as SpatialGeometryType } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ import '../../types/motion/spatializedVisual.js';
3
+ import '../../types/motion/spatializedPlayback.js';
4
+ import '../../types/global.js';
5
+ import '../../physicalMetrics-W5uZ5xKb.js';
6
+ import '../../SpatialObject.js';
7
+ import '../component/SpatialComponent.js';
8
+
9
+ declare class SpatialPlaneGeometry extends SpatialGeometry {
10
+ id: string;
11
+ options: SpatialPlaneGeometryOptions;
12
+ static type: SpatialGeometryType;
13
+ constructor(id: string, options: SpatialPlaneGeometryOptions);
14
+ }
15
+
16
+ export { SpatialPlaneGeometry };
@@ -0,0 +1,13 @@
1
+ import { SpatialGeometry } from "./SpatialGeometry";
2
+ class SpatialPlaneGeometry extends SpatialGeometry {
3
+ constructor(id, options) {
4
+ super(id, options);
5
+ this.id = id;
6
+ this.options = options;
7
+ }
8
+ static type = "PlaneGeometry";
9
+ }
10
+ export {
11
+ SpatialPlaneGeometry
12
+ };
13
+ //# sourceMappingURL=SpatialPlaneGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/geometry/SpatialPlaneGeometry.ts"],"sourcesContent":["import {\n SpatialGeometryType,\n SpatialPlaneGeometryOptions,\n} from '../../types/types'\nimport { SpatialGeometry } from './SpatialGeometry'\n\nexport class SpatialPlaneGeometry extends SpatialGeometry {\n static type: SpatialGeometryType = 'PlaneGeometry'\n constructor(\n public id: string,\n public options: SpatialPlaneGeometryOptions,\n ) {\n super(id, options)\n }\n}\n"],"mappings":"AAIA,SAAS,uBAAuB;AAEzB,MAAM,6BAA6B,gBAAgB;AAAA,EAExD,YACS,IACA,SACP;AACA,UAAM,IAAI,OAAO;AAHV;AACA;AAAA,EAGT;AAAA,EANA,OAAO,OAA4B;AAOrC;","names":[]}
@@ -0,0 +1,16 @@
1
+ import { N as SpatialGeometry, a9 as SpatialSphereGeometryOptions, R as SpatialGeometryType } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ import '../../types/motion/spatializedVisual.js';
3
+ import '../../types/motion/spatializedPlayback.js';
4
+ import '../../types/global.js';
5
+ import '../../physicalMetrics-W5uZ5xKb.js';
6
+ import '../../SpatialObject.js';
7
+ import '../component/SpatialComponent.js';
8
+
9
+ declare class SpatialSphereGeometry extends SpatialGeometry {
10
+ id: string;
11
+ options: SpatialSphereGeometryOptions;
12
+ static type: SpatialGeometryType;
13
+ constructor(id: string, options: SpatialSphereGeometryOptions);
14
+ }
15
+
16
+ export { SpatialSphereGeometry };
@@ -0,0 +1,13 @@
1
+ import { SpatialGeometry } from "./SpatialGeometry";
2
+ class SpatialSphereGeometry extends SpatialGeometry {
3
+ constructor(id, options) {
4
+ super(id, options);
5
+ this.id = id;
6
+ this.options = options;
7
+ }
8
+ static type = "SphereGeometry";
9
+ }
10
+ export {
11
+ SpatialSphereGeometry
12
+ };
13
+ //# sourceMappingURL=SpatialSphereGeometry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/geometry/SpatialSphereGeometry.ts"],"sourcesContent":["import {\n SpatialGeometryType,\n SpatialSphereGeometryOptions,\n} from '../../types/types'\nimport { SpatialGeometry } from './SpatialGeometry'\n\nexport class SpatialSphereGeometry extends SpatialGeometry {\n static type: SpatialGeometryType = 'SphereGeometry'\n constructor(\n public id: string,\n public options: SpatialSphereGeometryOptions,\n ) {\n super(id, options)\n }\n}\n"],"mappings":"AAIA,SAAS,uBAAuB;AAEzB,MAAM,8BAA8B,gBAAgB;AAAA,EAEzD,YACS,IACA,SACP;AACA,UAAM,IAAI,OAAO;AAHV;AACA;AAAA,EAGT;AAAA,EANA,OAAO,OAA4B;AAOrC;","names":[]}
@@ -0,0 +1,12 @@
1
+ export { N as SpatialGeometry } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ export { SpatialBoxGeometry } from './SpatialBoxGeometry.js';
3
+ export { SpatialSphereGeometry } from './SpatialSphereGeometry.js';
4
+ export { SpatialCylinderGeometry } from './SpatialCylinderGeometry.js';
5
+ export { SpatialPlaneGeometry } from './SpatialPlaneGeometry.js';
6
+ export { SpatialConeGeometry } from './SpatialConeGeometry.js';
7
+ import '../../types/motion/spatializedVisual.js';
8
+ import '../../types/motion/spatializedPlayback.js';
9
+ import '../../types/global.js';
10
+ import '../../physicalMetrics-W5uZ5xKb.js';
11
+ import '../../SpatialObject.js';
12
+ import '../component/SpatialComponent.js';
@@ -0,0 +1,7 @@
1
+ export * from "./SpatialGeometry";
2
+ export * from "./SpatialBoxGeometry";
3
+ export * from "./SpatialSphereGeometry";
4
+ export * from "./SpatialCylinderGeometry";
5
+ export * from "./SpatialPlaneGeometry";
6
+ export * from "./SpatialConeGeometry";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/geometry/index.ts"],"sourcesContent":["export * from './SpatialGeometry'\nexport * from './SpatialBoxGeometry'\nexport * from './SpatialSphereGeometry'\nexport * from './SpatialCylinderGeometry'\nexport * from './SpatialPlaneGeometry'\nexport * from './SpatialConeGeometry'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,18 @@
1
+ export { H as SpatialEntity, N as SpatialGeometry, X as SpatialMaterial } from '../spatializedElementMotion-_0XWPQCE.js';
2
+ export { SpatialModelEntity } from './entity/SpatialModelEntity.js';
3
+ export { SpatialComponent } from './component/SpatialComponent.js';
4
+ export { ModelComponent } from './component/ModelComponent.js';
5
+ export { SpatialUnlitMaterial } from './material/SpatialUnlitMaterial.js';
6
+ export { SpatialBoxGeometry } from './geometry/SpatialBoxGeometry.js';
7
+ export { SpatialSphereGeometry } from './geometry/SpatialSphereGeometry.js';
8
+ export { SpatialCylinderGeometry } from './geometry/SpatialCylinderGeometry.js';
9
+ export { SpatialPlaneGeometry } from './geometry/SpatialPlaneGeometry.js';
10
+ export { SpatialConeGeometry } from './geometry/SpatialConeGeometry.js';
11
+ export { SpatialModelAsset } from './resource/SpatialModelAsset.js';
12
+ export { SpatialTextureResource } from './resource/SpatialTextureResource.js';
13
+ export { Attachment, createAttachmentEntity } from './Attachment.js';
14
+ import '../types/motion/spatializedVisual.js';
15
+ import '../types/motion/spatializedPlayback.js';
16
+ import '../types/global.js';
17
+ import '../physicalMetrics-W5uZ5xKb.js';
18
+ import '../SpatialObject.js';
@@ -0,0 +1,7 @@
1
+ export * from "./entity";
2
+ export * from "./component";
3
+ export * from "./material";
4
+ export * from "./geometry";
5
+ export * from "./resource";
6
+ export * from "./Attachment";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/reality/index.ts"],"sourcesContent":["export * from './entity'\nexport * from './component'\nexport * from './material'\nexport * from './geometry'\nexport * from './resource'\nexport * from './Attachment'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,7 @@
1
+ import '../../SpatialObject.js';
2
+ export { X as SpatialMaterial } from '../../spatializedElementMotion-_0XWPQCE.js';
3
+ import '../../types/motion/spatializedVisual.js';
4
+ import '../../types/motion/spatializedPlayback.js';
5
+ import '../../types/global.js';
6
+ import '../../physicalMetrics-W5uZ5xKb.js';
7
+ import '../component/SpatialComponent.js';
@@ -0,0 +1,13 @@
1
+ import { SpatialObject } from "../../SpatialObject";
2
+ class SpatialMaterial extends SpatialObject {
3
+ constructor(id, type) {
4
+ super(id);
5
+ this.id = id;
6
+ this.type = type;
7
+ this.type = type;
8
+ }
9
+ }
10
+ export {
11
+ SpatialMaterial
12
+ };
13
+ //# sourceMappingURL=SpatialMaterial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/material/SpatialMaterial.ts"],"sourcesContent":["import { SpatialObject } from '../../SpatialObject'\nimport { SpatialMaterialType } from '../../types/types'\n\nexport abstract class SpatialMaterial extends SpatialObject {\n constructor(\n public id: string,\n public type: SpatialMaterialType,\n ) {\n super(id)\n this.type = type\n }\n\n abstract updateProperties(properties: any): void\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAGvB,MAAe,wBAAwB,cAAc;AAAA,EAC1D,YACS,IACA,MACP;AACA,UAAM,EAAE;AAHD;AACA;AAGP,SAAK,OAAO;AAAA,EACd;AAGF;","names":[]}
@@ -0,0 +1,16 @@
1
+ import { X as SpatialMaterial, ad as SpatialUnlitMaterialOptions, aK as CommandResult } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ import '../../types/motion/spatializedVisual.js';
3
+ import '../../types/motion/spatializedPlayback.js';
4
+ import '../../types/global.js';
5
+ import '../../physicalMetrics-W5uZ5xKb.js';
6
+ import '../../SpatialObject.js';
7
+ import '../component/SpatialComponent.js';
8
+
9
+ declare class SpatialUnlitMaterial extends SpatialMaterial {
10
+ id: string;
11
+ options: SpatialUnlitMaterialOptions;
12
+ constructor(id: string, options: SpatialUnlitMaterialOptions);
13
+ updateProperties(properties: Partial<SpatialUnlitMaterialOptions>): Promise<CommandResult<any>>;
14
+ }
15
+
16
+ export { SpatialUnlitMaterial };
@@ -0,0 +1,16 @@
1
+ import { UpdateUnlitMaterialProperties } from "../../JSBCommand";
2
+ import { SpatialMaterial } from "./SpatialMaterial";
3
+ class SpatialUnlitMaterial extends SpatialMaterial {
4
+ constructor(id, options) {
5
+ super(id, "unlit");
6
+ this.id = id;
7
+ this.options = options;
8
+ }
9
+ updateProperties(properties) {
10
+ return new UpdateUnlitMaterialProperties(this, properties).execute();
11
+ }
12
+ }
13
+ export {
14
+ SpatialUnlitMaterial
15
+ };
16
+ //# sourceMappingURL=SpatialUnlitMaterial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/material/SpatialUnlitMaterial.ts"],"sourcesContent":["import { UpdateUnlitMaterialProperties } from '../../JSBCommand'\nimport { SpatialUnlitMaterialOptions } from '../../types/types'\nimport { SpatialMaterial } from './SpatialMaterial'\n\nexport class SpatialUnlitMaterial extends SpatialMaterial {\n constructor(\n public id: string,\n public options: SpatialUnlitMaterialOptions,\n ) {\n super(id, 'unlit')\n }\n\n updateProperties(properties: Partial<SpatialUnlitMaterialOptions>) {\n return new UpdateUnlitMaterialProperties(this, properties).execute()\n }\n}\n"],"mappings":"AAAA,SAAS,qCAAqC;AAE9C,SAAS,uBAAuB;AAEzB,MAAM,6BAA6B,gBAAgB;AAAA,EACxD,YACS,IACA,SACP;AACA,UAAM,IAAI,OAAO;AAHV;AACA;AAAA,EAGT;AAAA,EAEA,iBAAiB,YAAkD;AACjE,WAAO,IAAI,8BAA8B,MAAM,UAAU,EAAE,QAAQ;AAAA,EACrE;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ export { SpatialUnlitMaterial } from './SpatialUnlitMaterial.js';
2
+ export { X as SpatialMaterial } from '../../spatializedElementMotion-_0XWPQCE.js';
3
+ import '../../types/motion/spatializedVisual.js';
4
+ import '../../types/motion/spatializedPlayback.js';
5
+ import '../../types/global.js';
6
+ import '../../physicalMetrics-W5uZ5xKb.js';
7
+ import '../../SpatialObject.js';
8
+ import '../component/SpatialComponent.js';
@@ -0,0 +1,3 @@
1
+ export * from "./SpatialUnlitMaterial";
2
+ export * from "./SpatialMaterial";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/material/index.ts"],"sourcesContent":["export * from './SpatialUnlitMaterial'\nexport * from './SpatialMaterial'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,22 @@
1
+ import { M as ModelAssetOptions, m as ModelComponentOptions, L as SpatialEntityUserData, H as SpatialEntity, N as SpatialGeometry, O as SpatialGeometryOptions, _ as SpatialModelEntityCreationOptions, ac as SpatialTextureResourceOptions, ad as SpatialUnlitMaterialOptions } from '../spatializedElementMotion-_0XWPQCE.js';
2
+ import { SpatialModelEntity } from './entity/SpatialModelEntity.js';
3
+ import { ModelComponent } from './component/ModelComponent.js';
4
+ import { SpatialUnlitMaterial } from './material/SpatialUnlitMaterial.js';
5
+ import { SpatialModelAsset } from './resource/SpatialModelAsset.js';
6
+ import { SpatialTextureResource } from './resource/SpatialTextureResource.js';
7
+ import '../types/motion/spatializedVisual.js';
8
+ import '../types/motion/spatializedPlayback.js';
9
+ import '../types/global.js';
10
+ import '../physicalMetrics-W5uZ5xKb.js';
11
+ import '../SpatialObject.js';
12
+ import './component/SpatialComponent.js';
13
+
14
+ declare function createSpatialEntity(userData?: SpatialEntityUserData): Promise<SpatialEntity>;
15
+ declare function createSpatialGeometry<T extends SpatialGeometry>(ctor: new (...args: any[]) => T, options: SpatialGeometryOptions): Promise<T>;
16
+ declare function createSpatialUnlitMaterial(options: SpatialUnlitMaterialOptions): Promise<SpatialUnlitMaterial>;
17
+ declare function createModelComponent(options: ModelComponentOptions): Promise<ModelComponent>;
18
+ declare function createSpatialModelEntity(options: SpatialModelEntityCreationOptions, userData?: SpatialEntityUserData): Promise<SpatialModelEntity>;
19
+ declare function createModelAsset(options: ModelAssetOptions): Promise<SpatialModelAsset>;
20
+ declare function createSpatialTexture(options: SpatialTextureResourceOptions): Promise<SpatialTextureResource>;
21
+
22
+ export { createModelAsset, createModelComponent, createSpatialEntity, createSpatialGeometry, createSpatialModelEntity, createSpatialTexture, createSpatialUnlitMaterial };
@@ -0,0 +1,89 @@
1
+ import {
2
+ CreateModelComponentCommand,
3
+ CreateModelAssetCommand,
4
+ CreateSpatialEntityCommand,
5
+ CreateSpatialGeometryCommand,
6
+ CreateSpatialModelEntityCommand,
7
+ CreateSpatialUnlitMaterialCommand,
8
+ CreateTextureCommand
9
+ } from "../JSBCommand";
10
+ import { SpatialEntity, SpatialModelEntity } from "./entity";
11
+ import { ModelComponent } from "./component";
12
+ import { SpatialUnlitMaterial } from "./material";
13
+ import { SpatialModelAsset, SpatialTextureResource } from "./resource";
14
+ async function createSpatialEntity(userData) {
15
+ const result = await new CreateSpatialEntityCommand(userData?.name).execute();
16
+ if (!result.success) {
17
+ throw new Error("createSpatialEntity failed:" + result?.errorMessage);
18
+ } else {
19
+ const { id } = result.data;
20
+ return new SpatialEntity(id, userData);
21
+ }
22
+ }
23
+ async function createSpatialGeometry(ctor, options) {
24
+ const result = await new CreateSpatialGeometryCommand(
25
+ ctor.type,
26
+ options
27
+ ).execute();
28
+ if (!result.success) {
29
+ throw new Error("createSpatialGeometry failed:" + result?.errorMessage);
30
+ } else {
31
+ const { id } = result.data;
32
+ return new ctor(id, options);
33
+ }
34
+ }
35
+ async function createSpatialUnlitMaterial(options) {
36
+ const result = await new CreateSpatialUnlitMaterialCommand(options).execute();
37
+ if (!result.success) {
38
+ throw new Error("createSpatialUnlitMaterial failed:" + result?.errorMessage);
39
+ } else {
40
+ const { id } = result.data;
41
+ return new SpatialUnlitMaterial(id, options);
42
+ }
43
+ }
44
+ async function createModelComponent(options) {
45
+ const result = await new CreateModelComponentCommand(options).execute();
46
+ if (!result.success) {
47
+ throw new Error("createModelComponent failed:" + result?.errorMessage);
48
+ } else {
49
+ const { id } = result.data;
50
+ return new ModelComponent(id, options);
51
+ }
52
+ }
53
+ async function createSpatialModelEntity(options, userData) {
54
+ const result = await new CreateSpatialModelEntityCommand(options).execute();
55
+ if (!result.success) {
56
+ throw new Error("createSpatialModelEntity failed:" + result?.errorMessage);
57
+ } else {
58
+ const { id } = result.data;
59
+ return new SpatialModelEntity(id, options, userData);
60
+ }
61
+ }
62
+ async function createModelAsset(options) {
63
+ const result = await new CreateModelAssetCommand(options).execute();
64
+ if (!result.success) {
65
+ throw new Error("createModelAsset failed:" + result?.errorMessage);
66
+ } else {
67
+ const { id } = result.data;
68
+ return new SpatialModelAsset(id, options);
69
+ }
70
+ }
71
+ async function createSpatialTexture(options) {
72
+ const result = await new CreateTextureCommand(options.url).execute();
73
+ if (!result.success) {
74
+ throw new Error("createSpatialTexture failed:" + result?.errorMessage);
75
+ } else {
76
+ const { id } = result.data;
77
+ return new SpatialTextureResource(id, options);
78
+ }
79
+ }
80
+ export {
81
+ createModelAsset,
82
+ createModelComponent,
83
+ createSpatialEntity,
84
+ createSpatialGeometry,
85
+ createSpatialModelEntity,
86
+ createSpatialTexture,
87
+ createSpatialUnlitMaterial
88
+ };
89
+ //# sourceMappingURL=realityCreator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/reality/realityCreator.ts"],"sourcesContent":["import {\n CreateModelComponentCommand,\n CreateModelAssetCommand,\n CreateSpatialEntityCommand,\n CreateSpatialGeometryCommand,\n CreateSpatialModelEntityCommand,\n CreateSpatialUnlitMaterialCommand,\n CreateTextureCommand,\n} from '../JSBCommand'\nimport {\n ModelComponentOptions,\n ModelAssetOptions,\n SpatialGeometryOptions,\n SpatialModelEntityCreationOptions,\n SpatialUnlitMaterialOptions,\n SpatialEntityUserData,\n SpatialTextureResourceOptions,\n} from '../types/types'\nimport { SpatialEntity, SpatialModelEntity } from './entity'\nimport { ModelComponent } from './component'\nimport { SpatialGeometry } from './geometry'\nimport { SpatialUnlitMaterial } from './material'\nimport { SpatialModelAsset, SpatialTextureResource } from './resource'\n\nexport async function createSpatialEntity(\n userData?: SpatialEntityUserData,\n): Promise<SpatialEntity> {\n const result = await new CreateSpatialEntityCommand(userData?.name).execute()\n if (!result.success) {\n throw new Error('createSpatialEntity failed:' + result?.errorMessage)\n } else {\n const { id } = result.data\n return new SpatialEntity(id, userData)\n }\n}\n\nexport async function createSpatialGeometry<T extends SpatialGeometry>(\n ctor: new (...args: any[]) => T,\n options: SpatialGeometryOptions,\n) {\n const result = await new CreateSpatialGeometryCommand(\n (ctor as any).type,\n options,\n ).execute()\n if (!result.success) {\n throw new Error('createSpatialGeometry failed:' + result?.errorMessage)\n } else {\n const { id } = result.data\n return new ctor(id, options) as T\n }\n}\n\nexport async function createSpatialUnlitMaterial(\n options: SpatialUnlitMaterialOptions,\n) {\n const result = await new CreateSpatialUnlitMaterialCommand(options).execute()\n if (!result.success) {\n throw new Error('createSpatialUnlitMaterial failed:' + result?.errorMessage)\n } else {\n const { id } = result.data\n return new SpatialUnlitMaterial(id, options)\n }\n}\n\nexport async function createModelComponent(options: ModelComponentOptions) {\n const result = await new CreateModelComponentCommand(options).execute()\n if (!result.success) {\n throw new Error('createModelComponent failed:' + result?.errorMessage)\n } else {\n const { id } = result.data\n return new ModelComponent(id, options)\n }\n}\n\nexport async function createSpatialModelEntity(\n options: SpatialModelEntityCreationOptions,\n userData?: SpatialEntityUserData,\n) {\n const result = await new CreateSpatialModelEntityCommand(options).execute()\n if (!result.success) {\n throw new Error('createSpatialModelEntity failed:' + result?.errorMessage)\n } else {\n const { id } = result.data\n return new SpatialModelEntity(id, options, userData)\n }\n}\n\nexport async function createModelAsset(options: ModelAssetOptions) {\n const result = await new CreateModelAssetCommand(options).execute()\n if (!result.success) {\n throw new Error('createModelAsset failed:' + result?.errorMessage)\n } else {\n const { id } = result.data\n return new SpatialModelAsset(id, options)\n }\n}\n\nexport async function createSpatialTexture(\n options: SpatialTextureResourceOptions,\n) {\n const result = await new CreateTextureCommand(options.url).execute()\n if (!result.success) {\n throw new Error('createSpatialTexture failed:' + result?.errorMessage)\n } else {\n const { id } = result.data\n return new SpatialTextureResource(id, options)\n }\n}\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP,SAAS,eAAe,0BAA0B;AAClD,SAAS,sBAAsB;AAE/B,SAAS,4BAA4B;AACrC,SAAS,mBAAmB,8BAA8B;AAE1D,eAAsB,oBACpB,UACwB;AACxB,QAAM,SAAS,MAAM,IAAI,2BAA2B,UAAU,IAAI,EAAE,QAAQ;AAC5E,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI,MAAM,gCAAgC,QAAQ,YAAY;AAAA,EACtE,OAAO;AACL,UAAM,EAAE,GAAG,IAAI,OAAO;AACtB,WAAO,IAAI,cAAc,IAAI,QAAQ;AAAA,EACvC;AACF;AAEA,eAAsB,sBACpB,MACA,SACA;AACA,QAAM,SAAS,MAAM,IAAI;AAAA,IACtB,KAAa;AAAA,IACd;AAAA,EACF,EAAE,QAAQ;AACV,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI,MAAM,kCAAkC,QAAQ,YAAY;AAAA,EACxE,OAAO;AACL,UAAM,EAAE,GAAG,IAAI,OAAO;AACtB,WAAO,IAAI,KAAK,IAAI,OAAO;AAAA,EAC7B;AACF;AAEA,eAAsB,2BACpB,SACA;AACA,QAAM,SAAS,MAAM,IAAI,kCAAkC,OAAO,EAAE,QAAQ;AAC5E,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI,MAAM,uCAAuC,QAAQ,YAAY;AAAA,EAC7E,OAAO;AACL,UAAM,EAAE,GAAG,IAAI,OAAO;AACtB,WAAO,IAAI,qBAAqB,IAAI,OAAO;AAAA,EAC7C;AACF;AAEA,eAAsB,qBAAqB,SAAgC;AACzE,QAAM,SAAS,MAAM,IAAI,4BAA4B,OAAO,EAAE,QAAQ;AACtE,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI,MAAM,iCAAiC,QAAQ,YAAY;AAAA,EACvE,OAAO;AACL,UAAM,EAAE,GAAG,IAAI,OAAO;AACtB,WAAO,IAAI,eAAe,IAAI,OAAO;AAAA,EACvC;AACF;AAEA,eAAsB,yBACpB,SACA,UACA;AACA,QAAM,SAAS,MAAM,IAAI,gCAAgC,OAAO,EAAE,QAAQ;AAC1E,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI,MAAM,qCAAqC,QAAQ,YAAY;AAAA,EAC3E,OAAO;AACL,UAAM,EAAE,GAAG,IAAI,OAAO;AACtB,WAAO,IAAI,mBAAmB,IAAI,SAAS,QAAQ;AAAA,EACrD;AACF;AAEA,eAAsB,iBAAiB,SAA4B;AACjE,QAAM,SAAS,MAAM,IAAI,wBAAwB,OAAO,EAAE,QAAQ;AAClE,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI,MAAM,6BAA6B,QAAQ,YAAY;AAAA,EACnE,OAAO;AACL,UAAM,EAAE,GAAG,IAAI,OAAO;AACtB,WAAO,IAAI,kBAAkB,IAAI,OAAO;AAAA,EAC1C;AACF;AAEA,eAAsB,qBACpB,SACA;AACA,QAAM,SAAS,MAAM,IAAI,qBAAqB,QAAQ,GAAG,EAAE,QAAQ;AACnE,MAAI,CAAC,OAAO,SAAS;AACnB,UAAM,IAAI,MAAM,iCAAiC,QAAQ,YAAY;AAAA,EACvE,OAAO;AACL,UAAM,EAAE,GAAG,IAAI,OAAO;AACtB,WAAO,IAAI,uBAAuB,IAAI,OAAO;AAAA,EAC/C;AACF;","names":[]}
@@ -0,0 +1,15 @@
1
+ import { SpatialObject } from '../../SpatialObject.js';
2
+ import { M as ModelAssetOptions } from '../../spatializedElementMotion-_0XWPQCE.js';
3
+ import '../../types/motion/spatializedVisual.js';
4
+ import '../../types/motion/spatializedPlayback.js';
5
+ import '../../types/global.js';
6
+ import '../../physicalMetrics-W5uZ5xKb.js';
7
+ import '../component/SpatialComponent.js';
8
+
9
+ declare class SpatialModelAsset extends SpatialObject {
10
+ id: string;
11
+ options: ModelAssetOptions;
12
+ constructor(id: string, options: ModelAssetOptions);
13
+ }
14
+
15
+ export { SpatialModelAsset };
@@ -0,0 +1,12 @@
1
+ import { SpatialObject } from "../../SpatialObject";
2
+ class SpatialModelAsset extends SpatialObject {
3
+ constructor(id, options) {
4
+ super(id);
5
+ this.id = id;
6
+ this.options = options;
7
+ }
8
+ }
9
+ export {
10
+ SpatialModelAsset
11
+ };
12
+ //# sourceMappingURL=SpatialModelAsset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/resource/SpatialModelAsset.ts"],"sourcesContent":["import { SpatialObject } from '../../SpatialObject'\nimport { ModelAssetOptions } from '../../types/types'\n\nexport class SpatialModelAsset extends SpatialObject {\n constructor(\n public id: string,\n public options: ModelAssetOptions,\n ) {\n super(id)\n }\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAGvB,MAAM,0BAA0B,cAAc;AAAA,EACnD,YACS,IACA,SACP;AACA,UAAM,EAAE;AAHD;AACA;AAAA,EAGT;AACF;","names":[]}
@@ -0,0 +1,16 @@
1
+ import { ac as SpatialTextureResourceOptions, aK as CommandResult } from '../../spatializedElementMotion-_0XWPQCE.js';
2
+ import { SpatialObject } from '../../SpatialObject.js';
3
+ import '../../types/motion/spatializedVisual.js';
4
+ import '../../types/motion/spatializedPlayback.js';
5
+ import '../../types/global.js';
6
+ import '../../physicalMetrics-W5uZ5xKb.js';
7
+ import '../component/SpatialComponent.js';
8
+
9
+ declare class SpatialTextureResource extends SpatialObject {
10
+ id: string;
11
+ options: SpatialTextureResourceOptions;
12
+ constructor(id: string, options: SpatialTextureResourceOptions);
13
+ updateProperties(properties: Partial<SpatialTextureResourceOptions>): Promise<CommandResult<any>>;
14
+ }
15
+
16
+ export { SpatialTextureResource };
@@ -0,0 +1,16 @@
1
+ import { SpatialObject } from "../../SpatialObject";
2
+ import { UpdateTexturePropertiesCommand } from "../../JSBCommand";
3
+ class SpatialTextureResource extends SpatialObject {
4
+ constructor(id, options) {
5
+ super(id);
6
+ this.id = id;
7
+ this.options = options;
8
+ }
9
+ updateProperties(properties) {
10
+ return new UpdateTexturePropertiesCommand(this, properties).execute();
11
+ }
12
+ }
13
+ export {
14
+ SpatialTextureResource
15
+ };
16
+ //# sourceMappingURL=SpatialTextureResource.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/resource/SpatialTextureResource.ts"],"sourcesContent":["import { SpatialObject } from '../../SpatialObject'\nimport { SpatialTextureResourceOptions } from '../../types/types'\nimport { UpdateTexturePropertiesCommand } from '../../JSBCommand'\n\nexport class SpatialTextureResource extends SpatialObject {\n constructor(\n public id: string,\n public options: SpatialTextureResourceOptions,\n ) {\n super(id)\n }\n\n updateProperties(properties: Partial<SpatialTextureResourceOptions>) {\n return new UpdateTexturePropertiesCommand(this, properties).execute()\n }\n}\n"],"mappings":"AAAA,SAAS,qBAAqB;AAE9B,SAAS,sCAAsC;AAExC,MAAM,+BAA+B,cAAc;AAAA,EACxD,YACS,IACA,SACP;AACA,UAAM,EAAE;AAHD;AACA;AAAA,EAGT;AAAA,EAEA,iBAAiB,YAAoD;AACnE,WAAO,IAAI,+BAA+B,MAAM,UAAU,EAAE,QAAQ;AAAA,EACtE;AACF;","names":[]}
@@ -0,0 +1,9 @@
1
+ export { SpatialModelAsset } from './SpatialModelAsset.js';
2
+ export { SpatialTextureResource } from './SpatialTextureResource.js';
3
+ import '../../SpatialObject.js';
4
+ import '../../spatializedElementMotion-_0XWPQCE.js';
5
+ import '../../types/motion/spatializedVisual.js';
6
+ import '../../types/motion/spatializedPlayback.js';
7
+ import '../../types/global.js';
8
+ import '../../physicalMetrics-W5uZ5xKb.js';
9
+ import '../component/SpatialComponent.js';
@@ -0,0 +1,3 @@
1
+ export * from "./SpatialModelAsset";
2
+ export * from "./SpatialTextureResource";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/reality/resource/index.ts"],"sourcesContent":["export * from './SpatialModelAsset'\nexport * from './SpatialTextureResource'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Thrown when a runtime-gated JS API is invoked but `supports('<name>')` is false.
3
+ * See OpenSpec `runtime-capabilities/spec.md` (Unsupported behavior contracts).
4
+ */
5
+ declare class WebSpatialRuntimeError extends Error {
6
+ readonly capability: string;
7
+ constructor(capability: string, message?: string);
8
+ }
9
+
10
+ export { WebSpatialRuntimeError };