diff --git a/kotlin-browser/src/jsMain/generated/web/worklets/WorkletHandle.kt b/kotlin-browser/src/jsMain/generated/web/audio/AudioWorkletHandle.kt similarity index 59% rename from kotlin-browser/src/jsMain/generated/web/worklets/WorkletHandle.kt rename to kotlin-browser/src/jsMain/generated/web/audio/AudioWorkletHandle.kt index e58e757853a8..6851265e31c3 100644 --- a/kotlin-browser/src/jsMain/generated/web/worklets/WorkletHandle.kt +++ b/kotlin-browser/src/jsMain/generated/web/audio/AudioWorkletHandle.kt @@ -1,8 +1,8 @@ // Automatically generated - do not modify! -package web.worklets +package web.audio import js.module.ModuleHandle -sealed external interface WorkletHandle : +sealed external interface AudioWorkletHandle : ModuleHandle diff --git a/kotlin-browser/src/jsMain/kotlin/web/audio/audioWorklet.kt b/kotlin-browser/src/jsMain/kotlin/web/audio/audioWorklet.kt index 88a78cf3de74..89fe4921e8a7 100644 --- a/kotlin-browser/src/jsMain/kotlin/web/audio/audioWorklet.kt +++ b/kotlin-browser/src/jsMain/kotlin/web/audio/audioWorklet.kt @@ -1,9 +1,8 @@ package web.audio -import web.worklets.WorkletHandle import web.worklets.internal.createWorklet fun audioWorklet( block: (self: AudioWorkletGlobalScope) -> Unit, -): WorkletHandle = +): AudioWorkletHandle = createWorklet("AudioWorkletGlobalScope", block) diff --git a/kotlin-browser/src/jsMain/kotlin/web/worklets/internal/createWorklet.kt b/kotlin-browser/src/jsMain/kotlin/web/worklets/internal/createWorklet.kt index 419e2c57ff1c..fa36cffc7d8d 100644 --- a/kotlin-browser/src/jsMain/kotlin/web/worklets/internal/createWorklet.kt +++ b/kotlin-browser/src/jsMain/kotlin/web/worklets/internal/createWorklet.kt @@ -1,14 +1,14 @@ package web.worklets.internal +import js.module.ModuleHandle import js.reflect.unsafeCast import web.globals.internal.getGlobalScope import web.worklets.WorkletGlobalScope -import web.worklets.WorkletHandle -internal fun createWorklet( +internal fun createWorklet( scopeClassName: String, block: (self: S) -> Unit, -): WorkletHandle { +): H { val self: S = getGlobalScope(scopeClassName) block(self) return unsafeCast("Missed plugin integration! Worklet handle should be generated!")