blecsd 0.1.1 → 0.3.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 (110) hide show
  1. package/LICENSE +4 -2
  2. package/README.md +209 -66
  3. package/dist/3d/index.d.ts +2 -2
  4. package/dist/3d/index.js +1 -1
  5. package/dist/audio/index.d.ts +2 -2
  6. package/dist/{border-D_Jb4ZJV.d.ts → border-Jb7TrMob.d.ts} +20 -10
  7. package/dist/chunk-2IEMMRUO.js +1 -0
  8. package/dist/chunk-3AV52GY5.js +1 -0
  9. package/dist/chunk-3LHLSY3Y.js +1 -0
  10. package/dist/chunk-3O4TQHGK.js +4 -0
  11. package/dist/chunk-3UJWZ5ZN.js +1 -0
  12. package/dist/chunk-5N3O25O7.js +1 -0
  13. package/dist/chunk-6M2J5QUA.js +1 -0
  14. package/dist/chunk-7IQEUVGF.js +1 -0
  15. package/dist/chunk-A6M6TFBL.js +1 -0
  16. package/dist/chunk-CUEUJAHK.js +3 -0
  17. package/dist/chunk-D42Q2KKR.js +1 -0
  18. package/dist/chunk-DYEXOFUU.js +2 -0
  19. package/dist/chunk-DYU72XLL.js +1 -0
  20. package/dist/chunk-E4CJRSND.js +1 -0
  21. package/dist/chunk-EAY7B5GL.js +1 -0
  22. package/dist/chunk-FCMTWFSE.js +1 -0
  23. package/dist/chunk-FL56THSI.js +25 -0
  24. package/dist/{chunk-2UBBZFE4.js → chunk-G437VE43.js} +1 -1
  25. package/dist/chunk-GGXNWT36.js +8 -0
  26. package/dist/chunk-HLFORKXS.js +1 -0
  27. package/dist/chunk-J7MBKEBY.js +1 -0
  28. package/dist/{chunk-TYMY2TBR.js → chunk-JHCKPCUH.js} +3 -3
  29. package/dist/chunk-K3SX2LY5.js +1 -0
  30. package/dist/chunk-LDAFEXN5.js +1 -0
  31. package/dist/chunk-MKMFUXLB.js +33 -0
  32. package/dist/chunk-MQWPHPUM.js +1 -0
  33. package/dist/chunk-MTI376CU.js +5 -0
  34. package/dist/chunk-MTV2RJZD.js +1 -0
  35. package/dist/chunk-NPDPBAW6.js +4 -0
  36. package/dist/chunk-OB66FB4F.js +1 -0
  37. package/dist/chunk-OR3BZY7C.js +1 -0
  38. package/dist/{chunk-VNZ6CWJA.js → chunk-R7AICVRN.js} +2 -2
  39. package/dist/{chunk-3B7MIVW6.js → chunk-RZ7FGVI6.js} +1 -1
  40. package/dist/chunk-UMGTXSQB.js +11 -0
  41. package/dist/chunk-X3Q3T2SS.js +4 -0
  42. package/dist/{chunk-JKVHO4LH.js → chunk-XZJRWFOS.js} +1 -1
  43. package/dist/chunk-ZAHG7Y3X.js +1 -0
  44. package/dist/cli/init.d.ts +1 -1
  45. package/dist/componentStorage-CJTh-TPO.d.ts +246 -0
  46. package/dist/components/index.d.ts +1942 -514
  47. package/dist/components/index.js +1 -1
  48. package/dist/core/index.d.ts +857 -259
  49. package/dist/core/index.js +1 -1
  50. package/dist/debug/index.d.ts +491 -98
  51. package/dist/debug/index.js +1 -1
  52. package/dist/dirtyTracking-C4v8MmM9.d.ts +235 -0
  53. package/dist/errors/index.d.ts +12 -12
  54. package/dist/errors/index.js +1 -1
  55. package/dist/{events-BbbxkgvX.d.ts → events-9ForpTfM.d.ts} +75 -2
  56. package/dist/game/index.d.ts +7 -7
  57. package/dist/game/index.js +1 -1
  58. package/dist/{gameLoop-BIPW7-OY.d.ts → gameLoop-C-Ez_i54.d.ts} +2 -2
  59. package/dist/{index-zSGJ2eUk.d.ts → index-DBS5Uefn.d.ts} +2 -2
  60. package/dist/index.d.ts +283 -20
  61. package/dist/index.js +3 -1
  62. package/dist/input/index.d.ts +1 -1
  63. package/dist/input/index.js +1 -1
  64. package/dist/{inputActions-CefRUBuT.d.ts → inputActions-CRsUtTHM.d.ts} +10 -721
  65. package/dist/packedStore-BgvnEdE7.d.ts +191 -0
  66. package/dist/{renderable-jTMOA-GK.d.ts → renderable-CwqGwrEV.d.ts} +9 -9
  67. package/dist/{scheduler-DcfoFuum.d.ts → scheduler-CMcYew9Z.d.ts} +65 -3
  68. package/dist/systems/index.d.ts +356 -55
  69. package/dist/systems/index.js +1 -1
  70. package/dist/terminal/index.d.ts +2233 -2299
  71. package/dist/terminal/index.js +1 -1
  72. package/dist/{tilemap-D1HJvKy3.d.ts → tilemap-BirMJdbu.d.ts} +92 -3
  73. package/dist/{types-BcsvoKzf.d.ts → types-CPB4CpbH.d.ts} +2 -2
  74. package/dist/utils/index.d.ts +27 -180
  75. package/dist/utils/index.js +1 -1
  76. package/dist/{virtualScrollback-DvZTRU8a.d.ts → virtualScrollback-D9uLFe8l.d.ts} +4 -4
  77. package/dist/{virtualViewport-Dx2iJliO.d.ts → virtualViewport-Bpv6jlKt.d.ts} +283 -761
  78. package/dist/widgets/bigText.d.ts +1 -1
  79. package/dist/widgets/bigText.js +1 -1
  80. package/dist/widgets/index.d.ts +10519 -5463
  81. package/dist/widgets/index.js +1 -1
  82. package/package.json +102 -6
  83. package/dist/chunk-35I22JJO.js +0 -1
  84. package/dist/chunk-3EGGGI5J.js +0 -3
  85. package/dist/chunk-4X4N4HNQ.js +0 -2
  86. package/dist/chunk-AQ7LW75B.js +0 -1
  87. package/dist/chunk-AXZQAH4X.js +0 -1
  88. package/dist/chunk-BCADUCOZ.js +0 -1
  89. package/dist/chunk-EJ5WVDDZ.js +0 -6
  90. package/dist/chunk-FT7BMYSN.js +0 -1
  91. package/dist/chunk-FYEBZAWN.js +0 -1
  92. package/dist/chunk-GYHI26UE.js +0 -1
  93. package/dist/chunk-H2YAOJDW.js +0 -1
  94. package/dist/chunk-K2B2OXQ5.js +0 -5
  95. package/dist/chunk-K37L3G4Z.js +0 -4
  96. package/dist/chunk-KD55INV7.js +0 -1
  97. package/dist/chunk-KFAK4A3G.js +0 -1
  98. package/dist/chunk-LCN2ZITE.js +0 -1
  99. package/dist/chunk-OUXUPF3V.js +0 -33
  100. package/dist/chunk-P6CJO3BC.js +0 -1
  101. package/dist/chunk-PI5UOHOH.js +0 -1
  102. package/dist/chunk-PSXXMBVJ.js +0 -1
  103. package/dist/chunk-TRK4422V.js +0 -12
  104. package/dist/chunk-W5OU7Z6J.js +0 -1
  105. package/dist/chunk-WNG4A3K7.js +0 -4
  106. package/dist/chunk-XRJNAHNG.js +0 -19
  107. package/dist/chunk-XZA63ZPO.js +0 -1
  108. package/dist/chunk-YAMOSPWB.js +0 -4
  109. package/dist/chunk-YD6ULIUR.js +0 -1
  110. package/dist/{keyParser-Bwm8-l7v.d.ts → keyParser-BnHbg2iD.d.ts} +1 -1
