Browse Source

Remove StylePropertyValue.asString, StylePropertyValue.asNumber and StylePropertyValue.asCSSStyleValue

in other words, remove all StylePropertyValue -> js object value
pull/905/head
Shagen Ogandzhanian 3 years ago
parent
commit
a83bf4c181
  1. 6
      web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/StylePropertyValue.kt

6
web/core/src/jsMain/kotlin/org/jetbrains/compose/web/css/StylePropertyValue.kt

@ -14,12 +14,6 @@ external interface StylePropertyString: StylePropertyValue
inline fun StylePropertyValue(value: String): StylePropertyString = value.unsafeCast<StylePropertyString>() inline fun StylePropertyValue(value: String): StylePropertyString = value.unsafeCast<StylePropertyString>()
inline fun StylePropertyValue(value: Number): StylePropertyNumber = value.unsafeCast<StylePropertyNumber>() inline fun StylePropertyValue(value: Number): StylePropertyNumber = value.unsafeCast<StylePropertyNumber>()
fun StylePropertyValue.asString(): String? = if (jsTypeOf(this) == "string") this.unsafeCast<String>() else null
fun StylePropertyValue.asNumber(): Number? = if (jsTypeOf(this) == "number") this.unsafeCast<Number>() else null
fun StylePropertyValue.asCSSStyleValue(): CSSStyleValue? = if (jsTypeOf(this) == "object") this.unsafeCast<CSSStyleValue>() else null
external interface CSSStyleValue: StylePropertyValue { external interface CSSStyleValue: StylePropertyValue {
override fun toString(): String override fun toString(): String
} }

Loading…
Cancel
Save