Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在TypeScript中,图像的类型是什么?_Typescript_Image_Interface - Fatal编程技术网

在TypeScript中,图像的类型是什么?

在TypeScript中,图像的类型是什么?,typescript,image,interface,Typescript,Image,Interface,我正在声明一个接口,它也将包含图像。我需要给它什么类型的 export interface AdInterface { email: string; mobile: number; image?: ?? } 如果图像属性包含 用作元素的图像 image?: HTMLImageElement image?: File 图像的URL。 image?: String 元素中的图像作为文件 image?: HTMLImageElement image?: Fil

我正在声明一个接口,它也将包含图像。我需要给它什么类型的

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

如果图像属性包含

用作元素的图像

image?: HTMLImageElement
image?: File

图像的URL。

image?: String

元素中的图像作为文件

image?: HTMLImageElement
image?: File


您如何表示图像?它是图像的URL吗?是水滴数据吗?它是HTML
元素吗?它是某种文件上传图像。所以你从文件输入中抓取图像?是的。我将从文件inputIt中获取建议使用“string”作为类型,而不是“string”。