@@ -1,12 +1,15 @@
1
- import { S as Scheduler } from '../scheduler-DcfoFuum.js';
2
- import { S as System, W as World, E as Entity, L as LoopPhase } from '../types-BcsvoKzf.js';
3
- import { d as CollisionPair, f as EmitterAppearance, R as RenderedTileCell } from '../tilemap-D1HJvKy3.js';
4
- import { E as EventBus, U as UIEventMap } from '../events-BbbxkgvX.js';
5
- import { b as KeyEvent } from '../keyParser-Bwm8-l7v.js';
1
+ import { S as Scheduler } from '../scheduler-CMcYew9Z.js';
2
+ import { S as System, W as World, E as Entity, L as LoopPhase } from '../types-CPB4CpbH.js';
3
+ import { d as CollisionPair, f as EmitterAppearance, R as RenderedTileCell } from '../tilemap-BirMJdbu.js';
4
+ import { a as EventBus, U as UIEventMap } from '../events-9ForpTfM.js';
5
+ import { P as PackedStore, a as PackedHandle } from '../packedStore-BgvnEdE7.js';
6
+ import { b as KeyEvent } from '../keyParser-BnHbg2iD.js';
6
7
  import { M as MouseEvent } from '../mouseParser-Cfrbn3AX.js';
7
8
  import { Writable } from 'node:stream';
8
9
  import { c as CellChange, S as ScreenBufferData, C as Cell } from '../cell-DwIu2ryP.js';
9
10
  import { D as DoubleBufferData } from '../doubleBuffer-CKQFmlPN.js';
11
+ import { D as DirtyTracker } from '../dirtyTracking-C4v8MmM9.js';
12
+ import { a as ComponentStore } from '../componentStorage-CJTh-TPO.js';
10
13
  import { z } from 'zod';
11
14
  import { V as VirtualizedLineStore } from '../virtualizedLineStore-DwPEvPkk.js';
12
15
  import 'bitecs';
@@ -20,6 +23,9 @@ import 'bitecs';
20
23
  /**
21
24
  * Query all entities with the Animation component.
22
25
  *
26
+ * PERF: Converts iterator to array for system processing.
27
+ * Array allocation is unavoidable here as we need to iterate over entities.
28
+ *
23
29
  * @param world - The ECS world
24
30
  * @returns Array of entity IDs with Animation component
25
31
  */
@@ -271,6 +277,10 @@ declare function updateCameras(world: World, deltaTime: number): void;
271
277
  /**
272
278
  * Collision system for detecting entity collisions.
273
279
  * Processes all entities with Collider component.
280
+ *
281
+ * Uses PackedStore for cache-friendly dense iteration of active pairs,
282
+ * with numeric pair keys to eliminate per-frame string allocation.
283
+ *
274
284
  * @module systems/collisionSystem
275
285
  */
276
286
 
@@ -296,16 +306,34 @@ interface CollisionEventMap {
296
306
  /** Fired when an entity exits a trigger zone */
297
307
  triggerExit: CollisionEventData;
298
308
  }
309
+ /**
310
+ * Readonly view of active collision/trigger pairs.
311
+ * Provides dense data for cache-friendly iteration without
312
+ * exposing mutable store internals. Do not cache this view
313
+ * across frames, as the underlying data may be reallocated.
314
+ */
315
+ interface ActivePairsView {
316
+ /** Dense array of active pairs. Read-only; do not mutate elements or indices. */
317
+ readonly data: ReadonlyArray<CollisionPair>;
318
+ /** Number of live pairs in the data array (iterate data[0..size-1]). */
319
+ readonly size: number;
320
+ }
299
321
  /**
300
322
  * Collision system state.
323
+ * Uses PackedStore for cache-friendly dense storage and iteration
324
+ * of active collision and trigger pairs.
301
325
  */
302
326
  interface CollisionSystemState {
303
327
  /** Event bus for collision events */
304
328
  readonly eventBus: EventBus<CollisionEventMap>;
305
- /** Currently active collision pairs */
306
- readonly activePairs: Map<string, CollisionPair>;
307
- /** Currently active trigger pairs */
308
- readonly activeTriggers: Map<string, CollisionPair>;
329
+ /** Currently active collision pairs (dense packed storage) */
330
+ readonly activePairs: PackedStore<CollisionPair>;
331
+ /** Currently active trigger pairs (dense packed storage) */
332
+ readonly activeTriggers: PackedStore<CollisionPair>;
333
+ /** Maps numeric pair key to handle in activePairs for O(1) lookup */
334
+ readonly pairHandles: Map<number, PackedHandle>;
335
+ /** Maps numeric pair key to handle in activeTriggers for O(1) lookup */
336
+ readonly triggerHandles: Map<number, PackedHandle>;
309
337
  }
310
338
  /**
311
339
  * Gets the collision event bus.
@@ -324,17 +352,53 @@ interface CollisionSystemState {
324
352
  */
325
353
  declare function getCollisionEventBus(): EventBus<CollisionEventMap>;
326
354
  /**
327
- * Gets the current active collision pairs.
355
+ * Gets the current number of active collision pairs.
356
+ *
357
+ * @returns Number of active solid collision pairs
358
+ *
359
+ * @example
360
+ * ```typescript
361
+ * import { getActiveCollisionCount } from 'blecsd';
328
362
  *
329
- * @returns Map of active collision pairs
363
+ * const count = getActiveCollisionCount();
364
+ * console.log(`${count} active collisions`);
365
+ * ```
330
366
  */
331
- declare function getActiveCollisions(): ReadonlyMap<string, CollisionPair>;
367
+ declare function getActiveCollisionCount(): number;
332
368
  /**
333
- * Gets the current active trigger pairs.
369
+ * Gets the current active collision pairs as a readonly view.
370
+ * Iterate data[0..size-1] for dense, cache-friendly access.
371
+ *
372
+ * The returned view is a snapshot reference into the live store.
373
+ * Do not cache it across frames or mutate its contents.
334
374
  *
335
- * @returns Map of active trigger pairs
375
+ * @returns Readonly view of active collision pairs
336
376
  */
337
- declare function getActiveTriggers(): ReadonlyMap<string, CollisionPair>;
377
+ declare function getActiveCollisions(): ActivePairsView;
378
+ /**
379
+ * Gets the current number of active trigger pairs.
380
+ *
381
+ * @returns Number of active trigger pairs
382
+ *
383
+ * @example
384
+ * ```typescript
385
+ * import { getActiveTriggerCount } from 'blecsd';
386
+ *
387
+ * const count = getActiveTriggerCount();
388
+ * console.log(`${count} active triggers`);
389
+ * ```
390
+ */
391
+ declare function getActiveTriggerCount(): number;
392
+ /**
393
+ * Gets the current active trigger pairs as a readonly view.
394
+ * Iterate data[0..size-1] for dense, cache-friendly access.
395
+ *
396
+ * The returned view is a snapshot reference into the live store.
397
+ * Do not cache it across frames or mutate its contents.
398
+ *
399
+ * @returns Readonly view of active trigger pairs
400
+ */
401
+ declare function getActiveTriggers(): ActivePairsView;
338
402
  /**
339
403
  * Resets the collision system state.
340
404
  * Useful for testing or scene changes.
@@ -420,6 +484,7 @@ declare function createCollisionSystem(): System;
420
484
  declare function registerCollisionSystem(scheduler: Scheduler, priority?: number): void;
421
485
  /**
422
486
  * Checks if an entity is currently colliding with any other entity.
487
+ * Uses dense iteration over the packed collision store.
423
488
  *
424
489
  * @param eid - The entity to check
425
490
  * @returns true if entity is in any active collision
@@ -436,6 +501,7 @@ declare function registerCollisionSystem(scheduler: Scheduler, priority?: number
436
501
  declare function isColliding(eid: number): boolean;
437
502
  /**
438
503
  * Checks if an entity is currently in any trigger zone.
504
+ * Uses dense iteration over the packed trigger store.
439
505
  *
440
506
  * @param eid - The entity to check
441
507
  * @returns true if entity is in any active trigger
@@ -452,6 +518,7 @@ declare function isColliding(eid: number): boolean;
452
518
  declare function isInTrigger(eid: number): boolean;
453
519
  /**
454
520
  * Gets all entities currently colliding with a specific entity.
521
+ * Uses dense iteration over the packed collision store.
455
522
  *
456
523
  * @param eid - The entity to check
457
524
  * @returns Array of entity IDs colliding with this entity
@@ -469,6 +536,7 @@ declare function isInTrigger(eid: number): boolean;
469
536
  declare function getCollidingEntities(eid: number): number[];
470
537
  /**
471
538
  * Gets all trigger zones an entity is currently in.
539
+ * Uses dense iteration over the packed trigger store.
472
540
  *
473
541
  * @param eid - The entity to check
474
542
  * @returns Array of entity IDs of triggers this entity is in
@@ -486,6 +554,7 @@ declare function getCollidingEntities(eid: number): number[];
486
554
  declare function getTriggerZones(eid: number): number[];
487
555
  /**
488
556
  * Checks if two specific entities are currently colliding.
557
+ * Uses handle-based O(1) lookup via numeric pair key.
489
558
  *
490
559
  * @param eidA - First entity
491
560
  * @param eidB - Second entity
@@ -780,14 +849,7 @@ declare function createDragSystem(eventBus: EventBus<DragEventMap>): {
780
849
  * @returns True if position was updated
781
850
  */
782
851
  updateDrag(world: World, mouseX: number, mouseY: number): boolean;
783
- /**
784
- * Ends the current drag operation.
785
- *
786
- * @param world - The ECS world
787
- * @param dropTarget - Entity under the drop point (if any)
788
- * @param cancelled - Whether the drag was cancelled
789
- */
790
- endDrag(world: World, dropTarget?: Entity | null, cancelled?: boolean): void;
852
+ endDrag: (world: World, dropTarget?: Entity | null, cancelled?: boolean) => void;
791
853
  /**
792
854
  * Cancels the current drag and restores original position.
793
855
  *
@@ -1471,6 +1533,8 @@ declare function pointInEntity(world: World, eid: Entity, x: number, y: number):
1471
1533
  * Performs hit testing at a point to find all entities under it.
1472
1534
  * Returns entities sorted by z-index (highest first).
1473
1535
  *
1536
+ * PERF: Uses iterator directly to avoid intermediate array allocation.
1537
+ *
1474
1538
  * @param world - The ECS world
1475
1539
  * @param x - X coordinate to test
1476
1540
  * @param y - Y coordinate to test
@@ -1584,6 +1648,8 @@ declare function clearEntityInput(world: World, eid: Entity): void;
1584
1648
  * Query all entities that can receive input.
1585
1649
  * Returns entities with either Interactive or Focusable components.
1586
1650
  *
1651
+ * PERF: Processes iterators directly to minimize allocations.
1652
+ *
1587
1653
  * @param world - The ECS world
1588
1654
  * @returns Array of entity IDs that can receive input
1589
1655
  */
