在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”。