In other words, there should be an (optional) mode property only; there should not be a fileSystemHandle property at all, and mode should not be required. Furthermore, the valid values for mode should be 'read' and 'readwrite'.
I think what went wrong originally is that FileSystemHandlePermissionDescriptor was confused with FileSystemPermissionDescriptor (note the absence of "Handle" in the latter); see here.
The typings for FileSystemHandlePermissionDescriptor do not seem to be correct. They currently look like this:
But the working draft defines FileSystemHandlePermissionDescriptor like so:
In other words, there should be an (optional)
mode
property only; there should not be afileSystemHandle
property at all, andmode
should not be required. Furthermore, the valid values formode
should be'read'
and'readwrite'
.(As some additional corroboration, the MDN docs for queryPermission and requestPermission indicate the same thing.)
I think what went wrong originally is that
FileSystemHandlePermissionDescriptor
was confused withFileSystemPermissionDescriptor
(note the absence of "Handle" in the latter); see here.[EDIT: PR attached below.]