@n3rdw1z4rd/core 0.22.0 → 0.23.1

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 (142) hide show
  1. package/README.md +59 -4
  2. package/dist/astar.d.ts +1 -3
  3. package/dist/astar.js +1 -2
  4. package/dist/canvas-renderer.d.ts +1 -3
  5. package/dist/canvas-renderer.js +1 -2
  6. package/dist/clock.d.ts +1 -3
  7. package/dist/clock.js +1 -2
  8. package/dist/color-palette.d.ts +1 -3
  9. package/dist/color-palette.js +1 -2
  10. package/dist/color.d.ts +1 -3
  11. package/dist/color.js +1 -2
  12. package/dist/disposable.d.ts +1 -3
  13. package/dist/disposable.js +1 -2
  14. package/dist/dungeon-generator.d.ts +2 -4
  15. package/dist/dungeon-generator.js +3 -4
  16. package/dist/ecs.d.ts +1 -3
  17. package/dist/ecs.js +1 -2
  18. package/dist/emitter.d.ts +1 -3
  19. package/dist/emitter.js +1 -2
  20. package/dist/event-queue.d.ts +1 -3
  21. package/dist/event-queue.js +1 -2
  22. package/dist/graph/doc.d.ts +2 -4
  23. package/dist/graph/doc.js +1 -2
  24. package/dist/graph/evaluate.d.ts +1 -3
  25. package/dist/graph/evaluate.js +1 -2
  26. package/dist/graph/index.d.ts +4 -4
  27. package/dist/graph/index.js +4 -4
  28. package/dist/graph/node.d.ts +7 -9
  29. package/dist/graph/node.js +1 -2
  30. package/dist/graph/nodes.d.ts +1 -3
  31. package/dist/graph/nodes.js +1 -2
  32. package/dist/graph/script.d.ts +37 -40
  33. package/dist/graph/script.js +14 -60
  34. package/dist/graph/sources.d.ts +1 -3
  35. package/dist/graph/sources.js +1 -2
  36. package/dist/graph/subgraph.d.ts +2 -4
  37. package/dist/graph/subgraph.js +1 -2
  38. package/dist/graph/types.d.ts +3 -5
  39. package/dist/graph/types.js +2 -3
  40. package/dist/graph.cjs +22 -77
  41. package/dist/graph.d.cts +44 -61
  42. package/dist/index.cjs +27 -52
  43. package/dist/index.d.cts +1 -63
  44. package/dist/index.d.ts +10 -10
  45. package/dist/index.js +14 -14
  46. package/dist/input/_input.d.ts +1 -3
  47. package/dist/input/_input.js +1 -2
  48. package/dist/input/action-map.d.ts +1 -3
  49. package/dist/input/action-map.js +1 -2
  50. package/dist/input/bindings.d.ts +1 -3
  51. package/dist/input/bindings.js +1 -2
  52. package/dist/input/gestures.d.ts +1 -3
  53. package/dist/input/gestures.js +1 -2
  54. package/dist/input/index.d.ts +1 -1
  55. package/dist/input/index.js +1 -1
  56. package/dist/input/input-action-map.d.ts +3 -5
  57. package/dist/input/input-action-map.js +3 -4
  58. package/dist/input/input.d.ts +2 -4
  59. package/dist/input/input.js +2 -3
  60. package/dist/log.d.ts +1 -3
  61. package/dist/log.js +1 -2
  62. package/dist/map2d.d.ts +1 -3
  63. package/dist/map2d.js +1 -2
  64. package/dist/{map3d-CHDJiq5T.d.cts → map3d-DRHhbrFn.d.cts} +0 -8
  65. package/dist/map3d.d.ts +1 -3
  66. package/dist/map3d.js +1 -2
  67. package/dist/math.d.ts +1 -3
  68. package/dist/math.js +1 -2
  69. package/dist/misc.d.ts +1 -3
  70. package/dist/misc.js +1 -2
  71. package/dist/observable.d.ts +1 -3
  72. package/dist/observable.js +1 -2
  73. package/dist/particle-renderer.d.ts +1 -3
  74. package/dist/particle-renderer.js +1 -2
  75. package/dist/particle-system-2d.d.ts +1 -3
  76. package/dist/particle-system-2d.js +3 -4
  77. package/dist/random.d.ts +1 -3
  78. package/dist/random.js +1 -2
  79. package/dist/rectangle.d.ts +1 -3
  80. package/dist/rectangle.js +1 -2
  81. package/dist/{rng-Dhqq7owV.cjs → rng-edL6atS3.cjs} +3 -6
  82. package/dist/rng.d.ts +1 -3
  83. package/dist/rng.js +2 -3
  84. package/dist/signal.d.ts +1 -3
  85. package/dist/signal.js +1 -2
  86. package/dist/spatial-partition-2d.d.ts +1 -3
  87. package/dist/spatial-partition-2d.js +1 -2
  88. package/dist/{spatial-partition-3d-CmSCL87Z.cjs → spatial-partition-3d-D1uyJVhM.cjs} +7 -13
  89. package/dist/spatial-partition-3d.d.ts +1 -3
  90. package/dist/spatial-partition-3d.js +1 -2
  91. package/dist/three/adaptive-grid.d.ts +1 -3
  92. package/dist/three/adaptive-grid.js +1 -2
  93. package/dist/three/asteroid-mesh.d.ts +1 -3
  94. package/dist/three/asteroid-mesh.js +1 -2
  95. package/dist/three/camera-rig.d.ts +1 -3
  96. package/dist/three/camera-rig.js +1 -2
  97. package/dist/three/cube-sphere-geometry.d.ts +1 -3
  98. package/dist/three/cube-sphere-geometry.js +1 -2
  99. package/dist/three/ecs.d.ts +1 -3
  100. package/dist/three/ecs.js +1 -2
  101. package/dist/three/editor-camera.d.ts +1 -3
  102. package/dist/three/editor-camera.js +1 -2
  103. package/dist/three/index.d.ts +4 -4
  104. package/dist/three/index.js +1 -1
  105. package/dist/three/particle-system-3d.d.ts +1 -3
  106. package/dist/three/particle-system-3d.js +3 -4
  107. package/dist/three/picking.d.ts +2 -4
  108. package/dist/three/picking.js +1 -2
  109. package/dist/three/renderer.d.ts +1 -3
  110. package/dist/three/renderer.js +1 -2
  111. package/dist/three/schema.d.ts +0 -2
  112. package/dist/three/schema.js +1 -2
  113. package/dist/three/starfield.d.ts +1 -3
  114. package/dist/three/starfield.js +1 -2
  115. package/dist/three/texture-atlas.d.ts +1 -3
  116. package/dist/three/texture-atlas.js +1 -2
  117. package/dist/three/texture-utils.d.ts +1 -3
  118. package/dist/three/texture-utils.js +1 -2
  119. package/dist/three/voxel-geometry.d.ts +2 -4
  120. package/dist/three/voxel-geometry.js +2 -3
  121. package/dist/three/voxel-mesh.d.ts +1 -3
  122. package/dist/three/voxel-mesh.js +1 -2
  123. package/dist/three/world.d.ts +0 -2
  124. package/dist/three/world.js +1 -2
  125. package/dist/three.cjs +18 -34
  126. package/dist/three.d.cts +1 -33
  127. package/dist/tilemap.d.ts +1 -3
  128. package/dist/tilemap.js +1 -2
  129. package/dist/types.d.ts +1 -3
  130. package/dist/vector.d.ts +1 -3
  131. package/dist/vector.js +1 -2
  132. package/dist/vite.cjs +1 -2
  133. package/dist/vite.d.cts +1 -3
  134. package/dist/vite.d.ts +1 -3
  135. package/dist/vite.js +1 -2
  136. package/dist/webgl-renderer.d.ts +1 -3
  137. package/dist/webgl-renderer.js +1 -2
  138. package/dist/webgl.d.ts +1 -3
  139. package/dist/webgl.js +1 -2
  140. package/dist/worker-interface.d.ts +1 -3
  141. package/dist/worker-interface.js +1 -2
  142. package/package.json +6 -6
package/dist/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
- import { _ as XYZ, a as Map3DCell, c as MAP_2D_MIN_COORD, d as ColorPalette, f as RGB, g as XY, h as NoiseFunction3D, i as Map3D, l as Map2D, m as KeyValue, n as MAP_3D_MAX_COORD, o as DEFAULT_MAP_2D_VALUE, p as buildColorPalette, r as MAP_3D_MIN_COORD, s as MAP_2D_MAX_COORD, t as DEFAULT_MAP_3D_VALUE, u as Map2DData } from "./map3d-CHDJiq5T.cjs";
2
- //#region src/astar.d.ts
1
+ import { _ as XYZ, a as Map3DCell, c as MAP_2D_MIN_COORD, d as ColorPalette, f as RGB, g as XY, h as NoiseFunction3D, i as Map3D, l as Map2D, m as KeyValue, n as MAP_3D_MAX_COORD, o as DEFAULT_MAP_2D_VALUE, p as buildColorPalette, r as MAP_3D_MIN_COORD, s as MAP_2D_MAX_COORD, t as DEFAULT_MAP_3D_VALUE, u as Map2DData } from "./map3d-DRHhbrFn.cjs";
3
2
  /**
4
3
  * Cost of stepping onto tile (x, y). Return `Infinity` for blocked tiles. Costs should be >= 1
5
4
  * (the heuristic assumes it); use larger values for slower terrain or occupied tiles.
@@ -41,8 +40,6 @@ export interface PathOptions {
41
40
  * @category Pathfinding & Procedural
42
41
  */
43
42
  export declare function findPath(start: XY, goal: XY, cost: StepCost, options?: PathOptions): XY[];
44
- //#endregion
45
- //#region src/canvas-renderer.d.ts
46
43
  /**
47
44
  * Anything a 2D context accepts as a fill or stroke style: a CSS color string, a gradient or a pattern.
48
45
  *
@@ -197,8 +194,6 @@ export declare class CanvasRenderer {
197
194
  */
198
195
  drawSprite(x: number, y: number, image: CanvasImageSource, width: number, height: number, params?: SpriteParams): void;
199
196
  }
200
- //#endregion
201
- //#region src/clock.d.ts
202
197
  /**
203
198
  * Milliseconds in one second.
204
199
  *
@@ -266,8 +261,6 @@ export declare class Clock {
266
261
  stop(): void;
267
262
  private _reset;
268
263
  }
269
- //#endregion
270
- //#region src/color.d.ts
271
264
  /**
272
265
  * RGBA color with 8-bit channels (integers 0-255), kept in sync with an 8-digit hex string.
273
266
  * Setting a channel rounds and clamps it to 0-255.
@@ -356,8 +349,6 @@ export declare class Color {
356
349
  /** new fully transparent black (0, 0, 0, 0) */
357
350
  static get TRANSPARENT(): Color;
358
351
  }
359
- //#endregion
360
- //#region src/disposable.d.ts
361
352
  /**
362
353
  * Collects cleanup functions (e.g. the unsubscribe functions returned by {@link Observable.subscribe}
363
354
  * and {@link Signal.subscribe}) and runs them all at once.
@@ -383,8 +374,6 @@ export declare class Disposable {
383
374
  */
384
375
  dispose(): void;
385
376
  }
386
- //#endregion
387
- //#region src/vector.d.ts
388
377
  /**
389
378
  * Mutable 2D vector. Most methods modify the vector in place and return `this` for chaining;
390
379
  * {@link Vector.clone} and {@link Vector.floored} return new vectors.
@@ -460,8 +449,6 @@ export declare class Vector {
460
449
  /** new (-1, 0) */
461
450
  static get WEST(): Vector;
462
451
  }
463
- //#endregion
464
- //#region src/rectangle.d.ts
465
452
  /**
466
453
  * Axis-aligned rectangle given by its top-left corner (`x`, `y`) and size. Edges are inclusive
467
454
  * in the containment and intersection tests.
@@ -503,8 +490,6 @@ export declare class Rectangle {
503
490
  /** Same as {@link Rectangle.contains} with a point. */
504
491
  vectorInside(vec: Vector, padding?: number): boolean;
505
492
  }
506
- //#endregion
507
- //#region src/dungeon-generator.d.ts
508
493
  /**
509
494
  * Two rooms to be joined by a corridor.
510
495
  *
@@ -642,8 +627,6 @@ export declare function GenerateDoors(map: Map2D, paths: XY[][], params?: DoorsP
642
627
  * @category Pathfinding & Procedural
643
628
  */
644
629
  export declare function GenerateWalls(map: Map2D): XY[];
