PHPStorm window.showOpenFilePicker() unresolved function

I am working on a very basic website to upload JSON files, edit them and then download them. I followed this description: https://web.dev/file-system-access/

Sadly, I get the problem "Unresolved function or method showOpenFilePicker()" (as you can see in the screenshot). I am quite a beginner with javascript, but I do understand that it doesn't find the method.

But the "window. object" should have this method available? I am truly confused. Do I need to install some other module?

Thank you very much for the help! If you need any further info, I'll gladly add them.

4 comments
Comment actions Permalink

library definitions the IDE uses for WEB API types resolving are provided by Microsoft (https://github.com/Microsoft/TypeScript repository); PhpStorm doesn't have its own library definitions. And the property 'showOpenFilePicker' does not exist on type Window in https://github.com/Microsoft/TypeScript/blob/master/lib/lib.dom.d.ts

1
Comment actions Permalink

Ok, thank you for explaining that!

So how can I still include this method in my program? Import the file system API somehow? https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API

What else would be the proposed way of opening a JSON file? 

0

Please sign in to leave a comment.