Add type definitions for Files And Directories API
See original GitHub issueSearch Terms
"Files And Directories API"
FileSystemFileEntry
Suggestion
Add types for the Files And Directories API: https://wicg.github.io/entries-api/
Specifically:
FileSystemEntry
FileSystemDirectoryEntry
FileSystemDirectoryReader
FileSystemFileEntry
FileSystem
Use Cases
Handling drag/drop of multiple files and/or folders, and gleaning extra information about the dropped files (which is what the API provides).
Checklist
My suggestion meets these guidelines:
- This wouldn’t be a breaking change in existing TypeScript/JavaScript code
- This wouldn’t change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn’t a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript’s Design Goals.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:8 (3 by maintainers)
Top Results From Across the Web
A quick introduction to “Type Declaration” files and adding ...
You can declare a type and entity such as a variable, function, or an n object (that uses this type) at the same...
Read more >Documentation - Creating .d.ts Files from .js files - TypeScript
Run the TypeScript compiler to generate the corresponding d.ts files for JS files; (optional) Edit your package.json to reference the types. Adding TypeScript....
Read more >File and Directory Entries API - MDN Web Docs - Mozilla
You can develop apps which read, write, and create files and/or directories in a virtual, sandboxed file system.
Read more >How to add type definitions for module in subdirectory?
Add the types directory under the files/include like the rest of your TS files. Assuming all of the source files are in src...
Read more >Generating TypeScript Definition Files from JavaScript
To accomplish that, you can publish Type Declaration files ( *.d.ts )in the root directory of the package you are publishing. TypeScript and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
looks like there are official types available. https://www.npmjs.com/package/@types/wicg-file-system-access
Just stumbled across this issue. The initial request of this issues asks for types for the non-standard “File and Directory Entries API”.
@types/wicg-file-system-access
are types for the “File System Access API”. (And be warned, there is also a third obsolete W3C draft for JS file system access)Currently, there are more browsers supporting the
entries-api
than thenative-file-system
API: https://caniuse.com/mdn-api_filesystementry https://caniuse.com/mdn-api_filesystemhandle It’s still undecided whether Firefox will implement the native file system API: https://mozilla.github.io/standards-positions/#native-file-system. atm Firefox only supports the non-standardized Entries API, even if access to it is prefixed withwebkit*
: https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API/Firefox_supportSo… this is the short summary of JS file-system APIs in early 2021.
⚠️ Edit: DefinitelyTyped now also provides types for the Entries API: https://www.npmjs.com/package/@types/wicg-entries-api https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wicg-entries-api