Clipboard copy with formatting in Kotlin/JS

I am working on a Kotlin multiplatform project.
I want to support copy action with formatting.
There are a plenty of page in the web implementing it in javascript. All of them are almost same and do it like this:

const content = "SOMETHING!" const clipboardItem = new ClipboardItem({ 'text/html': new Blob([content],{type: 'text/html'}), 'text/plain': new Blob([content],{type: 'text/plain'}) }); navigator.clipboard.write([clipboardItem]) 

But I don’t know how should I implement it in Kotlin. Indeed, I could not construct an instance of ClipboardItem. How should I do it?

The following is my incomplete snippet written in Kotlin:

navigator.clipboard.write( arrayOf( ClipboardItem( ..... ) // <--- What should be here? ) ) 

Note that I’ve also asked the same question in SO.

Hi, did you ever find a solution to this? It seems there is a clipboard.write method that takes a DataTransfer object but not the one for ClipboardItem or indeed the ClipboardItem type.

Where is such method? I cannot find it.
Could you please give me an example?