In TypeScript, What is the type of Image?

TypescriptImageInterface

Typescript Problem Overview


I'm declaring an interface which will contains image also. What type do i need to give to it.

export interface AdInterface {
    email: string;
    mobile: number;
    image?:   ??
}

Typescript Solutions


Solution 1 - Typescript

If your image property contains ...

Image used as <img> element

image?: HTMLImageElement

URL to image.

image?: String

Image as file from <input> element

image?: File

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSeenu SView Question on Stackoverflow
Solution 1 - TypescriptMisazView Answer on Stackoverflow