Hi, is the anyway to access File System API in bro...
# javascript
h
Hi, is the anyway to access File System API in browser mode from kotlinJS? i.e. https://web.dev/file-system-access/ It's important for me if I'm to create a PWA
t
No, but you can write it manually
Copy code
external fun showSaveFilePicker(): Promise<Array<out FileHandle>>
h
Thanks @turansky
t
Also you copy TypeScript existed definitions from
lib.d.ts
TypeScript definitions - good source for Kotlin declarations
h
Will make sure to look at that! 🙂
t
h
@turansky is it possible to use Dukat somehow to autogenerate from that repo? Or I still need to write the full JS code and wrap it in my own types?
t
You can check Dukat result for start. Most functions it will convert 🙂
In common case I add package, which missed in Dukat results
For “missed” browser extensions I have separate subproject
a
@Hampus Londögård yes, there is an option in gradle plugin to automatically generate wrappers under the hood: https://kotlinlang.org/docs/reference/js-external-declarations-with-dukat.html It is experimental and not fully accurate yet though.
h
having some issues with
AsyncIterableIterator
Note sure how i get that type/class included
t
You can declare it as
external interface
for start
j
You can use okio.FileSystem if you’d like a multiplatform one https://square.github.io/okio/2.x/okio/okio/-file-system/index.html
Copy code
implementation("com.squareup.okio:okio-multiplatform:3.0.0-alpha.1")
🤔 1
👍 1
h
@jessewilson thanks. That seems really good!