UNPKG

@visactor/vrender-animate

Version:

This module provides a graph-based animation system for VRender.

37 lines (36 loc) 1.21 kB
import { ACustomAnimate } from '../custom-animate'; import type { IRichTextCharacter, IAnimate, IStep, EasingType } from '@visactor/vrender-core'; export declare class SlideRichText extends ACustomAnimate<{ textConfig: IRichTextCharacter[]; }> { valid: boolean; private fromTextConfig; private toTextConfig; private originalTextConfig; private singleCharConfig; private fadeInDuration; private slideDirection; private slideDistance; private wordByWord; private wordRegex; private wordGroups; constructor(from: { textConfig: IRichTextCharacter[]; }, to: { textConfig: IRichTextCharacter[]; }, duration: number, easing: EasingType, params?: { fadeInDuration?: number; slideDirection?: 'up' | 'down' | 'left' | 'right'; slideDistance?: number; wordByWord?: boolean; wordRegex?: RegExp; }); onFirstRun(): void; private calculateWordGroups; private getInitialDx; private getInitialDy; onEnd(cb?: (animate: IAnimate, step: IStep) => void): void; onUpdate(end: boolean, ratio: number, out: Record<string, any>): void; private updateByWord; private updateByCharacter; }