/**
 * ali-oss模块
 * @date 2022-03
 * @author 何华东
 */
/// <reference types="node" />
import { OssService } from './OssService';
/**
 * ali-oss客户端实例
 *
 * 如果项目已添加配置依赖[NsConfig](https://me.keytop.cn/service/config)，
 * 那么模块被加载时，从`@Value`获取`ali-oss`配置({@link ConfigCenterConfigProvider})并自动创建该实例，否则为空
 *
 * ```ts
 * import { aliOss, aliOssClient } from "refs/nslib";
 *
 * //非标/上传base64图片到ali-oss
 * let res = await aliOss.putBase64Image('data:image/jpg;base64,/9j/4AAQSkZJRgABAQAASABIAA...');
 * throwIfUrlIsEmpty(res);
 * let imgUrl = res.url;
 *
 * //直接使用插件原生方法上传文件
 * let res = await aliOssClient.put(`${filename}`, buffer);
 * throwIfUrlIsEmpty(res);
 * let url = res.url;
 * ```
 * @see [ali-oss](https://www.npmjs.com/package/ali-oss)
 */
export declare let aliOssClient: any;
/**
 * ali-oss响应类
 */
declare type AliOssResponse = {
    name: string;
    /**
     * 文件地址
     */
    url: string;
    res: {
        status: number;
        statusCode: number;
        statusMessage: string;
    };
};
/**
 * 如果`ali-oss`接口返回的文件地址为空，则抛出异常
 */
export declare function throwIfUrlIsEmpty(response: AliOssResponse): void;
export declare class AliOssService implements OssService {
    getRootPath(): any;
    /**
     * 上传对象到ali-oss
     */
    put(data: string | Buffer, name: string): Promise<string>;
}
export {};
