Reputation: 514
I need to develop a game HTML5 and WebGL on JS, but the editor does not suggest methods, fields, enums related to WebGL to become easier. Any ideas?
Upvotes: 4
Views: 3592
Reputation: 1172
You can add a JSDOC style comment above the canvas like this:
/** @type {HTMLCanvasElement} */
const canvas = document.getElementById("renderCanvas");
More details in this answer: https://stackoverflow.com/a/61388350/4159530
Upvotes: 0
Reputation: 12147
You should download WebGl.d.ts, for example from here
And reference this file in first string of your JS file:
/// <reference path="webgl.d.ts" />
Upvotes: 4