zhizhi/node_modules/dingtalk-jsapi/api/biz/util/uploadAttachment.d.ts

68 lines
2.5 KiB
TypeScript
Raw Normal View History

/**
*
* @apiName biz.util.uploadAttachment
*/
export interface IBizUtilUploadAttachmentParams {
/** types这个数组里有photo、camera参数需要构建这个数据 */
image?: {
/** 是否多选默认为false */
multiple?: boolean;
/** 是否压缩默认为true */
compress?: boolean;
/** 最多选择的图片数目最多支持9张 */
max?: number;
/** 企业自定义空间 */
spaceId: string;
};
space?: {
/** 企业ID */
corpId: string;
/** 企业自定义空间 */
spaceId: string;
/** 1复制0不复制 */
isCopy?: number;
/** 最多选择的图片数目最多支持9张 */
max?: number;
};
file: {
/** 企业自定义空间 */
spaceId: string;
/** 最多选择的图片数目最多支持9张 */
max?: number;
};
/** 支持上传附件的文件类型,至少一个,最多支持四种类型 */
types: Array<'photo' | 'camera' | 'file' | 'space'>;
}
/**
*
* @apiName biz.util.uploadAttachment
*/
export interface IBizUtilUploadAttachmentResult {
/** 用户选择了哪种文件类型 image图片、file手机文件、space钉盘文件 */
type: 'photo' | 'camera' | 'file' | 'space';
/** 文件上传成功后的数据信息 */
data: Array<{
/** 目标空间id */
spaceId: string;
/** 文件id */
fileId: string;
/** 文件名称 */
fileName: string;
/** 文件大小 */
fileSize: number;
/** 文件类型 */
fileType: string;
}>;
}
/**
*
*
* SpaceIDFileID等SpaceID指定的钉盘空间再返回
*
* 访
* @apiName biz.util.uploadAttachment
* @supportVersion pc: 3.0.0 ios: 2.7.0 android: 2.7.0
*/
export declare function uploadAttachment$(params: IBizUtilUploadAttachmentParams): Promise<IBizUtilUploadAttachmentResult>;
export default uploadAttachment$;