/* * 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 { using BackgroundImage = std::variant; #ifdef RN_SERIALIZABLE_STATE folly::dynamic toDynamic(const BackgroundImage &backgroundImage); #endif #if RN_DEBUG_STRING_CONVERTIBLE inline std::string toString(std::vector &value) { std::stringstream ss; ss << "["; for (size_t i = 0; i < value.size(); i++) { if (i > 0) { ss << ", "; } const auto &backgroundImage = value[i]; if (std::holds_alternative(backgroundImage)) { std::get(backgroundImage).toString(ss); } else if (std::holds_alternative(backgroundImage)) { std::get(backgroundImage).toString(ss); } } ss << "]"; return ss.str(); } #endif }; // namespace facebook::react