merge Attachment metadata/ext

This commit is contained in:
Timi
2026-01-04 17:41:02 +08:00
parent f4232e8752
commit 2c6478c729
10 changed files with 41 additions and 54 deletions

View File

@ -17,7 +17,7 @@ export type Attachment = {
mimeType?: string;
metadata?: string | ImageMetadata;
metadata?: string | ImageMetadata | PreviewImageMetadata;
/** 文件 MD5 */
md5: string;
@ -27,9 +27,6 @@ export type Attachment = {
/** 大小 */
size: number;
/** 扩展数据 */
ext?: string | MediaAttachExt;
} & Model;
/** 媒体附件类型 */
@ -52,8 +49,7 @@ export type ImageMetadata = {
height: number;
}
/** 媒体附件扩展数据 */
export type MediaAttachExt = {
export type PreviewImageMetadata = {
/** 原文件附件 ID */
sourceId: number;
@ -66,10 +62,4 @@ export type MediaAttachExt = {
/** true 为视频 */
isVideo: boolean;
/** 原图宽度(像素) */
width?: number;
/** 原图高度(像素) */
height?: number;
}
} & ImageMetadata;