mirror of
https://github.com/divkit/divkit.git
synced 2026-05-07 20:02:32 +00:00
1a7f191e5c
commit_hash:5eeae113d00cd0aeb9aae7937ce441a31e6fea5c
19 lines
501 B
Swift
19 lines
501 B
Swift
import LayoutKit
|
|
|
|
public protocol DivBlockModeling {
|
|
var id: String? { get }
|
|
static var type: String { get }
|
|
func makeBlock(context: DivBlockModelingContext) throws -> Block
|
|
}
|
|
|
|
extension DivBlockModeling {
|
|
func modifiedContextParentPath(_ parentContext: DivBlockModelingContext)
|
|
-> DivBlockModelingContext {
|
|
let currentDivId = parentContext.overridenId ?? id
|
|
return parentContext.modifying(
|
|
currentDivId: currentDivId,
|
|
pathSuffix: currentDivId ?? Self.type
|
|
)
|
|
}
|
|
}
|