/* * 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 "AnimatedProps.h" namespace facebook::react { struct AnimatedPropsBuilder { std::vector> props; std::unique_ptr rawProps; void setOpacity(Float value) { props.push_back(std::make_unique>(OPACITY, value)); } void setWidth(yoga::Style::SizeLength value) { props.push_back(std::make_unique>(WIDTH, value)); } void setHeight(yoga::Style::SizeLength value) { props.push_back(std::make_unique>(HEIGHT, value)); } void setBorderRadii(CascadedBorderRadii &value) { props.push_back(std::make_unique>(BORDER_RADII, value)); } void setTransform(Transform &t) { props.push_back(std::make_unique>(TRANSFORM, std::move(t))); } void storeDynamic(folly::dynamic &d) { rawProps = std::make_unique(std::move(d)); } void storeJSI(jsi::Runtime &runtime, jsi::Value &value) { rawProps = std::make_unique(runtime, value); } AnimatedProps get() { return AnimatedProps{std::move(props), std::move(rawProps)}; } }; } // namespace facebook::react