2020-09-23 01:00:56 +00:00
|
|
|
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
|
|
|
|
import Combine
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
public protocol CollectionViewModel {
|
2021-01-26 00:45:18 +00:00
|
|
|
var identityContext: IdentityContext { get }
|
2020-10-07 21:06:26 +00:00
|
|
|
var updates: AnyPublisher<CollectionUpdate, Never> { get }
|
2020-10-05 20:21:06 +00:00
|
|
|
var title: AnyPublisher<String, Never> { get }
|
2020-12-03 01:41:22 +00:00
|
|
|
var titleLocalizationComponents: AnyPublisher<[String], Never> { get }
|
2020-10-14 00:03:01 +00:00
|
|
|
var expandAll: AnyPublisher<ExpandAllState, Never> { get }
|
2020-09-23 01:00:56 +00:00
|
|
|
var alertItems: AnyPublisher<AlertItem, Never> { get }
|
|
|
|
var loading: AnyPublisher<Bool, Never> { get }
|
2020-10-07 00:31:29 +00:00
|
|
|
var events: AnyPublisher<CollectionItemEvent, Never> { get }
|
2021-02-09 01:19:25 +00:00
|
|
|
var searchScopeChanges: AnyPublisher<SearchScope, Never> { get }
|
2020-10-05 22:50:05 +00:00
|
|
|
var nextPageMaxId: String? { get }
|
2021-01-16 20:06:35 +00:00
|
|
|
var canRefresh: Bool { get }
|
2021-02-21 23:00:56 +00:00
|
|
|
var announcesNewItems: Bool { get }
|
2021-01-23 03:48:33 +00:00
|
|
|
func request(maxId: String?, minId: String?, search: Search?)
|
2021-01-25 02:10:41 +00:00
|
|
|
func requestNextPage(fromIndexPath indexPath: IndexPath)
|
2021-03-05 06:16:38 +00:00
|
|
|
func cancelRequests()
|
2020-10-06 23:12:11 +00:00
|
|
|
func viewedAtTop(indexPath: IndexPath)
|
2020-10-05 07:50:59 +00:00
|
|
|
func select(indexPath: IndexPath)
|
|
|
|
func canSelect(indexPath: IndexPath) -> Bool
|
2022-11-27 22:19:44 +00:00
|
|
|
func viewModel(indexPath: IndexPath) -> Any?
|
2020-10-14 00:03:01 +00:00
|
|
|
func toggleExpandAll()
|
2021-01-27 00:15:52 +00:00
|
|
|
func applyAccountListEdit(viewModel: AccountViewModel, edit: CollectionItemEvent.AccountListEdit)
|
2020-09-23 01:00:56 +00:00
|
|
|
}
|