@@ -1770,6 +1836,9 @@ declare function getComputedBounds(world: World, eid: Entity): {
1770
1836
  /**
1771
1837
  * Query all entities with the Velocity component.
1772
1838
  *
1839
+ * PERF: Converts iterator to array for system processing.
1840
+ * Array allocation is unavoidable here as we need to iterate over entities.
1841
+ *
1773
1842
  * @param world - The ECS world
1774
1843
  * @returns Array of entity IDs with Velocity component
1775
1844
  */
@@ -1802,7 +1871,7 @@ declare function hasMovementSystem(world: World, eid: number): boolean;
1802
1871
  * import { createScheduler, LoopPhase, movementSystem } from 'blecsd';
1803
1872
  *
1804
1873
  * const scheduler = createScheduler();
1805
- * scheduler.registerSystem(LoopPhase.PHYSICS, movementSystem);
1874
+ * scheduler.registerSystem(LoopPhase.ANIMATION, movementSystem);
1806
1875
  *
1807
1876
  * // In game loop
1808
1877
  * scheduler.run(world, deltaTime);
@@ -1822,7 +1891,7 @@ declare const movementSystem: System;
1822
1891
  *
1823
1892
  * const scheduler = createScheduler();
1824
1893
  * const system = createMovementSystem();
1825
- * scheduler.registerSystem(LoopPhase.PHYSICS, system);
1894
+ * scheduler.registerSystem(LoopPhase.ANIMATION, system);
1826
1895
  * ```
1827
1896
  */
1828
1897
  declare function createMovementSystem(): System;
@@ -1899,6 +1968,7 @@ declare function createOutputState(): OutputState;
1899
1968
  *
1900
1969
  * @param state - Output state
1901
1970
  * @param changes - Array of cell changes
1971
+ * @param skipSort - Skip sorting if changes are already in row-major order
1902
1972
  * @returns ANSI output string
1903
1973
  *
1904
1974
  * @example
@@ -1910,7 +1980,7 @@ declare function createOutputState(): OutputState;
1910
1980
  * process.stdout.write(output);
1911
1981
  * ```
1912
1982
  */
1913
- declare function generateOutput(state: OutputState, changes: readonly CellChange[]): string;
1983
+ declare function generateOutput(state: OutputState, changes: readonly CellChange[], skipSort?: boolean): string;
1914
1984
  /**
1915
1985
  * Sets the output stream for the output system.
1916
1986
  *
@@ -2399,6 +2469,8 @@ interface ParticleSystemConfig {
2399
2469
  readonly particles: EntityProvider;
2400
2470
  /** Maximum concurrent particles (default: 1000) */
2401
2471
  readonly maxParticles?: number;
2472
+ /** Archetype pool name for zero-alloc entity recycling (optional) */
2473
+ readonly archetypeName?: string;
2402
2474
  }
2403
2475
  /**
2404
2476
  * Spawns a single particle from an emitter at a random angle within the spread.
@@ -2406,9 +2478,10 @@ interface ParticleSystemConfig {
2406
2478
  * @param world - The ECS world
2407
2479
  * @param emitterId - The emitter entity ID
2408
2480
  * @param appearance - Visual appearance config
2481
+ * @param archetypeName - Optional archetype pool name for entity recycling
2409
2482
  * @returns The spawned particle entity ID, or -1 if spawn failed
2410
2483
  */
2411
- declare function spawnParticle(world: World, emitterId: Entity, appearance: EmitterAppearance): Entity;
2484
+ declare function spawnParticle(world: World, emitterId: Entity, appearance: EmitterAppearance, archetypeName?: string): Entity;
2412
2485
  /**
2413
2486
  * Triggers a burst of particles from an emitter.
2414
2487
  *
@@ -2446,10 +2519,14 @@ declare function moveParticle(world: World, eid: Entity, delta: number): void;
2446
2519
  /**
2447
2520
  * Removes a dead particle and cleans up tracking.
2448
2521
  *
2522
+ * When an archetype name is provided, the entity is returned to the pool
2523
+ * instead of being fully removed from the world.
2524
+ *
2449
2525
  * @param world - The ECS world
2450
2526
  * @param eid - The particle entity ID
2527
+ * @param archetypeName - Optional archetype pool name for entity recycling
2451
2528
  */
2452
- declare function killParticle(world: World, eid: Entity): void;
2529
+ declare function killParticle(world: World, eid: Entity, archetypeName?: string): void;
2453
2530
  declare function createParticleSystem(config: ParticleSystemConfig): System;
2454
2531
 
2455
2532
  /**
@@ -2466,8 +2543,8 @@ interface RenderContext {
2466
2543
  readonly world: World;
2467
2544
  /** The screen buffer to render to */
2468
2545
  readonly buffer: ScreenBufferData;
2469
- /** The double buffer for dirty tracking */
2470
- readonly doubleBuffer: DoubleBufferData;
2546
+ /** The dirty tracker for optimized rendering */
2547
+ readonly dirtyTracker: DirtyTracker;
2471
2548
  }
2472
2549
  /**
2473
2550
  * Computed bounds for an entity.
@@ -2541,30 +2618,101 @@ declare function renderContent(_ctx: RenderContext, _eid: Entity, _contentBounds
2541
2618
  */
2542
2619
  declare function renderScrollbar(_ctx: RenderContext, _eid: Entity, _bounds: EntityBounds): void;
2543
2620
  /**
2544
- * Sets the double buffer for the render system.
2621
+ * Recursively renders an entity and its children in tree order.
2622
+ * @internal Currently unused, reserved for future tree-based rendering mode.
2623
+ *
2624
+ * @param ctx - Render context
2625
+ * @param eid - Entity ID
2626
+ */
2627
+ /**
2628
+ * Viewport bounds for culling off-screen entities.
2629
+ * Defaults to null (no culling). Set via setViewportBounds().
2630
+ */
2631
+ interface ViewportBounds {
2632
+ readonly x: number;
2633
+ readonly y: number;
2634
+ readonly width: number;
2635
+ readonly height: number;
2636
+ }
2637
+ /**
2638
+ * Sets the viewport bounds for culling.
2639
+ * Entities outside these bounds will be skipped during rendering.
2640
+ *
2641
+ * Pass null to disable viewport culling (default).
2642
+ * Typically set to screen dimensions for scrollable content optimization.
2643
+ *
2644
+ * @param bounds - Viewport bounds or null to disable culling
2645
+ *
2646
+ * @example
2647
+ * ```typescript
2648
+ * import { setViewportBounds } from 'blecsd';
2649
+ *
2650
+ * // Enable viewport culling for 80x24 screen
2651
+ * setViewportBounds({ x: 0, y: 0, width: 80, height: 24 });
2652
+ *
2653
+ * // Disable viewport culling
2654
+ * setViewportBounds(null);
2655
+ * ```
2656
+ */
2657
+ declare function setViewportBounds(bounds: ViewportBounds | null): void;
2658
+ /**
2659
+ * Gets the current viewport bounds.
2660
+ *
2661
+ * @returns Current viewport bounds or null if disabled
2662
+ */
2663
+ declare function getViewportBounds(): ViewportBounds | null;
2664
+ /**
2665
+ * Sets the dirty tracker and screen buffer for the render system.
2545
2666
  * Must be called before running the render system.
2546
2667
  *
2547
- * @param db - The double buffer to render to
2668
+ * @param tracker - The dirty tracker for optimized rendering
2669
+ * @param buffer - The screen buffer to render to
2548
2670
  *
2549
2671
  * @example
2550
2672
  * ```typescript
2551
- * import { setRenderBuffer, createDoubleBuffer } from 'blecsd';
2673
+ * import { setRenderBuffer, createDirtyTracker } from 'blecsd';
2674
+ * import { createScreenBuffer } from 'blecsd';
2552
2675
  *
2553
- * const db = createDoubleBuffer(80, 24);
2554
- * setRenderBuffer(db);
2676
+ * const tracker = createDirtyTracker(80, 24);
2677
+ * const buffer = createScreenBuffer(80, 24);
2678
+ * setRenderBuffer(tracker, buffer);
2555
2679
  * ```
2556
2680
  */
