using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; namespace LibMatrix.EventTypes; /// /// Extensible Event Content, aims to provide an API similar to JsonNode/JsonObject /// /// /// public class MatrixEventContent { // : MatrixEventContent where T : MatrixEventContent, new() { internal JsonNode _json = new JsonObject(); public static implicit operator MatrixEventContent(JsonNode json) => new(json); [JsonConstructor] public MatrixEventContent(JsonNode json) { _json = json; } public MatrixEventContent() { } public JsonNode? this[string key] => _json[key]; }