lecodes-sdk 1.2.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 (260) hide show
  1. package/README.md +5 -2
  2. package/dist/editor.d.ts +12 -0
  3. package/dist/global.d.ts +4 -8
  4. package/dist/host.d.ts +2 -3
  5. package/dist/types/animate/tween/Animation.d.ts +0 -3
  6. package/dist/types/animate/tween/animateValue.d.ts +4 -2
  7. package/dist/types/animate/tween/easing.d.ts +8 -0
  8. package/dist/types/animate/tween/spec.d.ts +15 -7
  9. package/dist/types/audio/audio.d.ts +2 -1
  10. package/dist/types/canvas/Canvas.d.ts +40 -108
  11. package/dist/types/canvas/gen/cssColor.d.ts +17 -0
  12. package/dist/types/canvas/gen/recorder.d.ts +118 -0
  13. package/dist/types/canvas/gen/spec.d.ts +144 -0
  14. package/dist/types/core/color.d.ts +3 -1
  15. package/dist/types/core/pins.d.ts +18 -0
  16. package/dist/types/g2/Node2D.d.ts +5 -8
  17. package/dist/types/g2/Scene2D.d.ts +6 -2
  18. package/dist/types/gl/Foliage.d.ts +30 -7
  19. package/dist/types/gl/Light.d.ts +8 -0
  20. package/dist/types/gl/Lightmap.d.ts +13 -2
  21. package/dist/types/gl/Material.d.ts +17 -3
  22. package/dist/types/gl/Model.d.ts +6 -2
  23. package/dist/types/gl/Node.d.ts +3 -6
  24. package/dist/types/gl/Scene.d.ts +41 -13
  25. package/dist/types/gl/Texture.d.ts +1 -1
  26. package/dist/types/gl/animation/Locomotion.d.ts +8 -1
  27. package/dist/types/inject.d.ts +11 -11
  28. package/dist/types/inject.editor.d.ts +1 -0
  29. package/dist/types/net/core.d.ts +7 -0
  30. package/dist/types/plugin.d.ts +76 -0
  31. package/dist/types/plugins/gen/camera/sdk/camera.d.ts +24 -0
  32. package/dist/types/plugins/gen/camera/sdk/camera.gen.d.ts +25 -0
  33. package/dist/types/plugins/{geolocation.d.ts → gen/geolocation/sdk/geolocation.d.ts} +2 -20
  34. package/dist/types/plugins/gen/geolocation/sdk/geolocation.gen.d.ts +31 -0
  35. package/dist/types/plugins/{map.d.ts → gen/map/sdk/map.d.ts} +9 -50
  36. package/dist/types/plugins/gen/map/sdk/map.gen.d.ts +53 -0
  37. package/dist/types/plugins/gen/push/sdk/push.d.ts +23 -0
  38. package/dist/types/plugins/gen/push/sdk/push.gen.d.ts +35 -0
  39. package/dist/types/plugins/{qr.d.ts → gen/qr-scanner/sdk/qr-scanner.d.ts} +2 -3
  40. package/dist/types/plugins/gen/qr-scanner/sdk/qr-scanner.gen.d.ts +15 -0
  41. package/dist/types/runtime/app.d.ts +9 -2
  42. package/dist/types/runtime/fetch.d.ts +2 -0
  43. package/dist/types/runtime/input.d.ts +1 -1
  44. package/dist/types/runtime/media.d.ts +6 -10
  45. package/dist/types/runtime/misc.d.ts +4 -1
  46. package/dist/types/runtime/net.d.ts +3 -2
  47. package/dist/types/runtime/touch.d.ts +32 -0
  48. package/dist/types/scene/defineScene.d.ts +43 -2
  49. package/dist/types/scene/editor.d.ts +52 -0
  50. package/dist/types/scene/gizmos.d.ts +7 -4
  51. package/dist/types/ui/NativeView.d.ts +6 -4
  52. package/dist/types/ui/UI.d.ts +1 -1
  53. package/dist/types/ui/UIBottomSheet.d.ts +6 -12
  54. package/dist/types/ui/UIButton.d.ts +12 -14
  55. package/dist/types/ui/UIContainer.d.ts +0 -6
  56. package/dist/types/ui/UIImage.d.ts +1 -4
  57. package/dist/types/ui/UIInput.d.ts +8 -24
  58. package/dist/types/ui/UIModal.d.ts +0 -2
  59. package/dist/types/ui/UINode.d.ts +70 -56
  60. package/dist/types/ui/UIPager.d.ts +28 -27
  61. package/dist/types/ui/UIPopover.d.ts +0 -2
  62. package/dist/types/ui/UIScreen.d.ts +12 -17
  63. package/dist/types/ui/UIScrollable.d.ts +1 -4
  64. package/dist/types/ui/UIText.d.ts +0 -2
  65. package/dist/types/ui/UIVideo.d.ts +3 -5
  66. package/dist/types/ui/UIVirtualizedList.d.ts +14 -16
  67. package/dist/types/ui/UIWidget.d.ts +10 -9
  68. package/dist/types/ui/colorKeys.gen.d.ts +9 -0
  69. package/dist/types/ui/presentable.d.ts +46 -32
  70. package/dist/types/ui/router.d.ts +18 -7
  71. package/dist/types/ui/styleColor.d.ts +1 -0
  72. package/dist/types/ui/transitions.d.ts +18 -0
  73. package/dist/types/ui/tree.d.ts +75 -0
  74. package/dist/types/version.d.ts +10 -0
  75. package/dist/types.json +1 -1
  76. package/package.json +12 -3
  77. package/prompts/2d.md +2 -6
  78. package/prompts/3d.md +1 -5
  79. package/prompts/README.md +1 -1
  80. package/prompts/canvas.md +9 -8
  81. package/prompts/compose.ts +1 -1
  82. package/prompts/core.md +3 -3
  83. package/prompts/design.md +1 -1
  84. package/prompts/dist/2d-game.md +473 -239
  85. package/prompts/dist/3d-app.md +553 -205
  86. package/prompts/dist/ar-app.md +435 -202
  87. package/prompts/dist/design.md +113 -95
  88. package/prompts/dist/ui-app.md +386 -170
  89. package/prompts/ui-design.md +2 -3
  90. package/prompts/ui.md +45 -37
  91. package/src/animate/tween/Animation.ts +34 -150
  92. package/src/animate/tween/Timeline.ts +175 -175
  93. package/src/animate/tween/animateValue.ts +6 -3
  94. package/src/animate/tween/easing.ts +10 -3
  95. package/src/animate/tween/spec.ts +41 -15
  96. package/src/audio/Sound.ts +3 -3
  97. package/src/audio/audio.ts +2 -1
  98. package/src/bridges/2d.d.ts +317 -0
  99. package/src/bridges/app.d.ts +91 -0
  100. package/src/bridges/audio.d.ts +97 -0
  101. package/src/bridges/canvas.d.ts +79 -0
  102. package/src/bridges/device.d.ts +72 -0
  103. package/src/bridges/fetch.d.ts +80 -0
  104. package/src/bridges/files.d.ts +70 -0
  105. package/src/bridges/gl.d.ts +1133 -0
  106. package/src/bridges/input.d.ts +72 -0
  107. package/src/bridges/media.d.ts +55 -0
  108. package/src/bridges/nav.d.ts +71 -0
  109. package/src/bridges/net.d.ts +52 -0
  110. package/src/bridges/service.d.ts +52 -0
  111. package/src/bridges/socket.d.ts +31 -0
  112. package/src/bridges/storage.d.ts +33 -0
  113. package/src/bridges/tree.d.ts +301 -0
  114. package/src/bridges/types.d.ts +49 -0
  115. package/src/canvas/Canvas.ts +114 -159
  116. package/src/canvas/gen/cssColor.ts +224 -0
  117. package/src/canvas/gen/recorder.ts +212 -0
  118. package/src/canvas/gen/spec.ts +201 -0
  119. package/src/chisel.ts +193 -0
  120. package/src/compile/assetMacro.ts +1 -1
  121. package/src/compile/bundler.ts +11 -2
  122. package/src/compile/compileProject.ts +43 -4
  123. package/src/compile/fontMacro.ts +3 -4
  124. package/src/compile/header.ts +26 -5
  125. package/src/compile/index.ts +3 -1
  126. package/src/compile/liteMaterial.ts +1 -1
  127. package/src/compile/sceneEditor.ts +11 -26
  128. package/src/core/color.ts +73 -30
  129. package/src/core/pins.ts +51 -0
  130. package/src/core/signals.ts +8 -1
  131. package/src/g2/CharacterController2D.ts +3 -3
  132. package/src/g2/Node2D.ts +57 -39
  133. package/src/g2/Physics2D.ts +2 -2
  134. package/src/g2/Scene2D.ts +35 -23
  135. package/src/g2/Texture2D.ts +1 -1
  136. package/src/g2/loop.ts +4 -4
  137. package/src/gl/CameraPlace.ts +52 -52
  138. package/src/gl/Foliage.ts +72 -17
  139. package/src/gl/Geometry.ts +1 -2
  140. package/src/gl/Light.ts +10 -0
  141. package/src/gl/Lightmap.ts +45 -29
  142. package/src/gl/Material.ts +95 -51
  143. package/src/gl/Mesh.ts +120 -120
  144. package/src/gl/Model.ts +21 -16
  145. package/src/gl/Node.ts +91 -24
  146. package/src/gl/Particles.ts +1 -1
  147. package/src/gl/Scene.ts +100 -44
  148. package/src/gl/Texture.ts +8 -7
  149. package/src/gl/animation/AnimationClip.ts +1 -1
  150. package/src/gl/animation/DynamicBone.ts +482 -482
  151. package/src/gl/animation/Locomotion.ts +8 -3
  152. package/src/gl/nav/NavMesh.ts +3 -4
  153. package/src/gl/physics/Physics.ts +2 -2
  154. package/src/gl/physics/physicsEvents.ts +3 -3
  155. package/src/gl/scenarios.ts +291 -291
  156. package/src/gl/terrain/Terrain.ts +4 -5
  157. package/src/gl/touch.ts +14 -15
  158. package/src/host.d.ts +2 -3
  159. package/src/inject.editor.ts +7 -0
  160. package/src/inject.ts +13 -16
  161. package/src/net/core.ts +6 -5
  162. package/src/net/index.ts +1 -1
  163. package/src/net/replication.ts +1 -1
  164. package/src/plugin.ts +191 -0
  165. package/src/plugins/gen/camera/contract.d.ts +27 -0
  166. package/src/plugins/gen/camera/sdk/camera.gen.ts +46 -0
  167. package/src/plugins/gen/camera/sdk/camera.ts +57 -0
  168. package/src/plugins/gen/geolocation/contract.d.ts +50 -0
  169. package/src/plugins/gen/geolocation/sdk/geolocation.gen.ts +54 -0
  170. package/src/plugins/{geolocation.ts → gen/geolocation/sdk/geolocation.ts} +22 -43
  171. package/src/plugins/gen/map/contract.d.ts +144 -0
  172. package/src/plugins/gen/map/sdk/map.gen.ts +88 -0
  173. package/src/plugins/{map.ts → gen/map/sdk/map.ts} +68 -102
  174. package/src/plugins/gen/push/contract.d.ts +61 -0
  175. package/src/plugins/gen/push/sdk/push.gen.ts +60 -0
  176. package/src/plugins/gen/push/sdk/push.ts +105 -0
  177. package/src/plugins/gen/qr-scanner/contract.d.ts +16 -0
  178. package/src/plugins/gen/qr-scanner/sdk/qr-scanner.gen.ts +29 -0
  179. package/src/plugins/gen/qr-scanner/sdk/qr-scanner.ts +52 -0
  180. package/src/plugins/permission.ts +5 -4
  181. package/src/runtime/app.ts +20 -9
  182. package/src/runtime/appEvents.ts +5 -4
  183. package/src/runtime/channel.ts +18 -15
  184. package/src/runtime/clipboard.ts +4 -3
  185. package/src/runtime/datetime.ts +2 -1
  186. package/src/runtime/device.ts +17 -15
  187. package/src/runtime/fetch.ts +30 -20
  188. package/src/runtime/files.ts +16 -15
  189. package/src/runtime/input.ts +12 -10
  190. package/src/runtime/media.ts +50 -46
  191. package/src/runtime/misc.ts +7 -3
  192. package/src/runtime/net.ts +8 -7
  193. package/src/runtime/rpc.ts +1 -3
  194. package/src/runtime/service.ts +19 -14
  195. package/src/runtime/share.ts +4 -3
  196. package/src/runtime/storage.ts +6 -4
  197. package/src/runtime/touch.ts +32 -0
  198. package/src/scene/defineScene.ts +61 -365
  199. package/src/scene/editor.ts +408 -0
  200. package/src/scene/editorPlugins.ts +3 -3
  201. package/src/scene/gizmos.ts +15 -9
  202. package/src/server/db/marci/query.ts +1 -1
  203. package/src/server/host.ts +1 -1
  204. package/src/server/runtime.ts +1 -1
  205. package/src/ui/NativeView.ts +72 -25
  206. package/src/ui/UI.ts +3 -3
  207. package/src/ui/UIBottomSheet.ts +16 -17
  208. package/src/ui/UIButton.ts +54 -16
  209. package/src/ui/UIContainer.ts +0 -6
  210. package/src/ui/UIImage.ts +34 -30
  211. package/src/ui/UIInput.ts +29 -37
  212. package/src/ui/UIModal.ts +1 -3
  213. package/src/ui/UINode.ts +347 -297
  214. package/src/ui/UIPager.ts +93 -78
  215. package/src/ui/UIPopover.ts +0 -2
  216. package/src/ui/UIScreen.ts +41 -36
  217. package/src/ui/UIScrollable.ts +19 -13
  218. package/src/ui/UISpacer.ts +1 -1
  219. package/src/ui/UITabs.ts +8 -6
  220. package/src/ui/UIText.ts +7 -17
  221. package/src/ui/UIVideo.ts +30 -27
  222. package/src/ui/UIVirtualizedList.ts +58 -59
  223. package/src/ui/UIWidget.ts +38 -18
  224. package/src/ui/colorKeys.gen.ts +37 -0
  225. package/src/ui/fonts.ts +2 -2
  226. package/src/ui/presentable.ts +59 -42
  227. package/src/ui/router.ts +52 -35
  228. package/src/ui/styleColor.ts +56 -0
  229. package/src/ui/theme.ts +7 -6
  230. package/src/ui/transitions.ts +249 -0
  231. package/src/ui/tree.ts +346 -0
  232. package/src/version.ts +24 -0
  233. package/tests/helpers/engineWorld.ts +11 -0
  234. package/tests/helpers/fakeTree.ts +353 -0
  235. package/tests/helpers/hostStubs.ts +31 -0
  236. package/tests/helpers/index.ts +14 -0
  237. package/tests/helpers/memoryMarci.ts +124 -0
  238. package/tests/helpers/phases.ts +23 -0
  239. package/tests/helpers/preload.ts +18 -0
  240. package/tests/helpers/stubApp.ts +2 -0
  241. package/tests/helpers/stubDevice.ts +2 -0
  242. package/tests/helpers/stubFetch.ts +2 -0
  243. package/tests/helpers/stubInput.ts +2 -0
  244. package/dist/inject.js +0 -4629
  245. package/dist/types/core/registry.d.ts +0 -7
  246. package/dist/types/plugins/camera.d.ts +0 -25
  247. package/dist/types/plugins/push.d.ts +0 -46
  248. package/src/bridges.d.ts +0 -1769
  249. package/src/compile/__tests__/assetIconMacro.test.ts +0 -219
  250. package/src/compile/__tests__/assetMacro.test.ts +0 -100
  251. package/src/compile/__tests__/assetName.test.ts +0 -55
  252. package/src/compile/__tests__/compile.test.ts +0 -310
  253. package/src/compile/__tests__/detectEntry.test.ts +0 -151
  254. package/src/compile/__tests__/fontMacro.test.ts +0 -199
  255. package/src/compile/__tests__/serverSplit.test.ts +0 -27
  256. package/src/core/__tests__/stateMachine.test.ts +0 -132
  257. package/src/core/registry.ts +0 -23
  258. package/src/plugins/camera.ts +0 -81
  259. package/src/plugins/push.ts +0 -132
  260. package/src/plugins/qr.ts +0 -73
