API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classSequenceAction

@codexo/exojs / input / stable

Ordered input pattern - `+` joins a chord within one step, `|` alternates between whole alternatives within one step (any ONE of which satisfies it), `>` advances to the next step. `triggered` is `true` for the one frame the final step completes; see progress's own doc comment for how far a pattern has advanced. Precedence, loosest to tightest: `'>'` separates steps, `'|'` separates alternatives within one step, `'+'` joins channels required simultaneously within one alternative - `'A+B|C>D'` is "(A and B) or C, then D". A step with no `'|'` has exactly one alternative, so this is a strict superset of the pre-`'|'` grammar: nothing about a plain `'+'`/`'>'` pattern changes. A repeated single-channel step (`'A>A'`) requires a genuine release between the two presses: holding the channel down after the first accepted step never re-satisfies the second on its own, since a step only advances on a channel's rising (inactive-to-active) edge, not merely because it reads active - see `_update`'s implementation. A single atomic ChannelEventBatch never invents an order: two channels written together by the same real-world event (e.g. `A` and `B` both changing in one batch) can complete a chord STEP together, but can never be read as two sequential steps (`A` then `B`) within that same batch - see `_update`'s implementation comment. Switching from one alternative to another within the same step is never treated as an unrelated, mismatching entry - only a channel that belongs to NONE of the step's alternatives is. A string pattern resolves tokens as case-insensitive Keyboard enum names (`'Down>Down+Right>Right>A'`). This is a shortcut list syntax for enum lookups, not text or IME input - it never decodes typed characters, dead keys, or composed input, and rejects any token that is not a known `Keyboard` member. Use an InputSequence array of channels/chords/ alternations directly to include pointer or gamepad channels. A string LITERAL is additionally checked at compile time, so a typo (`'Up>Up>Dwon'`) or a stray separator (`'A>>B'`) is a type error naming the reason rather than a throw on the first frame that constructs the action. A pattern that is only known at runtime - read from a config file, assembled from parts, or passed in from JavaScript - types as plain `string` and is checked by the parser alone, exactly as before.

6
props
1
methods
0
events
Import
import { SequenceAction } from '@codexo/exojs'

Ordered input pattern - `+` joins a chord within one step, `|` alternates between whole alternatives within one step (any ONE of which satisfies it), `>` advances to the next step. `triggered` is `true` for the one frame the final step completes; see progress's own doc comment for how far a pattern has advanced.

Precedence, loosest to tightest: `'>'` separates steps, `'|'` separates alternatives within one step, `'+'` joins channels required simultaneously within one alternative - `'A+B|C>D'` is "(A and B) or C, then D". A step with no `'|'` has exactly one alternative, so this is a strict superset of the pre-`'|'` grammar: nothing about a plain `'+'`/`'>'` pattern changes.

A repeated single-channel step (`'A>A'`) requires a genuine release between the two presses: holding the channel down after the first accepted step never re-satisfies the second on its own, since a step only advances on a channel's rising (inactive-to-active) edge, not merely because it reads active - see `_update`'s implementation.

A single atomic ChannelEventBatch never invents an order: two channels written together by the same real-world event (e.g. `A` and `B` both changing in one batch) can complete a chord STEP together, but can never be read as two sequential steps (`A` then `B`) within that same batch - see `_update`'s implementation comment. Switching from one alternative to another within the same step is never treated as an unrelated, mismatching entry - only a channel that belongs to NONE of the step's alternatives is.

A string pattern resolves tokens as case-insensitive Keyboard enum names (`'Down>Down+Right>Right>A'`). This is a shortcut list syntax for enum lookups, not text or IME input - it never decodes typed characters, dead keys, or composed input, and rejects any token that is not a known `Keyboard` member. Use an InputSequence array of channels/chords/ alternations directly to include pointer or gamepad channels.

A string LITERAL is additionally checked at compile time, so a typo (`'Up>Up>Dwon'`) or a stray separator (`'A>>B'`) is a type error naming the reason rather than a throw on the first frame that constructs the action. A pattern that is only known at runtime - read from a config file, assembled from parts, or passed in from JavaScript - types as plain `string` and is checked by the parser alone, exactly as before.

Constructors1
Methods1
Properties6
kind: "sequence"
Which action kind this is - the discriminant a serialized binding is validated against.
binding: Binding
The binding currently in effect: the default, or whatever last replaced it.
channels: readonly number[]
Absolute channel indices this action reads right now. Reflects the effective binding and the owning map's gamepad slot, and is what an InputScope claims on this action's behalf. The array is replaced, not mutated, on every rebind - do not retain it across one.
defaultBinding: Binding
The binding this action was constructed with - what a null rebind restores.
progress: number
How far the pattern has advanced, as completedSteps / totalSteps - in [0, (n-1)/n] for n steps, and never 1: the same update that accepts the final step also sets triggered and resets progress back to 0, so a caller polling both together never observes progress at its nominal maximum. maxGap/timeout expiry is evaluated once per frame against ActionSample.timestamp as well as against each arriving batch, so a half-completed pattern that goes quiet snaps back to 0 on the frame its window actually elapses - no event has to arrive first. It is still not a timer: expiry is observed on the frames the owning ActionMap is updated, so a map that is detached or unavailable holds its progress until it is fed again.
triggered: boolean
Source