We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In version 1.1.0, there is no values(), keys() or entries() defined in FileSystemDirectoryHandle.
I understand only standard API is emitted but in this case, in MDN, only Android Webview is not supported, which is exactly the same as removeEntry() which is emitted.
Did I miss something?
The text was updated successfully, but these errors were encountered:
You're correct - they are missing and need to be added. As always, the workaround is to use external extension methods until this is added. I believe this is a duplicate of #21, except here it's async: https://github.com/w3c/webref/blob/23c3d948f58f16e420d388269d29312f04cc419f/ed/idl/fs.idl#L45.
external
async
The Web IDL definition is here: https://webidl.spec.whatwg.org/#idl-iterable. There's an async section after that as well: https://webidl.spec.whatwg.org/#idl-async-iterable. This would add entries, keys, values, and forEach (if not async). We may want to add an Iterator type to dart:js_interop or package:web to support this.
entries
keys
values
forEach
Iterator
dart:js_interop
package:web
I thought we somewhat handled this with handling getter/setter and adding a List wrapper type, but we did not.
getter
setter
List
Sorry, something went wrong.
For those wanting an implementation right now, here is some code that works (with no exception handling):
extension FileSystemDirectoryHandleEx on FileSystemDirectoryHandle { Stream<FileSystemHandle> values() { final iterator = callMethod<JSObject>('values'.toJS); return _asyncIterator<FileSystemHandle>(iterator); } } Stream<T> _asyncIterator<T extends JSObject>(JSObject iterator) async* { while (true) { final next = await iterator.callMethod<JSPromise<T>>('next'.toJS).toDart; if (next.getProperty<JSBoolean>('done'.toJS).toDart) { break; } yield next.getProperty<T>('value'.toJS); } }
Use like this:
await for (FileSystemHandle handle in directoryHandle.values()) { ... }
No branches or pull requests
In version 1.1.0, there is no values(), keys() or entries() defined in FileSystemDirectoryHandle.
I understand only standard API is emitted but in this case, in MDN, only Android Webview is not supported, which is exactly the same as removeEntry() which is emitted.
Did I miss something?
The text was updated successfully, but these errors were encountered: