threedog 0.0.0-stage → 0.2.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 (506) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +39 -2
  4. package/core/Animator.js +268 -0
  5. package/core/Assets.js +256 -0
  6. package/core/Audio.js +267 -0
  7. package/core/Baked.js +72 -0
  8. package/core/Batching.js +247 -0
  9. package/core/Budget.js +221 -0
  10. package/core/Clock.js +94 -0
  11. package/core/Commits.js +77 -0
  12. package/core/DebugOverrides.js +143 -0
  13. package/core/Describe.js +145 -0
  14. package/core/Engine.js +184 -0
  15. package/core/Events.js +153 -0
  16. package/core/I18n.js +94 -0
  17. package/core/Input.js +245 -0
  18. package/core/Inspect.js +77 -0
  19. package/core/InspectScene.js +191 -0
  20. package/core/Jobs.js +146 -0
  21. package/core/Loading.js +149 -0
  22. package/core/MaterialInfo.js +32 -0
  23. package/core/Ops.js +256 -0
  24. package/core/Random.js +52 -0
  25. package/core/Rays.js +160 -0
  26. package/core/SaveStore.js +85 -0
  27. package/core/Saves.js +254 -0
  28. package/core/Stream.js +279 -0
  29. package/core/Threads.js +158 -0
  30. package/core/UrlState.js +94 -0
  31. package/core/Vars.js +35 -0
  32. package/core/Views.js +49 -0
  33. package/core/actor.js +23 -0
  34. package/core/assetEntry.js +89 -0
  35. package/core/assetLoad.js +190 -0
  36. package/core/assetManifest.js +35 -0
  37. package/core/assetReport.js +83 -0
  38. package/core/audioRules.js +121 -0
  39. package/core/audioVoice.js +225 -0
  40. package/core/batchGroups.js +116 -0
  41. package/core/canvasBox.js +63 -0
  42. package/core/catalog.js +169 -0
  43. package/core/checks.js +67 -0
  44. package/core/claims.js +51 -0
  45. package/core/dayTime.js +15 -0
  46. package/core/debugView.js +76 -0
  47. package/core/describeRender.js +45 -0
  48. package/core/describeText.js +143 -0
  49. package/core/easing.js +34 -0
  50. package/core/errorCodes.js +205 -0
  51. package/core/errorHints.js +208 -0
  52. package/core/errors.js +40 -0
  53. package/core/events.generated.js +84 -0
  54. package/core/ground.js +102 -0
  55. package/core/holds.js +106 -0
  56. package/core/inputContext.js +69 -0
  57. package/core/inputDefaults.js +22 -0
  58. package/core/inputPad.js +35 -0
  59. package/core/inputPointer.js +48 -0
  60. package/core/inputTouch.js +48 -0
  61. package/core/lifecycle.js +69 -0
  62. package/core/lightWatch.js +56 -0
  63. package/core/look/coreParts.js +112 -0
  64. package/core/look/layers.js +136 -0
  65. package/core/look/part.js +173 -0
  66. package/core/look/report.js +79 -0
  67. package/core/look/write.js +86 -0
  68. package/core/loop.js +200 -0
  69. package/core/math.js +33 -0
  70. package/core/modules.js +196 -0
  71. package/core/movement.js +19 -0
  72. package/core/mulberry32.js +14 -0
  73. package/core/opsAtomic.js +31 -0
  74. package/core/opsCheck.js +97 -0
  75. package/core/opsFail.js +20 -0
  76. package/core/opsGuard.js +26 -0
  77. package/core/opsHistory.js +27 -0
  78. package/core/opsRun.js +77 -0
  79. package/core/page.js +78 -0
  80. package/core/params.js +132 -0
  81. package/core/pureWorker.js +5 -0
  82. package/core/renamed.js +21 -0
  83. package/core/saveApply.js +128 -0
  84. package/core/saveFiles.js +139 -0
  85. package/core/saveIds.js +53 -0
  86. package/core/saveVersions.js +97 -0
  87. package/core/scatter.js +92 -0
  88. package/core/sceneMethods.js +100 -0
  89. package/core/screenToGround.js +39 -0
  90. package/core/services.js +73 -0
  91. package/core/session.js +171 -0
  92. package/core/shadowTypes.js +15 -0
  93. package/core/skip.js +104 -0
  94. package/core/startup.js +135 -0
  95. package/core/streamCells.js +24 -0
  96. package/core/streamSources.js +73 -0
  97. package/core/styleParts.js +96 -0
  98. package/core/targeting.js +64 -0
  99. package/core/thingExplain.js +68 -0
  100. package/core/thingOps.js +168 -0
  101. package/core/things.js +212 -0
  102. package/core/threadPure.js +120 -0
  103. package/core/threadServe.js +25 -0
  104. package/core/tier.js +11 -0
  105. package/core/util.js +11 -0
  106. package/core/validate.js +204 -0
  107. package/docs/AI.md +123 -0
  108. package/docs/API.md +83 -0
  109. package/docs/CODEMAP.md +347 -0
  110. package/docs/COMMANDS.md +108 -0
  111. package/docs/CONVENTIONS.md +145 -0
  112. package/docs/PERF.md +217 -0
  113. package/docs/THREE.md +86 -0
  114. package/docs/api/ambience.md +15 -0
  115. package/docs/api/assets.md +62 -0
  116. package/docs/api/audio.md +53 -0
  117. package/docs/api/budget.md +40 -0
  118. package/docs/api/cameraRig.md +120 -0
  119. package/docs/api/characters.md +144 -0
  120. package/docs/api/clock.md +7 -0
  121. package/docs/api/collision.md +39 -0
  122. package/docs/api/content.md +64 -0
  123. package/docs/api/dialogue.md +39 -0
  124. package/docs/api/engine.md +199 -0
  125. package/docs/api/entities.md +61 -0
  126. package/docs/api/events.md +95 -0
  127. package/docs/api/flow.md +27 -0
  128. package/docs/api/grids.md +11 -0
  129. package/docs/api/ground.md +16 -0
  130. package/docs/api/hlod.md +34 -0
  131. package/docs/api/hud.md +31 -0
  132. package/docs/api/i18n.md +10 -0
  133. package/docs/api/input.md +24 -0
  134. package/docs/api/interactions.md +31 -0
  135. package/docs/api/inventory.md +66 -0
  136. package/docs/api/jobs.md +10 -0
  137. package/docs/api/level.md +41 -0
  138. package/docs/api/lightPool.md +56 -0
  139. package/docs/api/music.md +34 -0
  140. package/docs/api/nav.md +26 -0
  141. package/docs/api/net.md +14 -0
  142. package/docs/api/openWorld.md +24 -0
  143. package/docs/api/particles.md +41 -0
  144. package/docs/api/photo.md +15 -0
  145. package/docs/api/post.md +10 -0
  146. package/docs/api/quests.md +36 -0
  147. package/docs/api/rays.md +26 -0
  148. package/docs/api/rigid.md +84 -0
  149. package/docs/api/saves.md +32 -0
  150. package/docs/api/settings.md +36 -0
  151. package/docs/api/sky.md +58 -0
  152. package/docs/api/stream.md +31 -0
  153. package/docs/api/style.md +134 -0
  154. package/docs/api/terrain.md +34 -0
  155. package/docs/api/timeline.md +39 -0
  156. package/docs/api/tools.md +57 -0
  157. package/docs/api/triggers.md +56 -0
  158. package/docs/api/vars.md +9 -0
  159. package/docs/api/vegetation.md +52 -0
  160. package/docs/api/water.md +48 -0
  161. package/docs/api/weather.md +29 -0
  162. package/docs/api/world.md +30 -0
  163. package/docs/recipes/01-new-game.md +148 -0
  164. package/docs/recipes/02-npc.md +167 -0
  165. package/docs/recipes/03-items-pickups.md +158 -0
  166. package/docs/recipes/04-quests.md +83 -0
  167. package/docs/recipes/05-props-bake.md +159 -0
  168. package/docs/recipes/06-clock-events.md +117 -0
  169. package/docs/recipes/07-flow-scenes-pause.md +132 -0
  170. package/docs/recipes/08-weather-sky.md +74 -0
  171. package/docs/recipes/09-style-pack.md +234 -0
  172. package/docs/recipes/10-blender-level.md +67 -0
  173. package/docs/recipes/11-vehicles.md +55 -0
  174. package/docs/recipes/12-navmesh.md +79 -0
  175. package/docs/recipes/13-animation.md +149 -0
  176. package/docs/recipes/14-custom-module.md +91 -0
  177. package/docs/recipes/15-perf.md +78 -0
  178. package/docs/recipes/16-dev-bridge.md +180 -0
  179. package/docs/recipes/18-world.md +185 -0
  180. package/docs/recipes/19-shooting-picking.md +76 -0
  181. package/docs/recipes/20-content-actions-save.md +176 -0
  182. package/docs/recipes/21-camera.md +153 -0
  183. package/docs/recipes/22-shop-gold.md +107 -0
  184. package/docs/recipes/23-ops.md +175 -0
  185. package/docs/recipes/26-ui-parts.md +138 -0
  186. package/docs/recipes/27-net.md +96 -0
  187. package/docs/recipes/28-terrain.md +80 -0
  188. package/docs/recipes/29-grid.md +87 -0
  189. package/docs/recipes/30-templates.md +131 -0
  190. package/docs/recipes/31-audio.md +126 -0
  191. package/docs/recipes/32-action-game.md +33 -0
  192. package/docs/recipes/33-stream-sources.md +37 -0
  193. package/docs/recipes/34-environment-lighting.md +36 -0
  194. package/docs/recipes/35-style-from-reference.md +89 -0
  195. package/docs/recipes/36-sky-ground-plant-looks.md +116 -0
  196. package/docs/recipes/37-terrain-look-hooks.md +97 -0
  197. package/docs/recipes/38-environment-look-hooks.md +83 -0
  198. package/docs/recipes/40-scene.md +108 -0
  199. package/docs/recipes/41-thing-registry.md +93 -0
  200. package/docs/recipes/42-terrain-shape.md +64 -0
  201. package/docs/recipes/43-shader-patches-surface-looks.md +120 -0
  202. package/docs/recipes/44-water-weather-look-hooks.md +135 -0
  203. package/docs/recipes/45-cascaded-shadows.md +51 -0
  204. package/docs/recipes/46-blender-art-route.md +114 -0
  205. package/docs/recipes/47-island-snow-backdrop.md +44 -0
  206. package/docs/recipes/48-make-material.md +70 -0
  207. package/docs/recipes/49-game-module-contract.md +71 -0
  208. package/docs/recipes/50-own-renderer.md +12 -0
  209. package/docs/recipes/51-capability-catalog.md +63 -0
  210. package/docs/recipes/52-look.md +108 -0
  211. package/examples/action/DESIGN.md +3 -0
  212. package/examples/action/GAMEMAP.md +127 -0
  213. package/examples/action/content/actions.js +8 -0
  214. package/examples/action/content/audio.js +9 -0
  215. package/examples/action/content/index.js +10 -0
  216. package/examples/action/content/items.js +4 -0
  217. package/examples/action/content/places.js +4 -0
  218. package/examples/action/content/props.js +11 -0
  219. package/examples/action/content/templates.js +10 -0
  220. package/examples/action/content/views.js +6 -0
  221. package/examples/action/look.js +5 -0
  222. package/examples/action/main.js +137 -0
  223. package/examples/action/models.js +25 -0
  224. package/examples/sheepisland/GAMEMAP.md +107 -0
  225. package/examples/sheepisland/content/index.js +6 -0
  226. package/examples/sheepisland/content/props.js +19 -0
  227. package/examples/sheepisland/content/templates.js +5 -0
  228. package/examples/sheepisland/content/vegetation.js +8 -0
  229. package/examples/sheepisland/main.js +71 -0
  230. package/examples/sheepisland/params.js +25 -0
  231. package/examples/sheepisland/style/index.js +79 -0
  232. package/examples/sheepisland/style/models.js +59 -0
  233. package/examples/sheepisland/views.js +9 -0
  234. package/examples/styletest/GAMEMAP.md +135 -0
  235. package/examples/styletest/content/index.js +9 -0
  236. package/examples/styletest/content/items.js +8 -0
  237. package/examples/styletest/content/npcs.js +8 -0
  238. package/examples/styletest/content/places.js +5 -0
  239. package/examples/styletest/content/props.js +16 -0
  240. package/examples/styletest/content/templates.js +9 -0
  241. package/examples/styletest/content/vegetation.js +31 -0
  242. package/examples/styletest/look.js +11 -0
  243. package/examples/styletest/main.js +95 -0
  244. package/examples/styletest/models.js +87 -0
  245. package/examples/styletest/overrides.js +33 -0
  246. package/examples/styletest/panel.js +135 -0
  247. package/examples/styletest/params.js +32 -0
  248. package/examples/styletest/views.js +31 -0
  249. package/examples/world/DESIGN.md +5 -0
  250. package/examples/world/GAMEMAP.md +171 -0
  251. package/examples/world/content/actions.js +8 -0
  252. package/examples/world/content/audio.js +25 -0
  253. package/examples/world/content/bodies.js +12 -0
  254. package/examples/world/content/containers.js +4 -0
  255. package/examples/world/content/dialogues.js +33 -0
  256. package/examples/world/content/index.js +17 -0
  257. package/examples/world/content/items.js +10 -0
  258. package/examples/world/content/npcs.js +14 -0
  259. package/examples/world/content/pickups.js +11 -0
  260. package/examples/world/content/places.js +6 -0
  261. package/examples/world/content/props.js +12 -0
  262. package/examples/world/content/quests.js +15 -0
  263. package/examples/world/content/rules.js +23 -0
  264. package/examples/world/content/templates.js +5 -0
  265. package/examples/world/content/vegetation.js +32 -0
  266. package/examples/world/main.js +168 -0
  267. package/examples/world/models.js +28 -0
  268. package/index.d.ts +306 -0
  269. package/index.js +122 -0
  270. package/llms.txt +61 -0
  271. package/modules/ambience/Ambience.js +186 -0
  272. package/modules/camera/FirstPersonCamera.js +131 -0
  273. package/modules/camera/FixedCamera.js +162 -0
  274. package/modules/camera/FollowCamera.js +91 -0
  275. package/modules/camera/RtsCamera.js +132 -0
  276. package/modules/camera/common.js +182 -0
  277. package/modules/camera/index.js +11 -0
  278. package/modules/camera/projection.js +34 -0
  279. package/modules/characters/Character.js +235 -0
  280. package/modules/characters/NPC.js +242 -0
  281. package/modules/characters/assetModel.js +42 -0
  282. package/modules/characters/astar.js +66 -0
  283. package/modules/characters/behaviors.js +72 -0
  284. package/modules/characters/footsteps.js +13 -0
  285. package/modules/characters/index.js +215 -0
  286. package/modules/characters/moveHelpers.js +29 -0
  287. package/modules/characters/movers/common.js +62 -0
  288. package/modules/characters/movers/rapier.js +74 -0
  289. package/modules/characters/movers/simple.js +43 -0
  290. package/modules/characters/npcAvoid.js +129 -0
  291. package/modules/characters/npcSim.js +150 -0
  292. package/modules/characters/npcView.js +42 -0
  293. package/modules/characters/pathAsync.js +113 -0
  294. package/modules/characters/pathJob.js +62 -0
  295. package/modules/characters/pathWorker.js +7 -0
  296. package/modules/characters/playerStrings.js +12 -0
  297. package/modules/characters/proceduralRig.js +58 -0
  298. package/modules/characters/useModel.js +22 -0
  299. package/modules/characters/walkTo.js +58 -0
  300. package/modules/collision/Collision.js +274 -0
  301. package/modules/collision/grid.js +63 -0
  302. package/modules/content/explain.js +13 -0
  303. package/modules/content/ids.js +95 -0
  304. package/modules/content/index.js +154 -0
  305. package/modules/content/loader.js +190 -0
  306. package/modules/content/models.js +69 -0
  307. package/modules/content/packs.js +69 -0
  308. package/modules/content/props.js +89 -0
  309. package/modules/content/rules.js +134 -0
  310. package/modules/content/templates.js +189 -0
  311. package/modules/debug/DebugPanel.js +174 -0
  312. package/modules/entities/Entities.js +243 -0
  313. package/modules/entities/build.js +25 -0
  314. package/modules/entities/index.js +4 -0
  315. package/modules/flow/index.js +101 -0
  316. package/modules/gameplay/Container.js +227 -0
  317. package/modules/gameplay/Containers.js +89 -0
  318. package/modules/gameplay/Dialogue.js +219 -0
  319. package/modules/gameplay/Interactions.js +253 -0
  320. package/modules/gameplay/Inventory.js +224 -0
  321. package/modules/gameplay/Quests.js +205 -0
  322. package/modules/gameplay/boxOps.js +60 -0
  323. package/modules/gameplay/dialogueBox.js +48 -0
  324. package/modules/gameplay/interactionPrompt.js +28 -0
  325. package/modules/gameplay/inventoryOps.js +137 -0
  326. package/modules/gameplay/pickups.js +115 -0
  327. package/modules/gameplay/questLog.js +54 -0
  328. package/modules/gameplay/questSave.js +71 -0
  329. package/modules/grid/Grid.js +184 -0
  330. package/modules/grid/Layer.js +142 -0
  331. package/modules/grid/index.js +236 -0
  332. package/modules/grid/ops.js +73 -0
  333. package/modules/grid/preview.js +85 -0
  334. package/modules/grid/tiles.js +79 -0
  335. package/modules/hlod/index.js +167 -0
  336. package/modules/hud/index.js +167 -0
  337. package/modules/hud/parts.js +80 -0
  338. package/modules/level/geometry.js +46 -0
  339. package/modules/level/heightfield.js +160 -0
  340. package/modules/level/index.js +233 -0
  341. package/modules/level/nodes.js +84 -0
  342. package/modules/lights/index.js +227 -0
  343. package/modules/music/Music.js +294 -0
  344. package/modules/music/index.js +2 -0
  345. package/modules/music/rules.js +28 -0
  346. package/modules/nav/index.js +156 -0
  347. package/modules/nav/navPath.js +17 -0
  348. package/modules/net/Client.js +137 -0
  349. package/modules/net/Host.js +117 -0
  350. package/modules/net/Net.js +49 -0
  351. package/modules/net/index.js +77 -0
  352. package/modules/net/sync.js +114 -0
  353. package/modules/net/transports.js +118 -0
  354. package/modules/particles/Particles.js +179 -0
  355. package/modules/particles/effect.js +112 -0
  356. package/modules/particles/shaders.js +28 -0
  357. package/modules/photo/Photo.js +146 -0
  358. package/modules/rigid/RigidBodies.js +265 -0
  359. package/modules/rigid/Vehicles.js +97 -0
  360. package/modules/rigid/sync.js +158 -0
  361. package/modules/settings/Settings.js +297 -0
  362. package/modules/settings/apply.js +21 -0
  363. package/modules/settings/index.js +3 -0
  364. package/modules/settings/sections.js +156 -0
  365. package/modules/settings/strings.js +53 -0
  366. package/modules/settings/view.js +65 -0
  367. package/modules/sky/Sky.js +259 -0
  368. package/modules/sky/calendar.js +80 -0
  369. package/modules/sky/cascades.js +125 -0
  370. package/modules/sky/clouds.js +79 -0
  371. package/modules/sky/domeLayers.js +33 -0
  372. package/modules/sky/environment.js +141 -0
  373. package/modules/sky/fog.js +139 -0
  374. package/modules/sky/frame.js +77 -0
  375. package/modules/sky/layers.js +69 -0
  376. package/modules/sky/look.js +51 -0
  377. package/modules/sky/lookFog.js +80 -0
  378. package/modules/sky/lookShadow.js +50 -0
  379. package/modules/sky/lookSky.js +108 -0
  380. package/modules/sky/schedule.js +80 -0
  381. package/modules/sky/shader.js +96 -0
  382. package/modules/sky/shadow.js +74 -0
  383. package/modules/sky/skyModule.js +60 -0
  384. package/modules/terrain/ChunkManager.js +260 -0
  385. package/modules/terrain/chunkJob.js +19 -0
  386. package/modules/terrain/chunkLevels.js +40 -0
  387. package/modules/terrain/chunkQueries.js +42 -0
  388. package/modules/terrain/chunkWorker.js +5 -0
  389. package/modules/terrain/index.js +118 -0
  390. package/modules/terrain/lookGround.js +61 -0
  391. package/modules/terrain/mountTerrain.js +32 -0
  392. package/modules/terrain/terrainColorMap.js +41 -0
  393. package/modules/terrain/terrainDefaults.js +39 -0
  394. package/modules/terrain/terrainEdit.js +139 -0
  395. package/modules/terrain/terrainGen.js +155 -0
  396. package/modules/terrain/terrainIsland.js +131 -0
  397. package/modules/terrain/terrainMesh.js +92 -0
  398. package/modules/terrain/terrainShape.js +108 -0
  399. package/modules/terrain/terrainShapeMain.js +41 -0
  400. package/modules/terrain/terrainTexture.js +44 -0
  401. package/modules/timeline/Timeline.js +253 -0
  402. package/modules/timeline/Tween.js +114 -0
  403. package/modules/timeline/letterbox.js +24 -0
  404. package/modules/timeline/shots.js +90 -0
  405. package/modules/triggers/index.js +268 -0
  406. package/modules/vegetation/Vegetation.js +256 -0
  407. package/modules/vegetation/groundChunks.js +177 -0
  408. package/modules/vegetation/index.js +43 -0
  409. package/modules/vegetation/lookWind.js +37 -0
  410. package/modules/vegetation/modelGeometry.js +21 -0
  411. package/modules/water/Water.js +160 -0
  412. package/modules/water/look.js +80 -0
  413. package/modules/water/surface.js +88 -0
  414. package/modules/weather/Weather.js +242 -0
  415. package/modules/weather/look.js +75 -0
  416. package/modules/weather/particles.js +92 -0
  417. package/modules/weather/shaders.js +49 -0
  418. package/modules/weather/strings.js +15 -0
  419. package/modules/world/World.js +231 -0
  420. package/modules/world/cells.js +42 -0
  421. package/modules/world/explain.js +11 -0
  422. package/modules/world/index.js +71 -0
  423. package/modules/world/persist.js +107 -0
  424. package/modules/world/pos.js +20 -0
  425. package/modules/world/records.js +89 -0
  426. package/modules/world/sim.js +175 -0
  427. package/modules/world/simFar.js +82 -0
  428. package/modules/world/state.js +115 -0
  429. package/modules/world/thingSource.js +44 -0
  430. package/modules/world/views.js +182 -0
  431. package/package.json +66 -4
  432. package/presets.js +96 -0
  433. package/render/PostFX.js +240 -0
  434. package/render/detail.js +105 -0
  435. package/render/effects.js +144 -0
  436. package/render/engineUniforms.js +23 -0
  437. package/render/fuse.js +84 -0
  438. package/render/lighting.js +100 -0
  439. package/render/lights.js +18 -0
  440. package/render/lookSurface.js +161 -0
  441. package/render/materials.js +220 -0
  442. package/render/patches.js +252 -0
  443. package/render/postLook.js +86 -0
  444. package/render/surface.js +69 -0
  445. package/render/uniformDecl.js +29 -0
  446. package/types/common.d.ts +34 -0
  447. package/types/core.d.ts +1965 -0
  448. package/types/gameplay.d.ts +1822 -0
  449. package/types/generated/core/Audio.d.ts +200 -0
  450. package/types/generated/core/Batching.d.ts +47 -0
  451. package/types/generated/core/Budget.d.ts +90 -0
  452. package/types/generated/core/Commits.d.ts +31 -0
  453. package/types/generated/core/DebugOverrides.d.ts +52 -0
  454. package/types/generated/core/Events.d.ts +89 -0
  455. package/types/generated/core/I18n.d.ts +30 -0
  456. package/types/generated/core/Input.d.ts +118 -0
  457. package/types/generated/core/Jobs.d.ts +41 -0
  458. package/types/generated/core/Ops.d.ts +203 -0
  459. package/types/generated/core/Random.d.ts +49 -0
  460. package/types/generated/core/Rays.d.ts +49 -0
  461. package/types/generated/core/Saves.d.ts +162 -0
  462. package/types/generated/core/Stream.d.ts +93 -0
  463. package/types/generated/core/Threads.d.ts +82 -0
  464. package/types/generated/core/Views.d.ts +33 -0
  465. package/types/generated/core/audioVoice.d.ts +47 -0
  466. package/types/generated/core/page.d.ts +18 -0
  467. package/types/generated/core/session.d.ts +48 -0
  468. package/types/generated/modules/ambience/Ambience.d.ts +48 -0
  469. package/types/generated/modules/debug/DebugPanel.d.ts +24 -0
  470. package/types/generated/modules/flow/index.d.ts +10 -0
  471. package/types/generated/modules/grid/Grid.d.ts +151 -0
  472. package/types/generated/modules/grid/Layer.d.ts +65 -0
  473. package/types/generated/modules/grid/index.d.ts +86 -0
  474. package/types/generated/modules/hlod/index.d.ts +11 -0
  475. package/types/generated/modules/hud/index.d.ts +10 -0
  476. package/types/generated/modules/lights/index.d.ts +13 -0
  477. package/types/generated/modules/music/Music.d.ts +111 -0
  478. package/types/generated/modules/net/Net.d.ts +34 -0
  479. package/types/generated/modules/net/index.d.ts +53 -0
  480. package/types/generated/modules/net/transports.d.ts +58 -0
  481. package/types/generated/modules/particles/Particles.d.ts +69 -0
  482. package/types/generated/modules/sky/Sky.d.ts +145 -0
  483. package/types/generated/modules/sky/skyModule.d.ts +10 -0
  484. package/types/generated/modules/timeline/Timeline.d.ts +51 -0
  485. package/types/generated/modules/water/Water.d.ts +29 -0
  486. package/types/generated/modules/weather/Weather.d.ts +62 -0
  487. package/types/generated/modules/world/World.d.ts +242 -0
  488. package/types/generated/modules/world/index.d.ts +15 -0
  489. package/types/generated/render/PostFX.d.ts +125 -0
  490. package/types/generated/render/materials.d.ts +100 -0
  491. package/types/generated/render/patches.d.ts +41 -0
  492. package/types/generated/ui/Focus.d.ts +11 -0
  493. package/types/generated/ui/LoadingScreen.d.ts +2 -0
  494. package/types/generated/ui/UI.d.ts +57 -0
  495. package/types/nav.d.ts +52 -0
  496. package/types/physics.d.ts +592 -0
  497. package/types/style.d.ts +638 -0
  498. package/types/worker.d.ts +11 -0
  499. package/types/world.d.ts +772 -0
  500. package/ui/Focus.js +51 -0
  501. package/ui/LoadingScreen.js +42 -0
  502. package/ui/Parts.js +199 -0
  503. package/ui/UI.js +167 -0
  504. package/ui/defaults.js +85 -0
  505. package/ui/theme.js +124 -0
  506. package/ui/touchPart.js +49 -0
