Files
letro-ios/ElementX/Sources/Other/HTMLParsing/AttributedStringBuilderProtocol.swift
Stefan Ceriu ba245aa3bb Fix vector-im/element-x-ios/issues/134 - Prevent home screen room last message attributed string from being computed on every update
Add async/await methods to the AttributedStringBuilder and adopt them throughout the app
2022-07-22 10:25:17 +03:00

25 lines
734 B
Swift

//
// AttributedStringBuilderProtocol.swift
// ElementX
//
// Created by Stefan Ceriu on 24/03/2022.
// Copyright © 2022 Element. All rights reserved.
//
import Foundation
struct AttributedStringBuilderComponent: Hashable {
let attributedString: AttributedString
let isBlockquote: Bool
}
protocol AttributedStringBuilderProtocol {
func fromPlain(_ string: String?) -> AttributedString?
func fromPlain(_ string: String?) async -> AttributedString?
func fromHTML(_ htmlString: String?) -> AttributedString?
func fromHTML(_ htmlString: String?) async -> AttributedString?
func blockquoteCoalescedComponentsFrom(_ attributedString: AttributedString?) -> [AttributedStringBuilderComponent]?
}