rename MutationObserverInit -> MutationObserverOptions to avoid naming collisions

This commit is contained in:
InsanusMokrassar committed 2026-11-03 17:44:45 +06:00
1 parent a81d28426b
commit a84a89fb5b
3 files changed
+3 -5

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@
* `SQLite`: `3.53.4.0` -> `3.54.1.0`
* `Ktor`: `3.6.0` -> `3.6.1`
* `Common`:
* Add JS `MutationObserverInit` factory that omits unspecified options and preserves browser defaults.
* Add JS `MutationObserverOptions` factory that omits unspecified options and preserves browser defaults.
* Use safe `MutationObserver` options in `onRemoved` and cover DOM observation and outside-click cleanup with browser tests.
## 0.32.1
@@ -19,7 +19,7 @@ fun Node.onRemoved(block: () -> Unit): MutationObserver {
}
}
observer.observe(document, MutationObserverInit(childList = true, subtree = true))
observer.observe(document, MutationObserverOptions(childList = true, subtree = true))
return observer
}
@@ -1,7 +1,5 @@
package dev.inmo.micro_utils.common
import org.w3c.dom.MutationObserverInit as NativeMutationObserverInit
/**
* Creates options for [org.w3c.dom.MutationObserver] without adding unspecified properties.
*
@@ -12,7 +10,7 @@ import org.w3c.dom.MutationObserverInit as NativeMutationObserverInit
* Null arguments are omitted. Explicit false values and empty arrays are preserved. The browser remains responsible
* for validating the options passed to [org.w3c.dom.MutationObserver.observe].
*/
fun MutationObserverInit(
fun MutationObserverOptions(
childList: Boolean? = null,
attributes: Boolean? = null,
characterData: Boolean? = null,