645
- //#endregion
646
- //#region src/ecs.d.ts
647
630
  /**
648
631
  * An entity id: a plain integer handed out by {@link ECS.createEntity}.
649
632
  *
@@ -729,8 +712,6 @@ export declare class ECS {
729
712
  * @category ECS
730
713
  */
731
714
  export declare const ecs: ECS;
732
- //#endregion
733
- //#region src/emitter.d.ts
734
715
  /**
735
716
  * An {@link Emitter} listener: called with the emitted arguments, followed by the event name.
736
717
  *
@@ -769,8 +750,6 @@ export declare class Emitter {
769
750
  */
770
751
  off(eventName: string, listener?: Listener): this;
771
752
  }
772
- //#endregion
773
- //#region src/event-queue.d.ts
774
753
  /**
775
754
  * A buffered queue of events: producers `emit()` events, and a consumer reads them later (e.g.
776
755
  * once per frame) with `drain()`, or with `consume()` followed by `clear()`.
@@ -798,8 +777,6 @@ export declare class EventQueue<T> {
798
777
  /** number of queued events */
799
778
  get size(): number;
800
779
  }
801
- //#endregion
802
- //#region src/input/bindings.d.ts
803
780
  /**
804
781
  * Modifier keys that must also be held for a key {@link Binding} to count (left or right side).
805
782
  * Modifiers left out are not checked, so a binding without `ctrl` still fires while Ctrl is held.
@@ -1071,8 +1048,6 @@ export declare function bindingsEqual(a: Binding, b: Binding): boolean;
1071
1048
  * @category Input
1072
1049
  */
1073
1050
  export declare function bindingLabel(binding: Binding, keyLabels?: ReadonlyMap<string, string>): string;
1074
- //#endregion
1075
- //#region src/input/action-map.d.ts
1076
1051
  /**
1077
1052
  * Deadzone given to new actions when none is specified.
1078
1053
  *
@@ -1184,8 +1159,6 @@ export declare class ActionMap {
1184
1159
  */
1185
1160
  addDefaults(): this;
1186
1161
  }
1187
- //#endregion
1188
- //#region src/input/gestures.d.ts
1189
1162
  /**
1190
1163
  * A finger currently on the screen, as reported by {@link GestureRecognizer.touches}.
1191
1164
  *
@@ -1309,8 +1282,6 @@ export declare class GestureRecognizer {
1309
1282
  /** Returns what happened since the last update. `time` is the current time in ms. */
1310
1283
  update(time: number): GestureFrame;
1311
1284
  }
1312
- //#endregion
1313
- //#region src/input/input.d.ts
1314
1285
  /**
1315
1286
  * Whether a key or button is down (`state` 1) or up (0), and when that last changed.
1316
1287
  *
@@ -1409,8 +1380,6 @@ export declare class Input extends Emitter {
1409
1380
  /** 1 if the button is down, else 0. */
1410
1381
  getButtonState(buttonNumber: number): number;
1411
1382
  }
1412
- //#endregion
1413
- //#region src/observable.d.ts
1414
1383
  /**
1415
1384
  * An {@link Observable} observer: called with the notified value (and any extra arguments).
1416
1385
  *
@@ -1452,8 +1421,6 @@ export declare class Observable<T> {
1452
1421
  /** number of observers */
1453
1422
  get size(): number;
1454
1423
  }
1455
- //#endregion
1456
- //#region src/input/input-action-map.d.ts
1457
1424
  /**
1458
1425
  * 0 = keyboard, mouse, pen, touch and VR; 1, 2, ... = gamepads.
1459
1426
  *
@@ -1774,16 +1741,12 @@ export declare class InputActionMap {
1774
1741
  private _onTouchUp;
1775
1742
  private _onWheel;
1776
1743
  }
1777
- //#endregion
1778
- //#region src/log.d.ts
1779
1744
  /**
1780
1745
  * `console.debug` with a bold gray `[dev]` prefix; takes the same arguments. Visible only when the
1781
1746
  * console shows verbose/debug messages.
1782
1747
  * @category Utilities
1783
1748
  */
1784
1749
  export declare const log: (...args: any[]) => void;
1785
- //#endregion
1786
- //#region src/math.d.ts
1787
1750
  /**
1788
1751
  * π, half a turn in radians.
1789
1752
  * @category Math & Random
@@ -1958,8 +1921,6 @@ export declare const hash32: (n: number) => number;
1958
1921
  * @category Math & Random
1959
1922
  */
1960
1923
  export declare const hash32mix: (...values: number[]) => number;
1961
- //#endregion
1962
- //#region src/misc.d.ts
1963
1924
  /**
1964
1925
  * True if `target` is `null` or `undefined`.
1965
1926
  * @category Utilities
@@ -2003,8 +1964,6 @@ export declare const xyz2k: (x: number, y: number, z: number, delimiter?: string
2003
1964
  * @category Utilities
2004
1965
  */
2005
1966
  export declare const k2xyz: (key: string, delimiter?: string) => [number, number, number];
2006
- //#endregion
2007
- //#region src/particle-renderer.d.ts
2008
1967
  /**
2009
1968
  * Double-buffered square-pixel renderer for particle effects: draw with `setPixel()` into an
2010
1969
  * offscreen buffer, then `render()` copies the buffer to the visible canvas and clears it.
@@ -2049,8 +2008,6 @@ export declare class ParticleRenderer {
2049
2008
  /** Replaces the visible canvas with the buffer's contents, then clears the buffer for the next frame. */
2050
2009
  render(): void;
2051
2010
  }
2052
- //#endregion
2053
- //#region src/particle-system-2d.d.ts
2054
2011
  /**
2055
2012
  * A `size` x `size` attraction matrix with values in [-1, 1). Deterministic: the same `size` and
2056
2013
  * `seed` always give the same matrix.
@@ -2108,8 +2065,6 @@ export declare class ParticleSystem2d {
2108
2065
  */
2109
2066
  update(renderer: ParticleRenderer, dt: number): void;
2110
2067
  }
2111
- //#endregion
2112
- //#region src/random.d.ts
2113
2068
  /**
2114
2069
  * Hash-based random numbers. The static methods are pure functions of their arguments (the same
2115
2070
  * inputs always give the same result), which makes them handy for coordinate-based noise; an
@@ -2154,8 +2109,6 @@ export declare class Random {
2154
2109
  /** Next angle in radians in [0, 2π); advances the seed. */
