UNPKG

@ffsm/native-animate

Version:

Simple animation for React Native, only React native and JavaScript

29 lines (28 loc) 1.08 kB
import { ComponentPropsWithRef, ComponentType, Ref } from 'react'; import { EasingFunction } from 'react-native'; import { NativeAnimateOutputs } from './types'; import { UseNativeAnimate } from './use-native-animate'; export type NativeAnimateRef = UseNativeAnimate & { play(): void; }; export type PropsWithNativeAnimate<Props> = (Props extends { style?: any; } ? Props : { style?: any; }) & { nativeAnimate?: NativeAnimateOutputs & { stack?: number[]; auto?: boolean; duration?: number | number[]; delay?: number; loop?: boolean; back?: boolean; backDelay?: number; easing?: EasingFunction; onComplete?(): void; }; animateRef?: Ref<unknown>; }; export declare function withNativeAnimate<Props = {}>(Component: ComponentType<Props>, create?: boolean): import("react").ForwardRefExoticComponent<import("react").PropsWithoutRef<PropsWithNativeAnimate<Props>> & import("react").RefAttributes<ComponentPropsWithRef<ComponentType<Props>> extends { ref: Ref<infer R>; } ? R : unknown>>;