2557
- declare function setRenderBuffer(db: DoubleBufferData): void;
2681
+ declare function setRenderBuffer(tracker: DirtyTracker, buffer: ScreenBufferData): void;
2558
2682
  /**
2559
- * Gets the current render buffer.
2683
+ * Gets the current dirty tracker.
2560
2684
  *
2561
- * @returns The current double buffer or null
2685
+ * @returns The current dirty tracker or null
2562
2686
  */
2563
- declare function getRenderBuffer(): DoubleBufferData | null;
2687
+ declare function getRenderBuffer(): DirtyTracker | null;
2564
2688
  /**
2565
- * Clears the render buffer reference.
2689
+ * Clears the render buffer references.
2566
2690
  */
2567
2691
  declare function clearRenderBuffer(): void;
2692
+ /**
2693
+ * Enables or disables z-order occlusion culling.
2694
+ * When enabled, entities fully hidden behind higher z-index entities are skipped during rendering.
2695
+ *
2696
+ * Disabled by default. Enable for applications with many overlapping widgets (modals, dialogs, overlays)
2697
+ * where the performance benefit outweighs the culling overhead.
2698
+ *
2699
+ * @param enabled - Whether to enable occlusion culling (default: false)
2700
+ *
2701
+ * @example
2702
+ * ```typescript
2703
+ * import { setOcclusionCulling } from 'blecsd';
2704
+ *
2705
+ * // Enable occlusion culling for layered UI
2706
+ * setOcclusionCulling(true);
2707
+ * ```
2708
+ */
2709
+ declare function setOcclusionCulling(enabled: boolean): void;
2710
+ /**
2711
+ * Gets the current occlusion culling state.
2712
+ *
2713
+ * @returns True if occlusion culling is enabled
2714
+ */
2715
+ declare function isOcclusionCullingEnabled(): boolean;
2568
2716
  /**
2569
2717
  * Render system that draws visible, dirty entities to the screen buffer.
2570
2718
  * Entities are rendered in z-index order (lower z first, higher z on top).
@@ -2573,21 +2721,33 @@ declare function clearRenderBuffer(): void;
2573
2721
  * 1. Queries all entities with Position and Renderable
2574
2722
  * 2. Filters to visible, dirty entities
2575
2723
  * 3. Sorts by z-index
2576
- * 4. Renders each entity (background, border, content)
2577
- * 5. Marks entities as clean
2724
+ * 4. Applies viewport bounds culling (skips off-screen entities)
2725
+ * 5. Applies z-order occlusion culling (skips fully hidden entities)
2726
+ * 6. Renders each visible entity (background, border, content)
2727
+ * 7. Marks entities as clean
2728
+ *
2729
+ * Viewport culling: entities completely outside the viewport bounds are skipped
2730
+ * to improve performance in scrollable content with many off-screen entities.
2731
+ * Enable via `setViewportBounds({ x, y, width, height })`.
2732
+ *
2733
+ * Occlusion culling: entities fully covered by higher z-index entities are
2734
+ * skipped to improve performance in layered UIs (modals, dialogs, overlays).
2735
+ * Enable via `setOcclusionCulling(true)`.
2578
2736
  *
2579
2737
  * @param world - The ECS world
2580
2738
  * @returns The world (unchanged)
2581
2739
  *
2582
2740
  * @example
2583
2741
  * ```typescript
2584
- * import { renderSystem, setRenderBuffer, createScheduler, LoopPhase } from 'blecsd';
2742
+ * import { renderSystem, setRenderBuffer, setViewportBounds, createScheduler, LoopPhase } from 'blecsd';
2585
2743
  *
2586
2744
  * const scheduler = createScheduler();
2587
2745
  * scheduler.registerSystem(LoopPhase.RENDER, renderSystem);
2588
2746
  *
2589
- * // Before running, set the render buffer
2590
- * setRenderBuffer(doubleBuffer);
2747
+ * // Set render buffer and enable viewport culling
2748
+ * setRenderBuffer(dirtyTracker, screenBuffer);
2749
+ * setViewportBounds({ x: 0, y: 0, width: 80, height: 24 });
2750
+ *
2591
2751
  * scheduler.run(world, deltaTime);
2592
2752
  * ```
2593
2753
  */