2155
2110
  angle(): number;
2156
2111
  }
2157
- //#endregion
2158
- //#region src/rng.d.ts
2159
2112
  /**
2160
2113
  * Seeded random number generator with helpers for ranges, picking, shuffling, geometric points,
2161
2114
  * Gaussian samples and matrices. Every call advances the underlying {@link Random}, so a given
@@ -2225,8 +2178,6 @@ export declare class Rng {
2225
2178
  * @category Math & Random
2226
2179
  */
2227
2180
  export declare const rng: Rng;
2228
- //#endregion
2229
- //#region src/signal.d.ts
2230
2181
  /**
2231
2182
  * A {@link Signal} subscriber: called with the new value.
2232
2183
  *
@@ -2259,8 +2210,6 @@ export declare class Signal<T> {
2259
2210
  /** Adds a subscriber and calls it right away with the current value; returns a function that removes it. */
2260
2211
  subscribe(subscriber: Subscriber<T>): () => void;
2261
2212
  }
2262
- //#endregion
2263
- //#region src/spatial-partition-2d.d.ts
2264
2213
  /**
2265
2214
  * Anything with a position that a {@link SpatialPartition2d} can bucket.
2266
2215
  *
@@ -2301,8 +2250,6 @@ export declare class SpatialPartition2d {
2301
2250
  */
2302
2251
  getCellNeighbors(x: number, y: number): SpatialPartitionEntity2d[][];
2303
2252
  }
2304
- //#endregion
2305
- //#region src/spatial-partition-3d.d.ts
2306
2253
  /**
2307
2254
  * Anything with a position that a {@link SpatialPartition3d} can bucket.
2308
2255
  *
@@ -2345,8 +2292,6 @@ export declare class SpatialPartition3d {
2345
2292
  /** Puts `entity` in the cell its current position falls in. */
2346
2293
  addEntity(entity: SpatialPartitionEntity3d): void;
2347
2294
  }
2348
- //#endregion
2349
- //#region src/tilemap.d.ts
2350
2295
  /**
2351
2296
  * Sparse 2D grid of arbitrary values, keyed by floored integer coordinates. Simpler than
2352
2297
  * {@link Map2D} (string keys, any value type, no default value or range limit).
@@ -2362,8 +2307,6 @@ export declare class Tilemap<T = number> {
2362
2307
  /** Sets the tile containing (x, y). */
2363
2308
  set(x: number, y: number, v: T): void;
2364
2309
  }
2365
- //#endregion
2366
- //#region src/webgl.d.ts
2367
2310
  /**
2368
2311
  * Literal GLenum values, so importing this module doesn't require `WebGL2RenderingContext` to exist.
2369
2312
  *
@@ -2719,8 +2662,6 @@ export interface DrawOptions {
2719
2662
  * @category WebGL
2720
2663
  */
2721
2664
  export declare function Draw(gl: WebGL2RenderingContext, info: ProgramInfo, vertexArray: VertexArrayInfo, options?: DrawOptions): void;
2722
- //#endregion
2723
- //#region src/webgl-renderer.d.ts
2724
2665
  /**
2725
2666
  * Options for the {@link WebGlRenderer} constructor.
2726
2667
  *
@@ -2806,8 +2747,6 @@ export declare class WebGlRenderer {
2806
2747
  dispose(): void;
2807
2748
  private _listen;
2808
2749
  }
2809
- //#endregion
2810
- //#region src/worker-interface.d.ts
2811
2750
  /**
2812
2751
  * Thin wrapper around a module `Worker` that exposes its errors and messages as
2813
2752
  * {@link Observable}s.
@@ -2835,5 +2774,4 @@ export declare class WorkerInterface<TReceive = any, TSend = any> {
2835
2774
  /** Stops the worker immediately. */
2836
2775
  terminate(): void;
2837
2776
  }
2838
- //#endregion
2839
2777
  export { ColorPalette, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, KeyValue, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map2D, Map2DData, Map3D, Map3DCell, NoiseFunction3D, RGB, XY, XYZ, buildColorPalette };
package/dist/index.d.ts CHANGED
@@ -1,36 +1,36 @@
1
- import { KeyValue, NoiseFunction3D, XY, XYZ } from "./types.js";
2
1
  import { PathOptions, StepCost, findPath } from "./astar.js";
3
2
  import { CanvasColor, CanvasRenderer, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PIXEL_SIZE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DrawParams, SpriteParams } from "./canvas-renderer.js";
4
3
  import { Clock, ClockCallback, ONE_SECOND } from "./clock.js";
5
4
  import { ColorPalette, RGB, buildColorPalette } from "./color-palette.js";
6
5
  import { Color } from "./color.js";
7
6
  import { Disposable } from "./disposable.js";
8
- import { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D, Map2DData } from "./map2d.js";
9
- import { Vector } from "./vector.js";
10
- import { Rectangle } from "./rectangle.js";
11
7
  import { DoorsParams, GenerateDoors, GenerateRooms, GenerateRoomsParams, GenerateWalls, PathsParams, PointPair, RectPair, RoomsParams, TILE_EMPTY, TILE_FLOOR, TILE_PATH } from "./dungeon-generator.js";
12
8
  import { Component, ComponentInstances, ComponentType, ECS, Entity, System, ecs } from "./ecs.js";
13
9
  import { Emitter, Listener } from "./emitter.js";
14
10
  import { EventQueue } from "./event-queue.js";
