@n3rdw1z4rd/core 0.23.0 → 0.24.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 (141) hide show
  1. package/dist/astar.d.ts +1 -3
  2. package/dist/astar.js +1 -2
  3. package/dist/canvas-renderer.d.ts +1 -3
  4. package/dist/canvas-renderer.js +1 -2
  5. package/dist/clock.d.ts +1 -3
  6. package/dist/clock.js +1 -2
  7. package/dist/color-palette.d.ts +1 -3
  8. package/dist/color-palette.js +1 -2
  9. package/dist/color.d.ts +1 -3
  10. package/dist/color.js +1 -2
  11. package/dist/disposable.d.ts +1 -3
  12. package/dist/disposable.js +1 -2
  13. package/dist/dungeon-generator.d.ts +2 -4
  14. package/dist/dungeon-generator.js +3 -4
  15. package/dist/ecs.d.ts +1 -3
  16. package/dist/ecs.js +1 -2
  17. package/dist/emitter.d.ts +1 -3
  18. package/dist/emitter.js +1 -2
  19. package/dist/event-queue.d.ts +1 -3
  20. package/dist/event-queue.js +1 -2
  21. package/dist/graph/doc.d.ts +2 -4
  22. package/dist/graph/doc.js +1 -2
  23. package/dist/graph/evaluate.d.ts +1 -3
  24. package/dist/graph/evaluate.js +1 -2
  25. package/dist/graph/index.d.ts +2 -2
  26. package/dist/graph/index.js +2 -2
  27. package/dist/graph/node.d.ts +1 -3
  28. package/dist/graph/node.js +1 -2
  29. package/dist/graph/nodes.d.ts +1 -3
  30. package/dist/graph/nodes.js +1 -2
  31. package/dist/graph/script.d.ts +1 -3
  32. package/dist/graph/script.js +1 -2
  33. package/dist/graph/sources.d.ts +1 -3
  34. package/dist/graph/sources.js +1 -2
  35. package/dist/graph/subgraph.d.ts +2 -4
  36. package/dist/graph/subgraph.js +1 -2
  37. package/dist/graph/types.d.ts +1 -3
  38. package/dist/graph/types.js +1 -2
  39. package/dist/graph.cjs +9 -17
  40. package/dist/graph.d.cts +1 -17
  41. package/dist/index.cjs +91 -67
  42. package/dist/index.d.cts +9 -63
  43. package/dist/index.d.ts +10 -10
  44. package/dist/index.js +14 -14
  45. package/dist/input/_input.d.ts +1 -3
  46. package/dist/input/_input.js +1 -2
  47. package/dist/input/action-map.d.ts +1 -3
  48. package/dist/input/action-map.js +1 -2
  49. package/dist/input/bindings.d.ts +1 -3
  50. package/dist/input/bindings.js +1 -2
  51. package/dist/input/gestures.d.ts +1 -3
  52. package/dist/input/gestures.js +1 -2
  53. package/dist/input/index.d.ts +1 -1
  54. package/dist/input/index.js +1 -1
  55. package/dist/input/input-action-map.d.ts +11 -5
  56. package/dist/input/input-action-map.js +67 -19
  57. package/dist/input/input.d.ts +2 -4
  58. package/dist/input/input.js +2 -3
  59. package/dist/log.d.ts +1 -3
  60. package/dist/log.js +1 -2
  61. package/dist/map2d.d.ts +1 -3
  62. package/dist/map2d.js +1 -2
  63. package/dist/{map3d-CHDJiq5T.d.cts → map3d-DRHhbrFn.d.cts} +0 -8
  64. package/dist/map3d.d.ts +1 -3
  65. package/dist/map3d.js +1 -2
  66. package/dist/math.d.ts +1 -3
  67. package/dist/math.js +1 -2
  68. package/dist/misc.d.ts +1 -3
  69. package/dist/misc.js +1 -2
  70. package/dist/observable.d.ts +1 -3
  71. package/dist/observable.js +1 -2
  72. package/dist/particle-renderer.d.ts +1 -3
  73. package/dist/particle-renderer.js +1 -2
  74. package/dist/particle-system-2d.d.ts +1 -3
  75. package/dist/particle-system-2d.js +3 -4
  76. package/dist/random.d.ts +1 -3
  77. package/dist/random.js +1 -2
  78. package/dist/rectangle.d.ts +1 -3
  79. package/dist/rectangle.js +1 -2
  80. package/dist/{rng-Dhqq7owV.cjs → rng-edL6atS3.cjs} +3 -6
  81. package/dist/rng.d.ts +1 -3
  82. package/dist/rng.js +2 -3
  83. package/dist/signal.d.ts +1 -3
  84. package/dist/signal.js +1 -2
  85. package/dist/spatial-partition-2d.d.ts +1 -3
  86. package/dist/spatial-partition-2d.js +1 -2
  87. package/dist/{spatial-partition-3d-CmSCL87Z.cjs → spatial-partition-3d-D1uyJVhM.cjs} +7 -13
  88. package/dist/spatial-partition-3d.d.ts +1 -3
  89. package/dist/spatial-partition-3d.js +1 -2
  90. package/dist/three/adaptive-grid.d.ts +1 -3
  91. package/dist/three/adaptive-grid.js +1 -2
  92. package/dist/three/asteroid-mesh.d.ts +1 -3
  93. package/dist/three/asteroid-mesh.js +1 -2
  94. package/dist/three/camera-rig.d.ts +1 -3
  95. package/dist/three/camera-rig.js +1 -2
  96. package/dist/three/cube-sphere-geometry.d.ts +1 -3
  97. package/dist/three/cube-sphere-geometry.js +1 -2
  98. package/dist/three/ecs.d.ts +1 -3
  99. package/dist/three/ecs.js +1 -2
  100. package/dist/three/editor-camera.d.ts +1 -3
  101. package/dist/three/editor-camera.js +1 -2
  102. package/dist/three/index.d.ts +4 -4
  103. package/dist/three/index.js +1 -1
  104. package/dist/three/particle-system-3d.d.ts +1 -3
  105. package/dist/three/particle-system-3d.js +3 -4
  106. package/dist/three/picking.d.ts +2 -4
  107. package/dist/three/picking.js +1 -2
  108. package/dist/three/renderer.d.ts +1 -3
  109. package/dist/three/renderer.js +1 -2
  110. package/dist/three/schema.d.ts +0 -2
  111. package/dist/three/schema.js +1 -2
  112. package/dist/three/starfield.d.ts +1 -3
  113. package/dist/three/starfield.js +1 -2
  114. package/dist/three/texture-atlas.d.ts +1 -3
  115. package/dist/three/texture-atlas.js +1 -2
  116. package/dist/three/texture-utils.d.ts +1 -3
  117. package/dist/three/texture-utils.js +1 -2
  118. package/dist/three/voxel-geometry.d.ts +2 -4
  119. package/dist/three/voxel-geometry.js +2 -3
  120. package/dist/three/voxel-mesh.d.ts +1 -3
  121. package/dist/three/voxel-mesh.js +1 -2
  122. package/dist/three/world.d.ts +0 -2
  123. package/dist/three/world.js +1 -2
  124. package/dist/three.cjs +18 -34
  125. package/dist/three.d.cts +1 -33
  126. package/dist/tilemap.d.ts +1 -3
  127. package/dist/tilemap.js +1 -2
  128. package/dist/types.d.ts +1 -3
  129. package/dist/vector.d.ts +1 -3
  130. package/dist/vector.js +1 -2
  131. package/dist/vite.cjs +1 -2
  132. package/dist/vite.d.cts +1 -3
  133. package/dist/vite.d.ts +1 -3
  134. package/dist/vite.js +1 -2
  135. package/dist/webgl-renderer.d.ts +1 -3
  136. package/dist/webgl-renderer.js +1 -2
  137. package/dist/webgl.d.ts +1 -3
  138. package/dist/webgl.js +1 -2
  139. package/dist/worker-interface.d.ts +1 -3
  140. package/dist/worker-interface.js +1 -2
  141. 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
  *
