index.d.ts 1.5 KB

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