mirror of
https://github.com/divkit/divkit.git
synced 2026-06-06 20:07:59 +00:00
16 lines
500 B
Swift
16 lines
500 B
Swift
import Serialization
|
|
|
|
public struct RawDivData: Deserializable, @unchecked Sendable {
|
|
public let card: [String: Any]
|
|
public let templates: [String: Any]
|
|
|
|
public init(dictionary: [String: Any]) throws {
|
|
card = try dictionary.getField("card")
|
|
templates = try dictionary.getOptionalField("templates") ?? [:]
|
|
}
|
|
|
|
public func resolve(flagsInfo: DivFlagsInfo = .default) -> DeserializationResult<DivData> {
|
|
DivData.resolve(card: card, templates: templates, flagsInfo: flagsInfo)
|
|
}
|
|
}
|