using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
namespace Elsa.Common.Contracts;
///
/// Provides JSON serialization services.
///
public interface IJsonSerializer
{
///
/// Returns the serializer options.
///
JsonSerializerOptions GetOptions();
///
/// Applies the specified options.
///
void ApplyOptions(JsonSerializerOptions options);
///
/// Serializes the specified value.
///
[RequiresUnreferencedCode("The type is not known at compile time.")]
string Serialize(object value);
///
/// Serializes the specified value.
///
[RequiresUnreferencedCode("The type is not known at compile time.")]
string Serialize(object value, Type type);
///
/// Deserializes the specified JSON.
///
[RequiresUnreferencedCode("The type is not known at compile time.")]
object Deserialize(string json);
///
/// Deserializes the specified JSON.
///
[RequiresUnreferencedCode("The type is not known at compile time.")]
object Deserialize(string json, Type type);
}