@aplus-frontend/ui
Version:
46 lines (45 loc) • 1.16 kB
TypeScript
import { accessCreate, client } from '@aplus-frontend/oss';
import { ButtonProps } from '@aplus-frontend/antdv/es/button';
/**
* 类型转换为单例和数组
*/
type TypeToSingleAndArray<Type = any> = Type extends any ? Type | Type[] : never;
export type ApDownLoadProps<FileNameType = any> = ButtonProps & {
/**
* 标签内容
*/
text: string;
/**
* 标签颜色
*/
color?: string;
fileName: TypeToSingleAndArray<string | FileNameType>;
/**
* 是否需要fileName别名
* 默认false
* 可以传配置项nameKey,pathKey
* 默认为name,path
*/
needName?: ApDownLoadNeedNameModel;
getOssAccess?: () => Promise<accessCreate>;
};
/**
* 别名配置项
*/
export type ApDownLoadNeedNameModel = boolean | {
nameKey?: string;
pathKey?: string;
};
/**
* 别名默认值
*/
export declare enum ApDownLoadNeedNameKeyDefault {
nameKey = "name",
pathKey = "path"
}
export type actionResponse = Awaited<ReturnType<typeof client.downloadFile>>;
export type downloadCallbackResponse = {
objectName: string;
fileName: string;
}[] | actionResponse;
export {};