fromRect

fun fromRect(other: DOMRectReadOnly = definedExternally): DOMRect(source)

The fromRect() static method of the DOMRect object creates a new DOMRect object with a given location and dimensions.

MDN Reference