@@ -0,0 +1,144 @@
1
+ export declare const SPEC_VERSION = 1;
2
+ export declare const LineJoin: {
3
+ readonly MITER: 0;
4
+ readonly ROUND: 1;
5
+ readonly BEVEL: 2;
6
+ };
7
+ export type LineJoin = (typeof LineJoin)[keyof typeof LineJoin];
8
+ export declare const LineJoinName: readonly string[];
9
+ export declare const LineCap: {
10
+ readonly BUTT: 0;
11
+ readonly ROUND: 1;
12
+ readonly SQUARE: 2;
13
+ };
14
+ export type LineCap = (typeof LineCap)[keyof typeof LineCap];
15
+ export declare const LineCapName: readonly string[];
16
+ export declare const TextAlign: {
17
+ readonly LEFT: 0;
18
+ readonly CENTER: 1;
19
+ readonly RIGHT: 2;
20
+ readonly START: 3;
21
+ readonly END: 4;
22
+ };
23
+ export type TextAlign = (typeof TextAlign)[keyof typeof TextAlign];
24
+ export declare const TextAlignName: readonly string[];
25
+ export declare const TextBaseline: {
26
+ readonly ALPHABETIC: 0;
27
+ readonly TOP: 1;
28
+ readonly MIDDLE: 2;
29
+ readonly BOTTOM: 3;
30
+ readonly HANGING: 4;
31
+ readonly IDEOGRAPHIC: 5;
32
+ };
33
+ export type TextBaseline = (typeof TextBaseline)[keyof typeof TextBaseline];
34
+ export declare const TextBaselineName: readonly string[];
35
+ export declare const FillRule: {
36
+ readonly NONZERO: 0;
37
+ readonly EVENODD: 1;
38
+ };
39
+ export type FillRule = (typeof FillRule)[keyof typeof FillRule];
40
+ export declare const FillRuleName: readonly string[];
41
+ export declare const Spread: {
42
+ readonly PAD: 0;
43
+ readonly REFLECT: 1;
44
+ readonly REPEAT: 2;
45
+ };
46
+ export type Spread = (typeof Spread)[keyof typeof Spread];
47
+ export declare const SpreadName: readonly string[];
48
+ export declare const Gradient: {
49
+ readonly LINEAR: 0;
50
+ readonly RADIAL: 1;
51
+ };
52
+ export type Gradient = (typeof Gradient)[keyof typeof Gradient];
53
+ export declare const GradientName: readonly string[];
54
+ export declare const Paint: {
55
+ readonly COLOR: 0;
56
+ readonly LINEAR: 1;
57
+ readonly RADIAL: 2;
58
+ };
59
+ export type Paint = (typeof Paint)[keyof typeof Paint];
60
+ export declare const PaintName: readonly string[];
61
+ export declare const PathVerb: {
62
+ readonly MOVE: 0;
63
+ readonly LINE: 1;
64
+ readonly QUAD: 2;
65
+ readonly CUBIC: 3;
66
+ readonly CLOSE: 4;
67
+ };
68
+ export type PathVerb = (typeof PathVerb)[keyof typeof PathVerb];
69
+ export declare const PathVerbName: readonly string[];
70
+ export declare const ImageFormat: {
71
+ readonly PNG: 0;
72
+ readonly JPEG: 1;
73
+ };
74
+ export type ImageFormat = (typeof ImageFormat)[keyof typeof ImageFormat];
75
+ export declare const ImageFormatName: readonly string[];
76
+ /** The opcode stream: op id → the word after it. */
77
+ export declare const OP: {
78
+ readonly SAVE: 0;
79
+ readonly RESTORE: 1;
80
+ readonly TRANSLATE: 2;
81
+ readonly SCALE: 3;
82
+ readonly ROTATE: 4;
83
+ readonly TRANSFORM: 5;
84
+ readonly SET_TRANSFORM: 6;
85
+ readonly RESET_TRANSFORM: 7;
86
+ readonly GLOBAL_ALPHA: 8;
87
+ readonly FILL_STYLE: 9;
88
+ readonly STROKE_STYLE: 10;
89
+ readonly FILL_GRADIENT: 11;
90
+ readonly STROKE_GRADIENT: 12;
91
+ readonly LINE_WIDTH: 13;
92
+ readonly LINE_JOIN: 14;
93
+ readonly LINE_CAP: 15;
94
+ readonly MITER_LIMIT: 16;
95
+ readonly LINE_DASH: 17;
96
+ readonly LINE_DASH_OFFSET: 18;
97
+ readonly FONT: 19;
98
+ readonly TEXT_ALIGN: 20;
99
+ readonly TEXT_BASELINE: 21;
100
+ readonly LETTER_SPACING: 22;
101
+ readonly PATH_BEGIN: 23;
102
+ readonly PATH_CLOSE: 24;
103
+ readonly MOVE_TO: 25;
104
+ readonly LINE_TO: 26;
105
+ readonly QUADRATIC_TO: 27;
106
+ readonly BEZIER_TO: 28;
107
+ readonly ARC: 29;
108
+ readonly ARC_TO: 30;
109
+ readonly ELLIPSE: 31;
110
+ readonly RECT: 32;
111
+ readonly ROUND_RECT: 33;
112
+ readonly FILL: 34;
113
+ readonly STROKE: 35;
114
+ readonly CLIP: 36;
115
+ readonly FILL_RECT: 37;
116
+ readonly STROKE_RECT: 38;
117
+ readonly CLEAR_RECT: 39;
118
+ readonly FILL_TEXT: 40;
119
+ readonly STROKE_TEXT: 41;
120
+ readonly DRAW_IMAGE: 42;
121
+ };
122
+ export type OP = (typeof OP)[keyof typeof OP];
123
+ /** Operand layout per op: `args` is one letter per fixed word (f float, i int, r string ref);
124
+ * `repeat` is the group that follows the trailing count. */
125
+ export declare const OP_ARGS: Record<number, {
126
+ args: string;
127
+ repeat: string;
128
+ }>;
129
+ export declare const OP_NAME: readonly string[];
130
+ /** The draw list: command id → the word after it. */
131
+ export declare const DRAW: {
132
+ readonly SET_TRANSFORM: 0;
133
+ readonly SAVE: 1;
134
+ readonly RESTORE: 2;
135
+ readonly CLIP: 3;
136
+ readonly FILL_PATH: 4;
137
+ readonly STROKE_PATH: 5;
138
+ readonly FILL_TEXT: 6;
139
+ readonly STROKE_TEXT: 7;
140
+ readonly DRAW_IMAGE: 8;
141
+ readonly CLEAR_RECT: 9;
142
+ };
143
+ export type DRAW = (typeof DRAW)[keyof typeof DRAW];
144
+ export declare const DRAW_NAME: readonly string[];
@@ -8,6 +8,8 @@ export declare const Color: {
8
8
  toPackedRgb(c: ColorInput): number;
9
9
  /** 0xRRGGBBAA packed int (unsigned). */
10
10
  toPackedRgba(c: ColorInput): number;
11
- /** '#rrggbb' (or '#rrggbbaa' when alpha < 1) — for the 3D material color uniforms. */
11
+ /** '#rrggbbaa' (lower-case, always eight digits) — the UI wire form and the 3D material color. */
12
12
  toHexString(c: ColorInput): string;
13
+ /** [r,g,b,a] in 0..1, or `null` when `c` is not a color — the non-throwing probe. */
14
+ tryParse(c: unknown): [number, number, number, number] | null;
13
15
  };
