NetNewsWire/Frameworks/Account/FeedProvider/FeedProvider.swift

34 lines
940 B
Swift
Raw Normal View History

2020-04-07 04:06:42 +02:00
//
// FeedProvider.swift
// FeedProvider
//
// Created by Maurice Parker on 4/6/20.
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
//
import Foundation
import RSCore
import RSParser
public enum FeedProviderAbility {
case owner
case available
case none
}
2020-04-07 04:06:42 +02:00
2020-04-07 22:25:33 +02:00
public protocol FeedProvider {
2020-04-07 04:06:42 +02:00
/// Informs the caller of the ability for this feed provider to service the given URL
func ability(_ urlComponents: URLComponents, forUsername: String?) -> FeedProviderAbility
/// Provide the iconURL of the given URL
func iconURL(_ urlComponents: URLComponents, completion: @escaping (Result<String, Error>) -> Void)
2020-04-17 01:00:27 +02:00
/// Construct a Name for the new feed
func assignName(_ urlComponents: URLComponents, completion: @escaping (Result<String, Error>) -> Void)
/// Refresh all the article entries (ParsedItems)
func refresh(_ webFeed: WebFeed, completion: @escaping (Result<Set<ParsedItem>, Error>) -> Void)
2020-04-07 04:06:42 +02:00
}