11
+ import { log } from "./log.js";
12
+ import { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D, Map2DData } from "./map2d.js";
13
+ import { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D, Map3DCell } from "./map3d.js";
14
+ import { DEG2RAD, E, EPSILON, HALF_PI, LN10, LN2, LOG10E, LOG2E, PI, QUARTER_PI, RAD2DEG, SQRT1_2, SQRT2, TAU, clamp, degrees, distance2d, distance3d, fract, hash32, hash32mix, inverseLerp, lerp, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, roundTo, saturate, smoothstep, squaredDistance, wrap } from "./math.js";
15
15
  import { Binding, GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, GamepadAxis, GamepadButton, Gesture, GestureBinding, KeyBinding, KeyModifiers, MouseBinding, MouseButton, PadAxisBinding, PadBinding, WheelBinding, WheelDirection, XRAxis, XRAxisBinding, XRBinding, XRButton, XRHand, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./input/bindings.js";
16
16
  import { Action, ActionMap, ActionMapJSON, ActionOptions, ActionRepeat, DEFAULT_DEADZONE, DEFAULT_REPEAT } from "./input/action-map.js";
17
17
  import { GestureEvent, GestureFrame, GestureRecognizer, GestureThresholds, TouchPoint } from "./input/gestures.js";
18
18
  import { Input, InputState } from "./input/input.js";
19
- import { Observable, Observer } from "./observable.js";
20
- import { ActionEvent, ActionPhase, CaptureOptions, DeviceQuery, GamepadInfo, InputActionMap, InputActionMapOptions, InputDevice, InputDeviceType, PointerState, XRSessionLike } from "./input/input-action-map.js";
21
- import { log } from "./log.js";
22
- import { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D, Map3DCell } from "./map3d.js";
23
- import { DEG2RAD, E, EPSILON, HALF_PI, LN10, LN2, LOG10E, LOG2E, PI, QUARTER_PI, RAD2DEG, SQRT1_2, SQRT2, TAU, clamp, degrees, distance2d, distance3d, fract, hash32, hash32mix, inverseLerp, lerp, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, roundTo, saturate, smoothstep, squaredDistance, wrap } from "./math.js";
24
19
  import { GetUrlParams, getRedYellowGreenGradientHex, isNullOrUndefined, isPositiveString, k2xy, k2xyz, xy2k, xyz2k } from "./misc.js";
20
+ import { ActionEvent, ActionPhase, CaptureOptions, DeviceQuery, GamepadInfo, InputActionMap, InputActionMapOptions, InputDevice, InputDeviceType, PointerState, XRSessionLike } from "./input/input-action-map.js";
21
+ import { Observable, Observer } from "./observable.js";
25
22
  import { ParticleRenderer } from "./particle-renderer.js";
26
23
  import { ParticleSystem2d, randomMatrix } from "./particle-system-2d.js";
27
24
  import { Random } from "./random.js";
25
+ import { Rectangle } from "./rectangle.js";
28
26
  import { Rng, rng } from "./rng.js";
29
27
  import { Signal, Subscriber } from "./signal.js";
30
28
  import { SpatialPartition2d, SpatialPartitionEntity2d } from "./spatial-partition-2d.js";
31
29
  import { SpatialPartition3d, SpatialPartitionEntity3d } from "./spatial-partition-3d.js";
32
30
  import { Tilemap } from "./tilemap.js";
33
- import { AttributeInfo, AttributeSource, BindRenderTarget, BufferOptions, CompileShader, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, Draw, DrawOptions, GetProgramLocations, LoadWebGlTexture, ProgramInfo, ProgramLocations, RenderTarget, RenderTargetOptions, ResizeRenderTarget, ResizeWebGlContext, SetUniforms, ShaderType, TextureData, TextureInfo, TextureOptions, UniformInfo, UniformValue, UpdateBuffer, UpdateTexture, VertexArrayInfo } from "./webgl.js";
31
+ import { KeyValue, NoiseFunction3D, XY, XYZ } from "./types.js";
32
+ import { Vector } from "./vector.js";
34
33
  import { RendererParams, WebGlRenderer } from "./webgl-renderer.js";
34
+ import { AttributeInfo, AttributeSource, BindRenderTarget, BufferOptions, CompileShader, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, Draw, DrawOptions, GetProgramLocations, LoadWebGlTexture, ProgramInfo, ProgramLocations, RenderTarget, RenderTargetOptions, ResizeRenderTarget, ResizeWebGlContext, SetUniforms, ShaderType, TextureData, TextureInfo, TextureOptions, UniformInfo, UniformValue, UpdateBuffer, UpdateTexture, VertexArrayInfo } from "./webgl.js";
35
35
  import { WorkerInterface } from "./worker-interface.js";
36
36
  export { Action, ActionEvent, ActionMap, ActionMapJSON, ActionOptions, ActionPhase, ActionRepeat, AttributeInfo, AttributeSource, BindRenderTarget, Binding, BufferOptions, CanvasColor, CanvasRenderer, CaptureOptions, Clock, ClockCallback, Color, ColorPalette, CompileShader, Component, ComponentInstances, ComponentType, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DEFAULT_COLOR, DEFAULT_DEADZONE, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, DEFAULT_PIXEL_SIZE, DEFAULT_REPEAT, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DEG2RAD, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, DeviceQuery, Disposable, DoorsParams, Draw, DrawOptions, DrawParams, E, ECS, EPSILON, Emitter, Entity, EventQueue, GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, GamepadAxis, GamepadButton, GamepadInfo, GenerateDoors, GenerateRooms, GenerateRoomsParams, GenerateWalls, Gesture, GestureBinding, GestureEvent, GestureFrame, GestureRecognizer, GestureThresholds, GetProgramLocations, GetUrlParams, HALF_PI, Input, InputActionMap, InputActionMapOptions, InputDevice, InputDeviceType, InputState, KeyBinding, KeyModifiers, KeyValue, LN10, LN2, LOG10E, LOG2E, Listener, LoadWebGlTexture, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map2D, Map2DData, Map3D, Map3DCell, MouseBinding, MouseButton, NoiseFunction3D, ONE_SECOND, Observable, Observer, PI, PadAxisBinding, PadBinding, ParticleRenderer, ParticleSystem2d, PathOptions, PathsParams, PointPair, PointerState, ProgramInfo, ProgramLocations, QUARTER_PI, RAD2DEG, RGB, Random, RectPair, Rectangle, RenderTarget, RenderTargetOptions, RendererParams, ResizeRenderTarget, ResizeWebGlContext, Rng, RoomsParams, SQRT1_2, SQRT2, SetUniforms, ShaderType, Signal, SpatialPartition2d, SpatialPartition3d, SpatialPartitionEntity2d, SpatialPartitionEntity3d, SpriteParams, StepCost, Subscriber, System, TAU, TILE_EMPTY, TILE_FLOOR, TILE_PATH, TextureData, TextureInfo, TextureOptions, Tilemap, TouchPoint, UniformInfo, UniformValue, UpdateBuffer, UpdateTexture, Vector, VertexArrayInfo, WebGlRenderer, WheelBinding, WheelDirection, WorkerInterface, XRAxis, XRAxisBinding, XRBinding, XRButton, XRHand, XRSessionLike, XR_AXES, XR_BUTTONS, XY, XYZ, bindingLabel, bindingsEqual, buildColorPalette, clamp, controlId, degrees, distance2d, distance3d, ecs, findPath, fract, gesture, getRedYellowGreenGradientHex, hash32, hash32mix, inverseLerp, isNullOrUndefined, isPositiveString, k2xy, k2xyz, key, lerp, log, manhattanDistance, mod, mouse, nearlyEqual, normalizeRadians, pad, padAxis, radians, randomMatrix, rng, roundTo, saturate, smoothstep, squaredDistance, wheel, wrap, xr, xrAxis, xy2k, xyz2k };
package/dist/index.js CHANGED
@@ -1,35 +1,35 @@
1
- import { DEG2RAD, E, EPSILON, HALF_PI, LN10, LN2, LOG10E, LOG2E, PI, QUARTER_PI, RAD2DEG, SQRT1_2, SQRT2, TAU, clamp, degrees, distance2d, distance3d, fract, hash32, hash32mix, inverseLerp, lerp, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, roundTo, saturate, smoothstep, squaredDistance, wrap } from "./math.js";
2
1
  import { findPath } from "./astar.js";
3
2
  import { CanvasRenderer, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PIXEL_SIZE, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE } from "./canvas-renderer.js";
4
3
  import { Clock, ONE_SECOND } from "./clock.js";
5
4
  import { buildColorPalette } from "./color-palette.js";
6
- import { log } from "./log.js";
7
5
  import { Color } from "./color.js";
8
6
  import { Disposable } from "./disposable.js";
9
- import { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D } from "./map2d.js";
10
- import { Random } from "./random.js";
11
- import { Rng, rng } from "./rng.js";
12
- import { Vector } from "./vector.js";
13
- import { Rectangle } from "./rectangle.js";
14
7
  import { GenerateDoors, GenerateRooms, GenerateWalls, TILE_EMPTY, TILE_FLOOR, TILE_PATH } from "./dungeon-generator.js";
15
8
  import { ECS, ecs } from "./ecs.js";
16
9
  import { Emitter } from "./emitter.js";
17
10
  import { EventQueue } from "./event-queue.js";
11
+ import { log } from "./log.js";
12
+ import { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D } from "./map2d.js";
13
+ import { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D } from "./map3d.js";
14
+ import { DEG2RAD, E, EPSILON, HALF_PI, LN10, LN2, LOG10E, LOG2E, PI, QUARTER_PI, RAD2DEG, SQRT1_2, SQRT2, TAU, clamp, degrees, distance2d, distance3d, fract, hash32, hash32mix, inverseLerp, lerp, manhattanDistance, mod, nearlyEqual, normalizeRadians, radians, roundTo, saturate, smoothstep, squaredDistance, wrap } from "./math.js";
15
+ import { GetUrlParams, getRedYellowGreenGradientHex, isNullOrUndefined, isPositiveString, k2xy, k2xyz, xy2k, xyz2k } from "./misc.js";
16
+ import { Observable } from "./observable.js";
17
+ import { ParticleRenderer } from "./particle-renderer.js";
18
18
  import { GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./input/bindings.js";
19
19
  import { ActionMap, DEFAULT_DEADZONE, DEFAULT_REPEAT } from "./input/action-map.js";
20
20
  import { GestureRecognizer } from "./input/gestures.js";
21
21
  import { Input } from "./input/input.js";
22
- import { Observable } from "./observable.js";
23
- import { InputActionMap } from "./input/input-action-map.js";
24
- import { DEFAULT_MAP_3D_VALUE, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map3D } from "./map3d.js";
25
- import { GetUrlParams, getRedYellowGreenGradientHex, isNullOrUndefined, isPositiveString, k2xy, k2xyz, xy2k, xyz2k } from "./misc.js";
26
- import { ParticleRenderer } from "./particle-renderer.js";
27
- import { SpatialPartition2d } from "./spatial-partition-2d.js";
28
22
  import { ParticleSystem2d, randomMatrix } from "./particle-system-2d.js";
23
+ import { InputActionMap } from "./input/input-action-map.js";
24
+ import { Random } from "./random.js";
25
+ import { Rectangle } from "./rectangle.js";
26
+ import { Rng, rng } from "./rng.js";
29
27
  import { Signal } from "./signal.js";
28
+ import { SpatialPartition2d } from "./spatial-partition-2d.js";
30
29
  import { SpatialPartition3d } from "./spatial-partition-3d.js";
31
30
  import { Tilemap } from "./tilemap.js";
32
- import { BindRenderTarget, CompileShader, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, Draw, GetProgramLocations, LoadWebGlTexture, ResizeRenderTarget, ResizeWebGlContext, SetUniforms, ShaderType, UpdateBuffer, UpdateTexture } from "./webgl.js";
31
+ import { Vector } from "./vector.js";
33
32
  import { WebGlRenderer } from "./webgl-renderer.js";
33
+ import { BindRenderTarget, CompileShader, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, Draw, GetProgramLocations, LoadWebGlTexture, ResizeRenderTarget, ResizeWebGlContext, SetUniforms, ShaderType, UpdateBuffer, UpdateTexture } from "./webgl.js";
34
34
  import { WorkerInterface } from "./worker-interface.js";
35
35
  export { ActionMap, BindRenderTarget, CanvasRenderer, Clock, Color, CompileShader, CreateBuffer, CreateProgram, CreateProgramInfo, CreateRenderTarget, CreateTexture, CreateVertexArray, CreateWebGlContext, DEFAULT_COLOR, DEFAULT_DEADZONE, DEFAULT_FONT, DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_MAP_2D_VALUE, DEFAULT_MAP_3D_VALUE, DEFAULT_PIXEL_SIZE, DEFAULT_REPEAT, DEFAULT_TEXTALIGN, DEFAULT_TEXTBASELINE, DEG2RAD, DeleteProgramInfo, DeleteRenderTarget, DeleteTexture, DeleteVertexArray, Disposable, Draw, E, ECS, EPSILON, Emitter, EventQueue, GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, GenerateDoors, GenerateRooms, GenerateWalls, GestureRecognizer, GetProgramLocations, GetUrlParams, HALF_PI, Input, InputActionMap, LN10, LN2, LOG10E, LOG2E, LoadWebGlTexture, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, MAP_3D_MAX_COORD, MAP_3D_MIN_COORD, Map2D, Map3D, ONE_SECOND, Observable, PI, ParticleRenderer, ParticleSystem2d, QUARTER_PI, RAD2DEG, Random, Rectangle, ResizeRenderTarget, ResizeWebGlContext, Rng, SQRT1_2, SQRT2, SetUniforms, ShaderType, Signal, SpatialPartition2d, SpatialPartition3d, TAU, TILE_EMPTY, TILE_FLOOR, TILE_PATH, Tilemap, UpdateBuffer, UpdateTexture, Vector, WebGlRenderer, WorkerInterface, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, buildColorPalette, clamp, controlId, degrees, distance2d, distance3d, ecs, findPath, fract, gesture, getRedYellowGreenGradientHex, hash32, hash32mix, inverseLerp, isNullOrUndefined, isPositiveString, k2xy, k2xyz, key, lerp, log, manhattanDistance, mod, mouse, nearlyEqual, normalizeRadians, pad, padAxis, radians, randomMatrix, rng, roundTo, saturate, smoothstep, squaredDistance, wheel, wrap, xr, xrAxis, xy2k, xyz2k };
@@ -1,5 +1,4 @@
1
1
  import { Emitter } from "../emitter.js";
2
- //#region src/input/_input.d.ts
3
2
  export interface InputState {
4
3
  state: number;
5
4
  timeStamp: number;
@@ -21,5 +20,4 @@ export declare class Input extends Emitter {
21
20
  getKeyState(keyCode: string): number;
22
21
  isButtonDown(buttonNumber: number): boolean;
23
22
  getButtonState(buttonNumber: number): number;
24
- }
25
- //#endregion
23
+ }
@@ -1,5 +1,5 @@
1
1
  import { Emitter } from "../emitter.js";
2
- //#region src/input/_input.ts
2
+ // src/input/_input.ts
3
3
  var Input = class Input extends Emitter {
4
4
  static _instance;
5
5
  static get instance() {
@@ -93,5 +93,4 @@ var Input = class Input extends Emitter {
93
93
  return this._state[`button${buttonNumber}`]?.state ?? 0;
94
94
  }
95
95
  };
96
- //#endregion
97
96
  export { Input };
@@ -1,5 +1,4 @@
1
1
  import { Binding } from "./bindings.js";
2
- //#region src/input/action-map.d.ts
3
2
  /**
4
3
  * Deadzone given to new actions when none is specified.
5
4
  *
@@ -110,5 +109,4 @@ export declare class ActionMap {
110
109
  * page actions auto-repeat ({@link DEFAULT_REPEAT}). Replaces existing ones.
111
110
  */
112
111
  addDefaults(): this;
113
- }
114
- //#endregion
112
+ }
@@ -1,5 +1,5 @@
1
1
  import { bindingsEqual, key, pad, padAxis } from "./bindings.js";
2
- //#region src/input/action-map.ts
2
+ // src/input/action-map.ts
3
3
  /**
4
4
  * Deadzone given to new actions when none is specified.
5
5
  *
@@ -153,5 +153,4 @@ var ActionMap = class {
153
153
  return this;
154
154
  }
155
155
  };
156
- //#endregion
157
156
  export { ActionMap, DEFAULT_DEADZONE, DEFAULT_REPEAT };
@@ -1,4 +1,3 @@
1
- //#region src/input/bindings.d.ts
2
1
  /**
3
2
  * Modifier keys that must also be held for a key {@link Binding} to count (left or right side).
4
3
  * Modifiers left out are not checked, so a binding without `ctrl` still fires while Ctrl is held.
@@ -269,5 +268,4 @@ export declare function bindingsEqual(a: Binding, b: Binding): boolean;
269
268
  *
270
269
  * @category Input
271
270
  */
272
- export declare function bindingLabel(binding: Binding, keyLabels?: ReadonlyMap<string, string>): string;
273
- //#endregion
271
+ export declare function bindingLabel(binding: Binding, keyLabels?: ReadonlyMap<string, string>): string;
@@ -1,4 +1,4 @@
1
- //#region src/input/bindings.ts
1
+ // src/input/bindings.ts
2
2
  /**
3
3
  * W3C "standard" gamepad mapping, in button-index order (Xbox names; on PlayStation A = Cross,
4
4
  * B = Circle, X = Square, Y = Triangle).
@@ -246,5 +246,4 @@ function bindingLabel(binding, keyLabels) {
246
246
  case "xrAxis": return `${capitalize(binding.hand)} ${AXIS_NAMES[binding.axis][binding.direction > 0 ? 1 : 0]}`;
247
247
  }
248
248
  }
249
- //#endregion
250
249
  export { GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis };
@@ -1,5 +1,4 @@
1
1
  import { Gesture } from "./bindings.js";
2
- //#region src/input/gestures.d.ts
3
2
  /**
4
3
  * A finger currently on the screen, as reported by {@link GestureRecognizer.touches}.
5
4
  *
@@ -122,5 +121,4 @@ export declare class GestureRecognizer {
122
121
  clear(): void;
123
122
  /** Returns what happened since the last update. `time` is the current time in ms. */
124
123
  update(time: number): GestureFrame;
125
- }
126
- //#endregion
124
+ }
@@ -1,4 +1,4 @@
1
- //#region src/input/gestures.ts
1
+ // src/input/gestures.ts
2
2
  const DEFAULT_THRESHOLDS = {
3
3
  tapMaxDuration: 250,
4
4
  tapMaxMovement: 10,
@@ -181,5 +181,4 @@ var GestureRecognizer = class {
181
181
  return frame;
182
182
  }
183
183
  };