@@ -0,0 +1,18 @@
1
+ /** The handle of a wrapper whose resource is gone: `id` 0, nothing to finalize. Replacing `_h`
2
+ * with it drops the real handle, so the runtime's record can go. */
3
+ export declare const DEAD_HANDLE: Handle;
4
+ export interface Pinned {
5
+ readonly _h: Handle;
6
+ /** The runtime freed the resource underneath (an ancestor's free): mark the wrapper dead. */
7
+ _freed?(): void;
8
+ }
9
+ export declare class Pins<T extends Pinned> {
10
+ private readonly map;
11
+ /** Keep `obj` alive and findable while native owns its resource. */
12
+ pin(obj: T | null | undefined): void;
13
+ unpin(id: number): void;
14
+ get(id: number): T | undefined;
15
+ has(id: number): boolean;
16
+ /** The runtime freed these resources: drop the pins, tell the wrappers. */
17
+ freed(ids: number[]): void;
18
+ }
@@ -1,6 +1,5 @@
1
1
  import { AspectHost } from "../core/Aspect";
2
2
  import type { CompAxis, CompWriter } from "../core/compWrite";
3
- import { Registry } from "../core/registry";
4
3
  import { Vec2, type Vec2Like } from "../math/vec";
5
4
  import type { ClickEvent, TouchStartEvent } from "../runtime/touch";