@@ -1482,6 +1449,12 @@ export interface ActionEvent {
1482
1449
  action: string;
1483
1450
  /** an auto-repeat of a held action (see {@link ActionRepeat}), not a new press */
1484
1451
  repeat: boolean;
1452
+ /**
1453
+ * The modifier keys that were held when the press happened, even if they were let go again
1454
+ * before update() (a quick Shift + arrow between two frames). For auto-repeats and releases:
1455
+ * the ones held now.
1456
+ */
1457
+ modifiers: Required<KeyModifiers>;
1485
1458
  }
1486
1459
  /**
1487
1460
  * Options for the {@link InputActionMap} constructor.
@@ -1733,6 +1706,8 @@ export declare class InputActionMap {
1733
1706
  protected _setControl(device: InputDevice, binding: Binding, value: number): void;
1734
1707
  /** A one-frame press with no held state: wheel steps, gestures. */
1735
1708
  protected _pulse(device: InputDevice, binding: Binding): void;
1709
+ /** the keyboard's modifier keys held right now (bits); they apply to every device's presses (Shift + click) */
1710
+ private _heldMods;
1736
1711
  private _tryCapture;
1737
1712
  private _setLastDevice;
1738
1713
  /**
@@ -1774,16 +1749,12 @@ export declare class InputActionMap {
1774
1749
  private _onTouchUp;
1775
1750
  private _onWheel;
1776
1751
  }
1777
- //#endregion
1778
- //#region src/log.d.ts
1779
1752
  /**
1780
1753
  * `console.debug` with a bold gray `[dev]` prefix; takes the same arguments. Visible only when the
1781
1754
  * console shows verbose/debug messages.
1782
1755
  * @category Utilities
1783
1756
  */