@@ -2866,6 +3026,11 @@ declare function createSmoothScrollSystem(physics?: Partial<ScrollPhysicsConfig>
2866
3026
  * which entities overlap it. Enables efficient broad-phase collision
2867
3027
  * detection by only checking entities in the same or adjacent cells.
2868
3028
  *
3029
+ * Supports incremental updates: tracks which entities have moved since
3030
+ * the last frame via a PackedStore dirty set, and only re-hashes those
3031
+ * entities. Falls back to full rebuild when the dirty fraction exceeds
3032
+ * a configurable threshold.
3033
+ *
2869
3034
  * @module systems/spatialHash
2870
3035
  */
2871
3036
 
@@ -2905,6 +3070,32 @@ interface SpatialHashStats {
2905
3070
  readonly averageEntitiesPerCell: number;
2906
3071
  readonly maxEntitiesInCell: number;
2907
3072
  }
3073
+ /**
3074
+ * Cached bounds for a single entity (position + collider offset + size).
3075
+ */
3076
+ interface PrevBounds {
3077
+ x: number;
3078
+ y: number;
3079
+ w: number;
3080
+ h: number;
3081
+ }
3082
+ /**
3083
+ * Internal state for the incremental spatial hash system.
3084
+ * Tracks which entities need re-hashing via a PackedStore dirty set,
3085
+ * and caches previous positions for change detection.
3086
+ */
3087
+ interface SpatialHashSystemState {
3088
+ /** Dense packed store of dirty entity IDs for cache-friendly iteration */
3089
+ readonly dirtyEntities: PackedStore<number>;
3090
+ /** O(1) dedup: entity IDs currently in the dirty store */
3091
+ readonly dirtyLookup: Set<number>;
3092
+ /** Previous bounds per entity, backed by PackedStore for cache-friendly iteration */
3093
+ readonly prevBounds: ComponentStore<PrevBounds>;
3094
+ /** Whether the system has run at least once (first frame needs full rebuild) */
3095
+ initialized: boolean;
3096
+ /** Fraction of entities that must be dirty to trigger full rebuild (0.0-1.0) */
3097
+ dirtyThreshold: number;
3098
+ }
2908
3099
  /** Default cell size */
2909
3100
  declare const DEFAULT_CELL_SIZE = 8;
2910
3101
  /**
@@ -3088,8 +3279,23 @@ declare function getSpatialHashStats(grid: SpatialHashGrid): SpatialHashStats;
3088
3279
  * ```
3089
3280
  */
3090
3281
  declare function rebuildSpatialHash(grid: SpatialHashGrid, world: World): void;
3282
+ /**
3283
+ * Creates a fresh spatial hash system state for incremental updates.
3284
+ *
3285
+ * @param dirtyThreshold - Fraction of entities above which full rebuild is used (default: 0.5)
3286
+ * @returns New system state
3287
+ *
3288
+ * @example
3289
+ * ```typescript
3290
+ * import { createSpatialHashSystemState } from 'blecsd';
3291
+ *
3292
+ * const state = createSpatialHashSystemState(0.3);
3293
+ * ```
3294
+ */
3295
+ declare function createSpatialHashSystemState(dirtyThreshold?: number): SpatialHashSystemState;
3091
3296
  /**
3092
3297
  * Sets the spatial hash grid for the system to use.
3298
+ * Resets incremental state so the next tick performs a full rebuild.
3093
3299
  *
3094
3300
  * @param grid - The spatial hash grid
3095
3301
  *
@@ -3109,7 +3315,96 @@ declare function setSpatialHashGrid(grid: SpatialHashGrid): void;
3109
3315
  */
3110
3316
  declare function getSpatialHashGrid(): SpatialHashGrid | null;
3111
3317
  /**
3112
- * Spatial hash system that rebuilds the grid each frame.
3318
+ * Gets the current incremental update system state.
3319
+ *
3320
+ * @returns The system state
3321
+ */
3322
+ declare function getSpatialHashSystemState(): SpatialHashSystemState;
3323
+ /**
3324
+ * Marks an entity as needing re-hashing on the next system tick.
3325
+ * Use this when an external system knows an entity's position or
3326
+ * collider changed, to avoid waiting for the position comparison scan.
3327
+ *
3328
+ * @param eid - Entity to mark dirty
3329
+ *
3330
+ * @example
3331
+ * ```typescript
3332
+ * import { markSpatialDirty } from 'blecsd';
3333
+ *
3334
+ * // After teleporting an entity, mark it dirty
3335
+ * Position.x[entity] = 100;
3336
+ * Position.y[entity] = 200;
3337
+ * markSpatialDirty(entity);
3338
+ * ```
3339
+ */
3340
+ declare function markSpatialDirty(eid: Entity): void;
3341
+ /**
3342
+ * Gets the number of entities currently marked as dirty.
3343
+ *
3344
+ * @returns Count of dirty entities awaiting re-hash
3345
+ *
3346
+ * @example
3347
+ * ```typescript
3348
+ * import { getSpatialDirtyCount } from 'blecsd';
3349
+ *
3350
+ * console.log(`${getSpatialDirtyCount()} entities need re-hashing`);
3351
+ * ```
3352
+ */
3353
+ declare function getSpatialDirtyCount(): number;
3354
+ /**
3355
+ * Resets the incremental spatial hash system state.
3356
+ * Clears dirty entities, position cache, and forces a full rebuild on next tick.
3357
+ * Useful for testing or scene transitions.
3358
+ *
3359
+ * @example
3360
+ * ```typescript
3361
+ * import { resetSpatialHashState } from 'blecsd';
3362
+ *
3363
+ * resetSpatialHashState();
3364
+ * ```
3365
+ */
3366
+ declare function resetSpatialHashState(): void;
3367
+ /**
3368
+ * Sets the dirty threshold for the incremental update system.
3369
+ * When the fraction of dirty entities exceeds this value,
3370
+ * a full rebuild is used instead of incremental updates.
3371
+ *
3372
+ * @param threshold - Fraction between 0.0 and 1.0 (default: 0.5)
3373
+ *
3374
+ * @example
3375
+ * ```typescript
3376
+ * import { setSpatialDirtyThreshold } from 'blecsd';
3377
+ *
3378
+ * // Use full rebuild when more than 30% of entities moved
3379
+ * setSpatialDirtyThreshold(0.3);
3380
+ * ```
3381
+ */
3382
+ declare function setSpatialDirtyThreshold(threshold: number): void;
3383
+ /**
3384
+ * Performs an incremental update of the spatial hash grid.
3385
+ * Only re-inserts entities that were marked dirty (moved, resized, or new).
3386
+ * Falls back to full rebuild when dirty count exceeds the threshold.
3387
+ *
3388
+ * @param grid - The spatial hash grid
3389
+ * @param state - The incremental update state
3390
+ * @param world - The ECS world
3391
+ *
3392
+ * @example
3393
+ * ```typescript
3394
+ * import { createSpatialHash, createSpatialHashSystemState, incrementalSpatialUpdate } from 'blecsd';
3395
+ *
3396
+ * const grid = createSpatialHash({ cellSize: 4 });
3397
+ * const state = createSpatialHashSystemState();
3398
+ * incrementalSpatialUpdate(grid, state, world);
3399
+ * ```
3400
+ */
3401
+ declare function incrementalSpatialUpdate(grid: SpatialHashGrid, state: SpatialHashSystemState, world: World): void;
3402
+ /**
3403
+ * Spatial hash system with incremental updates.
3404
+ *
3405
+ * On the first frame, performs a full rebuild. On subsequent frames,
3406
+ * detects which entities moved and only re-hashes those. Falls back
3407
+ * to full rebuild when the dirty fraction exceeds the configured threshold.
3113
3408
  *
3114
3409
  * Register this in the EARLY_UPDATE phase to ensure collision queries
3115
3410
  * use up-to-date spatial data.
@@ -3728,18 +4023,23 @@ interface CullingResult {
3728
4023
  /** Number of entities culled (not visible) */
3729
4024
  readonly culled: number;
3730
4025
  }
4026
+ /**
4027
+ * Cached bounds for a single entity in the position cache.
4028
+ */
4029
+ interface CachedBounds {
4030
+ x: number;
4031
+ y: number;
4032
+ w: number;
4033
+ h: number;
4034
+ }
3731
4035
  /**
3732
4036
  * Entity position cache for incremental updates.
4037
+ * Uses a single ComponentStore instead of 4 separate Maps,
4038
+ * reducing hash lookups from 4 to 1 per entity per frame.
3733
4039
  */
3734
4040
  interface PositionCache {
3735
- /** Previous x position per entity */
3736
- readonly prevX: Map<number, number>;
3737
- /** Previous y position per entity */
3738
- readonly prevY: Map<number, number>;
3739
- /** Previous width per entity */
3740
- readonly prevW: Map<number, number>;
3741
- /** Previous height per entity */
3742
- readonly prevH: Map<number, number>;
4041
+ /** Previous bounds per entity */
4042
+ readonly bounds: ComponentStore<CachedBounds>;
3743
4043
  }