6
5
  import type { Animation } from "../animate/tween/Animation";
@@ -38,11 +37,9 @@ export type Contact2D = {
38
37
  normal: Vec2;
39
38
  speed: number;
40
39
  };
41
- /** id → Node2D, so host callbacks (animation events) route back to the owning JS object. */
42
- export declare const node2dRegistry: Registry<Node2D>;
43
40
  export declare class Node2D extends AspectHost<Node2DEvents> implements CompWriter {
44
- /** Native entity handle. */
45
- readonly id: number;
41
+ /** Native entity id. */
42
+ get id(): number;
46
43
  /** Optional debug/editor name (plain JS data — scene2d files stamp their node names here). */
47
44
  name?: string;
48
45
  protected _x: number;
@@ -54,9 +51,7 @@ export declare class Node2D extends AspectHost<Node2DEvents> implements CompWrit
54
51
  protected _z: number;
55
52
  protected _visible: boolean;
56
53
  private _pushXf;
57
- private _parent;
58
- private _children;
59
- constructor(internalId?: number);
54
+ constructor(internalId?: number | Handle);
60
55
  private _pull;
61
56
  get x(): number;
62
57
  set x(v: number);
@@ -103,5 +98,7 @@ export declare class Node2D extends AspectHost<Node2DEvents> implements CompWrit
103
98
  localToWorld(p: Vec2Like): Vec2;
104
99
  private _syncLocalFromNative;
105
100
  addEventListener<K extends keyof Node2DEvents>(channel: K, callback: Node2DEvents[K]): void;
101
+ /** Destroy this node and its whole subtree (children go with it — the 3D / UI contract). Every
102
+ * aspect in the subtree detaches first (physics bodies released, updaters unregistered). */
106
103
  destroy(): void;
107
104
  }
@@ -1,6 +1,6 @@
1
1
  import { type ColorInput } from "../core/color";
2
2
  import { type Aspect, type AspectCtor, type FieldOf, type TargetOf } from "../core/Aspect";
