* Update copyright holding and dates * compound IDE Macros updated * update copyright * update copyrights done * update templates and README
32 lines
856 B
Swift
32 lines
856 B
Swift
//
|
|
// Copyright 2025 Element Creations Ltd.
|
|
// Copyright 2024-2025 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
// sourcery: AutoMockable
|
|
protocol RoomDirectorySearchProxyProtocol {
|
|
var resultsPublisher: CurrentValuePublisher<[RoomDirectorySearchResult], Never> { get }
|
|
|
|
func search(query: String?) async -> Result<Void, RoomDirectorySearchError>
|
|
func nextPage() async -> Result<Void, RoomDirectorySearchError>
|
|
}
|
|
|
|
enum RoomDirectorySearchError: Error {
|
|
case searchFailed
|
|
case nextPageQueryFailed
|
|
}
|
|
|
|
struct RoomDirectorySearchResult: Identifiable {
|
|
let id: String
|
|
let alias: String?
|
|
let name: String?
|
|
let topic: String?
|
|
let avatar: RoomAvatar
|
|
let canBeJoined: Bool
|
|
}
|