TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

incomplete FileSystemHandle types

Open jozefchutka opened this issue 3 years ago • 3 comments

Please update types for File System Access API:

FileSystemDirectoryHandle is missing entries/values iterators

FileSystemFileHandle missing createWritable

FileSystemHandle is missing queryPermission and requestPermission

jozefchutka avatar Sep 08 '22 11:09 jozefchutka

createWritable, queryPermission and requestPermission are not missing they are only supported in chromium so they are not added see for example https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle/createWritable#browser_compatibility

For FileSystemDirectoryHandle is missing entries/values iterators on first I think you are right not 100% sure maybe that would just need a bump of the BCD version to be fixed...

mathe42 avatar Sep 08 '22 12:09 mathe42

FileSystemDirectoryHandle is missing entries/values iterators

This is because the generator does not support async iterable, but then as far as I know Blink is the only engine that supports this. I'm all for a PR for that part, though. (Hi @MattiasBuelens, do you want to try cherry-picking from #1135 for this?)

saschanaz avatar Sep 18 '22 11:09 saschanaz

FileSystemDirectoryHandle has async iterable support in Blink (as of bug 1011539) and WebKit (as of bug 231142). So this does satisfy our criteria! 😄 (I'm a bit surprised that FileSystemDirectoryHandle got support before ReadableStream, but okay. 😛)

I'll look into reworking #1135.

MattiasBuelens avatar Sep 18 '22 13:09 MattiasBuelens

Firefox supports FileSystemFileHandle.createWritable as of version 111. https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API#browser_compatibility

(As a workaround there is @types/wicg-file-system-access)

ibillingsley avatar Mar 25 '23 04:03 ibillingsley

#1521 fixed this. Blink-only permission things will probably not be added given other implementors are against them.

@github-actions close

saschanaz avatar Mar 25 '23 05:03 saschanaz

Closing because @saschanaz is one of the code-owners of this repository.

github-actions[bot] avatar Mar 25 '23 05:03 github-actions[bot]

In what library is this included? The types for (listing the contents of a directory)[https://developer.mozilla.org/en-US/docs/Web/API/File_System_API/Origin_private_file_system#listing_the_contents_of_a_folder] seem to be missing for me, I'm using: "lib": ["DOM", "DOM.Iterable", "ESNext"]

image

mrkev avatar Oct 21 '23 02:10 mrkev

Created a new issue to not discuss in a closed issue https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1639

mrkev avatar Oct 21 '23 03:10 mrkev