3
- import { Presentable, type PresentOptions } from "../ui/presentable";
3
+ import { Presentable, type DismissOptions, type PresentOptions } from "../ui/presentable";
4
4
  import { type Vec2Like } from "../math/vec";
5
5
  import type { ClickEvent, TouchStartEvent } from "../runtime/touch";
6
6
  import { Camera2D } from "./Camera2D";
@@ -62,11 +62,15 @@ export declare class Scene2D implements Presentable {
62
62
  onOpen(callback: () => void): this;
63
63
  /** Fires when the scene stops being visible (closed, replaced, or covered by a push). */
64
64
  onClose(callback: () => void): this;
65
+ /** Hardware/system back while the scene is current. */
66
+ onBack(callback: () => void): this;
67
+ /** @deprecated Renamed `onBack` (2026-09-26). An alias for the projects compiled before the
68
+ * rename; removed with the release that recompiles them. */
65
69
  onBackPressed(callback: () => void): this;
66
70
  /** Make this the active scene — shows it as the current destination (replaces a screen /
67
71
  * another scene; only the active scene renders). */
68
72
  open(options?: PresentOptions): this;
69
- close(): this;
73
+ close(options?: DismissOptions): this;
70
74
  destroy(): void;
71
75
  }
72
76
  export {};
@@ -3,19 +3,20 @@ import { Node } from "./Node";
3
3
  export type FoliageWind = {
4
4
  /** Direction on the ground (x, z); normalised by the engine. Default [1, 0.3]. */
5
5
  direction?: [number, number];
6
- /** Metres of sway at `bendHeight` (taller parts sway more). Default 0.07. 0 = still. */
7
- strength?: number;
8
- /** Radians per second of the main sway. Default 1.2. */
6
+ /** The wind speed in m/s — the plants' permanent bend and how fast the field drifts past them. Default 8.3
7
+ * (30 km/h, the pack's demo). 0 = still. */
9
8
  speed?: number;
10
- /** 0..1: how much the strength breathes over a slow envelope. Default 0.6. */
9
+ /** 0..2: the random share of the speed — how far the bend wanders off the mean wind and how much the leaves move.
10
+ * Default 0.4. */
11
+ turbulence?: number;
12
+ /** 0..1: the gusts' strength — waves of extra wind that travel over the level, calm between. Default 0.35. */
11
13
  gust?: number;
14
+ /** m/s the gust pattern travels at. Default 5.6 (20 km/h). */
15
+ gustSpeed?: number;
12
16
  };
