generate sealed interfaces for entity enumerations

generate sealed interfaces for entity enumerations
This commit is contained in:
gulevsky
2022-11-08 16:16:33 +03:00
parent abf3e7becc
commit 7d0ddd3389
97 changed files with 1468 additions and 378 deletions
@@ -68,7 +68,7 @@ class KotlinDSLGenerator(Generator):
def __body_declaration(self, entity: KotlinDSLEntity) -> Text:
result = Text()
if entity.enclosing_enumeration is not None:
if entity.enclosing_enumerations:
static_type = entity.static_type
if static_type is not None:
result += EMPTY
@@ -116,8 +116,8 @@ class KotlinDSLGenerator(Generator):
result = Text()
for annotation in self.kotlin_annotations:
result += annotation
result += f'sealed class {entity_enumeration.enumeration_name}{entity_enumeration.supertype_declaration} {{'
result += ' abstract val type: String'
result += f'sealed interface {entity_enumeration.enumeration_name}{entity_enumeration.supertype_declaration} {{'
result += ' val type: String'
result += '}'
result += EMPTY
if entity_enumeration.generate_case_for_templates:
@@ -83,9 +83,8 @@ class KotlinDSLEntity(Entity):
@property
def supertype_declaration(self) -> str:
supertypes = []
enumeration = self.enclosing_enumeration
if enumeration is not None:
supertypes.append(f'{utils.capitalize_camel_case(enumeration.name)}()')
for enumeration in self.enclosing_enumerations:
supertypes.append(f'{utils.capitalize_camel_case(enumeration.name)}')
if self.root_entity:
supertypes.append('Root')
additional_supertypes = self.protocol_plus_super_entities
@@ -377,7 +376,7 @@ class KotlinDSLEntityEnumeration(EntityEnumeration):
result += f'private class {self.template_case_name} constructor('
result += ' @JsonProperty(\"type\") override val type: String,'
result += ' @JsonIgnore val bindings: Array<out TemplateBinding<*>>'
result += f') : {self.enumeration_name}() {{'
result += f') : {self.enumeration_name} {{'
result += EMPTY
result += ' @JsonAnyGetter'
result += ' fun properties(): Map<String, Any> {'
@@ -389,7 +388,7 @@ class KotlinDSLEntityEnumeration(EntityEnumeration):
result += ' type: String,'
result += ' vararg bindings: PropertyOverriding<*>'
result += f'): LiteralProperty<{self.enumeration_name}> {{'
result += f' return LiteralProperty{self.template_case_name}(type, bindings))'
result += f' return LiteralProperty({self.template_case_name}(type, bindings))'
result += '}'
result += EMPTY
result += 'fun CardContext.template('
@@ -278,8 +278,8 @@ class Entity(Declarable):
return self._implemented_protocol
@property
def enclosing_enumeration(self) -> Optional[EntityEnumeration]:
return self._enclosing_enumeration
def enclosing_enumerations(self) -> List[EntityEnumeration]:
return self._enclosing_enumerations
@property
def inner_types(self) -> List[Declarable]:
@@ -344,15 +344,14 @@ class Entity(Declarable):
None)
if self._lang is GeneratedLanguage.KOTLIN_DSL:
self._enclosing_enumeration = None
self._enclosing_enumerations = list()
for enumeration in global_objects:
valid_enumeration = False
if isinstance(enumeration, EntityEnumeration):
valid_names = [self._name, self._resolved_name, self._original_name]
valid_enumeration = any(ent[0] in valid_names for ent in enumeration.entities)
if valid_enumeration:
self._enclosing_enumeration = enumeration
break
self._enclosing_enumerations.append(enumeration)
def check_dependencies_resolved(self, location: ElementLocation, stack: List[Declarable]) -> None:
if self in stack:
@@ -9,6 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class Entity {
abstract val type: String
sealed interface Entity {
val type: String
}
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithArray internal constructor(
@JsonIgnore val array: Property<List<Entity>>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_array"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithArrayOfEnums internal constructor(
@JsonIgnore val items: Property<List<Item>>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_array_of_enums"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithArrayOfExpressions internal constructor(
@JsonIgnore val items: Property<List<String>>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_array_of_expressions"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithArrayOfNestedItems internal constructor(
@JsonIgnore val items: Property<List<Item>>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_array_of_nested_items"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithArrayWithTransform internal constructor(
@JsonIgnore val array: Property<List<Color>>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_array_with_transform"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithComplexProperty internal constructor(
@JsonIgnore val property: Property<Property>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_complex_property"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithComplexPropertyWithDefaultValue internal constructor(
@JsonIgnore val property: Property<Property>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_complex_property_with_default_value"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithEntityProperty internal constructor(
@JsonIgnore val entity: Property<Entity>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_entity_property"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithOptionalComplexProperty internal constructor(
@JsonIgnore val property: Property<Property>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_optional_complex_property"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithOptionalProperty internal constructor(
@JsonIgnore val property: Property<String>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_optional_property"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithOptionalStringEnumProperty internal constructor(
@JsonIgnore val property: Property<Property>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_optional_string_enum_property"
@@ -13,7 +13,7 @@ class EntityWithPropertyWithDefaultValue internal constructor(
@JsonIgnore val int: Property<Int>?,
@JsonIgnore val nested: Property<Nested>?,
@JsonIgnore val url: Property<URI>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_property_with_default_value"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithRequiredProperty internal constructor(
@JsonIgnore val property: Property<String>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_required_property"
@@ -19,7 +19,7 @@ class EntityWithSimpleProperties internal constructor(
@JsonIgnore val positiveInteger: Property<Int>?,
@JsonIgnore val string: Property<String>?,
@JsonIgnore val url: Property<URI>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_simple_properties"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithStrictArray internal constructor(
@JsonIgnore val array: Property<List<Entity>>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_strict_array"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithStringArrayProperty internal constructor(
@JsonIgnore val array: Property<List<String>>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_string_array_property"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithStringEnumProperty internal constructor(
@JsonIgnore val property: Property<Property>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_string_enum_property"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class EntityWithStringEnumPropertyWithDefaultValue internal constructor(
@JsonIgnore val value: Property<Value>?,
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_with_string_enum_property_with_default_value"
@@ -10,7 +10,7 @@ import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class EntityWithoutProperties internal constructor(
) : Entity() {
) : Entity {
@JsonProperty("type") override val type = "entity_without_properties"
}
+16 -7
View File
@@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20"
}
}
@@ -19,13 +19,22 @@ sourceSets {
}
}
def versions = [
jackson: "2.14.0",
jsonAssert: "1.5.1",
junit5: "5.9.1",
kotlin: "1.7.20"
]
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.10'
implementation "org.jetbrains.kotlin:kotlin-reflect:1.7.10"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$versions.kotlin"
implementation "org.jetbrains.kotlin:kotlin-reflect:$versions.kotlin"
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.2.2'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.13.2'
implementation "com.fasterxml.jackson.core:jackson-annotations:$versions.jackson"
implementation "com.fasterxml.jackson.core:jackson-databind:$versions.jackson"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$versions.jackson"
testImplementation 'junit:junit:4.12'
testImplementation "org.junit.jupiter:junit-jupiter-api:$versions.junit5"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$versions.junit5"
testImplementation "org.skyscreamer:jsonassert:$versions.jsonAssert"
}
@@ -1,102 +0,0 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class ActionBase internal constructor(
@JsonIgnore val logId: Property<String>?,
@JsonIgnore val payload: Property<Map<String, Any>>?,
@JsonIgnore val referer: Property<URI>?,
@JsonIgnore val url: Property<URI>?,
) {
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"log_id" to logId,
"payload" to payload,
"referer" to referer,
"url" to url,
)
}
}
fun <T> TemplateContext<T>.actionBase(): LiteralProperty<ActionBase> {
return value(ActionBase(
logId = null,
payload = null,
referer = null,
url = null,
))
}
fun <T> TemplateContext<T>.actionBase(
logId: Property<String>? = null,
payload: Property<Map<String, Any>>? = null,
referer: Property<URI>? = null,
url: Property<URI>? = null,
): LiteralProperty<ActionBase> {
return value(ActionBase(
logId = logId,
payload = payload,
referer = referer,
url = url,
))
}
fun <T> TemplateContext<T>.actionBase(
logId: String? = null,
payload: Map<String, Any>? = null,
referer: URI? = null,
url: URI? = null,
): LiteralProperty<ActionBase> {
return value(ActionBase(
logId = optionalValue(logId),
payload = optionalValue(payload),
referer = optionalValue(referer),
url = optionalValue(url),
))
}
fun CardContext.actionBase(): ActionBase {
return ActionBase(
logId = null,
payload = null,
referer = null,
url = null,
)
}
fun CardContext.actionBase(
logId: ValueProperty<String>? = null,
payload: ValueProperty<Map<String, Any>>? = null,
referer: ValueProperty<URI>? = null,
url: ValueProperty<URI>? = null,
): ActionBase {
return ActionBase(
logId = logId,
payload = payload,
referer = referer,
url = url,
)
}
fun CardContext.actionBase(
logId: String? = null,
payload: Map<String, Any>? = null,
referer: URI? = null,
url: URI? = null,
): ActionBase {
return ActionBase(
logId = optionalValue(logId),
payload = optionalValue(payload),
referer = optionalValue(referer),
url = optionalValue(url),
)
}
@@ -9,12 +9,12 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class BoolIntVariable internal constructor(
class BooleanVariable internal constructor(
@JsonIgnore val name: Property<String>?,
@JsonIgnore val value: Property<BoolInt>?,
) : DivVariable() {
) : DivVariable {
@JsonProperty("type") override val type = "bool_int"
@JsonProperty("type") override val type = "boolean"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
@@ -25,48 +25,48 @@ class BoolIntVariable internal constructor(
}
}
fun <T> TemplateContext<T>.boolIntVariable(): LiteralProperty<BoolIntVariable> {
return value(BoolIntVariable(
fun <T> TemplateContext<T>.booleanVariable(): LiteralProperty<BooleanVariable> {
return value(BooleanVariable(
name = null,
value = null,
))
}
fun <T> TemplateContext<T>.boolIntVariable(
fun <T> TemplateContext<T>.booleanVariable(
name: Property<String>? = null,
value: Property<BoolInt>? = null,
): LiteralProperty<BoolIntVariable> {
return value(BoolIntVariable(
): LiteralProperty<BooleanVariable> {
return value(BooleanVariable(
name = name,
value = value,
))
}
fun <T> TemplateContext<T>.boolIntVariable(
fun <T> TemplateContext<T>.booleanVariable(
name: String? = null,
value: BoolInt? = null,
): LiteralProperty<BoolIntVariable> {
return value(BoolIntVariable(
): LiteralProperty<BooleanVariable> {
return value(BooleanVariable(
name = optionalValue(name),
value = optionalValue(value),
))
}
fun CardContext.boolIntVariable(
fun CardContext.booleanVariable(
name: ValueProperty<String>,
value: ValueProperty<BoolInt>,
): BoolIntVariable {
return BoolIntVariable(
): BooleanVariable {
return BooleanVariable(
name = name,
value = value,
)
}
fun CardContext.boolIntVariable(
fun CardContext.booleanVariable(
name: String,
value: BoolInt,
): BoolIntVariable {
return BoolIntVariable(
): BooleanVariable {
return BooleanVariable(
name = value(name),
value = value(value),
)
@@ -12,7 +12,7 @@ import com.yandex.div.dsl.util.*
class ColorVariable internal constructor(
@JsonIgnore val name: Property<String>?,
@JsonIgnore val value: Property<Color>?,
) : DivVariable() {
) : DivVariable {
@JsonProperty("type") override val type = "color"
@@ -9,14 +9,14 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class Div {
abstract val type: String
sealed interface Div {
val type: String
}
private class TemplatedDiv constructor(
@JsonProperty("type") override val type: String,
@JsonIgnore val bindings: Array<out TemplateBinding<*>>
) : Div() {
) : Div {
@JsonAnyGetter
fun properties(): Map<String, Any> {
@@ -0,0 +1,102 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivAbsoluteEdgeInsets internal constructor(
@JsonIgnore val bottom: Property<Int>?,
@JsonIgnore val left: Property<Int>?,
@JsonIgnore val right: Property<Int>?,
@JsonIgnore val top: Property<Int>?,
) {
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"bottom" to bottom,
"left" to left,
"right" to right,
"top" to top,
)
}
}
fun <T> TemplateContext<T>.divAbsoluteEdgeInsets(): LiteralProperty<DivAbsoluteEdgeInsets> {
return value(DivAbsoluteEdgeInsets(
bottom = null,
left = null,
right = null,
top = null,
))
}
fun <T> TemplateContext<T>.divAbsoluteEdgeInsets(
bottom: Property<Int>? = null,
left: Property<Int>? = null,
right: Property<Int>? = null,
top: Property<Int>? = null,
): LiteralProperty<DivAbsoluteEdgeInsets> {
return value(DivAbsoluteEdgeInsets(
bottom = bottom,
left = left,
right = right,
top = top,
))
}
fun <T> TemplateContext<T>.divAbsoluteEdgeInsets(
bottom: Int? = null,
left: Int? = null,
right: Int? = null,
top: Int? = null,
): LiteralProperty<DivAbsoluteEdgeInsets> {
return value(DivAbsoluteEdgeInsets(
bottom = optionalValue(bottom),
left = optionalValue(left),
right = optionalValue(right),
top = optionalValue(top),
))
}
fun CardContext.divAbsoluteEdgeInsets(): DivAbsoluteEdgeInsets {
return DivAbsoluteEdgeInsets(
bottom = null,
left = null,
right = null,
top = null,
)
}
fun CardContext.divAbsoluteEdgeInsets(
bottom: ValueProperty<Int>? = null,
left: ValueProperty<Int>? = null,
right: ValueProperty<Int>? = null,
top: ValueProperty<Int>? = null,
): DivAbsoluteEdgeInsets {
return DivAbsoluteEdgeInsets(
bottom = bottom,
left = left,
right = right,
top = top,
)
}
fun CardContext.divAbsoluteEdgeInsets(
bottom: Int? = null,
left: Int? = null,
right: Int? = null,
top: Int? = null,
): DivAbsoluteEdgeInsets {
return DivAbsoluteEdgeInsets(
bottom = optionalValue(bottom),
left = optionalValue(left),
right = optionalValue(right),
top = optionalValue(top),
)
}
@@ -13,6 +13,7 @@ class DivAccessibility internal constructor(
@JsonIgnore val description: Property<String>?,
@JsonIgnore val hint: Property<String>?,
@JsonIgnore val mode: Property<Mode>?,
@JsonIgnore val muteAfterAction: Property<BoolInt>?,
@JsonIgnore val stateDescription: Property<String>?,
@JsonIgnore val type: Property<Type>?,
) {
@@ -23,6 +24,7 @@ class DivAccessibility internal constructor(
"description" to description,
"hint" to hint,
"mode" to mode,
"mute_after_action" to muteAfterAction,
"state_description" to stateDescription,
"type" to type,
)
@@ -50,6 +52,7 @@ fun <T> TemplateContext<T>.divAccessibility(): LiteralProperty<DivAccessibility>
description = null,
hint = null,
mode = null,
muteAfterAction = null,
stateDescription = null,
type = null,
))
@@ -59,6 +62,7 @@ fun <T> TemplateContext<T>.divAccessibility(
description: Property<String>? = null,
hint: Property<String>? = null,
mode: Property<DivAccessibility.Mode>? = null,
muteAfterAction: Property<BoolInt>? = null,
stateDescription: Property<String>? = null,
type: Property<DivAccessibility.Type>? = null,
): LiteralProperty<DivAccessibility> {
@@ -66,6 +70,7 @@ fun <T> TemplateContext<T>.divAccessibility(
description = description,
hint = hint,
mode = mode,
muteAfterAction = muteAfterAction,
stateDescription = stateDescription,
type = type,
))
@@ -75,6 +80,7 @@ fun <T> TemplateContext<T>.divAccessibility(
description: String? = null,
hint: String? = null,
mode: DivAccessibility.Mode? = null,
muteAfterAction: BoolInt? = null,
stateDescription: String? = null,
type: DivAccessibility.Type? = null,
): LiteralProperty<DivAccessibility> {
@@ -82,6 +88,7 @@ fun <T> TemplateContext<T>.divAccessibility(
description = optionalValue(description),
hint = optionalValue(hint),
mode = optionalValue(mode),
muteAfterAction = optionalValue(muteAfterAction),
stateDescription = optionalValue(stateDescription),
type = optionalValue(type),
))
@@ -92,6 +99,7 @@ fun CardContext.divAccessibility(): DivAccessibility {
description = null,
hint = null,
mode = null,
muteAfterAction = null,
stateDescription = null,
type = null,
)
@@ -101,6 +109,7 @@ fun CardContext.divAccessibility(
description: ValueProperty<String>? = null,
hint: ValueProperty<String>? = null,
mode: ValueProperty<DivAccessibility.Mode>? = null,
muteAfterAction: ValueProperty<BoolInt>? = null,
stateDescription: ValueProperty<String>? = null,
type: ValueProperty<DivAccessibility.Type>? = null,
): DivAccessibility {
@@ -108,6 +117,7 @@ fun CardContext.divAccessibility(
description = description,
hint = hint,
mode = mode,
muteAfterAction = muteAfterAction,
stateDescription = stateDescription,
type = type,
)
@@ -117,6 +127,7 @@ fun CardContext.divAccessibility(
description: String? = null,
hint: String? = null,
mode: DivAccessibility.Mode? = null,
muteAfterAction: BoolInt? = null,
stateDescription: String? = null,
type: DivAccessibility.Type? = null,
): DivAccessibility {
@@ -124,6 +135,7 @@ fun CardContext.divAccessibility(
description = optionalValue(description),
hint = optionalValue(hint),
mode = optionalValue(mode),
muteAfterAction = optionalValue(muteAfterAction),
stateDescription = optionalValue(stateDescription),
type = optionalValue(type),
)
@@ -10,8 +10,7 @@ import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivAction internal constructor(
@JsonIgnore val downloadCallbacks: Property<DownloadCallbacks>?,
@JsonIgnore val hover: Property<DivHover>?,
@JsonIgnore val downloadCallbacks: Property<DivDownloadCallbacks>?,
@JsonIgnore val logId: Property<String>?,
@JsonIgnore val logUrl: Property<URI>?,
@JsonIgnore val menuItems: Property<List<MenuItem>>?,
@@ -25,7 +24,6 @@ class DivAction internal constructor(
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"download_callbacks" to downloadCallbacks,
"hover" to hover,
"log_id" to logId,
"log_url" to logUrl,
"menu_items" to menuItems,
@@ -61,7 +59,6 @@ class DivAction internal constructor(
fun <T> TemplateContext<T>.divAction(): LiteralProperty<DivAction> {
return value(DivAction(
downloadCallbacks = null,
hover = null,
logId = null,
logUrl = null,
menuItems = null,
@@ -74,8 +71,7 @@ fun <T> TemplateContext<T>.divAction(): LiteralProperty<DivAction> {
fun <T> TemplateContext<T>.divAction(
logId: Property<String>? = null,
downloadCallbacks: Property<DownloadCallbacks>? = null,
hover: Property<DivHover>? = null,
downloadCallbacks: Property<DivDownloadCallbacks>? = null,
logUrl: Property<URI>? = null,
menuItems: Property<List<DivAction.MenuItem>>? = null,
payload: Property<Map<String, Any>>? = null,
@@ -85,7 +81,6 @@ fun <T> TemplateContext<T>.divAction(
): LiteralProperty<DivAction> {
return value(DivAction(
downloadCallbacks = downloadCallbacks,
hover = hover,
logId = logId,
logUrl = logUrl,
menuItems = menuItems,
@@ -98,8 +93,7 @@ fun <T> TemplateContext<T>.divAction(
fun <T> TemplateContext<T>.divAction(
logId: String? = null,
downloadCallbacks: DownloadCallbacks? = null,
hover: DivHover? = null,
downloadCallbacks: DivDownloadCallbacks? = null,
logUrl: URI? = null,
menuItems: List<DivAction.MenuItem>? = null,
payload: Map<String, Any>? = null,
@@ -109,7 +103,6 @@ fun <T> TemplateContext<T>.divAction(
): LiteralProperty<DivAction> {
return value(DivAction(
downloadCallbacks = optionalValue(downloadCallbacks),
hover = optionalValue(hover),
logId = optionalValue(logId),
logUrl = optionalValue(logUrl),
menuItems = optionalValue(menuItems),
@@ -154,8 +147,7 @@ fun <T> TemplateContext<T>.menuItem(
fun CardContext.divAction(
logId: ValueProperty<String>,
downloadCallbacks: ValueProperty<DownloadCallbacks>? = null,
hover: ValueProperty<DivHover>? = null,
downloadCallbacks: ValueProperty<DivDownloadCallbacks>? = null,
logUrl: ValueProperty<URI>? = null,
menuItems: ValueProperty<List<DivAction.MenuItem>>? = null,
payload: ValueProperty<Map<String, Any>>? = null,
@@ -165,7 +157,6 @@ fun CardContext.divAction(
): DivAction {
return DivAction(
downloadCallbacks = downloadCallbacks,
hover = hover,
logId = logId,
logUrl = logUrl,
menuItems = menuItems,
@@ -178,8 +169,7 @@ fun CardContext.divAction(
fun CardContext.divAction(
logId: String,
downloadCallbacks: DownloadCallbacks? = null,
hover: DivHover? = null,
downloadCallbacks: DivDownloadCallbacks? = null,
logUrl: URI? = null,
menuItems: List<DivAction.MenuItem>? = null,
payload: Map<String, Any>? = null,
@@ -189,7 +179,6 @@ fun CardContext.divAction(
): DivAction {
return DivAction(
downloadCallbacks = optionalValue(downloadCallbacks),
hover = optionalValue(hover),
logId = value(logId),
logUrl = optionalValue(logUrl),
menuItems = optionalValue(menuItems),
@@ -13,4 +13,5 @@ enum class DivAlignmentVertical(@JsonValue val value: String) {
TOP("top"),
CENTER("center"),
BOTTOM("bottom"),
BASELINE("baseline"),
}
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class DivAppearanceSetTransition internal constructor(
@JsonIgnore val items: Property<List<DivAppearanceTransition>>?,
) : DivAppearanceTransition() {
) : DivAppearanceTransition {
@JsonProperty("type") override val type = "set"
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivAppearanceTransition {
abstract val type: String
sealed interface DivAppearanceTransition {
val type: String
}
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivBackground {
abstract val type: String
sealed interface DivBackground {
val type: String
}
@@ -26,6 +26,7 @@ interface DivBase {
val rowSpan: Property<Int>?
val selectedActions: Property<List<DivAction>>?
val tooltips: Property<List<DivTooltip>>?
val transform: Property<DivTransform>?
val transitionChange: Property<DivChangeTransition>?
val transitionIn: Property<DivAppearanceTransition>?
val transitionOut: Property<DivAppearanceTransition>?
@@ -0,0 +1,19 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
enum class DivBlendMode(@JsonValue val value: String) {
SOURCE_IN("source_in"),
SOURCE_ATOP("source_atop"),
DARKEN("darken"),
LIGHTEN("lighten"),
MULTIPLY("multiply"),
SCREEN("screen"),
}
@@ -0,0 +1,62 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivBlur internal constructor(
@JsonIgnore val radius: Property<Int>?,
) : DivFilter {
@JsonProperty("type") override val type = "blur"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"radius" to radius,
)
}
}
fun <T> TemplateContext<T>.divBlur(): LiteralProperty<DivBlur> {
return value(DivBlur(
radius = null,
))
}
fun <T> TemplateContext<T>.divBlur(
radius: Property<Int>? = null,
): LiteralProperty<DivBlur> {
return value(DivBlur(
radius = radius,
))
}
fun <T> TemplateContext<T>.divBlur(
radius: Int? = null,
): LiteralProperty<DivBlur> {
return value(DivBlur(
radius = optionalValue(radius),
))
}
fun CardContext.divBlur(
radius: ValueProperty<Int>,
): DivBlur {
return DivBlur(
radius = radius,
)
}
fun CardContext.divBlur(
radius: Int,
): DivBlur {
return DivBlur(
radius = value(radius),
)
}
@@ -13,7 +13,7 @@ class DivChangeBoundsTransition internal constructor(
@JsonIgnore override val duration: Property<Int>?,
@JsonIgnore override val interpolator: Property<DivAnimationInterpolator>?,
@JsonIgnore override val startDelay: Property<Int>?,
) : DivChangeTransition(), DivTransitionBase {
) : DivChangeTransition, DivTransitionBase {
@JsonProperty("type") override val type = "change_bounds"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class DivChangeSetTransition internal constructor(
@JsonIgnore val items: Property<List<DivChangeTransition>>?,
) : DivChangeTransition() {
) : DivChangeTransition {
@JsonProperty("type") override val type = "set"
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivChangeTransition {
abstract val type: String
sealed interface DivChangeTransition {
val type: String
}
@@ -0,0 +1,68 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivCircleShape internal constructor(
@JsonIgnore val radius: Property<DivFixedSize>?,
) : DivShape {
@JsonProperty("type") override val type = "circle"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"radius" to radius,
)
}
}
fun <T> TemplateContext<T>.divCircleShape(): LiteralProperty<DivCircleShape> {
return value(DivCircleShape(
radius = null,
))
}
fun <T> TemplateContext<T>.divCircleShape(
radius: Property<DivFixedSize>? = null,
): LiteralProperty<DivCircleShape> {
return value(DivCircleShape(
radius = radius,
))
}
fun <T> TemplateContext<T>.divCircleShape(
radius: DivFixedSize? = null,
): LiteralProperty<DivCircleShape> {
return value(DivCircleShape(
radius = optionalValue(radius),
))
}
fun CardContext.divCircleShape(): DivCircleShape {
return DivCircleShape(
radius = null,
)
}
fun CardContext.divCircleShape(
radius: ValueProperty<DivFixedSize>? = null,
): DivCircleShape {
return DivCircleShape(
radius = radius,
)
}
fun CardContext.divCircleShape(
radius: DivFixedSize? = null,
): DivCircleShape {
return DivCircleShape(
radius = optionalValue(radius),
)
}
@@ -28,13 +28,17 @@ class DivContainer internal constructor(
@JsonIgnore override val height: Property<DivSize>?,
@JsonIgnore override val id: Property<String>?,
@JsonIgnore val items: Property<List<Div>>?,
@JsonIgnore val layoutMode: Property<LayoutMode>?,
@JsonIgnore val lineSeparator: Property<Separator>?,
@JsonIgnore val longtapActions: Property<List<DivAction>>?,
@JsonIgnore override val margins: Property<DivEdgeInsets>?,
@JsonIgnore val orientation: Property<Orientation>?,
@JsonIgnore override val paddings: Property<DivEdgeInsets>?,
@JsonIgnore override val rowSpan: Property<Int>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore val separator: Property<Separator>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -43,7 +47,7 @@ class DivContainer internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "container"
@@ -68,13 +72,17 @@ class DivContainer internal constructor(
"height" to height,
"id" to id,
"items" to items,
"layout_mode" to layoutMode,
"line_separator" to lineSeparator,
"longtap_actions" to longtapActions,
"margins" to margins,
"orientation" to orientation,
"paddings" to paddings,
"row_span" to rowSpan,
"selected_actions" to selectedActions,
"separator" to separator,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -86,11 +94,34 @@ class DivContainer internal constructor(
)
}
enum class LayoutMode(@JsonValue val value: String) {
NO_WRAP("no_wrap"),
WRAP("wrap"),
}
enum class Orientation(@JsonValue val value: String) {
VERTICAL("vertical"),
HORIZONTAL("horizontal"),
OVERLAP("overlap"),
}
class Separator internal constructor(
@JsonIgnore val showAtEnd: Property<BoolInt>?,
@JsonIgnore val showAtStart: Property<BoolInt>?,
@JsonIgnore val showBetween: Property<BoolInt>?,
@JsonIgnore val style: Property<DivDrawable>?,
) {
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"show_at_end" to showAtEnd,
"show_at_start" to showAtStart,
"show_between" to showBetween,
"style" to style,
)
}
}
}
fun <T> TemplateContext<T>.divContainer(): LiteralProperty<DivContainer> {
@@ -113,13 +144,17 @@ fun <T> TemplateContext<T>.divContainer(): LiteralProperty<DivContainer> {
height = null,
id = null,
items = null,
layoutMode = null,
lineSeparator = null,
longtapActions = null,
margins = null,
orientation = null,
paddings = null,
rowSpan = null,
selectedActions = null,
separator = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -150,13 +185,17 @@ fun <T> TemplateContext<T>.divContainer(
focus: Property<DivFocus>? = null,
height: Property<DivSize>? = null,
id: Property<String>? = null,
layoutMode: Property<DivContainer.LayoutMode>? = null,
lineSeparator: Property<DivContainer.Separator>? = null,
longtapActions: Property<List<DivAction>>? = null,
margins: Property<DivEdgeInsets>? = null,
orientation: Property<DivContainer.Orientation>? = null,
paddings: Property<DivEdgeInsets>? = null,
rowSpan: Property<Int>? = null,
selectedActions: Property<List<DivAction>>? = null,
separator: Property<DivContainer.Separator>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -185,13 +224,17 @@ fun <T> TemplateContext<T>.divContainer(
height = height,
id = id,
items = items,
layoutMode = layoutMode,
lineSeparator = lineSeparator,
longtapActions = longtapActions,
margins = margins,
orientation = orientation,
paddings = paddings,
rowSpan = rowSpan,
selectedActions = selectedActions,
separator = separator,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -222,13 +265,17 @@ fun <T> TemplateContext<T>.divContainer(
focus: DivFocus? = null,
height: DivSize? = null,
id: String? = null,
layoutMode: DivContainer.LayoutMode? = null,
lineSeparator: DivContainer.Separator? = null,
longtapActions: List<DivAction>? = null,
margins: DivEdgeInsets? = null,
orientation: DivContainer.Orientation? = null,
paddings: DivEdgeInsets? = null,
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
separator: DivContainer.Separator? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -257,13 +304,17 @@ fun <T> TemplateContext<T>.divContainer(
height = optionalValue(height),
id = optionalValue(id),
items = optionalValue(items),
layoutMode = optionalValue(layoutMode),
lineSeparator = optionalValue(lineSeparator),
longtapActions = optionalValue(longtapActions),
margins = optionalValue(margins),
orientation = optionalValue(orientation),
paddings = optionalValue(paddings),
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
separator = optionalValue(separator),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -275,6 +326,43 @@ fun <T> TemplateContext<T>.divContainer(
))
}
fun <T> TemplateContext<T>.separator(): LiteralProperty<DivContainer.Separator> {
return value(DivContainer.Separator(
showAtEnd = null,
showAtStart = null,
showBetween = null,
style = null,
))
}
fun <T> TemplateContext<T>.separator(
style: Property<DivDrawable>? = null,
showAtEnd: Property<BoolInt>? = null,
showAtStart: Property<BoolInt>? = null,
showBetween: Property<BoolInt>? = null,
): LiteralProperty<DivContainer.Separator> {
return value(DivContainer.Separator(
showAtEnd = showAtEnd,
showAtStart = showAtStart,
showBetween = showBetween,
style = style,
))
}
fun <T> TemplateContext<T>.separator(
style: DivDrawable? = null,
showAtEnd: BoolInt? = null,
showAtStart: BoolInt? = null,
showBetween: BoolInt? = null,
): LiteralProperty<DivContainer.Separator> {
return value(DivContainer.Separator(
showAtEnd = optionalValue(showAtEnd),
showAtStart = optionalValue(showAtStart),
showBetween = optionalValue(showBetween),
style = optionalValue(style),
))
}
fun CardContext.divContainer(
items: ValueProperty<List<Div>>,
accessibility: ValueProperty<DivAccessibility>? = null,
@@ -294,13 +382,17 @@ fun CardContext.divContainer(
focus: ValueProperty<DivFocus>? = null,
height: ValueProperty<DivSize>? = null,
id: ValueProperty<String>? = null,
layoutMode: ValueProperty<DivContainer.LayoutMode>? = null,
lineSeparator: ValueProperty<DivContainer.Separator>? = null,
longtapActions: ValueProperty<List<DivAction>>? = null,
margins: ValueProperty<DivEdgeInsets>? = null,
orientation: ValueProperty<DivContainer.Orientation>? = null,
paddings: ValueProperty<DivEdgeInsets>? = null,
rowSpan: ValueProperty<Int>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
separator: ValueProperty<DivContainer.Separator>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -329,13 +421,17 @@ fun CardContext.divContainer(
height = height,
id = id,
items = items,
layoutMode = layoutMode,
lineSeparator = lineSeparator,
longtapActions = longtapActions,
margins = margins,
orientation = orientation,
paddings = paddings,
rowSpan = rowSpan,
selectedActions = selectedActions,
separator = separator,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -366,13 +462,17 @@ fun CardContext.divContainer(
focus: DivFocus? = null,
height: DivSize? = null,
id: String? = null,
layoutMode: DivContainer.LayoutMode? = null,
lineSeparator: DivContainer.Separator? = null,
longtapActions: List<DivAction>? = null,
margins: DivEdgeInsets? = null,
orientation: DivContainer.Orientation? = null,
paddings: DivEdgeInsets? = null,
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
separator: DivContainer.Separator? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -401,13 +501,17 @@ fun CardContext.divContainer(
height = optionalValue(height),
id = optionalValue(id),
items = value(items),
layoutMode = optionalValue(layoutMode),
lineSeparator = optionalValue(lineSeparator),
longtapActions = optionalValue(longtapActions),
margins = optionalValue(margins),
orientation = optionalValue(orientation),
paddings = optionalValue(paddings),
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
separator = optionalValue(separator),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -418,3 +522,31 @@ fun CardContext.divContainer(
width = optionalValue(width),
)
}
fun CardContext.separator(
style: ValueProperty<DivDrawable>,
showAtEnd: ValueProperty<BoolInt>? = null,
showAtStart: ValueProperty<BoolInt>? = null,
showBetween: ValueProperty<BoolInt>? = null,
): DivContainer.Separator {
return DivContainer.Separator(
showAtEnd = showAtEnd,
showAtStart = showAtStart,
showBetween = showBetween,
style = style,
)
}
fun CardContext.separator(
style: DivDrawable,
showAtEnd: BoolInt? = null,
showAtStart: BoolInt? = null,
showBetween: BoolInt? = null,
): DivContainer.Separator {
return DivContainer.Separator(
showAtEnd = optionalValue(showAtEnd),
showAtStart = optionalValue(showAtStart),
showBetween = optionalValue(showBetween),
style = value(style),
)
}
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivCount {
abstract val type: String
sealed interface DivCount {
val type: String
}
@@ -29,6 +29,7 @@ class DivCustom internal constructor(
@JsonIgnore override val rowSpan: Property<Int>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -37,7 +38,7 @@ class DivCustom internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "custom"
@@ -63,6 +64,7 @@ class DivCustom internal constructor(
"row_span" to rowSpan,
"selected_actions" to selectedActions,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -96,6 +98,7 @@ fun <T> TemplateContext<T>.divCustom(): LiteralProperty<DivCustom> {
rowSpan = null,
selectedActions = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -127,6 +130,7 @@ fun <T> TemplateContext<T>.divCustom(
rowSpan: Property<Int>? = null,
selectedActions: Property<List<DivAction>>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -156,6 +160,7 @@ fun <T> TemplateContext<T>.divCustom(
rowSpan = rowSpan,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -187,6 +192,7 @@ fun <T> TemplateContext<T>.divCustom(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -216,6 +222,7 @@ fun <T> TemplateContext<T>.divCustom(
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -247,6 +254,7 @@ fun CardContext.divCustom(
rowSpan: ValueProperty<Int>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -276,6 +284,7 @@ fun CardContext.divCustom(
rowSpan = rowSpan,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -307,6 +316,7 @@ fun CardContext.divCustom(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -336,6 +346,7 @@ fun CardContext.divCustom(
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -9,7 +9,7 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DownloadCallbacks internal constructor(
class DivDownloadCallbacks internal constructor(
@JsonIgnore val onFailActions: Property<List<DivAction>>?,
@JsonIgnore val onSuccessActions: Property<List<DivAction>>?,
) {
@@ -23,55 +23,55 @@ class DownloadCallbacks internal constructor(
}
}
fun <T> TemplateContext<T>.downloadCallbacks(): LiteralProperty<DownloadCallbacks> {
return value(DownloadCallbacks(
fun <T> TemplateContext<T>.divDownloadCallbacks(): LiteralProperty<DivDownloadCallbacks> {
return value(DivDownloadCallbacks(
onFailActions = null,
onSuccessActions = null,
))
}
fun <T> TemplateContext<T>.downloadCallbacks(
fun <T> TemplateContext<T>.divDownloadCallbacks(
onFailActions: Property<List<DivAction>>? = null,
onSuccessActions: Property<List<DivAction>>? = null,
): LiteralProperty<DownloadCallbacks> {
return value(DownloadCallbacks(
): LiteralProperty<DivDownloadCallbacks> {
return value(DivDownloadCallbacks(
onFailActions = onFailActions,
onSuccessActions = onSuccessActions,
))
}
fun <T> TemplateContext<T>.downloadCallbacks(
fun <T> TemplateContext<T>.divDownloadCallbacks(
onFailActions: List<DivAction>? = null,
onSuccessActions: List<DivAction>? = null,
): LiteralProperty<DownloadCallbacks> {
return value(DownloadCallbacks(
): LiteralProperty<DivDownloadCallbacks> {
return value(DivDownloadCallbacks(
onFailActions = optionalValue(onFailActions),
onSuccessActions = optionalValue(onSuccessActions),
))
}
fun CardContext.downloadCallbacks(): DownloadCallbacks {
return DownloadCallbacks(
fun CardContext.divDownloadCallbacks(): DivDownloadCallbacks {
return DivDownloadCallbacks(
onFailActions = null,
onSuccessActions = null,
)
}
fun CardContext.downloadCallbacks(
fun CardContext.divDownloadCallbacks(
onFailActions: ValueProperty<List<DivAction>>? = null,
onSuccessActions: ValueProperty<List<DivAction>>? = null,
): DownloadCallbacks {
return DownloadCallbacks(
): DivDownloadCallbacks {
return DivDownloadCallbacks(
onFailActions = onFailActions,
onSuccessActions = onSuccessActions,
)
}
fun CardContext.downloadCallbacks(
fun CardContext.divDownloadCallbacks(
onFailActions: List<DivAction>? = null,
onSuccessActions: List<DivAction>? = null,
): DownloadCallbacks {
return DownloadCallbacks(
): DivDownloadCallbacks {
return DivDownloadCallbacks(
onFailActions = optionalValue(onFailActions),
onSuccessActions = optionalValue(onSuccessActions),
)
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivDrawable {
abstract val type: String
sealed interface DivDrawable {
val type: String
}
@@ -14,7 +14,7 @@ class DivFadeTransition internal constructor(
@JsonIgnore override val duration: Property<Int>?,
@JsonIgnore override val interpolator: Property<DivAnimationInterpolator>?,
@JsonIgnore override val startDelay: Property<Int>?,
) : DivAppearanceTransition(), DivTransitionBase {
) : DivAppearanceTransition, DivTransitionBase {
@JsonProperty("type") override val type = "fade"
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivHover {
abstract val type: String
sealed interface DivFilter {
val type: String
}
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class DivFixedCount internal constructor(
@JsonIgnore val value: Property<Int>?,
) : DivCount() {
) : DivCount {
@JsonProperty("type") override val type = "fixed"
@@ -12,7 +12,7 @@ import com.yandex.div.dsl.util.*
class DivFixedSize internal constructor(
@JsonIgnore val unit: Property<DivSizeUnit>?,
@JsonIgnore val value: Property<Int>?,
) : DivSize() {
) : DivSize, DivRadialGradientRadius {
@JsonProperty("type") override val type = "fixed"
@@ -19,6 +19,7 @@ class DivGallery internal constructor(
@JsonIgnore val columnCount: Property<Int>?,
@JsonIgnore override val columnSpan: Property<Int>?,
@JsonIgnore val crossContentAlignment: Property<CrossContentAlignment>?,
@JsonIgnore val crossSpacing: Property<Int>?,
@JsonIgnore val defaultItem: Property<Int>?,
@JsonIgnore override val extensions: Property<List<DivExtension>>?,
@JsonIgnore override val focus: Property<DivFocus>?,
@@ -34,6 +35,7 @@ class DivGallery internal constructor(
@JsonIgnore val scrollMode: Property<ScrollMode>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -42,7 +44,7 @@ class DivGallery internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "gallery"
@@ -58,6 +60,7 @@ class DivGallery internal constructor(
"column_count" to columnCount,
"column_span" to columnSpan,
"cross_content_alignment" to crossContentAlignment,
"cross_spacing" to crossSpacing,
"default_item" to defaultItem,
"extensions" to extensions,
"focus" to focus,
@@ -73,6 +76,7 @@ class DivGallery internal constructor(
"scroll_mode" to scrollMode,
"selected_actions" to selectedActions,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -112,6 +116,7 @@ fun <T> TemplateContext<T>.divGallery(): LiteralProperty<DivGallery> {
columnCount = null,
columnSpan = null,
crossContentAlignment = null,
crossSpacing = null,
defaultItem = null,
extensions = null,
focus = null,
@@ -127,6 +132,7 @@ fun <T> TemplateContext<T>.divGallery(): LiteralProperty<DivGallery> {
scrollMode = null,
selectedActions = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -149,6 +155,7 @@ fun <T> TemplateContext<T>.divGallery(
columnCount: Property<Int>? = null,
columnSpan: Property<Int>? = null,
crossContentAlignment: Property<DivGallery.CrossContentAlignment>? = null,
crossSpacing: Property<Int>? = null,
defaultItem: Property<Int>? = null,
extensions: Property<List<DivExtension>>? = null,
focus: Property<DivFocus>? = null,
@@ -163,6 +170,7 @@ fun <T> TemplateContext<T>.divGallery(
scrollMode: Property<DivGallery.ScrollMode>? = null,
selectedActions: Property<List<DivAction>>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -182,6 +190,7 @@ fun <T> TemplateContext<T>.divGallery(
columnCount = columnCount,
columnSpan = columnSpan,
crossContentAlignment = crossContentAlignment,
crossSpacing = crossSpacing,
defaultItem = defaultItem,
extensions = extensions,
focus = focus,
@@ -197,6 +206,7 @@ fun <T> TemplateContext<T>.divGallery(
scrollMode = scrollMode,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -219,6 +229,7 @@ fun <T> TemplateContext<T>.divGallery(
columnCount: Int? = null,
columnSpan: Int? = null,
crossContentAlignment: DivGallery.CrossContentAlignment? = null,
crossSpacing: Int? = null,
defaultItem: Int? = null,
extensions: List<DivExtension>? = null,
focus: DivFocus? = null,
@@ -233,6 +244,7 @@ fun <T> TemplateContext<T>.divGallery(
scrollMode: DivGallery.ScrollMode? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -252,6 +264,7 @@ fun <T> TemplateContext<T>.divGallery(
columnCount = optionalValue(columnCount),
columnSpan = optionalValue(columnSpan),
crossContentAlignment = optionalValue(crossContentAlignment),
crossSpacing = optionalValue(crossSpacing),
defaultItem = optionalValue(defaultItem),
extensions = optionalValue(extensions),
focus = optionalValue(focus),
@@ -267,6 +280,7 @@ fun <T> TemplateContext<T>.divGallery(
scrollMode = optionalValue(scrollMode),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -289,6 +303,7 @@ fun CardContext.divGallery(
columnCount: ValueProperty<Int>? = null,
columnSpan: ValueProperty<Int>? = null,
crossContentAlignment: ValueProperty<DivGallery.CrossContentAlignment>? = null,
crossSpacing: ValueProperty<Int>? = null,
defaultItem: ValueProperty<Int>? = null,
extensions: ValueProperty<List<DivExtension>>? = null,
focus: ValueProperty<DivFocus>? = null,
@@ -303,6 +318,7 @@ fun CardContext.divGallery(
scrollMode: ValueProperty<DivGallery.ScrollMode>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -322,6 +338,7 @@ fun CardContext.divGallery(
columnCount = columnCount,
columnSpan = columnSpan,
crossContentAlignment = crossContentAlignment,
crossSpacing = crossSpacing,
defaultItem = defaultItem,
extensions = extensions,
focus = focus,
@@ -337,6 +354,7 @@ fun CardContext.divGallery(
scrollMode = scrollMode,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -359,6 +377,7 @@ fun CardContext.divGallery(
columnCount: Int? = null,
columnSpan: Int? = null,
crossContentAlignment: DivGallery.CrossContentAlignment? = null,
crossSpacing: Int? = null,
defaultItem: Int? = null,
extensions: List<DivExtension>? = null,
focus: DivFocus? = null,
@@ -373,6 +392,7 @@ fun CardContext.divGallery(
scrollMode: DivGallery.ScrollMode? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -392,6 +412,7 @@ fun CardContext.divGallery(
columnCount = optionalValue(columnCount),
columnSpan = optionalValue(columnSpan),
crossContentAlignment = optionalValue(crossContentAlignment),
crossSpacing = optionalValue(crossSpacing),
defaultItem = optionalValue(defaultItem),
extensions = optionalValue(extensions),
focus = optionalValue(focus),
@@ -407,6 +428,7 @@ fun CardContext.divGallery(
scrollMode = optionalValue(scrollMode),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -39,6 +39,7 @@ class DivGifImage internal constructor(
@JsonIgnore val scale: Property<DivImageScale>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -47,7 +48,7 @@ class DivGifImage internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "gif"
@@ -83,6 +84,7 @@ class DivGifImage internal constructor(
"scale" to scale,
"selected_actions" to selectedActions,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -126,6 +128,7 @@ fun <T> TemplateContext<T>.divGifImage(): LiteralProperty<DivGifImage> {
scale = null,
selectedActions = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -167,6 +170,7 @@ fun <T> TemplateContext<T>.divGifImage(
scale: Property<DivImageScale>? = null,
selectedActions: Property<List<DivAction>>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -206,6 +210,7 @@ fun <T> TemplateContext<T>.divGifImage(
scale = scale,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -247,6 +252,7 @@ fun <T> TemplateContext<T>.divGifImage(
scale: DivImageScale? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -286,6 +292,7 @@ fun <T> TemplateContext<T>.divGifImage(
scale = optionalValue(scale),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -327,6 +334,7 @@ fun CardContext.divGifImage(
scale: ValueProperty<DivImageScale>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -366,6 +374,7 @@ fun CardContext.divGifImage(
scale = scale,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -407,6 +416,7 @@ fun CardContext.divGifImage(
scale: DivImageScale? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -446,6 +456,7 @@ fun CardContext.divGifImage(
scale = optionalValue(scale),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -35,6 +35,7 @@ class DivGrid internal constructor(
@JsonIgnore override val rowSpan: Property<Int>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -43,7 +44,7 @@ class DivGrid internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "grid"
@@ -75,6 +76,7 @@ class DivGrid internal constructor(
"row_span" to rowSpan,
"selected_actions" to selectedActions,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -114,6 +116,7 @@ fun <T> TemplateContext<T>.divGrid(): LiteralProperty<DivGrid> {
rowSpan = null,
selectedActions = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -151,6 +154,7 @@ fun <T> TemplateContext<T>.divGrid(
rowSpan: Property<Int>? = null,
selectedActions: Property<List<DivAction>>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -186,6 +190,7 @@ fun <T> TemplateContext<T>.divGrid(
rowSpan = rowSpan,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -223,6 +228,7 @@ fun <T> TemplateContext<T>.divGrid(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -258,6 +264,7 @@ fun <T> TemplateContext<T>.divGrid(
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -295,6 +302,7 @@ fun CardContext.divGrid(
rowSpan: ValueProperty<Int>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -330,6 +338,7 @@ fun CardContext.divGrid(
rowSpan = rowSpan,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -367,6 +376,7 @@ fun CardContext.divGrid(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -402,6 +412,7 @@ fun CardContext.divGrid(
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -1,62 +0,0 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivHoverBackgroundColor internal constructor(
@JsonIgnore val color: Property<Color>?,
) : DivHover() {
@JsonProperty("type") override val type = "background-color"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"color" to color,
)
}
}
fun <T> TemplateContext<T>.divHoverBackgroundColor(): LiteralProperty<DivHoverBackgroundColor> {
return value(DivHoverBackgroundColor(
color = null,
))
}
fun <T> TemplateContext<T>.divHoverBackgroundColor(
color: Property<Color>? = null,
): LiteralProperty<DivHoverBackgroundColor> {
return value(DivHoverBackgroundColor(
color = color,
))
}
fun <T> TemplateContext<T>.divHoverBackgroundColor(
color: Color? = null,
): LiteralProperty<DivHoverBackgroundColor> {
return value(DivHoverBackgroundColor(
color = optionalValue(color),
))
}
fun CardContext.divHoverBackgroundColor(
color: ValueProperty<Color>,
): DivHoverBackgroundColor {
return DivHoverBackgroundColor(
color = color,
)
}
fun CardContext.divHoverBackgroundColor(
color: Color,
): DivHoverBackgroundColor {
return DivHoverBackgroundColor(
color = value(color),
)
}
@@ -26,6 +26,7 @@ class DivImage internal constructor(
@JsonIgnore val contentAlignmentVertical: Property<DivAlignmentVertical>?,
@JsonIgnore val doubletapActions: Property<List<DivAction>>?,
@JsonIgnore override val extensions: Property<List<DivExtension>>?,
@JsonIgnore val filters: Property<List<DivFilter>>?,
@JsonIgnore override val focus: Property<DivFocus>?,
@JsonIgnore override val height: Property<DivSize>?,
@JsonIgnore val highPriorityPreviewShow: Property<BoolInt>?,
@@ -41,7 +42,9 @@ class DivImage internal constructor(
@JsonIgnore val scale: Property<DivImageScale>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore val tintColor: Property<Color>?,
@JsonIgnore val tintMode: Property<DivBlendMode>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -50,7 +53,7 @@ class DivImage internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "image"
@@ -73,6 +76,7 @@ class DivImage internal constructor(
"content_alignment_vertical" to contentAlignmentVertical,
"doubletap_actions" to doubletapActions,
"extensions" to extensions,
"filters" to filters,
"focus" to focus,
"height" to height,
"high_priority_preview_show" to highPriorityPreviewShow,
@@ -88,7 +92,9 @@ class DivImage internal constructor(
"scale" to scale,
"selected_actions" to selectedActions,
"tint_color" to tintColor,
"tint_mode" to tintMode,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -119,6 +125,7 @@ fun <T> TemplateContext<T>.divImage(): LiteralProperty<DivImage> {
contentAlignmentVertical = null,
doubletapActions = null,
extensions = null,
filters = null,
focus = null,
height = null,
highPriorityPreviewShow = null,
@@ -134,7 +141,9 @@ fun <T> TemplateContext<T>.divImage(): LiteralProperty<DivImage> {
scale = null,
selectedActions = null,
tintColor = null,
tintMode = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -164,6 +173,7 @@ fun <T> TemplateContext<T>.divImage(
contentAlignmentVertical: Property<DivAlignmentVertical>? = null,
doubletapActions: Property<List<DivAction>>? = null,
extensions: Property<List<DivExtension>>? = null,
filters: Property<List<DivFilter>>? = null,
focus: Property<DivFocus>? = null,
height: Property<DivSize>? = null,
highPriorityPreviewShow: Property<BoolInt>? = null,
@@ -178,7 +188,9 @@ fun <T> TemplateContext<T>.divImage(
scale: Property<DivImageScale>? = null,
selectedActions: Property<List<DivAction>>? = null,
tintColor: Property<Color>? = null,
tintMode: Property<DivBlendMode>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -205,6 +217,7 @@ fun <T> TemplateContext<T>.divImage(
contentAlignmentVertical = contentAlignmentVertical,
doubletapActions = doubletapActions,
extensions = extensions,
filters = filters,
focus = focus,
height = height,
highPriorityPreviewShow = highPriorityPreviewShow,
@@ -220,7 +233,9 @@ fun <T> TemplateContext<T>.divImage(
scale = scale,
selectedActions = selectedActions,
tintColor = tintColor,
tintMode = tintMode,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -250,6 +265,7 @@ fun <T> TemplateContext<T>.divImage(
contentAlignmentVertical: DivAlignmentVertical? = null,
doubletapActions: List<DivAction>? = null,
extensions: List<DivExtension>? = null,
filters: List<DivFilter>? = null,
focus: DivFocus? = null,
height: DivSize? = null,
highPriorityPreviewShow: BoolInt? = null,
@@ -264,7 +280,9 @@ fun <T> TemplateContext<T>.divImage(
scale: DivImageScale? = null,
selectedActions: List<DivAction>? = null,
tintColor: Color? = null,
tintMode: DivBlendMode? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -291,6 +309,7 @@ fun <T> TemplateContext<T>.divImage(
contentAlignmentVertical = optionalValue(contentAlignmentVertical),
doubletapActions = optionalValue(doubletapActions),
extensions = optionalValue(extensions),
filters = optionalValue(filters),
focus = optionalValue(focus),
height = optionalValue(height),
highPriorityPreviewShow = optionalValue(highPriorityPreviewShow),
@@ -306,7 +325,9 @@ fun <T> TemplateContext<T>.divImage(
scale = optionalValue(scale),
selectedActions = optionalValue(selectedActions),
tintColor = optionalValue(tintColor),
tintMode = optionalValue(tintMode),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -336,6 +357,7 @@ fun CardContext.divImage(
contentAlignmentVertical: ValueProperty<DivAlignmentVertical>? = null,
doubletapActions: ValueProperty<List<DivAction>>? = null,
extensions: ValueProperty<List<DivExtension>>? = null,
filters: ValueProperty<List<DivFilter>>? = null,
focus: ValueProperty<DivFocus>? = null,
height: ValueProperty<DivSize>? = null,
highPriorityPreviewShow: ValueProperty<BoolInt>? = null,
@@ -350,7 +372,9 @@ fun CardContext.divImage(
scale: ValueProperty<DivImageScale>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
tintColor: ValueProperty<Color>? = null,
tintMode: ValueProperty<DivBlendMode>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -377,6 +401,7 @@ fun CardContext.divImage(
contentAlignmentVertical = contentAlignmentVertical,
doubletapActions = doubletapActions,
extensions = extensions,
filters = filters,
focus = focus,
height = height,
highPriorityPreviewShow = highPriorityPreviewShow,
@@ -392,7 +417,9 @@ fun CardContext.divImage(
scale = scale,
selectedActions = selectedActions,
tintColor = tintColor,
tintMode = tintMode,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -422,6 +449,7 @@ fun CardContext.divImage(
contentAlignmentVertical: DivAlignmentVertical? = null,
doubletapActions: List<DivAction>? = null,
extensions: List<DivExtension>? = null,
filters: List<DivFilter>? = null,
focus: DivFocus? = null,
height: DivSize? = null,
highPriorityPreviewShow: BoolInt? = null,
@@ -436,7 +464,9 @@ fun CardContext.divImage(
scale: DivImageScale? = null,
selectedActions: List<DivAction>? = null,
tintColor: Color? = null,
tintMode: DivBlendMode? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -463,6 +493,7 @@ fun CardContext.divImage(
contentAlignmentVertical = optionalValue(contentAlignmentVertical),
doubletapActions = optionalValue(doubletapActions),
extensions = optionalValue(extensions),
filters = optionalValue(filters),
focus = optionalValue(focus),
height = optionalValue(height),
highPriorityPreviewShow = optionalValue(highPriorityPreviewShow),
@@ -478,7 +509,9 @@ fun CardContext.divImage(
scale = optionalValue(scale),
selectedActions = optionalValue(selectedActions),
tintColor = optionalValue(tintColor),
tintMode = optionalValue(tintMode),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -13,10 +13,11 @@ class DivImageBackground internal constructor(
@JsonIgnore val alpha: Property<Double>?,
@JsonIgnore val contentAlignmentHorizontal: Property<DivAlignmentHorizontal>?,
@JsonIgnore val contentAlignmentVertical: Property<DivAlignmentVertical>?,
@JsonIgnore val filters: Property<List<DivFilter>>?,
@JsonIgnore val imageUrl: Property<URI>?,
@JsonIgnore val preloadRequired: Property<BoolInt>?,
@JsonIgnore val scale: Property<DivImageScale>?,
) : DivBackground() {
) : DivBackground {
@JsonProperty("type") override val type = "image"
@@ -26,6 +27,7 @@ class DivImageBackground internal constructor(
"alpha" to alpha,
"content_alignment_horizontal" to contentAlignmentHorizontal,
"content_alignment_vertical" to contentAlignmentVertical,
"filters" to filters,
"image_url" to imageUrl,
"preload_required" to preloadRequired,
"scale" to scale,
@@ -38,6 +40,7 @@ fun <T> TemplateContext<T>.divImageBackground(): LiteralProperty<DivImageBackgro
alpha = null,
contentAlignmentHorizontal = null,
contentAlignmentVertical = null,
filters = null,
imageUrl = null,
preloadRequired = null,
scale = null,
@@ -49,6 +52,7 @@ fun <T> TemplateContext<T>.divImageBackground(
alpha: Property<Double>? = null,
contentAlignmentHorizontal: Property<DivAlignmentHorizontal>? = null,
contentAlignmentVertical: Property<DivAlignmentVertical>? = null,
filters: Property<List<DivFilter>>? = null,
preloadRequired: Property<BoolInt>? = null,
scale: Property<DivImageScale>? = null,
): LiteralProperty<DivImageBackground> {
@@ -56,6 +60,7 @@ fun <T> TemplateContext<T>.divImageBackground(
alpha = alpha,
contentAlignmentHorizontal = contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical,
filters = filters,
imageUrl = imageUrl,
preloadRequired = preloadRequired,
scale = scale,
@@ -67,6 +72,7 @@ fun <T> TemplateContext<T>.divImageBackground(
alpha: Double? = null,
contentAlignmentHorizontal: DivAlignmentHorizontal? = null,
contentAlignmentVertical: DivAlignmentVertical? = null,
filters: List<DivFilter>? = null,
preloadRequired: BoolInt? = null,
scale: DivImageScale? = null,
): LiteralProperty<DivImageBackground> {
@@ -74,6 +80,7 @@ fun <T> TemplateContext<T>.divImageBackground(
alpha = optionalValue(alpha),
contentAlignmentHorizontal = optionalValue(contentAlignmentHorizontal),
contentAlignmentVertical = optionalValue(contentAlignmentVertical),
filters = optionalValue(filters),
imageUrl = optionalValue(imageUrl),
preloadRequired = optionalValue(preloadRequired),
scale = optionalValue(scale),
@@ -85,6 +92,7 @@ fun CardContext.divImageBackground(
alpha: ValueProperty<Double>? = null,
contentAlignmentHorizontal: ValueProperty<DivAlignmentHorizontal>? = null,
contentAlignmentVertical: ValueProperty<DivAlignmentVertical>? = null,
filters: ValueProperty<List<DivFilter>>? = null,
preloadRequired: ValueProperty<BoolInt>? = null,
scale: ValueProperty<DivImageScale>? = null,
): DivImageBackground {
@@ -92,6 +100,7 @@ fun CardContext.divImageBackground(
alpha = alpha,
contentAlignmentHorizontal = contentAlignmentHorizontal,
contentAlignmentVertical = contentAlignmentVertical,
filters = filters,
imageUrl = imageUrl,
preloadRequired = preloadRequired,
scale = scale,
@@ -103,6 +112,7 @@ fun CardContext.divImageBackground(
alpha: Double? = null,
contentAlignmentHorizontal: DivAlignmentHorizontal? = null,
contentAlignmentVertical: DivAlignmentVertical? = null,
filters: List<DivFilter>? = null,
preloadRequired: BoolInt? = null,
scale: DivImageScale? = null,
): DivImageBackground {
@@ -110,6 +120,7 @@ fun CardContext.divImageBackground(
alpha = optionalValue(alpha),
contentAlignmentHorizontal = optionalValue(contentAlignmentHorizontal),
contentAlignmentVertical = optionalValue(contentAlignmentVertical),
filters = optionalValue(filters),
imageUrl = value(imageUrl),
preloadRequired = optionalValue(preloadRequired),
scale = optionalValue(scale),
@@ -34,6 +34,7 @@ class DivIndicator internal constructor(
@JsonIgnore val shape: Property<DivShape>?,
@JsonIgnore val spaceBetweenCenters: Property<DivFixedSize>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -42,7 +43,7 @@ class DivIndicator internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "indicator"
@@ -73,6 +74,7 @@ class DivIndicator internal constructor(
"shape" to shape,
"space_between_centers" to spaceBetweenCenters,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -117,6 +119,7 @@ fun <T> TemplateContext<T>.divIndicator(): LiteralProperty<DivIndicator> {
shape = null,
spaceBetweenCenters = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -153,6 +156,7 @@ fun <T> TemplateContext<T>.divIndicator(
shape: Property<DivShape>? = null,
spaceBetweenCenters: Property<DivFixedSize>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -187,6 +191,7 @@ fun <T> TemplateContext<T>.divIndicator(
shape = shape,
spaceBetweenCenters = spaceBetweenCenters,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -223,6 +228,7 @@ fun <T> TemplateContext<T>.divIndicator(
shape: DivShape? = null,
spaceBetweenCenters: DivFixedSize? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -257,6 +263,7 @@ fun <T> TemplateContext<T>.divIndicator(
shape = optionalValue(shape),
spaceBetweenCenters = optionalValue(spaceBetweenCenters),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -294,6 +301,7 @@ fun CardContext.divIndicator(): DivIndicator {
shape = null,
spaceBetweenCenters = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -330,6 +338,7 @@ fun CardContext.divIndicator(
shape: ValueProperty<DivShape>? = null,
spaceBetweenCenters: ValueProperty<DivFixedSize>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -364,6 +373,7 @@ fun CardContext.divIndicator(
shape = shape,
spaceBetweenCenters = spaceBetweenCenters,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -400,6 +410,7 @@ fun CardContext.divIndicator(
shape: DivShape? = null,
spaceBetweenCenters: DivFixedSize? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -434,6 +445,7 @@ fun CardContext.divIndicator(
shape = optionalValue(shape),
spaceBetweenCenters = optionalValue(spaceBetweenCenters),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -10,7 +10,7 @@ import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivInfinityCount internal constructor(
) : DivCount() {
) : DivCount {
@JsonProperty("type") override val type = "infinity"
}
@@ -32,7 +32,7 @@ class DivInput internal constructor(
@JsonIgnore val letterSpacing: Property<Double>?,
@JsonIgnore val lineHeight: Property<Int>?,
@JsonIgnore override val margins: Property<DivEdgeInsets>?,
@JsonIgnore val maxLines: Property<Int>?,
@JsonIgnore val maxVisibleLines: Property<Int>?,
@JsonIgnore val nativeInterface: Property<NativeInterface>?,
@JsonIgnore override val paddings: Property<DivEdgeInsets>?,
@JsonIgnore override val rowSpan: Property<Int>?,
@@ -41,6 +41,7 @@ class DivInput internal constructor(
@JsonIgnore val textColor: Property<Color>?,
@JsonIgnore val textVariable: Property<String>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -49,7 +50,7 @@ class DivInput internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "input"
@@ -78,7 +79,7 @@ class DivInput internal constructor(
"letter_spacing" to letterSpacing,
"line_height" to lineHeight,
"margins" to margins,
"max_lines" to maxLines,
"max_visible_lines" to maxVisibleLines,
"native_interface" to nativeInterface,
"paddings" to paddings,
"row_span" to rowSpan,
@@ -87,6 +88,7 @@ class DivInput internal constructor(
"text_color" to textColor,
"text_variable" to textVariable,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -99,12 +101,12 @@ class DivInput internal constructor(
}
enum class KeyboardType(@JsonValue val value: String) {
TEXT("text"),
SINGLE_LINE_TEXT("single_line_text"),
MULTI_LINE_TEXT("multi_line_text"),
PHONE("phone"),
NUMBER("number"),
EMAIL("email"),
URI("uri"),
DATE("date"),
}
class NativeInterface internal constructor(
@@ -144,7 +146,7 @@ fun <T> TemplateContext<T>.divInput(): LiteralProperty<DivInput> {
letterSpacing = null,
lineHeight = null,
margins = null,
maxLines = null,
maxVisibleLines = null,
nativeInterface = null,
paddings = null,
rowSpan = null,
@@ -153,6 +155,7 @@ fun <T> TemplateContext<T>.divInput(): LiteralProperty<DivInput> {
textColor = null,
textVariable = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -188,7 +191,7 @@ fun <T> TemplateContext<T>.divInput(
letterSpacing: Property<Double>? = null,
lineHeight: Property<Int>? = null,
margins: Property<DivEdgeInsets>? = null,
maxLines: Property<Int>? = null,
maxVisibleLines: Property<Int>? = null,
nativeInterface: Property<DivInput.NativeInterface>? = null,
paddings: Property<DivEdgeInsets>? = null,
rowSpan: Property<Int>? = null,
@@ -196,6 +199,7 @@ fun <T> TemplateContext<T>.divInput(
selectedActions: Property<List<DivAction>>? = null,
textColor: Property<Color>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -228,7 +232,7 @@ fun <T> TemplateContext<T>.divInput(
letterSpacing = letterSpacing,
lineHeight = lineHeight,
margins = margins,
maxLines = maxLines,
maxVisibleLines = maxVisibleLines,
nativeInterface = nativeInterface,
paddings = paddings,
rowSpan = rowSpan,
@@ -237,6 +241,7 @@ fun <T> TemplateContext<T>.divInput(
textColor = textColor,
textVariable = textVariable,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -272,7 +277,7 @@ fun <T> TemplateContext<T>.divInput(
letterSpacing: Double? = null,
lineHeight: Int? = null,
margins: DivEdgeInsets? = null,
maxLines: Int? = null,
maxVisibleLines: Int? = null,
nativeInterface: DivInput.NativeInterface? = null,
paddings: DivEdgeInsets? = null,
rowSpan: Int? = null,
@@ -280,6 +285,7 @@ fun <T> TemplateContext<T>.divInput(
selectedActions: List<DivAction>? = null,
textColor: Color? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -312,7 +318,7 @@ fun <T> TemplateContext<T>.divInput(
letterSpacing = optionalValue(letterSpacing),
lineHeight = optionalValue(lineHeight),
margins = optionalValue(margins),
maxLines = optionalValue(maxLines),
maxVisibleLines = optionalValue(maxVisibleLines),
nativeInterface = optionalValue(nativeInterface),
paddings = optionalValue(paddings),
rowSpan = optionalValue(rowSpan),
@@ -321,6 +327,7 @@ fun <T> TemplateContext<T>.divInput(
textColor = optionalValue(textColor),
textVariable = optionalValue(textVariable),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -378,7 +385,7 @@ fun CardContext.divInput(
letterSpacing: ValueProperty<Double>? = null,
lineHeight: ValueProperty<Int>? = null,
margins: ValueProperty<DivEdgeInsets>? = null,
maxLines: ValueProperty<Int>? = null,
maxVisibleLines: ValueProperty<Int>? = null,
nativeInterface: ValueProperty<DivInput.NativeInterface>? = null,
paddings: ValueProperty<DivEdgeInsets>? = null,
rowSpan: ValueProperty<Int>? = null,
@@ -386,6 +393,7 @@ fun CardContext.divInput(
selectedActions: ValueProperty<List<DivAction>>? = null,
textColor: ValueProperty<Color>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -418,7 +426,7 @@ fun CardContext.divInput(
letterSpacing = letterSpacing,
lineHeight = lineHeight,
margins = margins,
maxLines = maxLines,
maxVisibleLines = maxVisibleLines,
nativeInterface = nativeInterface,
paddings = paddings,
rowSpan = rowSpan,
@@ -427,6 +435,7 @@ fun CardContext.divInput(
textColor = textColor,
textVariable = textVariable,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -462,7 +471,7 @@ fun CardContext.divInput(
letterSpacing: Double? = null,
lineHeight: Int? = null,
margins: DivEdgeInsets? = null,
maxLines: Int? = null,
maxVisibleLines: Int? = null,
nativeInterface: DivInput.NativeInterface? = null,
paddings: DivEdgeInsets? = null,
rowSpan: Int? = null,
@@ -470,6 +479,7 @@ fun CardContext.divInput(
selectedActions: List<DivAction>? = null,
textColor: Color? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -502,7 +512,7 @@ fun CardContext.divInput(
letterSpacing = optionalValue(letterSpacing),
lineHeight = optionalValue(lineHeight),
margins = optionalValue(margins),
maxLines = optionalValue(maxLines),
maxVisibleLines = optionalValue(maxVisibleLines),
nativeInterface = optionalValue(nativeInterface),
paddings = optionalValue(paddings),
rowSpan = optionalValue(rowSpan),
@@ -511,6 +521,7 @@ fun CardContext.divInput(
textColor = optionalValue(textColor),
textVariable = value(textVariable),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -9,10 +9,10 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivGradientBackground internal constructor(
class DivLinearGradient internal constructor(
@JsonIgnore val angle: Property<Int>?,
@JsonIgnore val colors: Property<List<Color>>?,
) : DivBackground() {
) : DivTextGradient, DivBackground {
@JsonProperty("type") override val type = "gradient"
@@ -25,48 +25,48 @@ class DivGradientBackground internal constructor(
}
}
fun <T> TemplateContext<T>.divGradientBackground(): LiteralProperty<DivGradientBackground> {
return value(DivGradientBackground(
fun <T> TemplateContext<T>.divLinearGradient(): LiteralProperty<DivLinearGradient> {
return value(DivLinearGradient(
angle = null,
colors = null,
))
}
fun <T> TemplateContext<T>.divGradientBackground(
fun <T> TemplateContext<T>.divLinearGradient(
colors: Property<List<Color>>? = null,
angle: Property<Int>? = null,
): LiteralProperty<DivGradientBackground> {
return value(DivGradientBackground(
): LiteralProperty<DivLinearGradient> {
return value(DivLinearGradient(
angle = angle,
colors = colors,
))
}
fun <T> TemplateContext<T>.divGradientBackground(
fun <T> TemplateContext<T>.divLinearGradient(
colors: List<Color>? = null,
angle: Int? = null,
): LiteralProperty<DivGradientBackground> {
return value(DivGradientBackground(
): LiteralProperty<DivLinearGradient> {
return value(DivLinearGradient(
angle = optionalValue(angle),
colors = optionalValue(colors),
))
}
fun CardContext.divGradientBackground(
fun CardContext.divLinearGradient(
colors: ValueProperty<List<Color>>,
angle: ValueProperty<Int>? = null,
): DivGradientBackground {
return DivGradientBackground(
): DivLinearGradient {
return DivLinearGradient(
angle = angle,
colors = colors,
)
}
fun CardContext.divGradientBackground(
fun CardContext.divLinearGradient(
colors: List<Color>,
angle: Int? = null,
): DivGradientBackground {
return DivGradientBackground(
): DivLinearGradient {
return DivLinearGradient(
angle = optionalValue(angle),
colors = value(colors),
)
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class DivMatchParentSize internal constructor(
@JsonIgnore val weight: Property<Double>?,
) : DivSize() {
) : DivSize {
@JsonProperty("type") override val type = "match_parent"
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class DivNeighbourPageSize internal constructor(
@JsonIgnore val neighbourPageWidth: Property<DivFixedSize>?,
) : DivPagerLayoutMode() {
) : DivPagerLayoutMode {
@JsonProperty("type") override val type = "fixed"
@@ -0,0 +1,73 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivNinePatchBackground internal constructor(
@JsonIgnore val imageUrl: Property<URI>?,
@JsonIgnore val insets: Property<DivAbsoluteEdgeInsets>?,
) : DivBackground {
@JsonProperty("type") override val type = "nine_patch_image"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"image_url" to imageUrl,
"insets" to insets,
)
}
}
fun <T> TemplateContext<T>.divNinePatchBackground(): LiteralProperty<DivNinePatchBackground> {
return value(DivNinePatchBackground(
imageUrl = null,
insets = null,
))
}
fun <T> TemplateContext<T>.divNinePatchBackground(
imageUrl: Property<URI>? = null,
insets: Property<DivAbsoluteEdgeInsets>? = null,
): LiteralProperty<DivNinePatchBackground> {
return value(DivNinePatchBackground(
imageUrl = imageUrl,
insets = insets,
))
}
fun <T> TemplateContext<T>.divNinePatchBackground(
imageUrl: URI? = null,
insets: DivAbsoluteEdgeInsets? = null,
): LiteralProperty<DivNinePatchBackground> {
return value(DivNinePatchBackground(
imageUrl = optionalValue(imageUrl),
insets = optionalValue(insets),
))
}
fun CardContext.divNinePatchBackground(
imageUrl: ValueProperty<URI>,
insets: ValueProperty<DivAbsoluteEdgeInsets>,
): DivNinePatchBackground {
return DivNinePatchBackground(
imageUrl = imageUrl,
insets = insets,
)
}
fun CardContext.divNinePatchBackground(
imageUrl: URI,
insets: DivAbsoluteEdgeInsets,
): DivNinePatchBackground {
return DivNinePatchBackground(
imageUrl = value(imageUrl),
insets = value(insets),
)
}
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class DivPageSize internal constructor(
@JsonIgnore val pageWidth: Property<DivPercentageSize>?,
) : DivPagerLayoutMode() {
) : DivPagerLayoutMode {
@JsonProperty("type") override val type = "percentage"
@@ -32,6 +32,7 @@ class DivPager internal constructor(
@JsonIgnore override val rowSpan: Property<Int>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -40,7 +41,7 @@ class DivPager internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "pager"
@@ -69,6 +70,7 @@ class DivPager internal constructor(
"row_span" to rowSpan,
"selected_actions" to selectedActions,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -110,6 +112,7 @@ fun <T> TemplateContext<T>.divPager(): LiteralProperty<DivPager> {
rowSpan = null,
selectedActions = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -144,6 +147,7 @@ fun <T> TemplateContext<T>.divPager(
rowSpan: Property<Int>? = null,
selectedActions: Property<List<DivAction>>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -176,6 +180,7 @@ fun <T> TemplateContext<T>.divPager(
rowSpan = rowSpan,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -210,6 +215,7 @@ fun <T> TemplateContext<T>.divPager(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -242,6 +248,7 @@ fun <T> TemplateContext<T>.divPager(
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -276,6 +283,7 @@ fun CardContext.divPager(
rowSpan: ValueProperty<Int>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -308,6 +316,7 @@ fun CardContext.divPager(
rowSpan = rowSpan,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -342,6 +351,7 @@ fun CardContext.divPager(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -374,6 +384,7 @@ fun CardContext.divPager(
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivPagerLayoutMode {
abstract val type: String
sealed interface DivPagerLayoutMode {
val type: String
}
@@ -0,0 +1,14 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed interface DivPivot {
val type: String
}
@@ -0,0 +1,80 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivPivotFixed internal constructor(
@JsonIgnore val unit: Property<DivSizeUnit>?,
@JsonIgnore val value: Property<Int>?,
) : DivPivot {
@JsonProperty("type") override val type = "pivot-fixed"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"unit" to unit,
"value" to value,
)
}
}
fun <T> TemplateContext<T>.divPivotFixed(): LiteralProperty<DivPivotFixed> {
return value(DivPivotFixed(
unit = null,
value = null,
))
}
fun <T> TemplateContext<T>.divPivotFixed(
unit: Property<DivSizeUnit>? = null,
value: Property<Int>? = null,
): LiteralProperty<DivPivotFixed> {
return value(DivPivotFixed(
unit = unit,
value = value,
))
}
fun <T> TemplateContext<T>.divPivotFixed(
unit: DivSizeUnit? = null,
value: Int? = null,
): LiteralProperty<DivPivotFixed> {
return value(DivPivotFixed(
unit = optionalValue(unit),
value = optionalValue(value),
))
}
fun CardContext.divPivotFixed(): DivPivotFixed {
return DivPivotFixed(
unit = null,
value = null,
)
}
fun CardContext.divPivotFixed(
unit: ValueProperty<DivSizeUnit>? = null,
value: ValueProperty<Int>? = null,
): DivPivotFixed {
return DivPivotFixed(
unit = unit,
value = value,
)
}
fun CardContext.divPivotFixed(
unit: DivSizeUnit? = null,
value: Int? = null,
): DivPivotFixed {
return DivPivotFixed(
unit = optionalValue(unit),
value = optionalValue(value),
)
}
@@ -0,0 +1,62 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivPivotPercentage internal constructor(
@JsonIgnore val value: Property<Double>?,
) : DivPivot {
@JsonProperty("type") override val type = "pivot-percentage"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"value" to value,
)
}
}
fun <T> TemplateContext<T>.divPivotPercentage(): LiteralProperty<DivPivotPercentage> {
return value(DivPivotPercentage(
value = null,
))
}
fun <T> TemplateContext<T>.divPivotPercentage(
value: Property<Double>? = null,
): LiteralProperty<DivPivotPercentage> {
return value(DivPivotPercentage(
value = value,
))
}
fun <T> TemplateContext<T>.divPivotPercentage(
value: Double? = null,
): LiteralProperty<DivPivotPercentage> {
return value(DivPivotPercentage(
value = optionalValue(value),
))
}
fun CardContext.divPivotPercentage(
value: ValueProperty<Double>,
): DivPivotPercentage {
return DivPivotPercentage(
value = value,
)
}
fun CardContext.divPivotPercentage(
value: Double,
): DivPivotPercentage {
return DivPivotPercentage(
value = value(value),
)
}
@@ -0,0 +1,95 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivRadialGradient internal constructor(
@JsonIgnore val centerX: Property<DivRadialGradientCenter>?,
@JsonIgnore val centerY: Property<DivRadialGradientCenter>?,
@JsonIgnore val colors: Property<List<Color>>?,
@JsonIgnore val radius: Property<DivRadialGradientRadius>?,
) : DivTextGradient, DivBackground {
@JsonProperty("type") override val type = "radial_gradient"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"center_x" to centerX,
"center_y" to centerY,
"colors" to colors,
"radius" to radius,
)
}
}
fun <T> TemplateContext<T>.divRadialGradient(): LiteralProperty<DivRadialGradient> {
return value(DivRadialGradient(
centerX = null,
centerY = null,
colors = null,
radius = null,
))
}
fun <T> TemplateContext<T>.divRadialGradient(
colors: Property<List<Color>>? = null,
centerX: Property<DivRadialGradientCenter>? = null,
centerY: Property<DivRadialGradientCenter>? = null,
radius: Property<DivRadialGradientRadius>? = null,
): LiteralProperty<DivRadialGradient> {
return value(DivRadialGradient(
centerX = centerX,
centerY = centerY,
colors = colors,
radius = radius,
))
}
fun <T> TemplateContext<T>.divRadialGradient(
colors: List<Color>? = null,
centerX: DivRadialGradientCenter? = null,
centerY: DivRadialGradientCenter? = null,
radius: DivRadialGradientRadius? = null,
): LiteralProperty<DivRadialGradient> {
return value(DivRadialGradient(
centerX = optionalValue(centerX),
centerY = optionalValue(centerY),
colors = optionalValue(colors),
radius = optionalValue(radius),
))
}
fun CardContext.divRadialGradient(
colors: ValueProperty<List<Color>>,
centerX: ValueProperty<DivRadialGradientCenter>? = null,
centerY: ValueProperty<DivRadialGradientCenter>? = null,
radius: ValueProperty<DivRadialGradientRadius>? = null,
): DivRadialGradient {
return DivRadialGradient(
centerX = centerX,
centerY = centerY,
colors = colors,
radius = radius,
)
}
fun CardContext.divRadialGradient(
colors: List<Color>,
centerX: DivRadialGradientCenter? = null,
centerY: DivRadialGradientCenter? = null,
radius: DivRadialGradientRadius? = null,
): DivRadialGradient {
return DivRadialGradient(
centerX = optionalValue(centerX),
centerY = optionalValue(centerY),
colors = value(colors),
radius = optionalValue(radius),
)
}
@@ -0,0 +1,14 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed interface DivRadialGradientCenter {
val type: String
}
@@ -0,0 +1,73 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivRadialGradientFixedCenter internal constructor(
@JsonIgnore val unit: Property<DivSizeUnit>?,
@JsonIgnore val value: Property<Int>?,
) : DivRadialGradientCenter {
@JsonProperty("type") override val type = "fixed"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"unit" to unit,
"value" to value,
)
}
}
fun <T> TemplateContext<T>.divRadialGradientFixedCenter(): LiteralProperty<DivRadialGradientFixedCenter> {
return value(DivRadialGradientFixedCenter(
unit = null,
value = null,
))
}
fun <T> TemplateContext<T>.divRadialGradientFixedCenter(
value: Property<Int>? = null,
unit: Property<DivSizeUnit>? = null,
): LiteralProperty<DivRadialGradientFixedCenter> {
return value(DivRadialGradientFixedCenter(
unit = unit,
value = value,
))
}
fun <T> TemplateContext<T>.divRadialGradientFixedCenter(
value: Int? = null,
unit: DivSizeUnit? = null,
): LiteralProperty<DivRadialGradientFixedCenter> {
return value(DivRadialGradientFixedCenter(
unit = optionalValue(unit),
value = optionalValue(value),
))
}
fun CardContext.divRadialGradientFixedCenter(
value: ValueProperty<Int>,
unit: ValueProperty<DivSizeUnit>? = null,
): DivRadialGradientFixedCenter {
return DivRadialGradientFixedCenter(
unit = unit,
value = value,
)
}
fun CardContext.divRadialGradientFixedCenter(
value: Int,
unit: DivSizeUnit? = null,
): DivRadialGradientFixedCenter {
return DivRadialGradientFixedCenter(
unit = optionalValue(unit),
value = value(value),
)
}
@@ -0,0 +1,14 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed interface DivRadialGradientRadius {
val type: String
}
@@ -0,0 +1,62 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivRadialGradientRelativeCenter internal constructor(
@JsonIgnore val value: Property<Double>?,
) : DivRadialGradientCenter {
@JsonProperty("type") override val type = "relative"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"value" to value,
)
}
}
fun <T> TemplateContext<T>.divRadialGradientRelativeCenter(): LiteralProperty<DivRadialGradientRelativeCenter> {
return value(DivRadialGradientRelativeCenter(
value = null,
))
}
fun <T> TemplateContext<T>.divRadialGradientRelativeCenter(
value: Property<Double>? = null,
): LiteralProperty<DivRadialGradientRelativeCenter> {
return value(DivRadialGradientRelativeCenter(
value = value,
))
}
fun <T> TemplateContext<T>.divRadialGradientRelativeCenter(
value: Double? = null,
): LiteralProperty<DivRadialGradientRelativeCenter> {
return value(DivRadialGradientRelativeCenter(
value = optionalValue(value),
))
}
fun CardContext.divRadialGradientRelativeCenter(
value: ValueProperty<Double>,
): DivRadialGradientRelativeCenter {
return DivRadialGradientRelativeCenter(
value = value,
)
}
fun CardContext.divRadialGradientRelativeCenter(
value: Double,
): DivRadialGradientRelativeCenter {
return DivRadialGradientRelativeCenter(
value = value(value),
)
}
@@ -0,0 +1,69 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivRadialGradientRelativeRadius internal constructor(
@JsonIgnore val value: Property<Value>?,
) : DivRadialGradientRadius {
@JsonProperty("type") override val type = "relative"
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"value" to value,
)
}
enum class Value(@JsonValue val value: String) {
NEAREST_CORNER("nearest_corner"),
FARTHEST_CORNER("farthest_corner"),
NEAREST_SIDE("nearest_side"),
FARTHEST_SIDE("farthest_side"),
}
}
fun <T> TemplateContext<T>.divRadialGradientRelativeRadius(): LiteralProperty<DivRadialGradientRelativeRadius> {
return value(DivRadialGradientRelativeRadius(
value = null,
))
}
fun <T> TemplateContext<T>.divRadialGradientRelativeRadius(
value: Property<DivRadialGradientRelativeRadius.Value>? = null,
): LiteralProperty<DivRadialGradientRelativeRadius> {
return value(DivRadialGradientRelativeRadius(
value = value,
))
}
fun <T> TemplateContext<T>.divRadialGradientRelativeRadius(
value: DivRadialGradientRelativeRadius.Value? = null,
): LiteralProperty<DivRadialGradientRelativeRadius> {
return value(DivRadialGradientRelativeRadius(
value = optionalValue(value),
))
}
fun CardContext.divRadialGradientRelativeRadius(
value: ValueProperty<DivRadialGradientRelativeRadius.Value>,
): DivRadialGradientRelativeRadius {
return DivRadialGradientRelativeRadius(
value = value,
)
}
fun CardContext.divRadialGradientRelativeRadius(
value: DivRadialGradientRelativeRadius.Value,
): DivRadialGradientRelativeRadius {
return DivRadialGradientRelativeRadius(
value = value(value),
)
}
@@ -13,7 +13,7 @@ class DivRoundedRectangleShape internal constructor(
@JsonIgnore val cornerRadius: Property<DivFixedSize>?,
@JsonIgnore val itemHeight: Property<DivFixedSize>?,
@JsonIgnore val itemWidth: Property<DivFixedSize>?,
) : DivShape() {
) : DivShape {
@JsonProperty("type") override val type = "rounded_rectangle"
@@ -16,7 +16,7 @@ class DivScaleTransition internal constructor(
@JsonIgnore val pivotY: Property<Double>?,
@JsonIgnore val scale: Property<Double>?,
@JsonIgnore override val startDelay: Property<Int>?,
) : DivAppearanceTransition(), DivTransitionBase {
) : DivAppearanceTransition, DivTransitionBase {
@JsonProperty("type") override val type = "scale"
@@ -32,6 +32,7 @@ class DivSeparator internal constructor(
@JsonIgnore override val rowSpan: Property<Int>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -40,7 +41,7 @@ class DivSeparator internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "separator"
@@ -69,6 +70,7 @@ class DivSeparator internal constructor(
"row_span" to rowSpan,
"selected_actions" to selectedActions,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -124,6 +126,7 @@ fun <T> TemplateContext<T>.divSeparator(): LiteralProperty<DivSeparator> {
rowSpan = null,
selectedActions = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -158,6 +161,7 @@ fun <T> TemplateContext<T>.divSeparator(
rowSpan: Property<Int>? = null,
selectedActions: Property<List<DivAction>>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -190,6 +194,7 @@ fun <T> TemplateContext<T>.divSeparator(
rowSpan = rowSpan,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -224,6 +229,7 @@ fun <T> TemplateContext<T>.divSeparator(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -256,6 +262,7 @@ fun <T> TemplateContext<T>.divSeparator(
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -318,6 +325,7 @@ fun CardContext.divSeparator(): DivSeparator {
rowSpan = null,
selectedActions = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -352,6 +360,7 @@ fun CardContext.divSeparator(
rowSpan: ValueProperty<Int>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -384,6 +393,7 @@ fun CardContext.divSeparator(
rowSpan = rowSpan,
selectedActions = selectedActions,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -418,6 +428,7 @@ fun CardContext.divSeparator(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -450,6 +461,7 @@ fun CardContext.divSeparator(
rowSpan = optionalValue(rowSpan),
selectedActions = optionalValue(selectedActions),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivShape {
abstract val type: String
sealed interface DivShape {
val type: String
}
@@ -13,7 +13,7 @@ class DivShapeDrawable internal constructor(
@JsonIgnore val color: Property<Color>?,
@JsonIgnore val shape: Property<DivShape>?,
@JsonIgnore val stroke: Property<DivStroke>?,
) : DivDrawable() {
) : DivDrawable {
@JsonProperty("type") override val type = "shape_drawable"
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivSize {
abstract val type: String
sealed interface DivSize {
val type: String
}
@@ -15,7 +15,7 @@ class DivSlideTransition internal constructor(
@JsonIgnore val edge: Property<Edge>?,
@JsonIgnore override val interpolator: Property<DivAnimationInterpolator>?,
@JsonIgnore override val startDelay: Property<Int>?,
) : DivAppearanceTransition(), DivTransitionBase {
) : DivAppearanceTransition, DivTransitionBase {
@JsonProperty("type") override val type = "slide"
@@ -26,6 +26,7 @@ class DivSlider internal constructor(
@JsonIgnore val minValue: Property<Int>?,
@JsonIgnore override val paddings: Property<DivEdgeInsets>?,
@JsonIgnore override val rowSpan: Property<Int>?,
@JsonIgnore val secondaryValueAccessibility: Property<DivAccessibility>?,
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore val thumbSecondaryStyle: Property<DivDrawable>?,
@JsonIgnore val thumbSecondaryTextStyle: Property<TextStyle>?,
@@ -38,6 +39,7 @@ class DivSlider internal constructor(
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore val trackActiveStyle: Property<DivDrawable>?,
@JsonIgnore val trackInactiveStyle: Property<DivDrawable>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -46,7 +48,7 @@ class DivSlider internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "slider"
@@ -69,6 +71,7 @@ class DivSlider internal constructor(
"min_value" to minValue,
"paddings" to paddings,
"row_span" to rowSpan,
"secondary_value_accessibility" to secondaryValueAccessibility,
"selected_actions" to selectedActions,
"thumb_secondary_style" to thumbSecondaryStyle,
"thumb_secondary_text_style" to thumbSecondaryTextStyle,
@@ -81,6 +84,7 @@ class DivSlider internal constructor(
"tooltips" to tooltips,
"track_active_style" to trackActiveStyle,
"track_inactive_style" to trackInactiveStyle,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -131,6 +135,7 @@ fun <T> TemplateContext<T>.divSlider(): LiteralProperty<DivSlider> {
minValue = null,
paddings = null,
rowSpan = null,
secondaryValueAccessibility = null,
selectedActions = null,
thumbSecondaryStyle = null,
thumbSecondaryTextStyle = null,
@@ -143,6 +148,7 @@ fun <T> TemplateContext<T>.divSlider(): LiteralProperty<DivSlider> {
tooltips = null,
trackActiveStyle = null,
trackInactiveStyle = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -174,6 +180,7 @@ fun <T> TemplateContext<T>.divSlider(
minValue: Property<Int>? = null,
paddings: Property<DivEdgeInsets>? = null,
rowSpan: Property<Int>? = null,
secondaryValueAccessibility: Property<DivAccessibility>? = null,
selectedActions: Property<List<DivAction>>? = null,
thumbSecondaryStyle: Property<DivDrawable>? = null,
thumbSecondaryTextStyle: Property<DivSlider.TextStyle>? = null,
@@ -183,6 +190,7 @@ fun <T> TemplateContext<T>.divSlider(
tickMarkActiveStyle: Property<DivDrawable>? = null,
tickMarkInactiveStyle: Property<DivDrawable>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -209,6 +217,7 @@ fun <T> TemplateContext<T>.divSlider(
minValue = minValue,
paddings = paddings,
rowSpan = rowSpan,
secondaryValueAccessibility = secondaryValueAccessibility,
selectedActions = selectedActions,
thumbSecondaryStyle = thumbSecondaryStyle,
thumbSecondaryTextStyle = thumbSecondaryTextStyle,
@@ -221,6 +230,7 @@ fun <T> TemplateContext<T>.divSlider(
tooltips = tooltips,
trackActiveStyle = trackActiveStyle,
trackInactiveStyle = trackInactiveStyle,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -252,6 +262,7 @@ fun <T> TemplateContext<T>.divSlider(
minValue: Int? = null,
paddings: DivEdgeInsets? = null,
rowSpan: Int? = null,
secondaryValueAccessibility: DivAccessibility? = null,
selectedActions: List<DivAction>? = null,
thumbSecondaryStyle: DivDrawable? = null,
thumbSecondaryTextStyle: DivSlider.TextStyle? = null,
@@ -261,6 +272,7 @@ fun <T> TemplateContext<T>.divSlider(
tickMarkActiveStyle: DivDrawable? = null,
tickMarkInactiveStyle: DivDrawable? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -287,6 +299,7 @@ fun <T> TemplateContext<T>.divSlider(
minValue = optionalValue(minValue),
paddings = optionalValue(paddings),
rowSpan = optionalValue(rowSpan),
secondaryValueAccessibility = optionalValue(secondaryValueAccessibility),
selectedActions = optionalValue(selectedActions),
thumbSecondaryStyle = optionalValue(thumbSecondaryStyle),
thumbSecondaryTextStyle = optionalValue(thumbSecondaryTextStyle),
@@ -299,6 +312,7 @@ fun <T> TemplateContext<T>.divSlider(
tooltips = optionalValue(tooltips),
trackActiveStyle = optionalValue(trackActiveStyle),
trackInactiveStyle = optionalValue(trackInactiveStyle),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -372,6 +386,7 @@ fun CardContext.divSlider(
minValue: ValueProperty<Int>? = null,
paddings: ValueProperty<DivEdgeInsets>? = null,
rowSpan: ValueProperty<Int>? = null,
secondaryValueAccessibility: ValueProperty<DivAccessibility>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
thumbSecondaryStyle: ValueProperty<DivDrawable>? = null,
thumbSecondaryTextStyle: ValueProperty<DivSlider.TextStyle>? = null,
@@ -381,6 +396,7 @@ fun CardContext.divSlider(
tickMarkActiveStyle: ValueProperty<DivDrawable>? = null,
tickMarkInactiveStyle: ValueProperty<DivDrawable>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -407,6 +423,7 @@ fun CardContext.divSlider(
minValue = minValue,
paddings = paddings,
rowSpan = rowSpan,
secondaryValueAccessibility = secondaryValueAccessibility,
selectedActions = selectedActions,
thumbSecondaryStyle = thumbSecondaryStyle,
thumbSecondaryTextStyle = thumbSecondaryTextStyle,
@@ -419,6 +436,7 @@ fun CardContext.divSlider(
tooltips = tooltips,
trackActiveStyle = trackActiveStyle,
trackInactiveStyle = trackInactiveStyle,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -450,6 +468,7 @@ fun CardContext.divSlider(
minValue: Int? = null,
paddings: DivEdgeInsets? = null,
rowSpan: Int? = null,
secondaryValueAccessibility: DivAccessibility? = null,
selectedActions: List<DivAction>? = null,
thumbSecondaryStyle: DivDrawable? = null,
thumbSecondaryTextStyle: DivSlider.TextStyle? = null,
@@ -459,6 +478,7 @@ fun CardContext.divSlider(
tickMarkActiveStyle: DivDrawable? = null,
tickMarkInactiveStyle: DivDrawable? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -485,6 +505,7 @@ fun CardContext.divSlider(
minValue = optionalValue(minValue),
paddings = optionalValue(paddings),
rowSpan = optionalValue(rowSpan),
secondaryValueAccessibility = optionalValue(secondaryValueAccessibility),
selectedActions = optionalValue(selectedActions),
thumbSecondaryStyle = optionalValue(thumbSecondaryStyle),
thumbSecondaryTextStyle = optionalValue(thumbSecondaryTextStyle),
@@ -497,6 +518,7 @@ fun CardContext.divSlider(
tooltips = optionalValue(tooltips),
trackActiveStyle = value(trackActiveStyle),
trackInactiveStyle = value(trackInactiveStyle),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class DivSolidBackground internal constructor(
@JsonIgnore val color: Property<Color>?,
) : DivBackground() {
) : DivBackground {
@JsonProperty("type") override val type = "solid"
@@ -29,6 +29,7 @@ class DivState internal constructor(
@JsonIgnore override val selectedActions: Property<List<DivAction>>?,
@JsonIgnore val states: Property<List<State>>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore val transitionAnimationSelector: Property<DivTransitionSelector>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@@ -38,7 +39,7 @@ class DivState internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "state"
@@ -64,6 +65,7 @@ class DivState internal constructor(
"selected_actions" to selectedActions,
"states" to states,
"tooltips" to tooltips,
"transform" to transform,
"transition_animation_selector" to transitionAnimationSelector,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
@@ -118,6 +120,7 @@ fun <T> TemplateContext<T>.divState(): LiteralProperty<DivState> {
selectedActions = null,
states = null,
tooltips = null,
transform = null,
transitionAnimationSelector = null,
transitionChange = null,
transitionIn = null,
@@ -150,6 +153,7 @@ fun <T> TemplateContext<T>.divState(
rowSpan: Property<Int>? = null,
selectedActions: Property<List<DivAction>>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionAnimationSelector: Property<DivTransitionSelector>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
@@ -180,6 +184,7 @@ fun <T> TemplateContext<T>.divState(
selectedActions = selectedActions,
states = states,
tooltips = tooltips,
transform = transform,
transitionAnimationSelector = transitionAnimationSelector,
transitionChange = transitionChange,
transitionIn = transitionIn,
@@ -212,6 +217,7 @@ fun <T> TemplateContext<T>.divState(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionAnimationSelector: DivTransitionSelector? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
@@ -242,6 +248,7 @@ fun <T> TemplateContext<T>.divState(
selectedActions = optionalValue(selectedActions),
states = optionalValue(states),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionAnimationSelector = optionalValue(transitionAnimationSelector),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
@@ -316,6 +323,7 @@ fun CardContext.divState(
rowSpan: ValueProperty<Int>? = null,
selectedActions: ValueProperty<List<DivAction>>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionAnimationSelector: ValueProperty<DivTransitionSelector>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
@@ -346,6 +354,7 @@ fun CardContext.divState(
selectedActions = selectedActions,
states = states,
tooltips = tooltips,
transform = transform,
transitionAnimationSelector = transitionAnimationSelector,
transitionChange = transitionChange,
transitionIn = transitionIn,
@@ -378,6 +387,7 @@ fun CardContext.divState(
rowSpan: Int? = null,
selectedActions: List<DivAction>? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionAnimationSelector: DivTransitionSelector? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
@@ -408,6 +418,7 @@ fun CardContext.divState(
selectedActions = optionalValue(selectedActions),
states = value(states),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionAnimationSelector = optionalValue(transitionAnimationSelector),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
@@ -36,6 +36,7 @@ class DivTabs internal constructor(
@JsonIgnore val tabTitleStyle: Property<TabTitleStyle>?,
@JsonIgnore val titlePaddings: Property<DivEdgeInsets>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -44,7 +45,7 @@ class DivTabs internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "tabs"
@@ -77,6 +78,7 @@ class DivTabs internal constructor(
"tab_title_style" to tabTitleStyle,
"title_paddings" to titlePaddings,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -185,6 +187,7 @@ fun <T> TemplateContext<T>.divTabs(): LiteralProperty<DivTabs> {
tabTitleStyle = null,
titlePaddings = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -223,6 +226,7 @@ fun <T> TemplateContext<T>.divTabs(
tabTitleStyle: Property<DivTabs.TabTitleStyle>? = null,
titlePaddings: Property<DivEdgeInsets>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -259,6 +263,7 @@ fun <T> TemplateContext<T>.divTabs(
tabTitleStyle = tabTitleStyle,
titlePaddings = titlePaddings,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -297,6 +302,7 @@ fun <T> TemplateContext<T>.divTabs(
tabTitleStyle: DivTabs.TabTitleStyle? = null,
titlePaddings: DivEdgeInsets? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -333,6 +339,7 @@ fun <T> TemplateContext<T>.divTabs(
tabTitleStyle = optionalValue(tabTitleStyle),
titlePaddings = optionalValue(titlePaddings),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -510,6 +517,7 @@ fun CardContext.divTabs(
tabTitleStyle: ValueProperty<DivTabs.TabTitleStyle>? = null,
titlePaddings: ValueProperty<DivEdgeInsets>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -546,6 +554,7 @@ fun CardContext.divTabs(
tabTitleStyle = tabTitleStyle,
titlePaddings = titlePaddings,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -584,6 +593,7 @@ fun CardContext.divTabs(
tabTitleStyle: DivTabs.TabTitleStyle? = null,
titlePaddings: DivEdgeInsets? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -620,6 +630,7 @@ fun CardContext.divTabs(
tabTitleStyle = optionalValue(tabTitleStyle),
titlePaddings = optionalValue(titlePaddings),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -49,8 +49,9 @@ class DivText internal constructor(
@JsonIgnore val textAlignmentHorizontal: Property<DivAlignmentHorizontal>?,
@JsonIgnore val textAlignmentVertical: Property<DivAlignmentVertical>?,
@JsonIgnore val textColor: Property<Color>?,
@JsonIgnore val textGradient: Property<DivGradientBackground>?,
@JsonIgnore val textGradient: Property<DivTextGradient>?,
@JsonIgnore override val tooltips: Property<List<DivTooltip>>?,
@JsonIgnore override val transform: Property<DivTransform>?,
@JsonIgnore override val transitionChange: Property<DivChangeTransition>?,
@JsonIgnore override val transitionIn: Property<DivAppearanceTransition>?,
@JsonIgnore override val transitionOut: Property<DivAppearanceTransition>?,
@@ -61,7 +62,7 @@ class DivText internal constructor(
@JsonIgnore override val visibilityAction: Property<DivVisibilityAction>?,
@JsonIgnore override val visibilityActions: Property<List<DivVisibilityAction>>?,
@JsonIgnore override val width: Property<DivSize>?,
) : Div(), DivBase {
) : Div, DivBase {
@JsonProperty("type") override val type = "text"
@@ -109,6 +110,7 @@ class DivText internal constructor(
"text_color" to textColor,
"text_gradient" to textGradient,
"tooltips" to tooltips,
"transform" to transform,
"transition_change" to transitionChange,
"transition_in" to transitionIn,
"transition_out" to transitionOut,
@@ -151,6 +153,7 @@ class DivText internal constructor(
@JsonIgnore val height: Property<DivFixedSize>?,
@JsonIgnore val start: Property<Int>?,
@JsonIgnore val tintColor: Property<Color>?,
@JsonIgnore val tintMode: Property<DivBlendMode>?,
@JsonIgnore val url: Property<URI>?,
@JsonIgnore val width: Property<DivFixedSize>?,
) {
@@ -161,6 +164,7 @@ class DivText internal constructor(
"height" to height,
"start" to start,
"tint_color" to tintColor,
"tint_mode" to tintMode,
"url" to url,
"width" to width,
)
@@ -247,6 +251,7 @@ fun <T> TemplateContext<T>.divText(): LiteralProperty<DivText> {
textColor = null,
textGradient = null,
tooltips = null,
transform = null,
transitionChange = null,
transitionIn = null,
transitionOut = null,
@@ -300,8 +305,9 @@ fun <T> TemplateContext<T>.divText(
textAlignmentHorizontal: Property<DivAlignmentHorizontal>? = null,
textAlignmentVertical: Property<DivAlignmentVertical>? = null,
textColor: Property<Color>? = null,
textGradient: Property<DivGradientBackground>? = null,
textGradient: Property<DivTextGradient>? = null,
tooltips: Property<List<DivTooltip>>? = null,
transform: Property<DivTransform>? = null,
transitionChange: Property<DivChangeTransition>? = null,
transitionIn: Property<DivAppearanceTransition>? = null,
transitionOut: Property<DivAppearanceTransition>? = null,
@@ -355,6 +361,7 @@ fun <T> TemplateContext<T>.divText(
textColor = textColor,
textGradient = textGradient,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -408,8 +415,9 @@ fun <T> TemplateContext<T>.divText(
textAlignmentHorizontal: DivAlignmentHorizontal? = null,
textAlignmentVertical: DivAlignmentVertical? = null,
textColor: Color? = null,
textGradient: DivGradientBackground? = null,
textGradient: DivTextGradient? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -463,6 +471,7 @@ fun <T> TemplateContext<T>.divText(
textColor = optionalValue(textColor),
textGradient = optionalValue(textGradient),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -518,6 +527,7 @@ fun <T> TemplateContext<T>.image(): LiteralProperty<DivText.Image> {
height = null,
start = null,
tintColor = null,
tintMode = null,
url = null,
width = null,
))
@@ -528,12 +538,14 @@ fun <T> TemplateContext<T>.image(
url: Property<URI>? = null,
height: Property<DivFixedSize>? = null,
tintColor: Property<Color>? = null,
tintMode: Property<DivBlendMode>? = null,
width: Property<DivFixedSize>? = null,
): LiteralProperty<DivText.Image> {
return value(DivText.Image(
height = height,
start = start,
tintColor = tintColor,
tintMode = tintMode,
url = url,
width = width,
))
@@ -544,12 +556,14 @@ fun <T> TemplateContext<T>.image(
url: URI? = null,
height: DivFixedSize? = null,
tintColor: Color? = null,
tintMode: DivBlendMode? = null,
width: DivFixedSize? = null,
): LiteralProperty<DivText.Image> {
return value(DivText.Image(
height = optionalValue(height),
start = optionalValue(start),
tintColor = optionalValue(tintColor),
tintMode = optionalValue(tintMode),
url = optionalValue(url),
width = optionalValue(width),
))
@@ -677,8 +691,9 @@ fun CardContext.divText(
textAlignmentHorizontal: ValueProperty<DivAlignmentHorizontal>? = null,
textAlignmentVertical: ValueProperty<DivAlignmentVertical>? = null,
textColor: ValueProperty<Color>? = null,
textGradient: ValueProperty<DivGradientBackground>? = null,
textGradient: ValueProperty<DivTextGradient>? = null,
tooltips: ValueProperty<List<DivTooltip>>? = null,
transform: ValueProperty<DivTransform>? = null,
transitionChange: ValueProperty<DivChangeTransition>? = null,
transitionIn: ValueProperty<DivAppearanceTransition>? = null,
transitionOut: ValueProperty<DivAppearanceTransition>? = null,
@@ -732,6 +747,7 @@ fun CardContext.divText(
textColor = textColor,
textGradient = textGradient,
tooltips = tooltips,
transform = transform,
transitionChange = transitionChange,
transitionIn = transitionIn,
transitionOut = transitionOut,
@@ -785,8 +801,9 @@ fun CardContext.divText(
textAlignmentHorizontal: DivAlignmentHorizontal? = null,
textAlignmentVertical: DivAlignmentVertical? = null,
textColor: Color? = null,
textGradient: DivGradientBackground? = null,
textGradient: DivTextGradient? = null,
tooltips: List<DivTooltip>? = null,
transform: DivTransform? = null,
transitionChange: DivChangeTransition? = null,
transitionIn: DivAppearanceTransition? = null,
transitionOut: DivAppearanceTransition? = null,
@@ -840,6 +857,7 @@ fun CardContext.divText(
textColor = optionalValue(textColor),
textGradient = optionalValue(textGradient),
tooltips = optionalValue(tooltips),
transform = optionalValue(transform),
transitionChange = optionalValue(transitionChange),
transitionIn = optionalValue(transitionIn),
transitionOut = optionalValue(transitionOut),
@@ -886,12 +904,14 @@ fun CardContext.image(
url: ValueProperty<URI>,
height: ValueProperty<DivFixedSize>? = null,
tintColor: ValueProperty<Color>? = null,
tintMode: ValueProperty<DivBlendMode>? = null,
width: ValueProperty<DivFixedSize>? = null,
): DivText.Image {
return DivText.Image(
height = height,
start = start,
tintColor = tintColor,
tintMode = tintMode,
url = url,
width = width,
)
@@ -902,12 +922,14 @@ fun CardContext.image(
url: URI,
height: DivFixedSize? = null,
tintColor: Color? = null,
tintMode: DivBlendMode? = null,
width: DivFixedSize? = null,
): DivText.Image {
return DivText.Image(
height = optionalValue(height),
start = value(start),
tintColor = optionalValue(tintColor),
tintMode = optionalValue(tintMode),
url = value(url),
width = optionalValue(width),
)
@@ -0,0 +1,14 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed interface DivTextGradient {
val type: String
}
@@ -0,0 +1,90 @@
// Generated code. Do not modify.
package com.yandex.div.dsl.model
import java.net.URI
import com.fasterxml.jackson.annotation.*
import com.yandex.div.dsl.*
import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivTransform internal constructor(
@JsonIgnore val pivotX: Property<DivPivot>?,
@JsonIgnore val pivotY: Property<DivPivot>?,
@JsonIgnore val rotation: Property<Double>?,
) {
@JsonAnyGetter
internal fun properties(): Map<String, Any> {
return propertyMapOf(
"pivot_x" to pivotX,
"pivot_y" to pivotY,
"rotation" to rotation,
)
}
}
fun <T> TemplateContext<T>.divTransform(): LiteralProperty<DivTransform> {
return value(DivTransform(
pivotX = null,
pivotY = null,
rotation = null,
))
}
fun <T> TemplateContext<T>.divTransform(
pivotX: Property<DivPivot>? = null,
pivotY: Property<DivPivot>? = null,
rotation: Property<Double>? = null,
): LiteralProperty<DivTransform> {
return value(DivTransform(
pivotX = pivotX,
pivotY = pivotY,
rotation = rotation,
))
}
fun <T> TemplateContext<T>.divTransform(
pivotX: DivPivot? = null,
pivotY: DivPivot? = null,
rotation: Double? = null,
): LiteralProperty<DivTransform> {
return value(DivTransform(
pivotX = optionalValue(pivotX),
pivotY = optionalValue(pivotY),
rotation = optionalValue(rotation),
))
}
fun CardContext.divTransform(): DivTransform {
return DivTransform(
pivotX = null,
pivotY = null,
rotation = null,
)
}
fun CardContext.divTransform(
pivotX: ValueProperty<DivPivot>? = null,
pivotY: ValueProperty<DivPivot>? = null,
rotation: ValueProperty<Double>? = null,
): DivTransform {
return DivTransform(
pivotX = pivotX,
pivotY = pivotY,
rotation = rotation,
)
}
fun CardContext.divTransform(
pivotX: DivPivot? = null,
pivotY: DivPivot? = null,
rotation: Double? = null,
): DivTransform {
return DivTransform(
pivotX = optionalValue(pivotX),
pivotY = optionalValue(pivotY),
rotation = optionalValue(rotation),
)
}
@@ -9,7 +9,6 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
sealed class DivVariable {
abstract val type: String
sealed interface DivVariable {
val type: String
}
@@ -10,7 +10,7 @@ import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class DivVisibilityAction internal constructor(
@JsonIgnore val downloadCallbacks: Property<DownloadCallbacks>?,
@JsonIgnore val downloadCallbacks: Property<DivDownloadCallbacks>?,
@JsonIgnore val logId: Property<String>?,
@JsonIgnore val logLimit: Property<Int>?,
@JsonIgnore val payload: Property<Map<String, Any>>?,
@@ -50,7 +50,7 @@ fun <T> TemplateContext<T>.divVisibilityAction(): LiteralProperty<DivVisibilityA
fun <T> TemplateContext<T>.divVisibilityAction(
logId: Property<String>? = null,
downloadCallbacks: Property<DownloadCallbacks>? = null,
downloadCallbacks: Property<DivDownloadCallbacks>? = null,
logLimit: Property<Int>? = null,
payload: Property<Map<String, Any>>? = null,
referer: Property<URI>? = null,
@@ -72,7 +72,7 @@ fun <T> TemplateContext<T>.divVisibilityAction(
fun <T> TemplateContext<T>.divVisibilityAction(
logId: String? = null,
downloadCallbacks: DownloadCallbacks? = null,
downloadCallbacks: DivDownloadCallbacks? = null,
logLimit: Int? = null,
payload: Map<String, Any>? = null,
referer: URI? = null,
@@ -94,7 +94,7 @@ fun <T> TemplateContext<T>.divVisibilityAction(
fun CardContext.divVisibilityAction(
logId: ValueProperty<String>,
downloadCallbacks: ValueProperty<DownloadCallbacks>? = null,
downloadCallbacks: ValueProperty<DivDownloadCallbacks>? = null,
logLimit: ValueProperty<Int>? = null,
payload: ValueProperty<Map<String, Any>>? = null,
referer: ValueProperty<URI>? = null,
@@ -116,7 +116,7 @@ fun CardContext.divVisibilityAction(
fun CardContext.divVisibilityAction(
logId: String,
downloadCallbacks: DownloadCallbacks? = null,
downloadCallbacks: DivDownloadCallbacks? = null,
logLimit: Int? = null,
payload: Map<String, Any>? = null,
referer: URI? = null,
@@ -11,7 +11,7 @@ import com.yandex.div.dsl.util.*
class DivWrapContentSize internal constructor(
@JsonIgnore val constrained: Property<BoolInt>?,
) : DivSize() {
) : DivSize {
@JsonProperty("type") override val type = "wrap_content"
@@ -12,7 +12,7 @@ import com.yandex.div.dsl.util.*
class IntegerVariable internal constructor(
@JsonIgnore val name: Property<String>?,
@JsonIgnore val value: Property<Int>?,
) : DivVariable() {
) : DivVariable {
@JsonProperty("type") override val type = "integer"
@@ -12,7 +12,7 @@ import com.yandex.div.dsl.util.*
class NumberVariable internal constructor(
@JsonIgnore val name: Property<String>?,
@JsonIgnore val value: Property<Double>?,
) : DivVariable() {
) : DivVariable {
@JsonProperty("type") override val type = "number"
@@ -9,10 +9,10 @@ import com.yandex.div.dsl.context.*
import com.yandex.div.dsl.type.*
import com.yandex.div.dsl.util.*
class StrVariable internal constructor(
class StringVariable internal constructor(
@JsonIgnore val name: Property<String>?,
@JsonIgnore val value: Property<String>?,
) : DivVariable() {
) : DivVariable {
@JsonProperty("type") override val type = "string"
@@ -25,48 +25,48 @@ class StrVariable internal constructor(
}
}
fun <T> TemplateContext<T>.strVariable(): LiteralProperty<StrVariable> {
return value(StrVariable(
fun <T> TemplateContext<T>.stringVariable(): LiteralProperty<StringVariable> {
return value(StringVariable(
name = null,
value = null,
))
}
fun <T> TemplateContext<T>.strVariable(
fun <T> TemplateContext<T>.stringVariable(
name: Property<String>? = null,
value: Property<String>? = null,
): LiteralProperty<StrVariable> {
return value(StrVariable(
): LiteralProperty<StringVariable> {
return value(StringVariable(
name = name,
value = value,
))
}
fun <T> TemplateContext<T>.strVariable(
fun <T> TemplateContext<T>.stringVariable(
name: String? = null,
value: String? = null,
): LiteralProperty<StrVariable> {
return value(StrVariable(
): LiteralProperty<StringVariable> {
return value(StringVariable(
name = optionalValue(name),
value = optionalValue(value),
))
}
fun CardContext.strVariable(
fun CardContext.stringVariable(
name: ValueProperty<String>,
value: ValueProperty<String>,
): StrVariable {
return StrVariable(
): StringVariable {
return StringVariable(
name = name,
value = value,
)
}
fun CardContext.strVariable(
fun CardContext.stringVariable(
name: String,
value: String,
): StrVariable {
return StrVariable(
): StringVariable {
return StringVariable(
name = value(name),
value = value(value),
)
@@ -12,7 +12,7 @@ import com.yandex.div.dsl.util.*
class UrlVariable internal constructor(
@JsonIgnore val name: Property<String>?,
@JsonIgnore val value: Property<URI>?,
) : DivVariable() {
) : DivVariable {
@JsonProperty("type") override val type = "url"