All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yandex.div.dsl.context.Templates.kt Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 30.19.0
Show newest version
package com.yandex.div.dsl.context

import com.yandex.div.dsl.Property
import com.yandex.div.dsl.ReferenceProperty
import com.yandex.div.dsl.ValueProperty
import com.yandex.div.dsl.value

sealed class TemplateBinding

class PropertyOverriding internal constructor(
    val name: String,
    val property: Property
) : TemplateBinding()

fun  TemplateContext<*>.override(name: String, property: Property): PropertyOverriding {
    return PropertyOverriding(name, property)
}

fun  TemplateContext<*>.override(name: String, value: T): PropertyOverriding {
    return PropertyOverriding(name, value(value))
}

fun  CardContext.override(name: String, property: ValueProperty): PropertyOverriding {
    return PropertyOverriding(name, property)
}

fun  CardContext.override(name: String, value: T): PropertyOverriding {
    return PropertyOverriding(name, value(value))
}

class ReferenceResolving internal constructor(
    val reference: ReferenceProperty,
    val property: ValueProperty
) : TemplateBinding()

fun  CardContext.resolve(reference: ReferenceProperty, property: ValueProperty): ReferenceResolving {
    return ReferenceResolving(reference, property)
}

fun  CardContext.resolve(reference: ReferenceProperty, value: T): ReferenceResolving {
    return ReferenceResolving(reference, value(value))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy