@typeonce/ritmo-browser 0.9.0 → 0.11.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 (58) hide show
  1. package/CHANGELOG.md +285 -0
  2. package/README.md +6 -3
  3. package/dist/Controls.d.ts +495 -0
  4. package/dist/Controls.d.ts.map +1 -0
  5. package/dist/Controls.js +343 -0
  6. package/dist/Controls.js.map +1 -0
  7. package/dist/Gamepad.d.ts +375 -0
  8. package/dist/Gamepad.d.ts.map +1 -0
  9. package/dist/Gamepad.js +452 -0
  10. package/dist/Gamepad.js.map +1 -0
  11. package/dist/InputCapture.d.ts +47 -14
  12. package/dist/InputCapture.d.ts.map +1 -1
  13. package/dist/InputCapture.js +1 -1
  14. package/dist/InputCapture.js.map +1 -1
  15. package/dist/Keyboard.d.ts +184 -21
  16. package/dist/Keyboard.d.ts.map +1 -1
  17. package/dist/Keyboard.js +257 -91
  18. package/dist/Keyboard.js.map +1 -1
  19. package/dist/Pointer.d.ts +231 -62
  20. package/dist/Pointer.d.ts.map +1 -1
  21. package/dist/Pointer.js +205 -145
  22. package/dist/Pointer.js.map +1 -1
  23. package/dist/Touch.d.ts +73 -27
  24. package/dist/Touch.d.ts.map +1 -1
  25. package/dist/Touch.js +25 -30
  26. package/dist/Touch.js.map +1 -1
  27. package/dist/index.d.ts +10 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +10 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/internal/buttons.d.ts +52 -0
  32. package/dist/internal/buttons.d.ts.map +1 -0
  33. package/dist/internal/buttons.js +211 -0
  34. package/dist/internal/buttons.js.map +1 -0
  35. package/dist/internal/introspect.d.ts +14 -0
  36. package/dist/internal/introspect.d.ts.map +1 -0
  37. package/dist/internal/introspect.js +19 -0
  38. package/dist/internal/introspect.js.map +1 -0
  39. package/dist/internal/used.d.ts +8 -0
  40. package/dist/internal/used.d.ts.map +1 -0
  41. package/dist/internal/used.js +14 -0
  42. package/dist/internal/used.js.map +1 -0
  43. package/dist/internal/vectors.d.ts +24 -0
  44. package/dist/internal/vectors.d.ts.map +1 -0
  45. package/dist/internal/vectors.js +22 -0
  46. package/dist/internal/vectors.js.map +1 -0
  47. package/package.json +5 -3
  48. package/src/Controls.ts +799 -0
  49. package/src/Gamepad.ts +747 -0
  50. package/src/InputCapture.ts +44 -22
  51. package/src/Keyboard.ts +395 -68
  52. package/src/Pointer.ts +392 -164
  53. package/src/Touch.ts +111 -54
  54. package/src/index.ts +10 -1
  55. package/src/internal/buttons.ts +222 -0
  56. package/src/internal/introspect.ts +23 -0
  57. package/src/internal/used.ts +14 -0
  58. package/src/internal/vectors.ts +36 -0
@@ -30,12 +30,22 @@
30
30
  *
31
31
  * // Once per update:
32
32
  * const snapshot = input.snapshot()
33
- * if (snapshot.jump.pressed) jump()
33
+ * if (snapshot.actions.jump.pressed) jump()
34
34
  *
35
35
  * // On teardown:
36
36
  * input.dispose()
37
37
  * ```
38
38
  *
39
+ * Movement is one vector action: `move: Keyboard.vector({ up, down, left,
40
+ * right })` reports `vectors.move` with length at most 1 (opposite keys
41
+ * cancel, diagonals are not faster). Timelines name it by direction,
42
+ * `"move.right"`.
43
+ *
44
+ * For a controls settings screen, `presses(...)` reports every key that
45
+ * goes down (bound or not) so the screen can wait for the key to bind,
46
+ * `rebind(...)` swaps the keys of the same actions, and `parseRebinding(...)`
47
+ * validates bindings saved as JSON.
48
+ *
39
49
  * For tests, replays, and headless runs, `scripted(...)` plays a timeline of
40
50
  * presses and releases instead of listening to a host, and `recording(...)`
41
51
  * wraps live actions to capture the timeline a session produced.
@@ -53,7 +63,10 @@
53
63
  * }
54
64
  * ```
