/** 视频发布参数 */ export interface VideoPublishParam { /** 视频文件路径 */ video: string;// Buffer|Uint8Array|Blob|string|Readable; /** 封面图片路径 */ cover?: string; // Buffer|Uint8Array|Blob|string|Readable; /** 标记 */ mark: string; /** 是否加密 */ encrypt?: boolean; /** 存储时间 单位秒, -1:永不过期, 0:7天 , 默认-1*/ duration?: number; } export const enum ImagePublishUsage { Headshot = 0, // 头像 Figure, // 插图 Meme // 表情包 } /** 图片发布参数定义 */ export class ImagePublishParam { constructor(file: string, mark: string) { // 默认分辨率 this.resolutions = [ //{name: 'Original', quality: 100}, { name: 'High', quality: 90, scale: 1.0 }, { name: 'Medium', quality: 80, scale: 0.5 }, { name: 'Low', quality: 80, scale: 0.2 } ] // 默认标签 this.tag = { key: 'public', value: '1' }; this.file = file; this.mark = mark; this.duration = -1; } /** 图片文件路径 */ public file: string;// Buffer|Uint8Array|Blob|string|Readable; /** 标签 */ public tag: Tag; /** 标识 */ public mark: string; /** 多分辨率 */ public resolutions: Array; /** 是否加密 */ public encrypt?: boolean; /** 存储时间 单位秒, -1:永不过期, 0:7天 , 默认-1*/ public duration?: number; /** 图片用途, 默认表情 */ public usage: ImagePublishUsage = ImagePublishUsage.Meme; } export interface FilePublishParam { /** 本地路径 */ file: string; /** 标识 */ mark: string; /** 是否加密 */ encrypt?: boolean; /** 存储时间 单位秒, -1:永不过期, 0:7天 , 默认-1*/ duration?: number; } /** 标签键值对 */ export interface Tag { key: string; value: string; } /** 分辨率参数 */ export interface Resolution { /** 分辨率名称 */ name: string; /** 压缩质量 0~100 */ quality: number; /** * 缩放比例 0.0f ~ 1.0f * @remartk */ scale?: number; /** * 固定高度 * @remark scale未定义的时候,height参数生效 */ height?: number; }