forked from inorganik/countUp.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
44 lines (33 loc) · 1.54 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
declare function CountUp(target: string, startVal: number, endVal: number, decimals: number, duration: number, options: any): void;
declare module CountUp {
var options: CountUpOptions;
function version(): string;
function printValue(value: any): void;
function count(timestamp: any): void;
// start your animation
function start(callback: Function): boolean;
// toggles pause/resume animation
function pauseResume(): void;
// reset to startVal so animation can be run again
function reset(): void;
// pass a new endVal and start animation
function update(newEndVal: number): void;
}
interface CountUp {
// target = id of html element or var of previously selected html element where counting occurs
// startVal = the value you want to begin at
// endVal = the value you want to arrive at
// decimals = number of decimal places, default 0
// duration = duration of animation in seconds, default 2
// options = optional object of options (see below)
new(target: string, startVal: number, endVal: number, decimals: number, duration: number, options: any): CountUp;
}
interface CountUpOptions {
useEasing: boolean; // toggle easing
useGrouping: boolean; // 1,000,000 vs 1000000
separator: string; // character to use as a separator
decimal: string; // character to use as a decimal
easingFn: Function; // optional custom easing closure function, default is Robert Penner's easeOutExpo
formattingFn: Function; // optional custom formatting function, default is self.formatNumber below
}
export = CountUp;