// Generated by dts-bundle-generator v9.5.1 export declare const abortMultipartUpload: (options: Options, objectName: string, uploadId: string, multipartOptions?: MultipartOptions) => Promise; export declare const completeMultipartUpload: (options: Options, objectName: string, uploadId: string, parts: PartInfo[], multipartOptions?: MultipartOptions) => Promise; export declare const initMultipartUpload: (options: Options, objectName: string, multipartOptions?: MultipartOptions) => Promise; export declare const listParts: (options: Options, objectName: string, uploadId: string, query?: ListQuery, multipartOptions?: MultipartOptions) => Promise; export declare const listUploads: (options: Options, query?: ListUploadsQuery, multipartOptions?: MultipartOptions) => Promise; export declare const multipartUpload: (options: Options, objectName: string, file: BlobLike | string, multipartOptions?: MultipartUploadOptions) => Promise; export declare const put: (options: Options, objectName: string, data: BlobLike | string, putOptions?: PutOptions) => Promise; export declare const signatureUrl: (options: Options, objectName: string, urlOptions?: SignatureUrlOptions) => string; export declare const uploadPart: (options: Options, objectName: string, uploadId: string, partNo: number, data: BlobLike | string, start: number, end: number, multipartOptions?: MultipartOptions) => Promise; export declare const uploadPartCopy: (options: Options, objectName: string, uploadId: string, partNo: number, range: string, sourceData: SourceData, copyOptions?: UploadPartCopyOptions) => Promise; /** * Bind client options to an operation function, so callers don't have to * repeat the credentials on every call. The returned function keeps the * operation's original signature minus the leading options argument. * * Unlike a client object factory, this never references operations it * isn't given, so tree shaking keeps working: importing `put` plus * `bindOptions` still excludes the multipart code from the bundle. * * @example * import { put, bindOptions } from 'tiny-oss'; * const upload = bindOptions(put, { accessKeyId, accessKeySecret, region, bucket }); * upload('hello.txt', blob); */ export declare function bindOptions(operation: (options: O, ...args: A) => R, options: O): (...args: A) => R; /** * fetch-based transport for Service Workers and Node.js, where * XMLHttpRequest is unavailable. fetch cannot report intermediate * upload progress, so a synthetic 0% event fires before sending and a * 100% event after, with lengthComputable false. */ export declare function fetchTransport(url: string, options: TransportOptions): Promise; export declare function getTransport(): Transport; /** * Replace the network layer. Defaults to XMLHttpRequest; pass a * fetch-based adapter in Service Workers or a wx.request-based adapter * in WeChat mini programs. */ export declare function setTransport(transport: Transport): void; /** * wx.request-based transport for WeChat mini programs. Mini programs * have no XMLHttpRequest and no Blob, so uploads must pass ArrayBuffer * (see README). wx.request cannot report intermediate upload progress, * so a synthetic 0% event fires before sending and a 100% event after, * with lengthComputable false. */ export declare function wxRequestTransport(url: string, options: TransportOptions): Promise; export interface Checkpoint { file: BlobLike | string; name: string; uploadId: string; partSize: number; parts: PartInfo[]; doneParts: PartInfo[]; } export interface CompleteMultipartUploadResult { name: string; etag: string; bucket?: string; res?: any; } export interface InitMultipartUploadResult { name: string; uploadId: string; res?: any; } export interface ListPartsResult { isTruncated: boolean; nextPartNumberMarker: number; parts: Part[]; res?: any; } export interface ListQuery { "max-parts"?: number; "part-number-marker"?: number; } export interface ListUploadsQuery { prefix?: string; marker?: string; "max-uploads"?: number; "upload-id-marker"?: string; } export interface ListUploadsResult { uploads: UploadInfo[]; isTruncated: boolean; nextKeyMarker?: string; nextUploadIdMarker?: string; res?: any; } export interface MultipartOptions { timeout?: number; headers?: Record; callback?: ObjectCallback; } export interface MultipartUploadOptions extends MultipartOptions { parallel?: number; partSize?: number; checkpoint?: Checkpoint; progress?: (percentage: number, checkpoint: Checkpoint, res?: any) => void; meta?: Record; mime?: string; } /** * Server-side upload callback: once the object is stored the provider * calls back the configured URL and relays that response to the client. * Serialized by Aliyun OSS (x-oss-callback / x-oss-callback-var) and * Huawei OBS (x-obs-callback) on put and multipartUpload. COS and TOS * expose the same feature but their official SDKs pass the header value * through verbatim, so those users must set headers (x-cos-callback / * x-tos-callback) themselves. AWS S3 and Azure Blob have no callback API. */ export interface ObjectCallback { url: string; host?: string; body: string; contentType?: string; customValue?: object; headers?: object; } export interface Options { accessKeyId: string; accessKeySecret: string; stsToken?: string; bucket?: string; endpoint?: string; region?: string; internal?: boolean; secure?: boolean; timeout?: string | number; cname?: boolean; pathStyle?: boolean; } export interface Part { PartNumber: number; LastModified: string; ETag: string; Size: number; } export interface PartInfo { number: number; etag: string; } export interface Progress { loaded: number; total: number; lengthComputable: boolean; } export interface PutOptions { onprogress?: (e: Progress) => any; headers?: Record; callback?: ObjectCallback; } export interface ResponseHeaderType { "content-type"?: string; "content-disposition"?: string; "cache-control"?: string; "content-encoding"?: string; "content-language"?: string; } export interface SignatureUrlOptions { expires?: number; method?: HTTPMethods; "Content-Type"?: string; process?: string; response?: ResponseHeaderType; [key: string]: any; } export interface SourceData { sourceKey: string; sourceBucket?: string; } export interface TransportOptions { method: string; headers: Record; data?: any; timeout?: number; /** * Total payload size in bytes; transports without native progress * events use it to fire 0%/100% synthetic events. */ total?: number; /** * Upload progress. lengthComputable is false when the environment * cannot report intermediate progress (fetch, wx.request); such * adapters fire a 0% event before sending and a 100% event after. */ onprogress?: (e: Progress) => void; } export interface TransportResponse { data: string; headers: Record; status: number; statusText: string; } export interface UploadInfo { uploadId: string; name: string; initiated: string; } export interface UploadPartCopyOptions extends MultipartOptions { headers?: Record; } export interface UploadPartCopyResult { etag: string; lastModified: string; res?: any; } export interface UploadPartResult { name: string; etag: string; res?: any; } export type BlobLike = Blob | ArrayBuffer | Uint8Array; export type HTTPMethods = "GET" | "POST" | "DELETE" | "PUT"; export type Transport = (url: string, options: TransportOptions) => Promise; export {};