https://kotlinlang.org logo
#compose-web
Title
# compose-web
a

Anmol Verma

03/03/2024, 7:47 AM
Hi Folks, I want to access
window.crypto
via
import kotlinx.browser.window
within my kotlin/js project but it doesn't see to work. anyone ? Is there a separate dependency that needs to be imported ?
c

Chrimaeon

03/03/2024, 8:13 AM
🤔 looks like it’s only available in workers
🚫 1
a

Anmol Verma

03/03/2024, 8:17 AM
If web can access it via window.crypto it should be available on wasm too right ?
c

Chrimaeon

03/03/2024, 8:18 AM
In js I guess but not in wasm.
a

Anmol Verma

03/03/2024, 8:20 AM
But wasm can call js too ?
h

hfhbd

03/03/2024, 8:20 AM
It’s not only available in workers but the stdlib does not include it (yet). Just create the expected declaration manually.
👍 1
a

Anmol Verma

03/03/2024, 8:21 AM
Will try that, thanks philip!
t

turansky

03/03/2024, 3:18 PM
All stable browser declarations already available in
kotlin-browser
- https://github.com/JetBrains/kotlin-wrappers/tree/master/kotlin-browser
💯 1
🙌 1
💯 1
5 Views