184
- //#endregion
185
184
  export { GestureRecognizer };
@@ -1,5 +1,5 @@
1
- import { Binding, GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, GamepadAxis, GamepadButton, Gesture, GestureBinding, KeyBinding, KeyModifiers, MouseBinding, MouseButton, PadAxisBinding, PadBinding, WheelBinding, WheelDirection, XRAxis, XRAxisBinding, XRBinding, XRButton, XRHand, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./bindings.js";
2
1
  import { Action, ActionMap, ActionMapJSON, ActionOptions, ActionRepeat, DEFAULT_DEADZONE, DEFAULT_REPEAT } from "./action-map.js";
2
+ import { Binding, GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, GamepadAxis, GamepadButton, Gesture, GestureBinding, KeyBinding, KeyModifiers, MouseBinding, MouseButton, PadAxisBinding, PadBinding, WheelBinding, WheelDirection, XRAxis, XRAxisBinding, XRBinding, XRButton, XRHand, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./bindings.js";
3
3
  import { GestureEvent, GestureFrame, GestureRecognizer, GestureThresholds, TouchPoint } from "./gestures.js";
4
4
  import { Input, InputState } from "./input.js";
5
5
  import { ActionEvent, ActionPhase, CaptureOptions, DeviceQuery, GamepadInfo, InputActionMap, InputActionMapOptions, InputDevice, InputDeviceType, PointerState, XRSessionLike } from "./input-action-map.js";
@@ -1,5 +1,5 @@
1
- import { GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./bindings.js";
2
1
  import { ActionMap, DEFAULT_DEADZONE, DEFAULT_REPEAT } from "./action-map.js";
2
+ import { GAMEPAD_AXES, GAMEPAD_BUTTONS, GESTURES, XR_AXES, XR_BUTTONS, bindingLabel, bindingsEqual, controlId, gesture, key, mouse, pad, padAxis, wheel, xr, xrAxis } from "./bindings.js";
3
3
  import { GestureRecognizer } from "./gestures.js";
4
4
  import { Input } from "./input.js";
5
5
  import { InputActionMap } from "./input-action-map.js";
@@ -1,9 +1,8 @@
1
- import { Binding, MouseButton } from "./bindings.js";
1
+ import { Observable } from "../observable.js";
2
2
  import { ActionMap } from "./action-map.js";
3
3
  import { GestureFrame, GestureRecognizer, TouchPoint } from "./gestures.js";
4
4
  import { Input } from "./input.js";
5
- import { Observable } from "../observable.js";
6
- //#region src/input/input-action-map.d.ts
5
+ import { Binding, MouseButton } from "./bindings.js";
7
6
  /**
8
7
  * 0 = keyboard, mouse, pen, touch and VR; 1, 2, ... = gamepads.
9
8
  *
@@ -323,5 +322,4 @@ export declare class InputActionMap {
323
322
  private _onTouchMove;
324
323
  private _onTouchUp;
325
324
  private _onWheel;
326
- }
327
- //#endregion
325
+ }
@@ -1,9 +1,9 @@
1
- import { GAMEPAD_AXES, GAMEPAD_BUTTONS, XR_AXES, XR_BUTTONS, controlId } from "./bindings.js";
1
+ import { Observable } from "../observable.js";
2
2
  import { ActionMap } from "./action-map.js";
3
3
  import { GestureRecognizer } from "./gestures.js";
4
4
  import { Input } from "./input.js";
5
- import { Observable } from "../observable.js";
6
- //#region src/input/input-action-map.ts
5
+ import { GAMEPAD_AXES, GAMEPAD_BUTTONS, XR_AXES, XR_BUTTONS, controlId } from "./bindings.js";
6
+ // src/input/input-action-map.ts
7
7
  const ANY = -1;
8
8
  const now = () => performance.now();
9
9
  const MOUSE_BUTTONS = [
@@ -685,5 +685,4 @@ var InputActionMap = class {
685
685
  });
686
686
  }
687
687
  };
688
- //#endregion
689
688
  export { InputActionMap };
@@ -1,6 +1,5 @@
1
- import { Vector } from "../vector.js";
2
1
  import { Emitter } from "../emitter.js";
3
- //#region src/input/input.d.ts
2
+ import { Vector } from "../vector.js";
4
3
  /**
5
4
  * Whether a key or button is down (`state` 1) or up (0), and when that last changed.
6
5
  *
@@ -98,5 +97,4 @@ export declare class Input extends Emitter {
98
97
  isButtonDown(buttonNumber: number): boolean;
99
98
  /** 1 if the button is down, else 0. */
100
99
  getButtonState(buttonNumber: number): number;
101
- }
102
- //#endregion
100
+ }
@@ -1,6 +1,6 @@
1
- import { Vector } from "../vector.js";
2
1
  import { Emitter } from "../emitter.js";
3
- //#region src/input/input.ts
2
+ import { Vector } from "../vector.js";
3
+ // src/input/input.ts
4
4
  const BUTTON_BITS = [
5
5
  1,
6
6
  4,
@@ -239,5 +239,4 @@ var Input = class Input extends Emitter {
239
239
  return this._state[`button${buttonNumber}`]?.state ?? 0;
240
240
  }
241
241
  };
242
- //#endregion
243
242
  export { Input };
package/dist/log.d.ts CHANGED
@@ -1,8 +1,6 @@
1
- //#region src/log.d.ts
2
1
  /**
3
2
  * `console.debug` with a bold gray `[dev]` prefix; takes the same arguments. Visible only when the
4
3
  * console shows verbose/debug messages.
5
4
  * @category Utilities
6
5
  */
7
- export declare const log: (...args: any[]) => void;
8
- //#endregion
6
+ export declare const log: (...args: any[]) => void;
package/dist/log.js CHANGED
@@ -1,9 +1,8 @@
1
- //#region src/log.ts
1
+ // src/log.ts
2
2
  /**
3
3
  * `console.debug` with a bold gray `[dev]` prefix; takes the same arguments. Visible only when the
4
4
  * console shows verbose/debug messages.
5
5
  * @category Utilities
6
6
  */
7
7
  const log = console.debug.bind(console, "%c[dev]", "font-weight: bold; color: #888;");
8
- //#endregion
9
8
  export { log };
package/dist/map2d.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- //#region src/map2d.d.ts
2
1
  /**
3
2
  * Default "empty" value of a {@link Map2D}: cells holding it are not stored.
4
3
  *
@@ -79,5 +78,4 @@ export declare class Map2D {
79
78
  * O(size), not O(area).
80
79
  */
81
80
  forEachInArea(x1: number, y1: number, x2: number, y2: number, callback: (x: number, y: number, n: number) => void): void;
82
- }
83
- //#endregion
81
+ }
package/dist/map2d.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/map2d.ts
1
+ // src/map2d.ts
2
2
  /**
3
3
  * Default "empty" value of a {@link Map2D}: cells holding it are not stored.
4
4
  *
@@ -116,5 +116,4 @@ var Map2D = class {
116
116
  });
117
117
  }
118
118
  };
119
- //#endregion
120
119
  export { DEFAULT_MAP_2D_VALUE, MAP_2D_MAX_COORD, MAP_2D_MIN_COORD, Map2D };