Search code examples
javascriptphpstormwebstorm

PhpStorm Clipboard API


I'm trying to use the Clipboard API which already works in browsers, but PhpStorm doesn't know of it.

enter image description here

What does it take to make PhpStorm recognise it? I've set the JavaScript-language version in the project-settings to ECMAScript 6.


Solution

  • Thanks to Lena for the right direction, I've found a way so sort it.

    Under Settings > Javascript > Libraries click on Download. Select dom-clipboard-api from the list and click download and install.

    The library stub consists of this: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/dom-clipboard-api/index.d.ts

    I needed to invalidate caches and restart PhpStorm, but afterwards it worked as I expected.