I'm working on a project involving WebGL, and using WebStorm to do the development.
One issue with the development flow is that WebStorm isn't able to autocomplete things related to WebGL. In particular, if I annotate a value as being of type WebGLRenderingContext
/** @type {!WebGLRenderingContext} */
var gl;
WebStorm complains that WebGLRenderingContext is an unresolved variable. Also it complains about usages of methods on gl, warning that it can't find those methods so they may not exist.
My current workaround (besides just turning off the warnings) is to specify a record type like so:
* @type {{
* texParameteri: function,
* TEXTURE_WRAP_T: *,
* ...
* }}
var gl;
But obviously it's a bit silly to be personally listing dozens and dozens of standardized members like this every time I want to use a rendering context. Is there an easier way?