UNPKG

1.56 kBTypeScriptView Raw
1import type { ComponentClass, ComponentType, FunctionComponent } from 'react';
2import '../layoutReanimation/animationsManager';
3import type { AnimateProps } from '../helperTypes';
4import type { AnimatedComponentRef } from './commonTypes';
5import type { FlatList, FlatListProps } from 'react-native';
6type Options<P> = {
7 setNativeProps: (ref: AnimatedComponentRef, props: P) => void;
8};
9/**
10 * Lets you create an Animated version of any React Native component.
11 *
12 * @param component - The component you want to make animatable.
13 * @returns A component that Reanimated is capable of animating.
14 * @see https://docs.swmansion.com/react-native-reanimated/docs/core/createAnimatedComponent
15 */
16export declare function createAnimatedComponent<P extends object>(component: FunctionComponent<P>, options?: Options<P>): FunctionComponent<AnimateProps<P>>;
17export declare function createAnimatedComponent<P extends object>(component: ComponentClass<P>, options?: Options<P>): ComponentClass<AnimateProps<P>>;
18export declare function createAnimatedComponent<P extends object>(component: ComponentType<P>, options?: Options<P>): FunctionComponent<AnimateProps<P>> | ComponentClass<AnimateProps<P>>;
19/**
20 * @deprecated Please use `Animated.FlatList` component instead of calling
21 * `Animated.createAnimatedComponent(FlatList)` manually.
22 */
23export declare function createAnimatedComponent(component: typeof FlatList<unknown>, options?: Options<any>): ComponentClass<AnimateProps<FlatListProps<unknown>>>;
24export {};
25//# sourceMappingURL=createAnimatedComponent.d.ts.map
\No newline at end of file