55
65
  */
66
+ import type * as System from "@typeonce/ritmo/System";
56
67
  import * as Result from "@typeonce/ritmo/Result";
68
+ import type { Direction, Vector } from "./internal/vectors.ts";
69
+ export type { Direction, Vector };
57
70
  /**
58
71
  * The subset of `KeyboardEvent` the module reads. `code` (the physical key)
59
72
  * is optional so simple test hosts can omit it; browsers always provide it.
@@ -92,11 +105,51 @@ export interface PhysicalKey {
92
105
  * Option held on macOS, W types "∑"; with Shift, 1 types "!").
93
106
  */
94
107
  export type KeyBinding = string | PhysicalKey;
108
+ /** The keys of one action: at least one. */
109
+ export type Keys = readonly [KeyBinding, ...Array<KeyBinding>];
110
+ /**
111
+ * Keys for the four directions of a vector action (movement), built with
112
+ * {@link vector}.
113
+ */
114
+ export interface VectorBinding {
115
+ readonly _tag: "Vector";
116
+ readonly up: Keys;
117
+ readonly down: Keys;
118
+ readonly left: Keys;
119
+ readonly right: Keys;
120
+ }
121
+ /**
122
+ * Action name to the keys that trigger it (at least one), or to a
123
+ * {@link vector} binding for a direction such as movement.
124
+ */
125
+ export type Bindings = Readonly<Record<string, Keys | VectorBinding>>;
126
+ /** The bound button actions: the names bound to keys. */
127
+ export type ButtonNames<B> = {
128
+ [K in keyof B]: B[K] extends VectorBinding ? never : K;
129
+ }[keyof B] & string;
130
+ /** The bound vector actions: the names bound with {@link vector}. */
131
+ export type VectorNames<B> = {
132
+ [K in keyof B]: B[K] extends VectorBinding ? K : never;
133
+ }[keyof B] & string;
95
134
  /**
96
- * Action name to the keys that trigger it. Every action needs at least one
97
- * key.
135
+ * Binds a vector action to keys for its four directions. The snapshot's
136
+ * `vectors` reports it with length at most 1: opposite keys cancel and a
137
+ * diagonal is not faster than a straight line.
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const bindings = {
142
+ * move: Keyboard.vector({ up: ["w", "ArrowUp"], down: ["s", "ArrowDown"], left: ["a", "ArrowLeft"], right: ["d", "ArrowRight"] }),
143
+ * jump: [" "]
144
+ * } as const
145
+ * ```
98
146
  */
99
- export type Bindings = Readonly<Record<string, readonly [KeyBinding, ...Array<KeyBinding>]>>;
147
+ export declare const vector: (keys: {
148
+ readonly up: Keys;
149
+ readonly down: Keys;
150
+ readonly left: Keys;
151
+ readonly right: Keys;
152
+ }) => VectorBinding;
100
153
  /**
101
154
  * A binding to a physical key by its `KeyboardEvent.code`.
102
155
  *
@@ -112,29 +165,72 @@ export declare const code: <const Code extends string>(code: Code) => PhysicalKe
112
165
  readonly code: Code;
113
166
  };
114
167
  /**
115
- * One action's state in a snapshot.
168
+ * One action's state in a snapshot, the same on every device (`Gamepad`,
169
+ * `Pointer`, and `Touch` buttons too).
116
170
  */
117
171
  export interface ActionState {
118
- /** At least one bound key is down now. */
172
+ /** At least one bound key or button is down now. */
119
173
  readonly held: boolean;
120
- /** A bound key went down since the previous snapshot, even if already released. */
174
+ /** A bound key or button went down since the previous snapshot, even if already released. */
121
175
  readonly pressed: boolean;
122
- /** A bound key went up since the previous snapshot and none is held now. */
176
+ /** A bound key or button went up since the previous snapshot and none is held now. */
123
177
  readonly released: boolean;
124
178
  }
