// Copyright © 2020 Metabolist. All rights reserved. import Combine import Foundation public protocol CollectionViewModel { var identityContext: IdentityContext { get } var updates: AnyPublisher { get } var title: AnyPublisher { get } var titleLocalizationComponents: AnyPublisher<[String], Never> { get } var expandAll: AnyPublisher { get } var alertItems: AnyPublisher { get } var loading: AnyPublisher { get } var events: AnyPublisher { get } var searchScopeChanges: AnyPublisher { get } var nextPageMaxId: String? { get } var canRefresh: Bool { get } var announcesNewItems: Bool { get } func request(maxId: String?, minId: String?, search: Search?) func requestNextPage(fromIndexPath indexPath: IndexPath) func cancelRequests() func viewedAtTop(indexPath: IndexPath) func select(indexPath: IndexPath) func canSelect(indexPath: IndexPath) -> Bool func viewModel(indexPath: IndexPath) -> Any? func toggleExpandAll() func applyAccountListEdit(viewModel: AccountViewModel, edit: CollectionItemEvent.AccountListEdit) }