@@ -0,0 +1,111 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/music/Music.js (edit the JSDoc in the source, then run npm run map)
2
+ /**
3
+ * Background music -> engine.music. tracks; rules; fade: default fade seconds (2); duckDialogue: duck the music bus to this level during dialogue (default
4
+ * false = off; e.g. 0.35); duckFade; hold: rule debounce seconds (2)
5
+ * @param {MusicOptions} [opts]
6
+ * @returns {ModuleDef<Music>}
7
+ * @example engine.use(music({ tracks: { explore: '/music/explore.ogg' }, rules: [{ track: 'explore' }] }));
8
+ */
9
+ export function music(opts?: MusicOptions): ModuleDef<Music>;
10
+ /** engine.music */
11
+ export class Music {
12
+ /** Registered tracks @type {Map<string, { url?: string, volume?: number, loop?: boolean, stems?: { url: string, at?: number[], volume?: number }[] }>} */
13
+ tracks: Map<string, {
14
+ url?: string;
15
+ volume?: number;
16
+ loop?: boolean;
17
+ stems?: {
18
+ url: string;
19
+ at?: number[];
20
+ volume?: number;
21
+ }[];
22
+ }>;
23
+ /** Name of the track playing (or wanted) @type {string | null} */
24
+ current: string | null;
25
+ /** 0-1: how loud each stem of the playing track is (see the stems `at` range); fades in about half a second @type {number} */
26
+ intensity: number;
27
+ /**
28
+ * Register tracks: { name: url | { url, volume, loop, stems } }
29
+ * @param {Record<string, MusicTrack>} map
30
+ * @returns {this}
31
+ */
32
+ addTracks(map: Record<string, MusicTrack>): this;
33
+ /**
34
+ * Whether audio is usable
35
+ * @returns {boolean}
36
+ */
37
+ get ready(): boolean;
38
+ /** Auto track rules are in use */
39
+ get ruled(): boolean;
40
+ /**
41
+ * State (for debugging and tests): gain is the playing track's fade level, stems each stem's level
42
+ * @returns {{ current: string | null, playing: string | null, pending: string | null, override: string | null, intensity: number, gain: number, stems:
43
+ * number[] }}
44
+ */
45
+ get state(): {
46
+ current: string | null;
47
+ playing: string | null;
48
+ pending: string | null;
49
+ override: string | null;
50
+ intensity: number;
51
+ gain: number;
52
+ stems: number[];
53
+ };
54
+ /**
55
+ * Play a track (cross-fade over fade seconds). Does nothing if it is already playing; force replays it
56
+ * @param {string | null} name
57
+ * @param {{ fade?: number, force?: boolean }} [opts]
58
+ * @returns {void}
59
+ */
60
+ play(name: string | null, opts?: {
61
+ fade?: number;
62
+ force?: boolean;
63
+ }): void;
64
+ /**
65
+ * Fade out and stop (fade over fade seconds)
66
+ * @param {number} [fade]
67
+ * @returns {void}
68
+ */
69
+ stop(fade?: number): void;
70
+ /**
71
+ * Layer a one-shot piece (victory, discovered place...); the background dips to `duck` while it plays
72
+ * @param {string} name
73
+ * @param {{ duck?: number, volume?: number }} [opts]
74
+ * @returns {void}
75
+ */
76
+ stinger(name: string, opts?: {
77
+ duck?: number;
78
+ volume?: number;
79
+ }): void;
80
+ /**
81
+ * Set the auto track rules (null turns them off). opts: hold how many seconds a new result must be stable before switching, fade switch fade seconds,
82
+ * interval check interval
83
+ * @param {MusicRule[] | null} list
84
+ * @param {{ hold?: number, fade?: number, interval?: number }} [opts]
85
+ * @returns {this}
86
+ */
87
+ rules(list: MusicRule[] | null, opts?: {
88
+ hold?: number;
89
+ fade?: number;
90
+ interval?: number;
91
+ }): this;
92
+ /**
93
+ * Pick a track by hand, pausing the rules; override(null) hands control back
94
+ * @param {string | null} name
95
+ * @param {{ fade?: number, force?: boolean }} [opts]
96
+ * @returns {void}
97
+ */
98
+ override(name: string | null, opts?: {
99
+ fade?: number;
100
+ force?: boolean;
101
+ }): void;
102
+ /**
103
+ * Which track the current rules would pick (without switching)
104
+ * @returns {string | null | undefined}
105
+ */
106
+ pick(): string | null | undefined;
107
+ }
108
+ import type { MusicOptions } from '../../../gameplay';
109
+ import type { ModuleDef } from '../../../core';
110
+ import type { MusicRule } from '../../../gameplay';
111
+ import type { MusicTrack } from '../../../gameplay';
@@ -0,0 +1,34 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/net/Net.js (edit the JSDoc in the source, then run npm run map)
2
+ /** engine.net (installed by net()): role, who this machine is, connection state and counters. Changes go through engine.ops, never through net. @experimental */
3
+ export class Net {
4
+ /** 'host' or 'client' @type {'host' | 'client'} */
5
+ role: "host" | "client";
6
+ /**
7
+ * This machine's actor id on the host: 'player' on the host, e.g. 'guest-1' on a client (null until the first snapshot).
8
+ * A client calls itself 'player' locally (own avatar record, own bag), so game code rarely needs this; it is for showing names and for logs.
9
+ * @returns {string | null}
10
+ */
11
+ get actor(): string | null;
12
+ /** Client: has a connection and an up-to-date mirror. Host: always true @returns {boolean} */
13
+ get connected(): boolean;
14
+ /**
15
+ * Host: connected peers [{ id, actor }] (id from the transport, actor = world record / container id of that player). Client: []
16
+ * @returns {{ id: number, actor: string }[]}
17
+ */
18
+ get peers(): {
19
+ id: number;
20
+ actor: string;
21
+ }[];
22
+ /** Client: requests sent and not answered yet (seq -> op name). Host: empty @returns {Map<number, string>} */
23
+ get pending(): Map<number, string>;
24
+ /** Message counters: in / out, plus diffs, snapshots, rejected (host) or gaps (client: lost diffs that forced a snapshot) @returns {Record<string, number>} */
25
+ get stats(): Record<string, number>;
26
+ /**
27
+ * Client: attach a new transport after the connection dropped; the host answers with a full snapshot. Pass the old key to keep the same actor (and bag).
28
+ * @param {any} transport
29
+ * @returns {void}
30
+ * @example
31
+ * engine.events.on('net:close', () => setTimeout(() => engine.net.reconnect(webSocket(url, { key: oldKey })), 2000));
32
+ */
33
+ reconnect(transport: any): void;
34
+ }
@@ -0,0 +1,53 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/net/index.js (edit the JSDoc in the source, then run npm run map)
2
+ /**
3
+ * Optional co-op multiplayer: one host owns the state, clients mirror it and ask for changes through ops. Installed as engine.net.
4
+ * Host: peers' requests run as `ops.run(name, args, { source: 'net', actor })` only for ops defined with net: 'peer', with the op's args shape
5
+ * checked, the optional owner check, and a per-peer rate limit; the result comes back after the state diff that contains it.
6
+ * State: world records, containers, vars and the other save parts are sent as a snapshot on join and as diffs every syncEvery steps.
7
+ * Client: ops.run of a peer op returns { ok: true, pending: true, seq } (watch state or the net:result event, not the return value);
8
+ * its own avatar moves locally and is sent to the host (clamped to maxSpeed); other avatars glide between updates.
9
+ * Defaults per peer on the host (avatar: true): a world record { id: actor, kind: 'player' } (not saved) and a container with the actor id.
10
+ * @param {{ role: 'host' | 'client', transport: any, sync?: 'auto' | string[], syncEvery?: number, keepAlive?: number, rate?: number, burst?: number, maxSpeed?: number, posEvery?: number,
11
+ * actorFor?: (peerId: number) => string, actorFields?: string[], avatarFields?: string[], interpolate?: string[], avatar?: boolean,
12
+ * onJoin?: (e: any, peer: { id: number, actor: string }) => void, onLeave?: (e: any, peer: { id: number, actor: string }) => void }} opts
13
+ * sync: save parts to sync ('auto' = world, containers, vars and every other save part except random / level); syncEvery: steps between diffs (3 = 20/s);
14
+ * rate / burst: op requests per second per peer and the burst allowance; actorFields: record fields holding actor ids (swapped like ids, default ['owner']);
15
+ * avatarFields: own-avatar fields the client sends with its position; interpolate: record kinds that glide on clients (default ['player']).
16
+ * @returns {import('../../../core').ModuleDef<Net>}
17
+ * @example
18
+ * // host
19
+ * engine.ops.define('chest.take', { net: 'peer', args: { chest: 'id', item: 'string' },
20
+ * can: (e, a, ctx) => e.inventory.container(a.chest).has(a.item) || 'empty',
21
+ * run: (e, a, ctx) => e.inventory.transfer(a.chest, ctx.actor, a.item, 1) });
22
+ * engine.use(net({ role: 'host', transport: webSocket('ws://localhost:8787/farm', { host: true }) }));
23
+ * // client (same game code, same op definitions)
24
+ * engine.use(net({ role: 'client', transport: webSocket('ws://192.168.1.5:8787/farm') }));
25
+ * engine.ops.run('chest.take', { chest: 'chest-1', item: 'apple' }); // -> { ok: true, pending: true, seq: 1 }
26
+ * @experimental
27
+ */
28
+ export function net(opts?: {
29
+ role: "host" | "client";
30
+ transport: any;
31
+ sync?: "auto" | string[];
32
+ syncEvery?: number;
33
+ keepAlive?: number;
34
+ rate?: number;
35
+ burst?: number;
36
+ maxSpeed?: number;
37
+ posEvery?: number;
38
+ actorFor?: (peerId: number) => string;
39
+ actorFields?: string[];
40
+ avatarFields?: string[];
41
+ interpolate?: string[];
42
+ avatar?: boolean;
43
+ onJoin?: (e: any, peer: {
44
+ id: number;
45
+ actor: string;
46
+ }) => void;
47
+ onLeave?: (e: any, peer: {
48
+ id: number;
49
+ actor: string;
50
+ }) => void;
51
+ }): import("../../../core").ModuleDef<Net>;
52
+ import { Net } from './Net.js';
53
+ export { fakeNetwork, webSocket } from "./transports.js";
@@ -0,0 +1,58 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/net/transports.js (edit the JSDoc in the source, then run npm run map)
2
+ /**
3
+ * An in-process network for tests and offline demos: one host and any number of clients in the same page, with optional latency, jitter and loss.
4
+ * Messages are deep-copied on send (no shared objects, like a real wire). Order per link is kept, as on a WebSocket.
5
+ * manual: true delivers only when you call advance(ms) (deterministic tests); otherwise messages land after real time.
6
+ * @param {{ latency?: number, jitter?: number, loss?: number, seed?: number, manual?: boolean }} [opts] latency / jitter in ms, loss 0..1
7
+ * @returns {{ host(): any, connect(opts?: { key?: string }): any, advance(ms: number): void, readonly now: number, loss: number, latency: number, jitter: number }}
8
+ * @example
9
+ * const wire = fakeNetwork({ latency: 80, jitter: 30, loss: 0.05, manual: true });
10
+ * host.use(net({ role: 'host', transport: wire.host() }));
11
+ * guest.use(net({ role: 'client', transport: wire.connect() }));
12
+ * wire.advance(100); // deliver what is due in the next 100 ms
13
+ * @experimental
14
+ */
15
+ export function fakeNetwork(opts?: {
16
+ latency?: number;
17
+ jitter?: number;
18
+ loss?: number;
19
+ seed?: number;
20
+ manual?: boolean;
21
+ }): {
22
+ host(): any;
23
+ connect(opts?: {
24
+ key?: string;
25
+ }): any;
26
+ advance(ms: number): void;
27
+ readonly now: number;
28
+ loss: number;
29
+ latency: number;
30
+ jitter: number;
31
+ };
32
+ /**
33
+ * WebSocket transport: talks to the relay in packages/tools/net-relay.mjs (`node packages/tools/net-relay.mjs 8787`).
34
+ * The host joins a room with host: true; clients join the same room. The relay assigns peer ids and remembers each client's key for reconnects.
35
+ * Messages are JSON. For a dedicated server or Colyseus, write another transport with the same send / on / close shape instead.
36
+ * @param {string} url e.g. 'ws://localhost:8787/my-room'
37
+ * @param {{ host?: boolean, key?: string }} [opts] key: reuse a previous peer id after a reconnect (read transport.key after 'open')
38
+ * @returns {{ send(msg: any, to?: number): void, on(type: string, fn: Function): { remove(): void }, close(): void, key: string | null, id: number | null }}
39
+ * @example
40
+ * engine.use(net({ role: 'host', transport: webSocket('ws://localhost:8787/farm', { host: true }) }));
41
+ * // on a friend's machine
42
+ * const t = webSocket('ws://192.168.1.5:8787/farm', { key: localStorage.netKey });
43
+ * t.on('open', () => { localStorage.netKey = t.key; });
44
+ * engine.use(net({ role: 'client', transport: t }));
45
+ * @experimental
46
+ */
47
+ export function webSocket(url: string, { host, key }?: {
48
+ host?: boolean;
49
+ key?: string;
50
+ }): {
51
+ send(msg: any, to?: number): void;
52
+ on(type: string, fn: Function): {
53
+ remove(): void;
54
+ };
55
+ close(): void;
56
+ key: string | null;
57
+ id: number | null;
58
+ };
@@ -0,0 +1,69 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/particles/Particles.js (edit the JSDoc in the source, then run npm run map)
2
+ /**
3
+ * Particles -> engine.particles
4
+ * @returns {ModuleDef<Particles>}
5
+ */
6
+ export function particles(): ModuleDef<Particles>;
7
+ /** @import { ModuleDef } from '../../../core' */
8
+ /** @import { Object3D, PositionLike } from '../../../common' */
9
+ /** @import { ParticleEffect, ParticleEmitter, ParticleOptions } from '../../../gameplay' */
10
+ /** engine.particles */
11
+ export class Particles {
12
+ /** Defined effects @type {Map<string, ParticleEffect>} */
13
+ effects: Map<string, ParticleEffect>;
14
+ /**
15
+ * Define an effect (same name replaces it, and emitters attached to it move to the new definition); params sit on top of the style
16
+ * pack preset. Returns the effect object: .points is its THREE.Points, .material is the shader material
17
+ * @param {string} name
18
+ * @param {ParticleOptions} [opts]
19
+ * @returns {ParticleEffect}
20
+ */
21
+ define(name: string, opts?: ParticleOptions): ParticleEffect;
22
+ /**
23
+ * Whether this effect has been defined
24
+ * @param {string} name
25
+ * @returns {boolean}
26
+ */
27
+ has(name: string): boolean;
28
+ /**
29
+ * Burst: emit count particles at once (default 10) at position (Vector3 / Object3D / [x, y, z] / {x, y, z}). overrides affect this batch only (color, speed, direction...; max/texture/blending cannot be changed temporarily)
30
+ * @param {string} name
31
+ * @param {PositionLike} position
32
+ * @param {{ count?: number, overrides?: ParticleOptions | null }} [opts]
33
+ * @returns {void}
34
+ */
35
+ emit(name: string, position: PositionLike, opts?: {
36
+ count?: number;
37
+ overrides?: ParticleOptions | null;
38
+ }): void;
39
+ /**
40
+ * Keep emitting while following an object: rate per second, offset in the object's local coordinates [x, y, z] (meters). Returns a handle { remove(), rate, active } (active = false pauses)
41
+ * @param {string} name
42
+ * @param {Object3D} object3d
43
+ * @param {{ rate?: number, offset?: number[], overrides?: ParticleOptions | null }} [opts]
44
+ * @returns {ParticleEmitter}
45
+ */
46
+ attach(name: string, object3d: THREE.Object3D, opts?: {
47
+ rate?: number;
48
+ offset?: number[];
49
+ overrides?: ParticleOptions | null;
50
+ }): ParticleEmitter;
51
+ /**
52
+ * Live particle count (no name = all)
53
+ * @param {string} [name]
54
+ * @returns {number}
55
+ */
56
+ count(name?: string): number;
57
+ /**
58
+ * Clear one effect's (or all) particles
59
+ * @param {string} [name]
60
+ * @returns {void}
61
+ */
62
+ clear(name?: string): void;
63
+ }
64
+ import type { ModuleDef } from '../../../core';
65
+ import type { ParticleEffect } from '../../../gameplay';
66
+ import * as THREE from 'three';
67
+ import type { ParticleOptions } from '../../../gameplay';
68
+ import type { PositionLike } from '../../../common';
69
+ import type { ParticleEmitter } from '../../../gameplay';
@@ -0,0 +1,145 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/sky/Sky.js (edit the JSDoc in the source, then run npm run map)
2
+ /** engine.sky */
3
+ export class Sky {
4
+ /**
5
+ * Sky time of day: 0-1 (0 midnight, 0.25 6am, 0.5 noon, 0.75 6pm); one day = dayLength game seconds (the unit of engine.clock.now). Fixed-step seconds
6
+ * (unaffected by timeScale) are engine.elapsed @type {number}
7
+ */
8
+ timeOfDay: number;
9
+ /**
10
+ * Game seconds per day (1 sky hour = dayLength / 24 game seconds; at timeScale 1 game seconds equal fixed-step seconds); Infinity = the time of day never
11
+ * moves @type {number}
12
+ */
13
+ dayLength: number;
14
+ /** Day number (1-based) @type {number} */
15
+ day: number;
16
+ /** Days per season for seasons given by name only @type {number} */
17
+ daysPerSeason: number;
18
+ /** Season names, [] when the game has no seasons (the default) @type {string[]} */
19
+ seasons: string[];
20
+ /** Dome mesh @type {Object3D} */
21
+ dome: THREE.Object3D;
22
+ /** Hemisphere ambient light (engine.lights.hemi, driven by the sky) @type {any} */
23
+ hemi: any;
24
+ /** Sun directional light (engine.lights.sun driven by the sky; moonlight at night, shadows live on it) @type {any} */
25
+ sun: any;
26
+ /** Sun direction (unit vector toward the sun) @type {Vector3} */
27
+ sunDir: THREE.Vector3;
28
+ /**
29
+ * Sun orbit: tilt = north-south tilt, sway = east-west swing, distance = light distance (meters) @type {{ tilt: number, sway: number, distance: number }}
30
+ */
31
+ orbit: {
32
+ tilt: number;
33
+ sway: number;
34
+ distance: number;
35
+ };
36
+ /** Current shadow params (change via look.shadow.set) @readonly @type {SkyShadowParams} */
37
+ readonly shadow: SkyShadowParams;
38
+ /** three's CSM (addons/csm) while shadow.cascades > 1, else null; its lights[0] is sun (recipes/45) @type {any} */
39
+ csm: any;
40
+ /** Hours per day @type {number} */
41
+ hoursPerDay: number;
42
+ /** Composite of all modifier layers (read-only; use modify to adjust brightness) @readonly @type {SkyModifiers} */
43
+ readonly modifiers: SkyModifiers;
44
+ /**
45
+ * Write a modifier layer (only the given fields; unwritten fields have no effect); values null removes the layer. Weather uses the 'weather' layer, games use
46
+ * their own layer name.
47
+ * Layers composite every frame: sun / ambient / fog multiply; tint blends weighted by tintAmount; flash takes the max
48
+ * @example engine.sky.modify('cave', { sun: 0.3, ambient: 0.4 }); engine.sky.modify('cave', null);
49
+ * @param {string} owner
50
+ * @param {SkyLayer | null} values
51
+ * @returns {this}
52
+ */
53
+ modify(owner: string, values: SkyLayer | null): this;
54
+ /**
55
+ * Shadow resolution (pixels)
56
+ * @returns {number}
57
+ */
58
+ get shadowMapSize(): number;
59
+ /** Clock text, e.g. "18:00" */
60
+ get clock(): string;
61
+ /** Sun elevation -1 (midnight) ... 0 (horizon) ... 1 (noon). Day/night is computed only here; other modules read isDay / daylight */
62
+ get sunHeight(): number;
63
+ /** Whether it is daytime (sun above the horizon) */
64
+ get isDay(): boolean;
65
+ /** Daylight amount 0-1 (0 at night, 1 at noon); ambience etc. fade by it */
66
+ get daylight(): number;
67
+ /** Current season index, -1 without seasons */
68
+ get seasonIndex(): number;
69
+ /** Current season name, e.g. 'spring'; null without seasons @type {string | null} */
70
+ get season(): string | null;
71
+ /** Day within the season (1-based); 0 without seasons */
72
+ get dayOfSeason(): number;
73
+ /** Fraction of the season elapsed, 0-1 (includes time of day); 0 without seasons */
74
+ get seasonProgress(): number;
75
+ /** Total game time in days (fractional), for growth, cooldowns and the like */
76
+ get totalDays(): number;
77
+ /**
78
+ * Call fn every day at a clock time: at('18:00', fn) or at(0.75, fn).
79
+ * Fires only when time moves forward across the clock time: natural flow, step fast-forward and setting timeOfDay later all count;
80
+ * crossing several triggers at once is replayed per catchUp; rewinding time and loading a save do not fire, they only reset the baseline.
81
+ * To hold a state during a time range (lights, shop door) use between
82
+ * @param {string | number} clock 'HH:MM' or 0-1
83
+ * @param {(day: number) => void} fn
84
+ * @param {SkyAtOptions} [opts]
85
+ * @returns {Handle}
86
+ */
87
+ at(clock: string | number, fn: (day: number) => void, opts?: SkyAtOptions): Handle;
88
+ /**
89
+ * Time-range switch: on() while clock time is in [from, to), otherwise off() (from > to wraps midnight).
90
+ * Aligns once immediately on registration, new game, load, applying a scenario and time rewind; afterwards it calls on/off when crossing a boundary
91
+ * @example engine.sky.between('18:00', '06:00', { on: () => lamp.on(), off: () => lamp.off() })
92
+ * @param {string | number} from
93
+ * @param {string | number} to
94
+ * @param {SkyBetweenOptions} opts
95
+ * @returns {Handle}
96
+ */
97
+ between(from: string | number, to: string | number, opts: SkyBetweenOptions): Handle;
98
+ /**
99
+ * Call fn(day) at the start of each day (00:00)
100
+ * @param {(day: number) => void} fn
101
+ * @param {SkyAtOptions} [opts]
102
+ * @returns {Handle}
103
+ */
104
+ daily(fn: (day: number) => void, opts?: SkyAtOptions): Handle;
105
+ /**
106
+ * Call fn(seasonName) on entering season name
107
+ * @param {string} name
108
+ * @param {(season: string) => void} fn
109
+ * @returns {Handle}
110
+ */
111
+ onSeason(name: string, fn: (season: string) => void): Handle;
112
+ /**
113
+ * Renamed in 0.2: throws and names the new call, engine.look.shadow.set(opts) (fields: bias, normalBias, updateEvery, snap, ahead, type, radius, blurSamples, cascades; recipes/45)
114
+ * @param {Partial<SkyShadowParams>} [_opts]
115
+ * @returns {never}
116
+ */
117
+ setShadow(_opts?: Partial<SkyShadowParams>): never;
118
+ /**
119
+ * Change shadow resolution (raise temporarily for photo mode)
120
+ * @param {number} n pixels
121
+ * @returns {void}
122
+ */
123
+ setShadowMapSize(n: number): void;
124
+ /**
125
+ * Renamed in 0.2: throws and names the new call, engine.look.env.replace(source) then engine.look.env.set({ intensity, rotation, interval })
126
+ * @param {{ source?: string | null, intensity?: number, rotation?: number, interval?: number } | null} [_opts]
127
+ * @returns {never}
128
+ */
129
+ setEnvironment(_opts?: {
130
+ source?: string | null;
131
+ intensity?: number;
132
+ rotation?: number;
133
+ interval?: number;
134
+ } | null): never;
135
+ /** Environment lighting now: { source, intensity, rotation, interval, builds }, null when off @type {SkyEnvironmentInfo | null} */
136
+ get environment(): SkyEnvironmentInfo | null;
137
+ }
138
+ import * as THREE from 'three';
139
+ import type { SkyShadowParams } from '../../../style';
140
+ import type { SkyModifiers } from '../../../world';
141
+ import type { SkyLayer } from '../../../world';
142
+ import type { SkyAtOptions } from '../../../world';
143
+ import type { Handle } from '../../../common';
144
+ import type { SkyBetweenOptions } from '../../../world';
145
+ import type { SkyEnvironmentInfo } from '../../../world';
@@ -0,0 +1,10 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/sky/skyModule.js (edit the JSDoc in the source, then run npm run map)
2
+ /**
3
+ * Sky, day/night, calendar -> engine.sky
4
+ * @param {SkyOptions} [opts]
5
+ * @returns {ModuleDef<Sky>}
6
+ */
7
+ export function sky(opts?: SkyOptions): ModuleDef<Sky>;
8
+ import type { SkyOptions } from '../../../world';
9
+ import { Sky } from './Sky.js';
10
+ import type { ModuleDef } from '../../../core';
@@ -0,0 +1,51 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/timeline/Timeline.js (edit the JSDoc in the source, then run npm run map)
2
+ /**
3
+ * Timeline (cutscenes, tweens) -> engine.timeline.
4
+ * timeline({ skipKeys: ['Escape', 'Backspace'] })(timeline({ skipKeys: ['Escape', 'Backspace'] }) (Esc is the back key, dispatched by the UI focus stack)
5
+ * Optional dependency: dialogue (say step). The camera module cooperates with engine.cameraOverride automatically.
6
+ * @param {TimelineOptions} [opts]
7
+ * @returns {ModuleDef<Timeline>}
8
+ */
9
+ export function timeline(opts?: TimelineOptions): ModuleDef<Timeline>;
10
+ /** engine.timeline */
11
+ export class Timeline {
12
+ /** Skip every cutscene immediately (set by scenario param cutscene=skip) @type {boolean} */
13
+ skipAll: boolean;
14
+ /**
15
+ * Whether a cutscene is playing
16
+ * @returns {boolean}
17
+ */
18
+ get playing(): boolean;
19
+ /**
20
+ * General tween (the only entry point for tweens in the engine): await engine.timeline.tween(mesh, { 'position.y': 2 }, 1, 'outCubic'); duration in seconds.
21
+ * Returns a Promise (with finish()/cancel())
22
+ * @param {any} target
23
+ * @param {TweenTo} to
24
+ * @param {number} [duration]
25
+ * @param {Ease} [ease]
26
+ * @returns {TweenPromise}
27
+ */
28
+ tween(target: any, to: TweenTo, duration?: number, ease?: Ease): TweenPromise;
29
+ /**
30
+ * Play a timeline; resolves with { skipped } when it ends
31
+ * @param {TimelineStep | TimelineStep[]} steps
32
+ * @param {TimelinePlayOptions} [opts]
33
+ * @returns {Promise<{ skipped: boolean }>}
34
+ */
35
+ play(steps: TimelineStep | TimelineStep[], opts?: TimelinePlayOptions): Promise<{
36
+ skipped: boolean;
37
+ }>;
38
+ /**
39
+ * Skip all (or one) playing timelines
40
+ * @param {any} [run]
41
+ * @returns {void}
42
+ */
43
+ skip(run?: any): void;
44
+ }
45
+ import type { TimelineOptions } from '../../../gameplay';
46
+ import type { ModuleDef } from '../../../core';
47
+ import type { TweenTo } from '../../../gameplay';
48
+ import type { Ease } from '../../../common';
49
+ import type { TweenPromise } from '../../../gameplay';
50
+ import type { TimelineStep } from '../../../gameplay';
51
+ import type { TimelinePlayOptions } from '../../../gameplay';
@@ -0,0 +1,29 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/water/Water.js (edit the JSDoc in the source, then run npm run map)
2
+ /**
3
+ * Water → engine.water. Global level defaults to the terrain water level; independent bodies use engine.addWaterBody()
4
+ * @param {WaterOptions} [opts]
5
+ * @returns {ModuleDef<Water>}
6
+ */
7
+ export function water(opts?: WaterOptions): ModuleDef<Water>;
8
+ /** engine.water */
9
+ export class Water {
10
+ /**
11
+ * Water material (shared by all water)
12
+ * @type {Material}
13
+ */
14
+ material: THREE.Material;
15
+ /**
16
+ * Water body → mesh
17
+ * @type {Map<WaterBody, THREE.Mesh>}
18
+ */
19
+ bodies: Map<WaterBody, THREE.Mesh>;
20
+ /**
21
+ * Global water mesh (null when absent)
22
+ * @type {THREE.Mesh | null}
23
+ */
24
+ sea: THREE.Mesh | null;
25
+ }
26
+ import type { WaterOptions } from '../../../world';
27
+ import type { ModuleDef } from '../../../core';
28
+ import * as THREE from 'three';
29
+ import type { WaterBody } from '../../../world';
@@ -0,0 +1,62 @@
1
+ // Generated by npm run map, do not edit by hand. Source: packages/engine/modules/weather/Weather.js (edit the JSDoc in the source, then run npm run map)
2
+ /**
3
+ * Weather → engine.weather (install sky first)
4
+ * @param {WeatherOptions} [opts]
5
+ * @returns {ModuleDef<Weather>}
6
+ */
7
+ export function weather(opts?: WeatherOptions): ModuleDef<Weather>;
8
+ /** engine.weather */
9
+ export class Weather {
10
+ /**
11
+ * The weather types this game has: name -> numbers (the standard fields plus any of the game's own, all blended on change) @type {Record<string,
12
+ * WeatherPreset>}
13
+ */
14
+ types: Record<string, WeatherPreset>;
15
+ /** Current (mid-transition) weather parameters @type {WeatherPreset} */
16
+ current: WeatherPreset;
17
+ /** Current weather name @type {string} */
18
+ name: string;
19
+ /** Automatic weather on/off @type {boolean} */
20
+ auto: boolean;
21
+ /** Candidates for automatic weather (repeat a name to make it likelier) @type {string[]} */
22
+ autoPool: string[];
23
+ /** Automatic weather interval [min, max] seconds @type {number[]} */
24
+ autoInterval: number[];
25
+ /** Transition seconds for automatic weather @type {number} */
26
+ autoTransition: number;
27
+ /** Default particle count per system (halved on low-tier devices) @type {number} */
28
+ particles: number;
29
+ /** Particle systems drawn now: field -> { field, object, uniforms } (rain / snow when the table has them, plus define()) @type {Map<string, any>} */
30
+ systems: Map<string, any>;
31
+ /**
32
+ * Renamed in 0.2: throws and names the new call, engine.look.weather.replace({ [field]: spec }) (recipes/44-water-weather-look-hooks.md)
33
+ * @param {string} _field
34
+ * @param {import('../../../style').StyleWeatherParticles} [_spec]
35
+ * @returns {never}
36
+ */
37
+ define(_field: string, _spec?: import("../../../style").StyleWeatherParticles): never;
38
+ /**
39
+ * Automatic weather on/off
40
+ * @param {boolean} on
41
+ * @returns {void}
42
+ */
43
+ setAuto(on: boolean): void;
44
+ /**
45
+ * Switch weather. seconds: transition seconds, default 15
46
+ * @param {WeatherName} name
47
+ * @param {number} [seconds]
48
+ * @returns {void}
49
+ */
50
+ set(name: WeatherName, seconds?: number): void;
51
+ /**
52
+ * Display name of a weather (string table weather.<name>, falls back to the name itself); defaults to the current weather
53
+ * @param {string} [name]
54
+ * @returns {string}
55
+ */
56
+ label(name?: string): string;
57
+ }
58
+ import type { WeatherOptions } from '../../../world';
59
+ import type { ModuleDef } from '../../../core';
60
+ import type { WeatherPreset } from '../../../world';
61
+ import * as THREE from 'three';
62
+ import type { WeatherName } from '../../../world';