/// import { CreateAssetRequest } from "../client"; import { AssetLibrary as GeneratedClient } from "../client/Client"; import { Asset, CompleteAssetUploadResponse } from "../types"; export declare type UploadAssetProgressHandler = (progress: number) => void; export interface UploadAssetRequest extends Omit { } export interface UploadRequestOptions extends GeneratedClient.RequestOptions { /** * Callback to receive upload progress. The callback will be called with a number between 0 and 1 representing the fraction of the file that has been uploaded. */ onProgress?: UploadAssetProgressHandler; } export interface WaitForReadyOptions extends GeneratedClient.RequestOptions { pollingIntervalInSeconds?: number; } export interface UploadAssetResponse extends CompleteAssetUploadResponse { asset: Asset; } export declare class AssetLibrary extends GeneratedClient { /** * Uploads a file to the asset library. Takes the following steps: * 1. Call `create()` to create the asset. * 2. Uploads the provided `fileOrDirecotry` data to s3 using the provided STS credentials. * 3. Calls `completeUpload()` to mark the asset as uploaded. * 4. Polls `get(assetId)` until the asset to becomes ready. * @param {string | Uint8Array | Buffer} fileOrDirectory File or directory to upload. If a string is provided it will be treated as a file path. * @param {UploadAssetRequest} request Request parameters * @param {UploadRequestOptions} uploadOptions Upload handling options. * @returns {UploadAssetResponse} Created assset details. */ upload(fileOrDirectory: string | Uint8Array | Buffer, request: UploadAssetRequest, { onProgress, ...requestOptions }?: UploadRequestOptions): Promise; waitForReady(assetId: string, requestOptions?: WaitForReadyOptions): Promise; }