Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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)
Expand Up @@ -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)
}
Expand Up @@ -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
Expand Down
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down
Expand Up @@ -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")
Expand Down Expand Up @@ -152,7 +152,7 @@ open class StyleSheet(
StyleSheet().apply(rulesBuild).cssRules
}

fun buildCSS(
internal fun buildCSS(
thisClass: CSSSelector,
thisContext: CSSSelector,
cssRule: CSSBuilder.() -> Unit
Expand Down