ngx-teximate
Version:
Angular text animations component
49 lines (48 loc) • 1.8 kB
TypeScript
import { AfterViewInit, OnChanges, OnDestroy, NgZone, ElementRef, EventEmitter } from '@angular/core';
import { AnimationPlayer, AnimationBuilder } from '@angular/animations';
import { Observable } from 'rxjs';
import { TextAnimation } from './teximate.model';
export declare class Teximate implements AfterViewInit, OnChanges, OnDestroy {
private animationBuilder;
private zone;
private el;
/** Set animated text */
setText: string;
/** Animation that triggers on init */
enter: TextAnimation;
/** Animation that triggers on destroy */
leave: TextAnimation;
/** Animation that triggers with the play() function */
animation: TextAnimation;
/** Stream that emits when animation is started */
playEmitter: EventEmitter<{}>;
/** Stream that emits when animation is done */
finishEmitter: EventEmitter<{}>;
/** Teximate animations */
players: Map<string, AnimationPlayer>;
/** Teximate state */
private _state;
state: Observable<string[][][]>;
/** Teximate playing state */
private _isPlaying;
private _isViewInit;
readonly isPlaying: boolean;
readonly enterPlayer: AnimationPlayer;
readonly leavePlayer: AnimationPlayer;
readonly defaultPlayer: AnimationPlayer;
constructor(animationBuilder: AnimationBuilder, zone: NgZone, el: ElementRef);
ngAfterViewInit(): void;
ngOnChanges(): void;
ngOnDestroy(): void;
/**
* Register a new animation
*/
registerAnimation(config: TextAnimation): AnimationPlayer;
private updateAnimations;
/**
* Build animation
*/
private buildAnimation;
}
/** Convert text string into a workable text */
export declare function teximateFactory(text: string): string[][][];