GoogleChromeLabs / browser-fs-access

File System Access API with legacy fallback in the browser
https://googlechromelabs.github.io/browser-fs-access/demo/
Apache License 2.0
1.39k stars 85 forks source link

Add TypeScript definitions file #5

Closed bates64 closed 4 years ago

bates64 commented 4 years ago

The definition is based on the JSDoc comments, and they assume #3 is correct (i.e. DirectoryOpenOptions.recursive should be a boolean).

TypeScript currently does not support the Native File System API as the specification/implementation progress does not currently meet the requirements, so I've included temporary definitions for FileSystemHandle and FileSystemHandlePermissionDescriptor. This should scale gracefully once support is actually added provided the interface in the specification does not change significantly. (An alternative solution would be to simply not include these two interfaces and have fileSave take a generic object as its handle argument.)