UNPKG

react-native-reanimated

Version:

More powerful alternative to Animated library for React Native.

101 lines (82 loc) 2.4 kB
'use strict'; import type { ShadowNodeWrapper, StyleProps } from '../../commonTypes'; import { ReanimatedModule } from '../../ReanimatedModule'; import type { CSSEventHandler } from './events'; import type { CSSAnimationUpdates, CSSPseudoStyleConfig, CSSTransitionConfig, NormalizedCSSAnimationKeyframesConfig, } from './types'; // COMMON export function setViewStyle(viewTag: number, style: StyleProps) { ReanimatedModule.setViewStyle(viewTag, style); } // EVENTS export function setCSSEventHandler(handler: CSSEventHandler) { ReanimatedModule.setCSSEventHandler(handler); } export function markNodeAsRemovable(shadowNodeWrapper: ShadowNodeWrapper) { ReanimatedModule.markNodeAsRemovable(shadowNodeWrapper); } export function unmarkNodeAsRemovable(viewTag: number) { ReanimatedModule.unmarkNodeAsRemovable(viewTag); } // ANIMATIONS // Keyframes export function registerCSSKeyframes( animationName: string, compoundComponentName: string, keyframesConfig: NormalizedCSSAnimationKeyframesConfig ) { ReanimatedModule.registerCSSKeyframes( animationName, compoundComponentName, keyframesConfig ); } export function unregisterCSSKeyframes( animationName: string, compoundComponentName: string ) { ReanimatedModule.unregisterCSSKeyframes(animationName, compoundComponentName); } // View animations export function applyCSSAnimations( shadowNodeWrapper: ShadowNodeWrapper, compoundComponentName: string, animationUpdates: CSSAnimationUpdates ) { ReanimatedModule.applyCSSAnimations( shadowNodeWrapper, compoundComponentName, animationUpdates ); } export function unregisterCSSAnimations(viewTag: number) { ReanimatedModule.unregisterCSSAnimations(viewTag); } // TRANSITIONS export function runCSSTransition( shadowNodeWrapper: ShadowNodeWrapper, transitionConfig: CSSTransitionConfig, eventMask: number ) { ReanimatedModule.runCSSTransition( shadowNodeWrapper, transitionConfig, eventMask ); } export function unregisterCSSTransition(viewTag: number) { ReanimatedModule.unregisterCSSTransition(viewTag); } export function registerPseudoStyles( shadowNodeWrapper: ShadowNodeWrapper, config: CSSPseudoStyleConfig ) { ReanimatedModule.registerPseudoStyles(shadowNodeWrapper, config); } export function unregisterPseudoStyles(viewTag: number) { ReanimatedModule.unregisterPseudoStyles(viewTag); }