gitart-animate-number
Advanced tools
Comparing version 0.0.3 to 0.1.0
@@ -1,17 +0,5 @@ | ||
import type { IAnimateByIntervalParams, IParams, StopAnimationFn } from './types'; | ||
import type { IParams, StopAnimationFn } from './types'; | ||
/** | ||
* animate number using `setInterval` | ||
*/ | ||
export declare const animateUsingInterval: ({ from, to, duration, fps, bezier, on, completed, stopped, done, }: IAnimateByIntervalParams) => StopAnimationFn; | ||
/** | ||
* animate number using `requestAnimationFrame` | ||
*/ | ||
export declare const animateUsingRAF: ({ from, to, duration, bezier, on, completed, stopped, done, }: IParams) => StopAnimationFn; | ||
/** | ||
* animate number using `requestAnimationFrame` | ||
*/ | ||
export declare function animate(params: IParams, type?: 'raf'): StopAnimationFn; | ||
/** | ||
* animate number using `setInterval` | ||
*/ | ||
export declare function animate(params: IAnimateByIntervalParams, type?: 'interval'): StopAnimationFn; | ||
export declare const animate: ({ from, to, duration, bezier, on, completed, stopped, done, }: IParams) => StopAnimationFn; |
export type { IParams, IAnimateByIntervalParams, BezierParams } from './types'; | ||
export { animate, animateUsingInterval, animateUsingRAF } from './animate'; | ||
export { animateUsingInterval } from './animateUsingInterval'; | ||
export { animate } from './animate'; | ||
export { easingTypes } from './config'; |
{ | ||
"name": "gitart-animate-number", | ||
"version": "0.0.3", | ||
"version": "0.1.0", | ||
"license": "MIT", | ||
@@ -40,5 +40,5 @@ "repository": { | ||
"typescript": "^4.4.4", | ||
"vite": "^2.7.2", | ||
"vitest": "^0.1.27" | ||
"vite": "^2.8.6", | ||
"vitest": "^0.7.10" | ||
} | ||
} |
# Animate Number | ||
A simple utility to animate a single number. | ||
A simple utility to animate a single number. The number changes on each frame (by requestAnimationFrame). | ||
For more complex cases you can take a look at the [shifty](https://www.npmjs.com/package/shifty). The package can animate a few fields and control the animation timelines. | ||
For more complex cases, you can take a look at the [shifty](https://www.npmjs.com/package/shifty). | ||
The package can animate a few fields and control the animation timelines. | ||
@@ -26,4 +27,3 @@ ## Usage | ||
type Animate = ( | ||
params: IParams | IAnimateByIntervalParams, | ||
type: 'raf' | 'interval' = 'raf' | ||
params: IParams, | ||
): StopAnimationFn | ||
@@ -55,3 +55,3 @@ ``` | ||
/** | ||
* a callback that is called many times until the animation is complete. | ||
* a callback called many times (on requestAnimationFrame) until the animation is complete. | ||
* the current progress is passed as the first parameter. | ||
@@ -58,0 +58,0 @@ */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31343
12
251
1