125
- export type Snapshot<B extends Bindings> = {
126
- readonly [Action in keyof B]: ActionState;
179
+ /**
180
+ * Every action's state, with the same core as the other devices' snapshots
181
+ * (`actions`, `vectors`, and `used`) so `Controls` can merge them.
182
+ */
183
+ export interface Snapshot<B extends Bindings> {
184
+ readonly actions: {
185
+ readonly [Action in ButtonNames<B>]: ActionState;
186
+ };
187
+ /** Each vector action's direction, length at most 1, `y` growing down. */
188
+ readonly vectors: {
189
+ readonly [Action in VectorNames<B>]: Vector;
190
+ };
191
+ /** Some key bound to an action was pressed in this window or is held: the player is using the keyboard. */
192
+ readonly used: boolean;
193
+ }
194
+ /**
195
+ * New keys for the same actions, for {@link Actions.rebind}: keys for a
196
+ * button action, a {@link vector} for a vector action. Load saved ones with
197
+ * {@link parseRebinding}.
198
+ */
199
+ export type Rebinding<B extends Bindings> = {
200
+ readonly [Action in keyof B]: B[Action] extends VectorBinding ? VectorBinding : Keys;
201
+ };
202
+ /**
203
+ * Rejects actions a rebinding names that the bindings do not have, so
204
+ * {@link Actions.rebind} takes exactly the actions it was made with.
205
+ */
206
+ export type OnlyActionsOf<R, B extends Bindings> = {
207
+ readonly [Name in Exclude<keyof R, keyof B>]: `${Name & string} is not an action of these bindings`;
127
208
  };
128
- export interface Actions<B extends Bindings> {
209
+ /**
210
+ * A keyboard bound to actions, built with {@link actions} (live),
211
+ * {@link scripted}, or {@link recording}. Capture it with
212
+ * `InputCapture.system(...)`, or merge it with `Controls`.
213
+ */
214
+ export interface Actions<B extends Bindings> extends System.Consumes<"snapshot"> {
129
215
  /**
130
216
  * Returns every action's state and starts a new press/release window.
131
217
  */
132
218
  snapshot(): Snapshot<B>;
219
+ /**
220
+ * Binds the same actions to new keys, from the next snapshot, for a
221
+ * settings screen where players remap controls (capture the key to bind
222
+ * with {@link presses}). An action held only through keys it lost reports
223
+ * `released`. A key held across the rebind holds a newly bound action only
224
+ * once it is pressed again, so an action never turns held without a
225
+ * press. It takes exactly the actions the source was made with.
226
+ */
227
+ rebind<const R extends Rebinding<B>>(bindings: R & OnlyActionsOf<R, B>): void;
133
228
  /**
134
229
  * Removes the event listeners.
135
230
  */
136
231
  dispose(): void;
137
232
  }
233
+ /** Options for {@link actions}. */
138
234
  export interface ActionsOptions {
139
235
  /**
140
236
  * Call `preventDefault()` for bound keys, so arrows and space do not scroll
@@ -148,27 +244,69 @@ export interface ActionsOptions {
148
244
  */
149
245
  export declare const idle: <const B extends Bindings>(bindings: B) => Snapshot<B>;
150
246
  /**
151
- * Starts tracking bound keys on `host`.
247
+ * Starts tracking bound keys on `host`, usually `window`, until `dispose()`.
248
+ * When the window loses focus every held action is released. Each call is
249
+ * its own device: build one per source (one `Controls` merge, one player
250
+ * of a pool). Use {@link scripted} for tests and headless runs, and
251
+ * {@link presses} to capture an unbound key on a settings screen.
152
252
  */
153
- export declare const actions: <const B extends Bindings>(host: KeyboardHost, bindings: B, options?: ActionsOptions) => Actions<B>;
253
+ export declare const actions: <const B extends Bindings>(host: KeyboardHost, initial: B, options?: ActionsOptions) => Actions<B>;
254
+ /** One key that went down, in the two forms a {@link KeyBinding} can name it. */
255
+ export interface KeyPress {
256
+ /** The character typed (`KeyboardEvent.key`), for a character binding. */
257
+ readonly key: string;
258
+ /** The physical key (`KeyboardEvent.code`), for `Keyboard.code(...)`; `null` when the host gave none. */
259
+ readonly code: string | null;
260
+ }
261
+ /** Every key press on a host, bound or not; see {@link presses}. */
262
+ export interface Presses extends System.Consumes<"snapshot"> {
263
+ /** The keys that went down since the previous snapshot, in order, without auto-repeats. */
264
+ snapshot(): ReadonlyArray<KeyPress>;
265
+ /** Removes the event listener. */
266
+ dispose(): void;
267
+ }
154
268
  /**
155
- * Input changes applied just before one snapshot: presses first, then
156
- * releases. `frame` is the snapshot's index, counting from 0 at the first
157
- * `snapshot()` call. An action both pressed and released in one frame is a
158
- * tap shorter than a frame.
269
+ * Starts collecting every key press on `host`, whatever the bindings, for a
270
+ * settings screen that waits for the key to bind. Use {@link actions} for
271
+ * gameplay. It never calls `preventDefault()`.
272
+ *
273
+ * @example
274
+ * ```ts
275
+ * const presses = Keyboard.presses(window)
276
+ *
277
+ * // While the settings screen waits for the new jump key:
278
+ * const press = presses.snapshot()[0]
279
+ * if (press !== undefined) {
280
+ * input.rebind({ ...current, jump: [press.code === null ? press.key : Keyboard.code(press.code)] })
281
+ * }
282
+ * ```
283
+ */
284
+ export declare const presses: (host: KeyboardHost) => Presses;
285
+ /**
286
+ * Input changes applied just before one snapshot. `frame` is the snapshot's
287
+ * index, counting from 0 at the first `snapshot()` call. Entries name
288
+ * actions, and a vector action by direction (`"move.right"`). An action in both
289
+ * `press` and `release` changed twice within the frame: a tap shorter than a
290
+ * frame when it was up, a release and a new press when it was held.
159
291
  */
160
292
  export interface TimelineEntry<B extends Bindings> {
161
293
  readonly frame: number;
162
- readonly press?: ReadonlyArray<keyof B & string>;
163
- readonly release?: ReadonlyArray<keyof B & string>;
294
+ readonly press?: ReadonlyArray<TimelineName<B>>;
295
+ readonly release?: ReadonlyArray<TimelineName<B>>;
164
296
  }
297
+ /**
298
+ * What a timeline presses and releases: a button action, or one direction
299
+ * of a vector action (`"move.right"`).
300
+ */
301
+ export type TimelineName<B extends Bindings> = ButtonNames<B> | `${VectorNames<B>}.${Direction}`;
165
302
  /**
166
303
  * Input changes by snapshot index. Plain data, so it round-trips through
167
304
  * JSON; load it back with `parseTimeline`.
168
305
  */
169
306
  export type Timeline<B extends Bindings> = ReadonlyArray<TimelineEntry<B>>;
170
307
  /**
171
- * Actions driven by a timeline instead of a host.
308
+ * Actions driven by a timeline instead of a host. The timeline names
309
+ * actions, not keys, so `rebind` changes nothing.
172
310
  */
173
311
  export interface Scripted<B extends Bindings> extends Actions<B> {
174
312
  /** Number of snapshots taken so far, which is the next frame index. */
@@ -204,7 +342,32 @@ export interface InvalidTimeline {
204
342
  /**
205
343
  * Validates untrusted data, such as a parsed JSON file, as a timeline for
206
344
  * `bindings`: an array of entries with a non-negative integer `frame` and
207
- * optional `press`/`release` arrays of bound action names.
345
+ * optional `press`/`release` arrays of bound action names (a vector action
346
+ * by direction, `"move.right"`).
208
347
  */
209
348
  export declare const parseTimeline: <const B extends Bindings>(bindings: B, data: unknown) => Result.Result<Timeline<B>, InvalidTimeline>;
349
+ /**
350
+ * Why loaded data is not a rebinding for the bindings. `path` points at the
351
+ * offending value, for example `jump[1]`.
352
+ */
353
+ export interface InvalidRebinding {
354
+ readonly _tag: "InvalidRebinding";
355
+ readonly path: string;
356
+ readonly message: string;
357
+ }
358
+ /**
359
+ * Validates untrusted data, such as saved settings parsed from JSON, as new
360
+ * keys for `bindings`: an object with exactly the same action names, each
361
+ * mapped to a non-empty array of characters or `{ code }` physical keys
362
+ * (for a vector action, an object with such keys for `up`, `down`, `left`,
363
+ * and `right`, as `Keyboard.vector` saves).
364
+ * Pass the result to {@link Actions.rebind}; on failure, keep the defaults.
365
+ *
366
+ * @example
367
+ * ```ts
368
+ * const saved = Keyboard.parseRebinding(bindings, JSON.parse(stored))
369
+ * if (saved.ok) input.rebind(saved.value)
370
+ * ```
371
+ */
372
+ export declare const parseRebinding: <const B extends Bindings>(bindings: B, data: unknown) => Result.Result<Rebinding<B>, InvalidRebinding>;
210
373
  //# sourceMappingURL=Keyboard.d.ts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