web (breaking change): make some functions internal (#1509)

Co-authored-by: Oleksandr Karpovich <oleksandr.karpovich@jetbrains.com>
This commit is contained in:
Oleksandr Karpovich
2021-11-30 11:33:55 +01:00
committed by GitHub
parent 386b19e67e
commit 6d0a0f4f1d
5 changed files with 10 additions and 10 deletions

View File

@@ -10,18 +10,18 @@ import org.w3c.dom.css.CSSRule
import org.w3c.dom.css.CSSRuleList
external class CSSKeyframesRule: CSSRule {
internal external class CSSKeyframesRule: CSSRule {
val name: String
val cssRules: CSSRuleList
}
inline fun CSSKeyframesRule.appendRule(cssRule: String) {
internal inline fun CSSKeyframesRule.appendRule(cssRule: String) {
this.asDynamic().appendRule(cssRule)
}
@Suppress("NOTHING_TO_INLINE")
inline fun <T : Any> jsObject(): T =
internal inline fun <T : Any> jsObject(): T =
js("({})")
inline fun <T : Any> jsObject(builder: T.() -> Unit): T =
internal inline fun <T : Any> jsObject(builder: T.() -> Unit): T =
jsObject<T>().apply(builder)

View File

@@ -67,7 +67,7 @@ class CSSKeyframesBuilder() {
}
}
fun buildKeyframes(name: String, builder: CSSKeyframesBuilder.() -> Unit): CSSKeyframesRuleDeclaration {
internal fun buildKeyframes(name: String, builder: CSSKeyframesBuilder.() -> Unit): CSSKeyframesRuleDeclaration {
val frames = CSSKeyframesBuilder(builder).frames
return CSSKeyframesRuleDeclaration(name, frames)
}

View File

@@ -32,7 +32,7 @@ interface CSSGroupingRuleDeclaration: CSSRuleDeclaration {
typealias CSSRuleDeclarationList = List<CSSRuleDeclaration>
typealias MutableCSSRuleDeclarationList = MutableList<CSSRuleDeclaration>
fun buildCSSStyleRule(cssRule: CSSStyleRuleBuilder.() -> Unit): StyleHolder {
internal fun buildCSSStyleRule(cssRule: CSSStyleRuleBuilder.() -> Unit): StyleHolder {
val builder = CSSRuleBuilderImpl()
builder.cssRule()
return builder

View File

@@ -57,7 +57,7 @@ interface StyleBuilder {
}
}
inline fun variableValue(variableName: String, fallback: StylePropertyValue? = null) =
internal inline fun variableValue(variableName: String, fallback: StylePropertyValue? = null) =
"var(--$variableName${fallback?.let { ", $it" } ?: ""})"
external interface CSSVariableValueAs<out T : StylePropertyValue>
@@ -169,7 +169,7 @@ data class StylePropertyDeclaration(
typealias StylePropertyList = List<StylePropertyDeclaration>
typealias MutableStylePropertyList = MutableList<StylePropertyDeclaration>
fun StylePropertyList.nativeEquals(properties: StylePropertyList): Boolean {
internal fun StylePropertyList.nativeEquals(properties: StylePropertyList): Boolean {
if (this.size != properties.size) return false
var index = 0

View File

@@ -75,7 +75,7 @@ open class StyleSheet(
protected fun keyframes(cssKeyframes: CSSKeyframesBuilder.() -> Unit) = CSSKeyframesHolder(usePrefix, cssKeyframes)
companion object {
var counter = 0
private var counter = 0
}
@Suppress("EqualsOrHashCode")
@@ -152,7 +152,7 @@ open class StyleSheet(
StyleSheet().apply(rulesBuild).cssRules
}
fun buildCSS(
internal fun buildCSS(
thisClass: CSSSelector,
thisContext: CSSSelector,
cssRule: CSSBuilder.() -> Unit