using System.Text.Json.Serialization; namespace UndoTree; internal sealed record UndoTreeRecordCommand(string Kind, string Target, string Member, string Detail); internal sealed record UndoTreeRecordNode(int Id, int Parent, string Label, DateTime Time, IReadOnlyList Commands, string Tag = "", bool Saved = false); internal sealed record UndoTreeRecord(DateTime SavedAt, IReadOnlyList Nodes) { [JsonIgnore] public bool HasEdits => Nodes.Count > 1; } internal sealed record UndoTreeRecordFile(int Version, string ProjectPath, UndoTreeRecord? Previous, UndoTreeRecord? Current) { public const int CurrentVersion = 1; [JsonIgnore] public UndoTreeRecord? Latest => Current is { HasEdits: true } ? Current : Previous; } internal sealed record UndoTreeRecordUsage(int Count, long Bytes);