How can I tell my IDE (PHPStorm) that certain global variables aren't "undeclared", but simply declared elsewhere; and have a specific type?
An example from Magento (opcheckout.js
):
if (response.duplicateBillingInfo) {
shipping.setSameAsBilling(true); // "shipping undeclared" warning
}
// in fact, shipping is a global variable with constructor "Shipping".
What I'd like to do is something like this:
/** @var Shipping window.shipping */
shipping.setS // with autocompletion:
setSameAsBilling