class Reactive · Animation

RvgStringAnimator

Animator for reactive string values.

Accessed via Animate.String. Progressively constructs a target string over time, character by character, with optional deconstruction of the existing value before building the new one.

Methods

animate

animate(refObj: StringValue, to: string, duration: number, options?: RvgTextOptions | null): RvgAnimation

Animates the string value from its current content to to, progressively revealing characters over time.

Duration modes — when options.durationMode is RvgTextDurationMode.Overall (the default), the duration parameter covers the entire animation. When set to RvgTextDurationMode.PerCharacter, the total animation length is duration × characterCount.

refObj
The reactive StringValue to animate. Pass the StringValue object itself; a plain string is not accepted.
to
The target string to animate toward.
duration
Animation duration in milliseconds. Interpreted according to options.durationMode.
options optional
Optional RvgTextOptions controlling the easing curve, duration mode, deconstruction behaviour, and an onComplete callback.

Returns The running animation: to cancel it or to wait for it.

set

set(refObj: StringValue, value: string, delay: number, options?: RvgSetOptions | null): RvgAnimation

Schedules an assignment of value after the given delay, with no character-by-character animation.

refObj
The reactive StringValue to animate. Pass the StringValue object itself; a plain string is not accepted.
value
The string to assign when the delay elapses.
delay
Delay in milliseconds before the assignment occurs.
options optional
Optional RvgSetOptions — currently supports an onComplete callback invoked after the assignment.

Returns The running animation: to cancel it or to wait for it.

snap

snap(refObj: StringValue, value: string): void

Immediately cancels any active animation on the value and assigns the new string without delay or animation.

refObj
The reactive StringValue box to update.
value
The string to assign immediately.