1784
1757
  export declare const log: (...args: any[]) => void;
1785
- //#endregion
1786
- //#region src/math.d.ts
1787
1758
  /**
1788
1759
  * π, half a turn in radians.
1789
1760
  * @category Math & Random
@@ -1958,8 +1929,6 @@ export declare const hash32: (n: number) => number;
1958
1929
  * @category Math & Random
1959
1930
  */
1960
1931
  export declare const hash32mix: (...values: number[]) => number;
1961
- //#endregion
1962
- //#region src/misc.d.ts
1963
1932
  /**
1964
1933
  * True if `target` is `null` or `undefined`.
1965
1934
  * @category Utilities
@@ -2003,8 +1972,6 @@ export declare const xyz2k: (x: number, y: number, z: number, delimiter?: string
2003
1972
  * @category Utilities
2004
1973
  */
2005
1974
  export declare const k2xyz: (key: string, delimiter?: string) => [number, number, number];
2006
- //#endregion
2007
- //#region src/particle-renderer.d.ts
2008
1975
  /**
2009
1976
  * Double-buffered square-pixel renderer for particle effects: draw with `setPixel()` into an
2010
1977
  * offscreen buffer, then `render()` copies the buffer to the visible canvas and clears it.
@@ -2049,8 +2016,6 @@ export declare class ParticleRenderer {
2049
2016
  /** Replaces the visible canvas with the buffer's contents, then clears the buffer for the next frame. */
2050
2017
  render(): void;
2051
2018
  }
2052
- //#endregion
2053
- //#region src/particle-system-2d.d.ts
2054
2019
  /**
2055
2020
  * A `size` x `size` attraction matrix with values in [-1, 1). Deterministic: the same `size` and
2056
2021
  * `seed` always give the same matrix.
@@ -2108,8 +2073,6 @@ export declare class ParticleSystem2d {
2108
2073
  */
2109
2074
  update(renderer: ParticleRenderer, dt: number): void;
2110
2075
  }
2111
- //#endregion
2112
- //#region src/random.d.ts
2113
2076
  /**
2114
2077
  * Hash-based random numbers. The static methods are pure functions of their arguments (the same
2115
2078
  * inputs always give the same result), which makes them handy for coordinate-based noise; an
@@ -2154,8 +2117,6 @@ export declare class Random {
2154
2117
  /** Next angle in radians in [0, 2π); advances the seed. */
2155
2118
  angle(): number;
2156
2119
  }
2157
- //#endregion
2158
- //#region src/rng.d.ts
2159
2120
  /**
2160
2121
  * Seeded random number generator with helpers for ranges, picking, shuffling, geometric points,
2161
2122
  * Gaussian samples and matrices. Every call advances the underlying {@link Random}, so a given
@@ -2225,8 +2186,6 @@ export declare class Rng {
2225
2186
  * @category Math & Random
2226
2187
  */
2227
2188
  export declare const rng: Rng;
2228
- //#endregion
2229
- //#region src/signal.d.ts
2230
2189
  /**
2231
2190
  * A {@link Signal} subscriber: called with the new value.
2232
2191
  *
@@ -2259,8 +2218,6 @@ export declare class Signal<T> {
2259
2218
  /** Adds a subscriber and calls it right away with the current value; returns a function that removes it. */
2260
2219
  subscribe(subscriber: Subscriber<T>): () => void;
2261
2220
  }
