import type { ResponseMetadata, UploadOptions, UploadResponse } from "./interfaces"; /** * Represents an error when a request to ImageKit is invalid. */ export declare class ImageKitInvalidRequestError extends Error { /** * Optional metadata about the response. It is only available if server returns a response. */ readonly $ResponseMetadata?: ResponseMetadata; constructor(message: string, responseMetadata?: ResponseMetadata); } /** * Represents an error when an upload operation is aborted. */ export declare class ImageKitAbortError extends Error { /** * The reason why the operation was aborted, which can be any JavaScript value. If not specified, the reason is set to "AbortError" DOMException. */ reason?: unknown; constructor(message: string, reason?: unknown); } /** * Represents a network error during an upload operation to ImageKit. */ export declare class ImageKitUploadNetworkError extends Error { constructor(message: string); } /** * Represents a server error from ImageKit during an upload operation. */ export declare class ImageKitServerError extends Error { /** * Optional metadata about the response. It is only available if server returns a response. */ readonly $ResponseMetadata?: ResponseMetadata; constructor(message: string, responseMetadata?: ResponseMetadata); } /** * Uploads a file to ImageKit with the given upload options. This function uses V1 API, check the [API docs](https://imagekit.io/docs/api-reference/upload-file/upload-file) for more details. * * @throws {ImageKitInvalidRequestError} If the request is invalid. * @throws {ImageKitAbortError} If the request is aborted. * @throws {ImageKitUploadNetworkError} If there is a network error. * @throws {ImageKitServerError} If there is a server error. * * @param {UploadOptions} uploadOptions - The options for uploading the file. * @returns {Promise} A Promise resolving to a successful UploadResponse. */ export declare const upload: (uploadOptions: UploadOptions) => Promise;