import { RequestResult, UploadProgressEvent } from "./utils/request"; declare type Region = 'oss-cn-hangzhou' | 'oss-cn-shanghai' | 'oss-cn-qingdao' | 'oss-cn-beijing' | 'oss-cn-zhangjiakou' | 'oss-cn-huhehaote' | 'oss-cn-shenzhen' | 'oss-cn-heyuan' | 'oss-cn-chengdu' | 'oss-cn-hongkong' | 'oss-us-west-1' | 'oss-us-east-1' | 'oss-ap-southeast-1' | 'oss-ap-southeast-2' | 'oss-ap-southeast-3' | 'oss-ap-southeast-5' | 'oss-ap-northeast-1' | 'oss-ap-south-1' | 'oss-eu-central-1' | 'oss-eu-west-1' | 'oss-me-east-1' | string; export interface ClientOptions { /** * access key you create on aliyun console website */ accessKeyId: string; /** * access secret you create */ accessKeySecret: string; bucket?: string; /** * used by temporary authorization */ stsToken?: string; /** * oss region domain. It takes priority over `region` */ endpoint?: string; /** * the bucket data region location, default is `oss-cn-hangzhou` */ region?: Region; /** * access OSS with aliyun internal network or not, default is false. If your servers are running on aliyun too, * you can set true to save lot of money. */ internal?: boolean; /** * instance level timeout for all operations, default is 60_000(60s). */ timeout?: number; secure?: boolean; /** * default false, access oss with custom domain name. if true, you can fill endpoint field with your custom domain name */ cname?: boolean; } export interface PostObjectOptions { dir?: string; policy?: string | { expiration: string; conditions: any[]; }; signature?: string; timeout?: number; onProgress?: (e: UploadProgressEvent) => void; onSuccess?: (result: RequestResult, xhr: XMLHttpRequest) => void; onError?: (e: Error) => void; onAbort?: () => void; success_action_status?: 200 | 201 | 204; success_action_redirect?: string; 'x-oss-object-acl'?: 'private' | 'public-read' | 'public-read-write'; headers?: { [key: string]: string | number; }; [key: string]: any; } declare class Client { protected opts: ClientOptions & { host: string; }; constructor(options: ClientOptions); /** * post object as form/multi-part * @param name * @param file * @param options */ postObject(name: string, file: File | Blob, options?: PostObjectOptions): { abort(): void; }; /** * Get the Object url. * If provide baseUrl, will use baseUrl instead the default bucket and endpoint . * @param name * @param baseUrl */ generateObjectUrl(name: string, baseUrl?: string): string; } export default Client;