2262
- //#endregion
2263
- //#region src/spatial-partition-2d.d.ts
2264
2221
  /**
2265
2222
  * Anything with a position that a {@link SpatialPartition2d} can bucket.
2266
2223
  *
@@ -2301,8 +2258,6 @@ export declare class SpatialPartition2d {
2301
2258
  */
2302
2259
  getCellNeighbors(x: number, y: number): SpatialPartitionEntity2d[][];
2303
2260
  }
2304
- //#endregion
2305
- //#region src/spatial-partition-3d.d.ts
2306
2261
  /**
2307
2262
  * Anything with a position that a {@link SpatialPartition3d} can bucket.
2308
2263
  *
@@ -2345,8 +2300,6 @@ export declare class SpatialPartition3d {
2345
2300
  /** Puts `entity` in the cell its current position falls in. */
2346
2301
  addEntity(entity: SpatialPartitionEntity3d): void;
2347
2302
  }
2348
- //#endregion
2349
- //#region src/tilemap.d.ts
2350
2303
  /**
2351
2304
  * Sparse 2D grid of arbitrary values, keyed by floored integer coordinates. Simpler than
2352
2305
  * {@link Map2D} (string keys, any value type, no default value or range limit).
@@ -2362,8 +2315,6 @@ export declare class Tilemap<T = number> {
2362
2315
  /** Sets the tile containing (x, y). */
2363
2316
  set(x: number, y: number, v: T): void;
2364
2317
  }
2365
- //#endregion
2366
- //#region src/webgl.d.ts
2367
2318
  /**
2368
2319
  * Literal GLenum values, so importing this module doesn't require `WebGL2RenderingContext` to exist.
2369
2320
  *
@@ -2719,8 +2670,6 @@ export interface DrawOptions {
2719
2670
  * @category WebGL
2720
2671
  */
2721
2672
  export declare function Draw(gl: WebGL2RenderingContext, info: ProgramInfo, vertexArray: VertexArrayInfo, options?: DrawOptions): void;
2722
- //#endregion
2723
- //#region src/webgl-renderer.d.ts
2724
2673
  /**
2725
2674
  * Options for the {@link WebGlRenderer} constructor.
2726
2675
  *
@@ -2806,8 +2755,6 @@ export declare class WebGlRenderer {
2806
2755
  dispose(): void;
2807
2756
  private _listen;
2808
2757
  }
2809
- //#endregion
2810
- //#region src/worker-interface.d.ts
2811
2758
  /**
2812
2759
  * Thin wrapper around a module `Worker` that exposes its errors and messages as
2813
2760
  * {@link Observable}s.
@@ -2835,5 +2782,4 @@ export declare class WorkerInterface<TReceive = any, TSend = any> {
2835
2782
  /** Stops the worker immediately. */
2836
2783
  terminate(): void;
2837
2784
  }
2838
- //#endregion
2839
2785
  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, KeyModifiers, MouseButton } from "./bindings.js";
7
6
  /**
8
7
  * 0 = keyboard, mouse, pen, touch and VR; 1, 2, ... = gamepads.
9
8
  *
@@ -32,6 +31,12 @@ export interface ActionEvent {
32
31
  action: string;
33
32
  /** an auto-repeat of a held action (see {@link ActionRepeat}), not a new press */
34
33
  repeat: boolean;
34
+ /**
35
+ * The modifier keys that were held when the press happened, even if they were let go again
36
+ * before update() (a quick Shift + arrow between two frames). For auto-repeats and releases:
37
+ * the ones held now.
38
+ */
39
+ modifiers: Required<KeyModifiers>;
35
40
  }
36
41
  /**
37
42
  * Options for the {@link InputActionMap} constructor.
@@ -283,6 +288,8 @@ export declare class InputActionMap {
283
288
  protected _setControl(device: InputDevice, binding: Binding, value: number): void;
284
289
  /** A one-frame press with no held state: wheel steps, gestures. */
285
290
  protected _pulse(device: InputDevice, binding: Binding): void;
291
+ /** the keyboard's modifier keys held right now (bits); they apply to every device's presses (Shift + click) */
292
+ private _heldMods;
286
293
  private _tryCapture;
287
294
  private _setLastDevice;
288
295
  /**
@@ -323,5 +330,4 @@ export declare class InputActionMap {
323
330
  private _onTouchMove;
324
331
  private _onTouchUp;
325
332
  private _onWheel;
326
- }
327
- //#endregion
333
+ }