import { Value, block, cond, clockRunning, startClock, stopClock, set, timing, Easing, } from 'react-native-reanimated'; export function runTiming(clock: any, value: any, dest: any): any { const state = { finished: new Value(0), position: new Value(0), time: new Value(0), frameTime: new Value(0), }; const config = { duration: 1200, toValue: new Value(0), easing: Easing.inOut(Easing.ease), }; return block([ cond( clockRunning(clock), [set(config.toValue, dest)], [ set(state.finished, 0), set(state.time, 0), set(state.position, value), set(state.frameTime, 0), set(config.toValue, dest), startClock(clock), ], ), timing(clock, state, config), cond(state.finished, stopClock(clock)), state.position, ]); }