We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi. I'm trying to use Babylon.js within TypeScript project so I installed "node-canvas-webgl" using npm.
However, when I try to use createCanvas, it keeps importing from node Canvas module instead of node-canvas-webgl's ../lib.
createCanvas
Canvas
node-canvas-webgl
../lib
Also, this global declaration part keeps giving me errors like Unresolved variable HTMLElement
Unresolved variable HTMLElement
// polyfill global.HTMLElement = function () {}; // -> Unresolved variable HTMLElement global.window = { setTimeout, addEventListener() {}, }; global.navigator = {}; global.document = { createElement() { return createCanvas(300, 150); }, addEventListener() {}, };
I have included the following codes for global declaration.
declare global { var HTMLElement:any; var window:any; var navigator:any; var document:any; } export {}
Is there some way to use these codes in TypeScript without any issues?
Thank you :)
The text was updated successfully, but these errors were encountered:
declare global { HTMLElement:any = function () { }; window:any = { setTimeout, addEventListener() {}, }; navigator:any = {}; document:any = { addEventListener() {}, }; }
tried this and it's still not working :(
Sorry, something went wrong.
No branches or pull requests
Hi. I'm trying to use Babylon.js within TypeScript project so I installed "node-canvas-webgl" using npm.
However, when I try to use
createCanvas
, it keeps importing from nodeCanvas
module instead ofnode-canvas-webgl
's../lib
.Also, this global declaration part keeps giving me errors like
Unresolved variable HTMLElement
I have included the following codes for global declaration.
Is there some way to use these codes in TypeScript without any issues?
Thank you :)
The text was updated successfully, but these errors were encountered: