VSCode uses its own Typescript version by default; Webstorm also bundles Typescript with it, you can use the bundled version if you like (can be chosen in Settings | Languages & Frameworks | TypeScript, TypeScript). But using project local version (if any) is preferable, as it's the version used in your project, the one you will use for building it. So I'd strongly recommend updating your project dependencies instead of relying on bundled libraries
Please could you elaborate on this? Code snippets plus screenshots illustrating the issue would be helpful
export var gl: WebGL2RenderingContext
can't see any problems with this code:
what errors using it have you seen namely?
clone this project https://github.com/duzenko/webgl and open in webstorm
open src/index.ts, wait for it load fully
observer errors
The error comes from the Typescript compiler, not from the IDE; you will face the same issue when running
tsc -p .in the command line:The problem is that you are using a very old Typescript version (2.9.2), and WebGL typings are only included in Typescript since 3.6 (see https://github.com/microsoft/TypeScript/issues/14733#issuecomment-553589617). If upgrading Typescript is not an option, I can only suggest trying the
@types/webgl2(https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/webgl2)I see
However both VisualStudio 2022 and VSCode use system-wide lib.dom.d.ts and not the one from local .node_modules/typescript/lib/lib.dom.d.ts
I think webstorm should comply
VSCode uses its own Typescript version by default; Webstorm also bundles Typescript with it, you can use the bundled version if you like (can be chosen in Settings | Languages & Frameworks | TypeScript, TypeScript). But using project local version (if any) is preferable, as it's the version used in your project, the one you will use for building it. So I'd strongly recommend updating your project dependencies instead of relying on bundled libraries