|
| 1 | +import { NumberFlowLite, Value, Format } from 'number-flow'; |
| 2 | +import * as React from 'react'; |
| 3 | +export { Format, Trend, Value } from 'number-flow'; |
| 4 | + |
| 5 | +declare const OBSERVED_ATTRIBUTES: readonly ['parts']; |
| 6 | +type ObservedAttribute = (typeof OBSERVED_ATTRIBUTES)[number]; |
| 7 | +declare class NumberFlowElement extends NumberFlowLite { |
| 8 | + static observedAttributes: readonly ['parts']; |
| 9 | + attributeChangedCallback( |
| 10 | + attr: ObservedAttribute, |
| 11 | + _oldValue: string, |
| 12 | + newValue: string, |
| 13 | + ): void; |
| 14 | +} |
| 15 | +type NumberFlowProps = React.HTMLAttributes<NumberFlowElement> & { |
| 16 | + value: Value; |
| 17 | + locales?: Intl.LocalesArgument; |
| 18 | + format?: Format; |
| 19 | + isolate?: boolean; |
| 20 | + animated?: boolean; |
| 21 | + respectMotionPreference?: boolean; |
| 22 | + willChange?: boolean; |
| 23 | + onAnimationsStart?: () => void; |
| 24 | + onAnimationsFinish?: () => void; |
| 25 | + trend?: (typeof NumberFlowElement)['prototype']['trend']; |
| 26 | + opacityTiming?: (typeof NumberFlowElement)['prototype']['opacityTiming']; |
| 27 | + transformTiming?: (typeof NumberFlowElement)['prototype']['transformTiming']; |
| 28 | + spinTiming?: (typeof NumberFlowElement)['prototype']['spinTiming']; |
| 29 | +}; |
| 30 | +declare const NumberFlow: ( |
| 31 | + options: React.HTMLAttributes<NumberFlowElement> & { |
| 32 | + value: Value; |
| 33 | + locales?: Intl.LocalesArgument; |
| 34 | + format?: Format; |
| 35 | + isolate?: boolean; |
| 36 | + animated?: boolean; |
| 37 | + respectMotionPreference?: boolean; |
| 38 | + willChange?: boolean; |
| 39 | + onAnimationsStart?: () => void; |
| 40 | + onAnimationsFinish?: () => void; |
| 41 | + trend?: (typeof NumberFlowElement)['prototype']['trend']; |
| 42 | + opacityTiming?: (typeof NumberFlowElement)['prototype']['opacityTiming']; |
| 43 | + transformTiming?: (typeof NumberFlowElement)['prototype']['transformTiming']; |
| 44 | + spinTiming?: (typeof NumberFlowElement)['prototype']['spinTiming']; |
| 45 | + } & React.RefAttributes<NumberFlowElement>, |
| 46 | +) => JSX.Element; |
| 47 | + |
| 48 | +declare function useCanAnimate({ |
| 49 | + respectMotionPreference, |
| 50 | +}?: { |
| 51 | + respectMotionPreference?: boolean | undefined; |
| 52 | +}): boolean; |
| 53 | + |
| 54 | +export { |
| 55 | + NumberFlowElement, |
| 56 | + type NumberFlowProps, |
| 57 | + NumberFlow as default, |
| 58 | + useCanAnimate, |
| 59 | +}; |
0 commit comments