Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ElementType,
ComponentPropsWithRef,
FluidValue,
} from 'shared'
import { KonvaExports, KonvaElements, elements } from './elements'
type CreateAnimated = (
wrappedComponent: T
) => AnimatedComponent
type KonvaComponents = {
[Tag in KonvaElements]: AnimatedComponent
}
// Extend animated with all the available Konva elements
export const animated: CreateAnimated & KonvaComponents = extendAnimated(
withAnimated,
elements
)
export { animated as a }
/** The type of an `animated()` component */
export type AnimatedComponent<
T extends ElementType
> = ForwardRefExoticComponent>>
/** The props of an `animated()` component */
export type AnimatedProps = {
[P in keyof Props]: (P extends 'ref' | 'key'
? Props[P]
: AnimatedProp)
'Rect',
'RoundedRect',
'Ellipse',
'Polygon',
'Hemisphere',
'Cylinder',
'Cone',
'Box',
]
type CreateAnimated = (
wrappedComponent: T
) => AnimatedComponent
// Extend animated with all the available Zdog elements
export const animated: CreateAnimated & ZdogComponents = extendAnimated(
withAnimated,
elements
)
export { animated as a }
/** The type of an `animated()` component */
export type AnimatedComponent<
T extends ElementType
> = ForwardRefExoticComponent>>
/** The props of an `animated()` component */
export type AnimatedProps = {
[P in keyof Props]: (P extends 'ref' | 'key'
? Props[P]
: AnimatedProp)