StringTune/Docs

API Reference

Event Channels

Central reference for global and object-scoped events that are safe to consume.

Event Channels

StringTune exposes one global event bus through:

TypeScript
stringTune.on(eventName, callback);
stringTune.off(eventName, callback);

This page lists channels that are reasonable to treat as public integration surface.

Important Boundary

Some events in the runtime exist only for internal orchestration.

Examples:

  • wheel
  • resize
  • scrollTo

Those channels are used by controllers and modules internally. They should not be documented as normal app-facing API.

Global Runtime Channels

ChannelPayloadFired when
startnullstringTune.start() finishes initialization
updatenullEnd of each update frame
scrollnumberScroll position changes
lerpnumberShared scroll lerp value changes
scroll:startnullScrolling begins
scroll:stopnullScrolling stops
dom:changednullObject manager detects relevant DOM additions or removals

Global Module Channels

ChannelPayloadFired when
screen:mobilebooleanResponsive mobile match changes
screen:tabletbooleanResponsive tablet match changes
screen:laptopbooleanResponsive laptop match changes
screen:desktopbooleanResponsive desktop match changes
cursor{ x, y, stepX, stepY }Cursor portal state changes
fpsnumberFPS tracker measures a new FPS value
scroll-position{ val, valPct, direction }Position tracker updates
tracker:fps:visiblebooleanstringTune.FPSTrackerVisible changes
tracker:position:visiblebooleanstringTune.PositionTrackerVisible changes
masonry:shuffle:start{ object }Masonry shuffle starts
masonry:shuffle:end{ object }Masonry shuffle ends

Object Lifecycle Channels

These are keyed by object ID, so they depend on string-id.

ChannelPayloadFired when
object:activate:<id>booleanActivation observer toggles the object
object:inview:<id>{ inView, direction }In-view window changes

direction is one of:

  • enter-top
  • enter-bottom
  • exit-top
  • exit-bottom

Progress And Motion Channels

ChannelPayloadFired when
object:progress:<id>numberStringProgress updates eased progress
object:progress-slice:<id>numberStringProgressPart updates remapped slice progress
object:parallax:<id>numberStringParallax recomputes translation
object:lerp:<id>numberStringLerp applies a new lerp value
object:glide:<id>numberStringGlide recomputes the pixel translation

Important:

  • object:progress:<id> emits a plain number
  • object:progress-slice:<id> emits a plain number
  • object:parallax:<id> emits a plain number
  • object:lerp:<id> emits a plain number
  • object:glide:<id> emits a plain number

Cursor And Interaction Channels

ChannelPayloadFired when
cursor:start:<id>nullCursor target tracking becomes active
cursor:move:<id>{ x, y }Target-local cursor coordinates change
cursor:pixel:<id>{ x, y }Target-local pixel coordinates change
cursor:end:<id>nullCursor target tracking ends
magnetic:move:<id>{ x, y }Magnetic offset changes
spotlight:update:<id>{ angleDeg, distance }Spotlight values change
object:impulse:<id>:move{ x, y }Impulse translation output changes
object:impulse:<id>:rotate{ rotation }Impulse rotation output changes
object:impulse:<id>:side{ value }Pointer side position across the element changes

The order for suffixed impulse channels is important:

  • object:impulse:<id>:move
  • not object:impulse:move:<id>

Form Channels

ChannelPayloadFired when
form:submit:<id>Record<string, any>Submit passes validation
form:invalid:<id>voidSubmit fails validation
form:field:valid:<key>{ key, field, errors, phase, valid }Field becomes valid
form:field:invalid:<key>{ key, field, errors, phase, valid }Field fails live validation
form:field:error:<key>{ key, field, errors, phase, valid }Field fails submit validation

Form field channels are keyed by field key, not by form ID.

Local Object Events

Some behavior in the runtime is local to StringObject.events, not the global bus.

Examples:

  • enter
  • leave

StringVideoAutoplay uses those local object events internally. They are not consumed through stringTune.on(...).

Where To Go Next

  • For string-id and object-scoped naming, see Object IDs.
  • For module-specific event contracts, use the relevant page in Built-in Modules.
  • For CSS output paired with these channels, see CSS Variables.