TypeScript -- new Image from global scope

0 votes

I have a class MYMODULE.Image{}, but I want to instantiate an object of type HTMLImageElement. When I call new Image(), TypeScript thinks I want to instantiate MYMODULE.Image, even when I use

image: HTMLImageElement = new Image();

Can I somehow explicitly call the global Image class? I tried

image: HTMLImageElement = new Window.Image(); but to no avail.

A scope resolution operator like C++'s ::Image would be handy. Perhaps it's there and I just don't see it.

Jul 13, 2022 in TypeSript by Logan
• 2,140 points
719 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In TypeSript

0 votes
1 answer

How do you run TypeScript files from command line?

You can leave tsc running in watch mode using tsc ...READ MORE

answered May 31, 2022 in TypeSript by Nina
• 3,060 points
502 views
0 votes
1 answer

how to use spread syntax and new Set() with TypeScript

The ... operator should work on anything ...READ MORE

answered Jun 10, 2022 in TypeSript by Nina
• 3,060 points
250 views
0 votes
0 answers

ngx-image-cropper imageloaded() not passing any image data to typescript file event method

I'm using ngx-image-cropper to load and crop images. According ...READ MORE

Jul 5, 2022 in TypeSript by Logan
• 2,140 points
1,187 views
0 votes
1 answer

Using spread syntax and new Set() with typescript

This seems to be a typescript ES6 ...READ MORE

answered Aug 3, 2022 in TypeSript by Abhinaya
• 1,160 points
831 views
0 votes
1 answer
0 votes
1 answer

How to set meta tags using Angular universal SSR and ngx-seo plug-in?

first Install the plug-in with npm i ngx-seo ...READ MORE

answered Feb 11, 2022 in Others by narikkadan
• 63,420 points
1,899 views
0 votes
1 answer

How to use next-seo for setting nextjs meta tag with multiple OGP images?

https://github.com/garmeeh/next-seo use this git repo that contains ...READ MORE

answered Feb 24, 2022 in Others by narikkadan
• 63,420 points
4,816 views
0 votes
0 answers

how to sign bitcoin psbt with ledger?

I'm trying to sign a PSBT transaction ...READ MORE

Mar 9, 2022 in Blockchain by Soham
• 9,700 points
1,255 views
0 votes
1 answer

Can't bind to 'ngModel' since it isn't a known property of 'input'

Just add this in the app.module.ts file: import { FormsModule ...READ MORE

answered Apr 30, 2022 in Other DevOps Questions by narikkadan
• 63,420 points
3,882 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP