Files
divkit/client/ios/DivKit/generated_sources/DivShapeDrawable.swift
T
pkurchatov 149b80a37f Sendable DivData
commit_hash:ae183ed8d06f2c89c8693f59bedba49752638377
2025-01-16 16:25:07 +03:00

53 lines
1.2 KiB
Swift

// Generated code. Do not modify.
import Foundation
import Serialization
import VGSL
public final class DivShapeDrawable: Sendable {
public static let type: String = "shape_drawable"
public let color: Expression<Color>
public let shape: DivShape
public let stroke: DivStroke?
public func resolveColor(_ resolver: ExpressionResolver) -> Color? {
resolver.resolveColor(color)
}
init(
color: Expression<Color>,
shape: DivShape,
stroke: DivStroke? = nil
) {
self.color = color
self.shape = shape
self.stroke = stroke
}
}
#if DEBUG
extension DivShapeDrawable: Equatable {
public static func ==(lhs: DivShapeDrawable, rhs: DivShapeDrawable) -> Bool {
guard
lhs.color == rhs.color,
lhs.shape == rhs.shape,
lhs.stroke == rhs.stroke
else {
return false
}
return true
}
}
#endif
extension DivShapeDrawable: Serializable {
public func toDictionary() -> [String: ValidSerializationValue] {
var result: [String: ValidSerializationValue] = [:]
result["type"] = Self.type
result["color"] = color.toValidSerializationValue()
result["shape"] = shape.toDictionary()
result["stroke"] = stroke?.toDictionary()
return result
}
}