divkit.dsl.DivanPatch.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-json-builder Show documentation
Show all versions of kotlin-json-builder Show documentation
DivKit is an open source Server-Driven UI (SDUI) framework. SDUI is a an emerging technique that leverage the server to build the user interfaces of their mobile app.
package divkit.dsl
import com.fasterxml.jackson.annotation.JsonIgnore
import divkit.dsl.core.Supplement
import divkit.dsl.core.SupplementKey
import divkit.dsl.scope.DivScope
import kotlin.String
import kotlin.collections.Map
class DivanPatch internal constructor(
val patch: Patch,
val templates: Map,
@JsonIgnore
val supplements: Map, Supplement>,
)
fun divanPatch(init: DivScope.() -> Patch): DivanPatch {
val scope = DivScope()
val patch = init.invoke(scope)
return DivanPatch(
patch = patch,
templates = scope.templates.mapValues { (_, template) -> template.div },
supplements = scope.supplements
)
}