mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-29 13:38:45 +00:00
fixes in ResizeObserver
This commit is contained in:
parent
65bdab4f7e
commit
6f9c19bbf6
@ -14,15 +14,17 @@ external class ResizeObserver(
|
|||||||
fun disconnect()
|
fun disconnect()
|
||||||
}
|
}
|
||||||
|
|
||||||
external class ResizeObserverEntry {
|
external interface ResizeObserverSize {
|
||||||
val borderBoxSize: Int?
|
val blockSize: Float
|
||||||
val contentBoxSize: Int?
|
val inlineSize: Float
|
||||||
val devicePixelContentBoxSize: Int?
|
|
||||||
val contentRect: DOMRectReadOnly
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ResizeObserverEntry.sizeOrThrow(): Int {
|
external interface ResizeObserverEntry {
|
||||||
return contentBoxSize ?: borderBoxSize ?: devicePixelContentBoxSize ?: error("Unable to find default size in entry $this")
|
val borderBoxSize: Array<ResizeObserverSize>
|
||||||
|
val contentBoxSize: Array<ResizeObserverSize>
|
||||||
|
val devicePixelContentBoxSize: Array<ResizeObserverSize>
|
||||||
|
val contentRect: DOMRectReadOnly
|
||||||
|
val target: Element
|
||||||
}
|
}
|
||||||
|
|
||||||
fun ResizeObserver.observe(target: Element, options: ResizeObserverObserveOptions) = observe(
|
fun ResizeObserver.observe(target: Element, options: ResizeObserverObserveOptions) = observe(
|
||||||
|
Loading…
Reference in New Issue
Block a user