3744
4044
  /**
3745
4045
  * Creates a position cache for tracking entity movement.
@@ -3868,6 +4168,7 @@ declare function createVisibilityCullingSystem(grid: SpatialHashGrid, getViewpor
3868
4168
  *
3869
4169
  * @module systems/workerPool
3870
4170
  */
4171
+
3871
4172
  /**
3872
4173
  * Configuration for the worker pool.
3873
4174
  */
@@ -4033,4 +4334,4 @@ declare function getWorkerPoolState(): WorkerPoolState;
4033
4334
  */
4034
4335
  declare function destroyWorkerPool(): void;
4035
4336
 
4036
- export { type BehaviorSystemConfig, type BudgetAlert, type CellCoord, type CollisionEventData, type CollisionEventMap, type CollisionSystemState, ComputedLayout, type ComputedLayoutData, type CullingResult, DEFAULT_CELL_SIZE, type DirtyRect, type DragConstraints, type DragEndEvent, type DragEventMap, type DragMoveEvent, type DragStartEvent, type DragState, type DragVerifyCallback, type DropEvent, type EntityProvider, type FocusEventData, type FocusEventMap, type FocusEventType, type FrameBudgetConfig, type FrameBudgetManager, type FrameStats, type HitTestResult, type InputEventType, type InputSystemState, type LineRenderConfig, LineRenderConfigSchema, type MoveResult, type MovementApplier, type OutputState, type PanelConstraints, type PanelMoveConfig, type PanelMoveState, type ParticleSystemConfig, type PoolStats, type PoolTask, type PositionCache, type PositionResolver, type QueuedInputEvent, type QueuedKeyEvent, type QueuedMouseEvent, type RenderContext, type ResizeHandle, type ScrollAnimationState, type ScrollEvent, type ScrollPhysicsConfig, type SpatialHashConfig, type SpatialHashGrid, type SpatialHashStats, type SyncHandler, type SystemTiming, type TaskPriority, type TaskResult, type TileMapBuffer, type TileMapCamera, type TileMapRendererConfig, type Viewport, type VirtualizedRenderContext, type WorkerPoolConfig, type WorkerPoolState, ageParticle, animationSystem, applyScrollImpulse, areColliding, beginMove, beginResize, blurAll, burstParticles, cameraSystem, cancelAllOfType, cancelMoveOrResize, cancelTask, captureMouseTo, cleanup, cleanupEntityResources, cleanupVirtualizedRenderSystem, clearAllScrollStates, clearDragConstraints, clearEntityInput, clearEventQueue, clearFocusStack, clearLineRenderConfig, clearOutputBuffer, clearOutputStream, clearPositionCache, clearRenderBuffer, clearScreen, clearSpatialHash, clearTileMapRenderBuffer, clearVirtualizedRenderBuffer, collisionSystem, computeLayoutNow, createAnimationSystem, createBehaviorSystem, createCameraSystem, createCollisionSystem, createDragSystem, createEmptyBuffer, createFocusSystem, createFrameBudgetManager, createIncrementalSpatialSystem, createInputSystem, createLayoutSystem, createMovementSystem, createOutputState, createOutputSystem, createPanelConstraints, createPanelMoveConfig, createPanelMoveState, createParticleSystem, createPositionCache, createRenderSystem, createSmoothScrollSystem, createSpatialHash, createSpatialHashSystem, createStateMachineSystem, createTilemapRenderSystem, createVirtualizedRenderSystem, createVisibilityCullingSystem, createWorkerPool, cursorHome, destroyFrameBudgetManager, destroyWorkerPool, detectCollisions, detectResizeHandle, endMoveOrResize, endUserScroll, enterAlternateScreen, exportFrameBudgetMetrics, focusEntity, focusFirst, focusLast, focusNext, focusOffset, focusPop, focusPrev, focusPush, focusSystem, generateOutput, getActiveCollisions, getActiveTriggers, getCollidingEntities, getCollisionEventBus, getComputedBounds, getComputedLayout, getDragConstraints, getDragVerifyCallback, getEntitiesAtPoint, getEntitiesInCell, getEventQueue, getFocusEventBus, getFocusStackDepth, getFocusableEntities, getFocused, getFrameBudgetStats, getInputEventBus, getInteractiveEntityAt, getLineRenderConfig, getLineStore, getMouseCaptureEntity, getNearbyEntities, getOutputBuffer, getOutputState, getOutputStream, getRenderBuffer, getScrollPosition, getScrollState, getSpatialHashGrid, getSpatialHashStats, getStateAgeStore, getSystemStateAge, getTileMapRenderBuffer, getTileMapRendererConfig, getTriggerZones, getVirtualizedRenderBuffer, getWorkerPoolState, hasAnimationSystem, hasComputedLayout, hasMovementSystem, hideCursor, hitTest, inputState, inputSystem, insertEntity, invalidateAllLayouts, invalidateLayout, isColliding, isInTrigger, isMouseCaptured, isScrolling, keyboardMove, keyboardResize, killParticle, layoutSystem, leaveAlternateScreen, markAllDirty, mergeDirtyRects, moveParticle, movementSystem, onBudgetAlert, outputSystem, peekFocusStack, performCulling, pointInEntity, profiledSystem, queryAnimation, queryArea, queryCameras, queryColliders, queryInputReceivers, queryMovement, queryStateMachine, queryVisibleEntities, queueKeyEvent, queueMouseEvent, rebuildSpatialHash, recordFrameBudgetSystemTime, recordFrameTime, recordPhaseTime, registerAnimationSystem, registerCameraSystem, registerCollisionSystem, registerInputSystem, registerLineStore, registerMovementSystem, registerStateMachineSystem, registerTaskHandler, releaseMouse, removeEntityFromGrid, removeFromCache, removeScrollState, renderAllTileMaps, renderBackground, renderBorder, renderContent, renderRect, renderScrollbar, renderSystem, renderText, renderTileMapToBuffer, resetAttributes, resetCollisionState, resetDragStores, resetFocusEventBus, resetFrameBudget, resetInputState, resetOutputState, resetStateAge, resetTileMapRenderer, restoreFocus, rewindFocus, saveFocus, setDragConstraints, setDragVerifyCallback, setLineRenderConfig, setOutputBuffer, setOutputStream, setRenderBuffer, setScrollImmediate, setSpatialHashGrid, setTileMapRendererConfig, setVirtualizedRenderBuffer, showCursor, smoothScrollTo, spatialHashSystem, spawnParticle, startUserScroll, stateMachineSystem, submitTask, tilemapRenderSystem, unregisterLineStore, updateAnimations, updateCameras, updateEntityIfMoved, updateLineStore, updateMove, updateMovements, updateResize, updateScrollPhysics, updateStateAges, virtualizedRenderSystem, worldToCell, writeRaw };
4337
+ export { type ActivePairsView, type BehaviorSystemConfig, type BudgetAlert, type CachedBounds, type CellCoord, type CollisionEventData, type CollisionEventMap, type CollisionSystemState, ComputedLayout, type ComputedLayoutData, type CullingResult, DEFAULT_CELL_SIZE, type DirtyRect, type DragConstraints, type DragEndEvent, type DragEventMap, type DragMoveEvent, type DragStartEvent, type DragState, type DragVerifyCallback, type DropEvent, type EntityProvider, type FocusEventData, type FocusEventMap, type FocusEventType, type FrameBudgetConfig, type FrameBudgetManager, type FrameStats, type HitTestResult, type InputEventType, type InputSystemState, type LineRenderConfig, LineRenderConfigSchema, type MoveResult, type MovementApplier, type OutputState, type PanelConstraints, type PanelMoveConfig, type PanelMoveState, type ParticleSystemConfig, type PoolStats, type PoolTask, type PositionCache, type PositionResolver, type PrevBounds, type QueuedInputEvent, type QueuedKeyEvent, type QueuedMouseEvent, type RenderContext, type ResizeHandle, type ScrollAnimationState, type ScrollEvent, type ScrollPhysicsConfig, type SpatialHashConfig, type SpatialHashGrid, type SpatialHashStats, type SpatialHashSystemState, type SyncHandler, type SystemTiming, type TaskPriority, type TaskResult, type TileMapBuffer, type TileMapCamera, type TileMapRendererConfig, type Viewport, type VirtualizedRenderContext, type WorkerPoolConfig, type WorkerPoolState, ageParticle, animationSystem, applyScrollImpulse, areColliding, beginMove, beginResize, blurAll, burstParticles, cameraSystem, cancelAllOfType, cancelMoveOrResize, cancelTask, captureMouseTo, cleanup, cleanupEntityResources, cleanupVirtualizedRenderSystem, clearAllScrollStates, clearDragConstraints, clearEntityInput, clearEventQueue, clearFocusStack, clearLineRenderConfig, clearOutputBuffer, clearOutputStream, clearPositionCache, clearRenderBuffer, clearScreen, clearSpatialHash, clearTileMapRenderBuffer, clearVirtualizedRenderBuffer, collisionSystem, computeLayoutNow, createAnimationSystem, createBehaviorSystem, createCameraSystem, createCollisionSystem, createDragSystem, createEmptyBuffer, createFocusSystem, createFrameBudgetManager, createIncrementalSpatialSystem, createInputSystem, createLayoutSystem, createMovementSystem, createOutputState, createOutputSystem, createPanelConstraints, createPanelMoveConfig, createPanelMoveState, createParticleSystem, createPositionCache, createRenderSystem, createSmoothScrollSystem, createSpatialHash, createSpatialHashSystem, createSpatialHashSystemState, createStateMachineSystem, createTilemapRenderSystem, createVirtualizedRenderSystem, createVisibilityCullingSystem, createWorkerPool, cursorHome, destroyFrameBudgetManager, destroyWorkerPool, detectCollisions, detectResizeHandle, endMoveOrResize, endUserScroll, enterAlternateScreen, exportFrameBudgetMetrics, focusEntity, focusFirst, focusLast, focusNext, focusOffset, focusPop, focusPrev, focusPush, focusSystem, generateOutput, getActiveCollisionCount, getActiveCollisions, getActiveTriggerCount, getActiveTriggers, getCollidingEntities, getCollisionEventBus, getComputedBounds, getComputedLayout, getDragConstraints, getDragVerifyCallback, getEntitiesAtPoint, getEntitiesInCell, getEventQueue, getFocusEventBus, getFocusStackDepth, getFocusableEntities, getFocused, getFrameBudgetStats, getInputEventBus, getInteractiveEntityAt, getLineRenderConfig, getLineStore, getMouseCaptureEntity, getNearbyEntities, getOutputBuffer, getOutputState, getOutputStream, getRenderBuffer, getScrollPosition, getScrollState, getSpatialDirtyCount, getSpatialHashGrid, getSpatialHashStats, getSpatialHashSystemState, getStateAgeStore, getSystemStateAge, getTileMapRenderBuffer, getTileMapRendererConfig, getTriggerZones, getViewportBounds, getVirtualizedRenderBuffer, getWorkerPoolState, hasAnimationSystem, hasComputedLayout, hasMovementSystem, hideCursor, hitTest, incrementalSpatialUpdate, inputState, inputSystem, insertEntity, invalidateAllLayouts, invalidateLayout, isColliding, isInTrigger, isMouseCaptured, isOcclusionCullingEnabled, isScrolling, keyboardMove, keyboardResize, killParticle, layoutSystem, leaveAlternateScreen, markAllDirty, markSpatialDirty, mergeDirtyRects, moveParticle, movementSystem, onBudgetAlert, outputSystem, peekFocusStack, performCulling, pointInEntity, profiledSystem, queryAnimation, queryArea, queryCameras, queryColliders, queryInputReceivers, queryMovement, queryStateMachine, queryVisibleEntities, queueKeyEvent, queueMouseEvent, rebuildSpatialHash, recordFrameBudgetSystemTime, recordFrameTime, recordPhaseTime, registerAnimationSystem, registerCameraSystem, registerCollisionSystem, registerInputSystem, registerLineStore, registerMovementSystem, registerStateMachineSystem, registerTaskHandler, releaseMouse, removeEntityFromGrid, removeFromCache, removeScrollState, renderAllTileMaps, renderBackground, renderBorder, renderContent, renderRect, renderScrollbar, renderSystem, renderText, renderTileMapToBuffer, resetAttributes, resetCollisionState, resetDragStores, resetFocusEventBus, resetFrameBudget, resetInputState, resetOutputState, resetSpatialHashState, resetStateAge, resetTileMapRenderer, restoreFocus, rewindFocus, saveFocus, setDragConstraints, setDragVerifyCallback, setLineRenderConfig, setOcclusionCulling, setOutputBuffer, setOutputStream, setRenderBuffer, setScrollImmediate, setSpatialDirtyThreshold, setSpatialHashGrid, setTileMapRendererConfig, setViewportBounds, setVirtualizedRenderBuffer, showCursor, smoothScrollTo, spatialHashSystem, spawnParticle, startUserScroll, stateMachineSystem, submitTask, tilemapRenderSystem, unregisterLineStore, updateAnimations, updateCameras, updateEntityIfMoved, updateLineStore, updateMove, updateMovements, updateResize, updateScrollPhysics, updateStateAges, virtualizedRenderSystem, worldToCell, writeRaw };