Hi everyone,
I would like to use the org.w3c.workers.ServiceWorkerRegistration external class from Kotlin code but the pushManager property is not defined on Kotlin side. What is the recommended way to extend an existing external class with missing properties so that I don’t have to use dynamic?
Thank you!
s
spand
01/05/2024, 1:04 PM
Not sure what is best but this works really well:
Copy code
val ServiceWorkerRegistration.pushManager: PushManager get() = this.asDynamic().pushManager
a
Artem Kobzar
01/05/2024, 1:12 PM
@turansky do we have some api for it inside the kotlin-wrappers?
t
turansky
01/05/2024, 1:17 PM
In Kotlin Wrappers we have all stable browser API 😉