'use strict'; /* This file is a legacy remainder of manual types from react-native-reanimated.d.ts file. I wasn't able to get rid of all of them from the code. They should be treated as a temporary solution until time comes to refactor the code and get necessary types right. This will not be easy though! */ import type { ImageStyle, RegisteredStyle, StyleProp, TextStyle, TransformsStyle, ViewStyle, } from 'react-native'; import type { AnimatableValue, SharedValue } from './commonTypes'; import type { BaseAnimationBuilder } from './layoutReanimation/animationBuilder/BaseAnimationBuilder'; import type { EntryExitAnimationFunction, LayoutAnimationFunction, } from './layoutReanimation/animationBuilder/commonTypes'; import type { ReanimatedKeyframe } from './layoutReanimation/animationBuilder/Keyframe'; import type { SharedTransition } from './layoutReanimation/sharedTransitions'; export type TransformArrayItem = Extract< TransformsStyle['transform'], Array >[number]; export type AnimatedTransform = MaybeSharedValueRecursive< TransformsStyle['transform'] >; type MaybeSharedValue = | Value | (Value extends AnimatableValue ? SharedValue : never); type MaybeSharedValueRecursive = Value extends (infer Item)[] ? SharedValue | (MaybeSharedValueRecursive | Item)[] : Value extends object ? | SharedValue | { [Key in keyof Value]: | MaybeSharedValueRecursive | Value[Key]; } : MaybeSharedValue; type DefaultStyle = ViewStyle & ImageStyle & TextStyle; // Ideally we want AnimatedStyle to not be generic, but there are // so many depenedencies on it being generic that it's not feasible at the moment. export type AnimatedStyle