@ngx-extensions/count-up.js
Version:
Wrapper module for countup.js
63 lines (62 loc) • 1.68 kB
TypeScript
import { ElementRef, AfterViewInit, EventEmitter } from '@angular/core';
import { CountUpOptions } from 'countup.js';
export declare class NgxCountUpDirective implements AfterViewInit {
private readonly elementRef;
private static readonly LARGE_VALUE_FIX;
/**
* The options for the countUp.js API.
* Defaults to undefined.
*/
options: CountUpOptions;
/**
* The value to count up to.
* Defaults to zero.
*/
endValue: any;
/**
* Whether or not the element should re-animate when clicked.
* Default is false.
*/
reanimateOnClick: any;
/**
* Duration of the animation in seconds.
* Defaults to 2[s].
*/
duration: any;
/**
* Optional number of decimal places.
* Default is zero.
*/
decimals: number;
/**
* Optional start value for the count.
* Defaults to zero.
*/
startValue: any;
/**
* Emits when the count-up animation has completed
*/
readonly animationStarted: EventEmitter<void>;
/**
* Emits when the count-up animation has started
*/
readonly animationCompleted: EventEmitter<void>;
private _startValue;
private _endValue;
private _duration;
private _reanimateOnClick;
private countUp;
constructor(elementRef: ElementRef);
ngAfterViewInit(): void;
/**
* Handles the click event of the host element
*/
onClick(): void;
/**
* Triggers the count-up animation.
*/
animate(): void;
private createCountUp;
private onAnimationStarted;
private onAnimationCompleted;
}