
using aeqw89.DataKeys;
using HtmlAgilityPack;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Beam.Dynamic {
    public class Binding(DataKey<Binding> key) : IBinding, IKeyed<Binding> {
        public Binding(string key) : this(new DataKey<Binding>(key)) { }
        public Binding() : this("") { }

        [JsonRequired]
        public DataKey<Binding> Key { get; set; } = key;

        public string? XPath { get; set; }
        public string? CssPath { get; set; }
        public string? Text { get; set; }
    }
}
