cool-admin-midway/typings/upload.d.ts

57 lines
915 B
TypeScript
Raw Normal View History

2024-05-28 15:22:15 +08:00
// 模式
export enum MODETYPE {
// 本地
LOCAL = 'local',
// 云存储
CLOUD = 'cloud',
// 其他
OTHER = 'other',
}
/**
*
*/
export interface Mode {
// 模式
mode: MODETYPE;
// 类型
type: string;
}
/**
*
*/
export interface BaseUpload {
/**
*
*/
getMode(): Promise<Mode>;
/**
*
* @returns
*/
getMetaFileObj(): Promise<any>;
/**
*
* @param url
* @param fileName
*/
downAndUpload(url: string, fileName?: string): Promise<string>;
/**
* Key()
* @param filePath
* @param key
*/
uploadWithKey(filePath, key): Promise<string>;
/**
*
* @param ctx
* @param key
*/
upload(ctx): Promise<string>;
}