article-writer-cn
Version:
AI 驱动的智能写作系统 - 专注公众号/自媒体文章创作
38 lines • 1.07 kB
TypeScript
/**
* 阿里云 OSS 图床提供者
*
* 参考文档: https://help.aliyun.com/document_detail/111265.html
*/
import type { ImageBedProvider, ImageBedType, UploadResult, AliyunOSSConfig } from '../types.js';
export declare class AliyunOSSProvider implements ImageBedProvider {
readonly type: ImageBedType;
private config;
private client;
constructor(config: AliyunOSSConfig);
/**
* 上传单张图片到阿里云 OSS
*/
upload(imagePath: string, remotePath?: string): Promise<UploadResult>;
/**
* 批量上传图片
*/
uploadBatch(imagePaths: string[]): Promise<UploadResult[]>;
/**
* 验证配置是否有效
*/
validateConfig(): Promise<boolean>;
/**
* 生成远程文件路径
* 格式: images/{year}/{month}/{hash}-{filename}
*/
private generateRemotePath;
/**
* 根据文件扩展名确定 Content-Type
*/
private getContentType;
/**
* 构建公开访问 URL
*/
private buildPublicUrl;
}
//# sourceMappingURL=aliyun-oss-provider.d.ts.map