13
17
  export type FoliageOptions = {
14
18
  /** The wind, or `false` for none. */
15
19
  wind?: FoliageWind | false;
16
- /** Height above the instance origin (m) where the full sway / touch applies; the base never moves.
17
- * Default 1.5. */
18
- bendHeight?: number;
19
20
  /** Metres the TOP of a small plant leans away from a bender standing at its centre; the whole plant leans
20
21
  * as one, rooted at its base. Plants over ~2 m react less, trees over ~5 m not at all (the engine
21
22
  * measures each asset). Default 0.6. 0 = no touch reaction. */
@@ -25,6 +26,28 @@ export type FoliageOptions = {
25
26
  variation?: number;
26
27
  /** 0..1: wrapped sun lighting — thin leaves let light through. Default 0.5. */
27
28
  sunWrap?: number;
29
+ /** A multiplier on every material's shiver drag (the leaves' own motion on top of the bend): 1 = as the
30
+ * model's materials say, 0 = the leaves ride the bend alone. Default 1. */
31
+ shiver?: number;
32
+ /** 0..1: the sun through a thin leaf lit from behind (a back-lit crown glows). Default 0.35. */
33
+ translucency?: number;
34
+ /** 0..1: how much of a light's shadow a leaf card takes. A crown scatters light through itself, so its cards take the
35
+ * shadow map partly — at 1 a distant crown is a dark silhouette lit only on its top layer. Bark always takes the
36
+ * shadow in full. Default 0.6. */
37
+ leafShadow?: number;
38
+ /** 0..1: how far the baked per-vertex sky visibility (the crown's interior, the trunk under it) darkens the ambient.
39
+ * Default 0.7. */
40
+ skyAo?: number;
41
+ /** 0..1: a leaf card's shading normal, from the card's own plane (0) to the crown's hull normal (1) — what hides that a
42
+ * crown is flat quads: each card is lit as the part of the volume it sits in. Default 0.7. */
43
+ canopy?: number;
44
+ /** The cards' normal-map strength (a strong map brings the planes back). Default 0.5. */
45
+ normalMap?: number;
46
+ /** A card seen edge-on dissolves over this much of |N·V| — no paper edges on the silhouette. Default 0.15, 0 = none. */
47
+ edgeFade?: number;
48
+ /** Coverage held over distance: the cards' alpha × (1 + coverage × mip level), so a far crown does not thin out as its
49
+ * atlas mips away. Default 0.25, 0 = none; past ~0.5 a crown turns into a solid mass. */
50
+ coverage?: number;
28
51
  };
29
52
  export declare const Foliage: {
30
53
  /** Level-wide options; each field given replaces the current value (a scene file's `env.foliage`
@@ -33,6 +33,13 @@ export type SunOptions = {
33
33
  * the same quality and puts fewer casters in the shadow pass. 30-40 is plenty in first person.
34
34
  */
35
35
  shadowDistance?: number;
36
+ /**
37
+ * How many shadow-map cascades split `shadowDistance` (default 1). One map over the whole range gives a tall
38
+ * tree 5-10 cm shadow texels on its own trunk; 3 cascades put a tight map on the first metres and coarser
39
+ * ones behind, fit to their texel grids so the shadow does not swim as the camera moves. Each cascade is
40
+ * another caster pass, so it costs in proportion to what casts: forests, not a lightmapped level.
41
+ */
42
+ shadowCascades?: 1 | 2 | 3 | 4;
36
43
  };
37
44
  export type PointOptions = {
38
45
  /**
@@ -74,6 +81,7 @@ export declare class Light extends Node {
74
81
  /** The most recently created sun. */
75
82
  static lastSun: Light | null;
76
83
  _shadowDistance: number;
84
+ _shadowCascades: number;
77
85
  /** A directional sun light. */
78
86
  static sun(options?: SunOptions): Light;
79
87
  /**
@@ -93,6 +93,17 @@ export declare class Lightmap {
93
93
  private static loadVolume;
94
94
  /** Forget every registration (a scene rebuild). */
95
95
  static clear(): void;
96
+ /** THE MOVERS' SUN SHADOWS ON THE BAKED STATICS (a bot, a barrel, the player's rifle darkening the ground under
97
+ * it): the lightmap shader reads the real-time shadow map and the bake's sun map for it, per pixel. Off, a baked
98
+ * surface takes no real-time shadow at all — the cheapest lighting tier (some 4 ms of a 16 ms 720p frame on an
99
+ * integrated GPU, the yard 2026-09-26); a mover still shades ITSELF and the other movers. Live: it rebinds the
100
+ * level's material instances at once. */
101
+ static get moverShadows(): boolean;
102
+ static set moverShadows(on: boolean);
103
+ private static _moverShadows;
104
+ /** The loaded bake's sun (TO the sun ×3, its illuminance rgb, the sun map's levels), null without a sun map. */
105
+ private static sunArgs;
106
+ private static applySun;
96
107
  /** Apply a bake — or, under `lecodes lightmap bake`, run it. Resolves to null when nothing was
97
108
  * applied (no bake yet, a host without the feature, bake mode). */
98
109
  private static scene;
@@ -116,8 +127,8 @@ export declare class Lightmap {
116
127
  * so the value can be looked up in the bake's debug layers (`lecodes lightmap inspect`). null when
117
128
  * nothing baked is under the point or the host has no triangle pick. */
118
129
  static probe(screenX: number, screenY: number): LightmapProbe | null;
119
- /** A hex colour as the 9-char form the float4 uniform path expects ("#rrggbbaa"). */
120
- private static hex8;
130
+ /** A material's colour uniform as "#rrggbbaa" (the float4 uniform path sets its alpha); white without one. */
131
+ private static colorUniform;
121
132
  /** The lightmap material for a static Mesh, from whatever lit material it carried (colour, map, roughness, metallic). */
122
133
  private static meshMaterial;
123
134
  private static bake;
@@ -123,7 +123,7 @@ export declare class Material {
123
123
  readonly shader: FetchResponse | "unknown";
124
124
  readonly uniforms: Record<string, UniformValue>;
125
125
  private _colorKey;
126
- constructor(shader: FetchResponse | number);
126
+ constructor(shader: FetchResponse | Handle | number);
127
127
  /** Set a uniform (chainable). */
128
128
  set(key: string, value: UniformValue): this;
129
129
  set color(c: ColorInput);
@@ -137,6 +137,8 @@ export declare class Material {
137
137
  /** The stencil test / write (write-only; `null` = back to none). See `MaterialStencil`. */
138
138
  set stencil(s: MaterialStencil | null);
139
139
  set map(value: Texture | Canvas | null);
140
+ /** The material an instance handle is of; a host that carries none under `name` is an error naming it. */
141
+ private static _builtin;
140
142
  /** PBR lit material. */
141
143
  static lit(options?: LitMaterialOptions): Material;
142
144
  /** Unlit (flat) material — opaque unless `transparent` asks for alpha blending. */
@@ -151,7 +153,7 @@ export declare class Material {
151
153
  static decal(options?: DecalMaterialOptions): Material;
152
154
  /** Material that samples a VideoPlayer's texture. */
153
155
  static video(map?: Texture): Material;
154
- /** The lightmap material (packages/creator-bake): a lit PBR material whose whole DIFFUSE light is the
156
+ /** The lightmap material (engines/bake): a lit PBR material whose whole DIFFUSE light is the
155
157
  * baked irradiance atlas on UV1 (`lightmapLight`, lux) — the real-time sun, lamps and diffuse IBL do not
156
158
  * touch it; the specular IBL stays, occluded by the baked sky visibility. Models take it through
157
159
  * `Model.load(…, { lightmap: true })`; a static Mesh gets one from here. Parameters use gltfio's names
@@ -161,6 +163,17 @@ export declare class Material {
161
163
  /** `Material.lightmap()`'s masked twin (`blending: masked`, same shader and parameters): what the engine
162
164
  * gives a lightmapped model's alpha-MASK materials. The cutoff comes from the glTF material. */
163
165
  static lightmapMasked(): Material;
166
+ /** THE LIGHTMAP SHADER TIER, engine-wide: `"full"` = the target's own blob (desktop: the bicubic atlas fetch, eight
167
+ * probe corners, the sun's highlight on metal), `"lite"` = the blob the phones ship (bilinear fetch, one probe
168
+ * corner, no sun highlight; the movers' shadows on the statics stay) — on an integrated GPU some 30 % less per
169
+ * pixel on a baked level, the picture a phone shows. Read when a lightmap material is FIRST made, which
170
+ * `Model.load({ lightmap })` does once per world: set it BEFORE the level loads (a graphics preset applied at
171
+ * boot, like `Texture.maxSize`); a change afterwards takes the next level. A host without the lite material
172
+ * (a phone: its own blob is that shader already) takes the full one. */
173
+ static lightmapShading: "full" | "lite";
174
+ /** The lite tier's instance, or — said once — that this host has none and the full shader is used. */
175
+ private static _liteTier;
176
+ private static _liteWarned;
164
177
  /** The terrain splat material (docs/terrain-plan.md §1.5): four albedo (+ normal-map) layers blended by
165
178
  * a control map on the terrain's own grid, per-layer `tiling` (metres per repeat) / `roughness` /
166
179
  * `normalScale` / `triplanar`. `Terrain` builds and owns one per terrain; the uniforms are primed here so an
@@ -186,8 +199,9 @@ export declare class Material {
186
199
  private static _glbDefaults;
187
200
  private static _lightmapDefaults;
188
201
  private static _folTemplate;
189
- static _foliageMaskedTemplate(): Material;
202
+ static _foliageMaskedTemplate(): Material | null;
190
203
  private static _folMaskedTemplate;
204
+ private static _glbTemplate;
191
205
  /** Shadow-catcher material (transparent except where shadows fall). */
192
206
  static shadow(color?: ColorInput): Material;
193
207
  /** Load a custom compiled shader (.mat URL) as a material. */
@@ -12,12 +12,16 @@ export interface TrianglePick {
12
12
  mesh: string;
13
13
  primitive: number;
14
14
  material: string;
15
+ /** the node's lightmap group (scene-file extras), when it has one */
16
+ lightmapGroup?: number;
15
17
  /** triangle index within the primitive (index-buffer order), and whether the ray came from behind */
16
18
  triangle: number;
17
19
  backface: boolean;
18
20
  distance: number;
19
21
  point: [number, number, number];
20
22
  bary: [number, number, number];
23
+ /** the lightmap uv (TEXCOORD_1) at the hit, when the primitive carries one */
24
+ uv1?: [number, number];
21
25
  skin: string;
22
26
  vertices: {
23
27
  index: number;
@@ -33,7 +37,7 @@ export declare class Model extends Node {
33
37
  /** The model's Animator — always present, its clip table = the GLB's embedded clips. Configure
34
38
  * more (external clips, blend spaces, layers) with `model.aspect(Animator, {...})`. */
35
39
  readonly anim: Animator;
36
- constructor(internalId: number);
40
+ constructor(internalId: number | Handle);
37
41
  /** Does this model cast a real-time shadow? Unlike Mesh (one renderable) a GLB is a whole
38
42
  * hierarchy, so the flag goes to EVERY renderable of the instance. A first-person viewmodel —
39
43
  * arms, weapon, attachments — sets it false: it lives in front of the camera and its shadow
@@ -77,7 +81,7 @@ export declare class Model extends Node {
77
81
  loaded: number;
78
82
  total?: number;
79
83
  }) => void;
80
- /** Baked lighting (packages/creator-bake). `true` = a STATIC: loads through the lightmap material so
84
+ /** Baked lighting (engines/bake). `true` = a STATIC: loads through the lightmap material so
81
85
  * `Lightmap.load` can bind its atlas rect (the GLB needs TEXCOORD_1 — `lecodes assets doctor
82
86
  * --lightmap-uv`) and takes nothing from the real-time lights once the bake applies. Omitted / `false` =
83
87
  * the standard shader, lit real-time (movers). Hosts without lightmap support ignore it. */
@@ -1,5 +1,4 @@
1
1
  import { AspectHost } from "../core/Aspect";
2
- import { Registry } from "../core/registry";
3
2
  import { Vec3, type Vec3Like } from "../math/vec";
4
3
  import { Quat, type QuatLike } from "../math/quat";
5
4
  import { Mat4, type Mat4Like } from "../math/mat4";
@@ -18,8 +17,6 @@ export type NodeTweenProps = {
18
17
  /** Degrees, YXZ; interpolated per axis without shortest-arc, so `[0, 720, 0]` spins twice. */
19
18
  eulerAngles?: Vec3Like | Vec3Like[];
20
19
  };
21
- /** id → Node, so host callbacks (touch hits, animation events) route back to the owning object. */
22
- export declare const nodeRegistry: Registry<Node>;
23
20
  export type NodeEvents = {
24
21
  click: (ev: ClickEvent<Node | null>) => void;
25
22
  touchstart: (ev: TouchStartEvent<Node | null>) => void;
@@ -33,8 +30,8 @@ export type NodeEvents = {
33
30
  exit: (other: Node) => void;
34
31
  };
35
32
  export declare class Node extends AspectHost<NodeEvents> implements CompWriter {
36
- /** Native entity handle. */
37
- readonly id: number;
33
+ /** Native entity id. */
34
+ get id(): number;
38
35
  /** AR anchors only — whether the anchor is currently being tracked. Kept in step with the
39
36
  * 'track' / 'untrack' events; `false` for any non-anchor node. */
40
37
  isTracked: boolean;
@@ -43,7 +40,7 @@ export declare class Node extends AspectHost<NodeEvents> implements CompWriter {
43
40
  private _boneCache?;
44
41
  /** Materials assigned through setMaterial, by primitive slot (a Mesh fills slot 0 itself). */
45
42
  protected _materials?: Material[];
46
- constructor(internalId?: number);
43
+ constructor(internalId?: number | Handle);
47
44
  /** Geometry, if this node is a Mesh (used by physics auto-shape). Overridden by Mesh. */
48
45
  get geometry(): Geometry | undefined;
49
46
  get name(): string;
@@ -1,6 +1,6 @@
1
1
  import { type ColorInput } from "../core/color";
2
2
  import { type Aspect, type AspectCtor, type FieldOf, type TargetOf } from "../core/Aspect";
3
- import { Presentable, type PresentOptions } from "../ui/presentable";
3
+ import { Presentable, type DismissOptions, type PresentOptions } from "../ui/presentable";
4
4
  import type { ClickEvent, TouchStartEvent } from "../runtime/touch";
5
5
  import type { FetchResponse } from "../runtime/fetch";
6
6
  import { Camera } from "./Camera";
@@ -18,6 +18,20 @@ export type AmbientOcclusionOptions = {
18
18
  /** Sample count + filtering (default 'medium'). Not the buffer resolution — that stays half. */
19
19
  quality?: "low" | "medium" | "high" | "ultra";
20
20
  };
21
+ /** `SceneOptions.taa` / `scene.setAntialias("taa", 4, taa)`: the temporal anti-aliasing knobs. */
22
+ export type TaaOptions = {
23
+ /** Render the 3D at this fraction (0.5–1) and TAA-upscale it to the viewport; 1 = none. */
24
+ upscale?: number;
25
+ /** The history's share, 0 (max smoothing) … 1 (none); 0.12 default. */
26
+ feedback?: number;
27
+ /** Post-TAA sharpen 0–1; defaults to 0.5 with `upscale` below 1, else 0. */
28
+ sharpness?: number;
29
+ /** A first-person viewmodel: everything closer than this many metres to the camera is treated as
30
+ * fixed on screen — its history is read at the same pixel, not reprojected by the camera's motion,
31
+ * which would trail the weapon on every turn (TAA has no per-object motion vectors). 1 covers arms
32
+ * and weapon at eye height; 0 (the default) = off. A wall walked into within the band smears a little. */
33
+ viewmodel?: number;
34
+ };
21
35
  export type FogOptions = {
22
36
  /** A TINT on the in-scattered ambient, not an absolute colour: the engine multiplies it by the
23
37
  * environment luminance, so white (the default) means "fog as bright as the ambient" and the fog
@@ -92,10 +106,18 @@ export type SceneOptions = {
92
106
  * at every distance — the skybox included — so the sky itself takes the fog colour and the horizon
93
107
  * blends on its own; `cutoff` opts geometry beyond a distance back out. */
94
108
  fog?: FogOptions;
95
- /** Multisample anti-aliasing: `true` = 4×, `2`/`4` = that many samples, `false` = off (FXAA
96
- * takes over). Unset keeps the host default (desktop 4×, mobile/web off). The biggest single
97
- * fill-rate cost after resolution — turn it down on big screens before anything else. */
98
- antialias?: boolean | 2 | 4;
109
+ /** Anti-aliasing: `true` = 4× MSAA, `2`/`4` = that many samples, `false` = off (FXAA takes over),
110
+ * `"taa"` = temporal anti-aliasing (Filament's TAA: one full-screen history blend instead of the
111
+ * multisampled buffers — cheaper than MSAA on an integrated GPU and it also calms specular and
112
+ * foliage shimmer; see `taa` for its knobs). Unset keeps the host default (desktop 4×, mobile/web
113
+ * off). The biggest single fill-rate cost after resolution — turn it down on big screens first. */
114
+ antialias?: boolean | 2 | 4 | "taa";
115
+ /** The TAA's knobs (`antialias: "taa"`): `upscale` = render the 3D at this fraction (0.5–1) and let
116
+ * TAA reconstruct the full resolution — the cheap way to a lower render cost with most of the
117
+ * detail kept (`renderScale` shrinks the buffer and stretches it instead); `feedback` = the
118
+ * history's share, 0.12 by default (raise it toward 0.3 if fast motion ghosts); `sharpness` =
119
+ * a post-TAA sharpen 0–1, useful with `upscale`. */
120
+ taa?: TaaOptions;
99
121
  /** Keep a stencil buffer for this scene (off by default: it costs memory and a clear per frame).
100
122
  * Needed before any material's `stencil` test or write does anything. */
101
123
  stencil?: boolean;
@@ -152,7 +174,8 @@ export declare class Scene implements Presentable {
152
174
  setRenderOptions(renderScale: number, dynamicResolution?: boolean | {
153
175
  min?: number;
154
176
  }): void;
155
- /** Scene occlusion material. */
177
+ /** Scene occlusion material: an unlit instance in the occluder blue (the built-in `unlit`, which
178
+ * every runtime carries) — one per scene, made on first use. */
156
179
  get occlusionMaterial(): Material;
157
180
  set skybox(sky: ColorInput | "environment" | {
158
181
  texture: string;
@@ -162,7 +185,7 @@ export declare class Scene implements Presentable {
162
185
  /** Runtime form of `fog` (weather, entering a building). `false` turns it off. */
163
186
  setFog(options: FogOptions | false): void;
164
187
  setMaterialGlobalParameter(i: number, x: number, y: number, z: number, w: number): void;
165
- setAntialias(enabled: boolean, scale?: number): void;
188
+ setAntialias(mode: boolean | 2 | 4 | "taa", scale?: number, taa?: TaaOptions): void;
166
189
  /** Depth-reading effects on / off (a graphics-settings menu): soft particles and projected decals
167
190
  * read the scene depth, which costs a depth pre-pass of every opaque draw (~12 % of a fill-bound
168
191
  * frame). Off = hard-edged particles, no decals, no pre-pass. Engine-wide, live. */
@@ -189,8 +212,8 @@ export declare class Scene implements Presentable {
189
212
  private static _warnedEnvIntensity;
190
213
  /** The scene's stencil buffer on / off (see `SceneOptions.stencil`). */
191
214
  setStencil(enabled: boolean): void;
192
- add(...nodes: Node[]): this;
193
- remove(...nodes: Node[]): this;
215
+ add(...list: Node[]): this;
216
+ remove(...list: Node[]): this;
194
217
  /** Attach (and configure) a system, or reconfigure it if already present. Returns the scene typed
195
218
  * as now-having it (`scene.system(Hud).hud`). A `System<'x', Scene2D>` is rejected here. */
196
219
  system<Self extends TargetOf<A>, A extends Aspect<any, any, any>>(this: Self, ctor: AspectCtor<A>, opts?: Partial<A>): Self & FieldOf<A>;
@@ -219,11 +242,16 @@ export declare class Scene implements Presentable {
219
242
  onOpen(callback: () => void): this;
220
243
  /** Fires when the scene stops being visible (closed, replaced, or covered by a push). */
221
244
  onClose(callback: () => void): this;
245
+ /** Hardware/system back while the scene is current. */
246
+ onBack(callback: () => void): this;
247
+ /** @deprecated Renamed `onBack` (2026-09-26). An alias for the projects compiled before the
248
+ * rename; removed with the release that recompiles them. */
222
249
  onBackPressed(callback: () => void): this;
223
250
  /** Make this the active scene — shows it as the current destination (replaces a screen /
224
- * another scene; only the active scene renders). */
251
+ * another scene; only the active scene renders). The runtime activates the engine as part of
252
+ * presenting the destination. */
225
253
  open(options?: PresentOptions): void | Promise<void>;
226
- close(): void;
254
+ close(options?: DismissOptions): void;
227
255
  addEventListener(channel: "click", callback: (ev: ClickEvent<Node | null>) => void): void;
228
256
  addEventListener(channel: "touchstart", callback: (ev: TouchStartEvent<Node | null>) => void): void;
229
257
  removeEventListener(channel: "click" | "touchstart", callback: (ev: any) => void): void;
@@ -248,7 +276,7 @@ export declare class ARScene<T extends ARMode = "default"> extends Scene {
248
276
  */
249
277
  addControls(target: Node, options?: ControlsOptions): ControlsHandle;
250
278
  open(options?: PresentOptions): Promise<void>;
251
- close(): void;
279
+ close(options?: DismissOptions): void;
252
280
  }
253
281
  /**
254
282
  * A 3D scene rendered in a VR headset (OpenXR — e.g. Meta Quest). The headset drives the camera:
@@ -260,5 +288,5 @@ export declare class ARScene<T extends ARMode = "default"> extends Scene {
260
288
  */
261
289
  export declare class VRScene extends Scene {
262
290
  open(options?: PresentOptions): Promise<void>;
263
- close(): void;
291
+ close(options?: DismissOptions): void;
264
292
  }
@@ -29,7 +29,7 @@ export declare class Texture {
29
29
  wrapS: number;
30
30
  /** Vertical wrap mode (V). */
31
31
  wrapT: number;
32
- constructor(width: number, height: number, id: number);
32
+ constructor(width: number, height: number, id: Handle | number);
33
33
  static fromCanvas(canvas: {
34
34
  _bakeSurface(): number;
35
35
  width: number;
@@ -256,7 +256,10 @@ export declare class Locomotion extends Aspect<"loco", Node, LocomotionEvents> {
256
256
  * stay, the time changes), `travel` takes only that share of its recorded travel (an attack aimed at a target:
257
257
  * 0.3 to stop at the blade's length from one that is close, 1.3 to reach one a step too far — the pose is
258
258
  * untouched, so keep it to a fast step; `{ share, at, after }` takes another share from clip time `at` on: a
259
- * swing's take travels on after its cut, into a body that stands at the blade's length), `fade` is the transition into it and `out` the one out of it (default: the tuning's
259
+ * swing's take travels on after its cut, into a body that stands at the blade's length), `dash` THROWS the body
260
+ * `distance` metres along the action's direction on top of that, inside `time` seconds (default 0.12) from its first
261
+ * step, eased out — the gap to a target closed in the wind-up, the blow struck from where it lands (scaling a take's
262
+ * own step is a slide stretched over the whole swing), `fade` is the transition into it and `out` the one out of it (default: the tuning's
260
263
  * `blend`; an action ends in ITS stance, not the idle's, and a longer way out is what hides that), and `exit` is the
261
264
  * clip time from which a MOVE intent may take over — the cancel window: along the way the body faces at once, a
262
265
  * heading that needs a turn as soon as the body has slowed to where a start can answer; with nothing asked for it plays out, to
@@ -278,6 +281,10 @@ export declare class Locomotion extends Aspect<"loco", Node, LocomotionEvents> {
278
281
  at: number;
279
282
  after: number;
280
283
  };
284
+ dash?: {
285
+ distance: number;
286
+ time?: number;
287
+ };
281
288
  }): boolean;
282
289
  /** Face this way without moving — the facing intent on its own (`Vec3`, or a heading in degrees,
283
290
  * 0 = +Z, + = toward +X). A standing body turns to it on the spot. */