/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #pragma once #include #include namespace facebook::react { enum PropName { OPACITY, WIDTH, HEIGHT, BORDER_RADII, FLEX, TRANSFORM }; struct AnimatedPropBase { PropName propName; explicit AnimatedPropBase(PropName propName) : propName(propName) {} virtual ~AnimatedPropBase() = default; }; template struct AnimatedProp : AnimatedPropBase { T value; AnimatedProp() = default; AnimatedProp(PropName propName, const T &value) : AnimatedPropBase{propName}, value(std::move(value)) {} }; template T get(const std::unique_ptr &animatedProp) { return static_cast *>(animatedProp.get())->value; } struct AnimatedProps { std::vector> props; std::unique_ptr rawProps; }; } // namespace facebook::react