mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
React countup upgrade definitions up to version 4.3.3 (#42748)
* update react-countup to version 4.3.3 * lint fixes * update version Co-authored-by: Ezequiel Surijon <esurijon@medallia.com>
This commit is contained in:
parent
ab3222235c
commit
bd9dc30f38
118
types/react-countup/index.d.ts
vendored
118
types/react-countup/index.d.ts
vendored
@ -1,6 +1,7 @@
|
||||
// Type definitions for react-countup 4.0
|
||||
// Type definitions for react-countup 4.3
|
||||
// Project: https://react-countup.now.sh
|
||||
// Definitions by: Daniel Brodin <https://github.com/danielbrodin>
|
||||
// Ezequiel Surijon <https://github.com/esurijon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@ -12,52 +13,165 @@ export = ReactCountUp;
|
||||
|
||||
declare namespace ReactCountUp {
|
||||
interface RenderProps {
|
||||
/**
|
||||
* Ref to hook the countUp instance to
|
||||
*/
|
||||
countUpRef: React.RefObject<any>;
|
||||
/**
|
||||
* Pauses or resumes the transition
|
||||
*/
|
||||
pauseResume(): void;
|
||||
/**
|
||||
* Resets to initial value
|
||||
*/
|
||||
reset(): void;
|
||||
/**
|
||||
* Starts or restarts the transition
|
||||
*/
|
||||
start(): void;
|
||||
/**
|
||||
* Updates transition to the new end value (if given)
|
||||
*/
|
||||
update(newEnd?: number): void;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
* CSS class name of the span element.
|
||||
* Note: This won't be applied when using CountUp with render props.
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* Specifies decimal character.
|
||||
* Default: .
|
||||
*/
|
||||
decimal?: string;
|
||||
|
||||
/**
|
||||
* Amount of decimals to display.
|
||||
* Default: 0
|
||||
*/
|
||||
decimals?: number;
|
||||
|
||||
/**
|
||||
* Delay in seconds before starting the transition.
|
||||
* Default: null
|
||||
* Note: delay={0} will automatically start the count up.
|
||||
*/
|
||||
delay?: number;
|
||||
|
||||
/**
|
||||
* Duration in seconds.
|
||||
* Default: 2
|
||||
*/
|
||||
duration?: number;
|
||||
|
||||
/**
|
||||
* Target value.
|
||||
*/
|
||||
end?: number;
|
||||
|
||||
/**
|
||||
* Static text before the transitioning value.
|
||||
*/
|
||||
prefix?: string;
|
||||
|
||||
/**
|
||||
* Forces count up transition on every component update.
|
||||
* Default: false
|
||||
*/
|
||||
redraw?: boolean;
|
||||
|
||||
/**
|
||||
* Save previously ended number to start every new animation from it.
|
||||
* Default: false
|
||||
*/
|
||||
preserveValue?: boolean;
|
||||
|
||||
/**
|
||||
* Specifies character of thousands separator.
|
||||
*/
|
||||
separator?: string;
|
||||
|
||||
/**
|
||||
* Initial value.
|
||||
* Default: 0
|
||||
*/
|
||||
start?: number;
|
||||
|
||||
/**
|
||||
* Use for start counter on mount for hook usage.
|
||||
* Default: true
|
||||
*/
|
||||
startOnMount?: boolean;
|
||||
|
||||
/**
|
||||
* Static text after the transitioning value.
|
||||
*/
|
||||
suffix?: string;
|
||||
|
||||
/**
|
||||
* Enables easing. Set to false for a linear transition.
|
||||
* Default: true
|
||||
*/
|
||||
useEasing?: boolean;
|
||||
|
||||
/**
|
||||
* Easing function. http://robertpenner.com/easing for more details.
|
||||
* Default: easeInExpo
|
||||
*/
|
||||
easingFn?(t: number, b: number, c: number, d: number): void;
|
||||
|
||||
/**
|
||||
* Function to customize the formatting of the number
|
||||
*/
|
||||
formattingFn?(value: number): string;
|
||||
onComplete?(): void;
|
||||
|
||||
/**
|
||||
* Callback function on transition end.
|
||||
*/
|
||||
onEnd?(providedFn: {
|
||||
pauseResume(): void;
|
||||
reset(): void;
|
||||
start(): void;
|
||||
update(): void;
|
||||
}): void;
|
||||
|
||||
/**
|
||||
* Callback function on transition start.
|
||||
*/
|
||||
onStart?(providedFn: {
|
||||
pauseResume(): void;
|
||||
reset(): void;
|
||||
update(): void;
|
||||
}): void;
|
||||
|
||||
/**
|
||||
* Callback function on pause or resume.
|
||||
*/
|
||||
onPauseResume?(): (
|
||||
providedFn: { reset(): void; start(): void; update(): void }
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* Callback function on reset.
|
||||
*/
|
||||
onReset?(): (
|
||||
providedFn: { pauseResume(): void; start(): void; update(): void }
|
||||
) => void;
|
||||
|
||||
/**
|
||||
* Callback function on update.
|
||||
*/
|
||||
onUpdate?(providedFn: {
|
||||
pauseResume(): void;
|
||||
reset(): void;
|
||||
start(): void;
|
||||
}): void;
|
||||
|
||||
style?: React.CSSProperties;
|
||||
|
||||
children?(data: RenderProps): React.ReactElement;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user