using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; using ExpandedSearchInfo.Sections; namespace ExpandedSearchInfo.Providers { public interface IProvider { /// /// If this provider is capable of parsing the search info for custom Uris, this should be true. /// /// Note that normal Uris are parsed by the plugin itself, so this can remain false for providers /// that only handle normal Uris. /// bool ExtractsUris { get; } /// /// Determine if this provider should run on the given Uri. /// /// Uri to test /// true if this provider's Extract method should be run for the HTTP response from this Uri bool Matches(Uri uri); /// /// For providers that require Uris, this can return null. /// For providers that don't require Uris, this must return a Uri extracted from the given search info. /// /// The actor ID associated with the search info /// A character's full search info /// null for providers that require Uris, a Uri for providers that don't IEnumerable? ExtractUris(int actorId, string info); /// /// Extract the search info to be displayed given the HTTP response from a Uri. /// /// HTTP response from a Uri /// null if search info could not be extracted or the search info as a string if it could Task ExtractInfo(HttpResponseMessage response); } }