using Beam.Models;

namespace Beam {
    internal interface IDocumentSourceLinkFactory {
        string GetNextLink(string current);
        string GetPrecedingLink(string current);
        string GetArbitraryLink(string current, int offset) => offset switch {
            0 => current,
            > 0 => GetArbitraryLink(GetNextLink(current), offset - 1),
            < 0 => GetArbitraryLink(GetPrecedingLink(current), offset + 1)
        };
    }
}
