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): RvgAnimationAnimates 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
StringValueto animate. Pass theStringValueobject itself; a plain string is not accepted. to- The target string to animate toward.
duration- Animation duration in milliseconds. Interpreted according to
options.durationMode. optionsoptional- Optional
RvgTextOptionscontrolling the easing curve, duration mode, deconstruction behaviour, and anonCompletecallback.
Returns The running animation: to cancel it or to wait for it.
set
set(refObj: StringValue, value: string, delay: number, options?: RvgSetOptions | null): RvgAnimationSchedules an assignment of value after the given delay, with no character-by-character
animation.
refObj- The reactive
StringValueto animate. Pass theStringValueobject itself; a plain string is not accepted. value- The string to assign when the delay elapses.
delay- Delay in milliseconds before the assignment occurs.
optionsoptional- Optional
RvgSetOptions— currently supports anonCompletecallback invoked after the assignment.
Returns The running animation: to cancel it or to wait for it.
snap
snap(refObj: StringValue, value: string): voidImmediately cancels any active animation on the value and assigns the new string without delay or animation.
refObj- The reactive
StringValuebox to update. value- The string to assign immediately.
