import type { ThirdwebClient } from "../client/client.js"; import type { UploadOptions as InternalUploadOptions, UploadableFile } from "./upload/types.js"; export type UploadOptions = InternalUploadOptions & { client: ThirdwebClient; }; type UploadReturnType = TFiles extends { length: 0; } ? null : TFiles extends { length: 1; } ? string : string[]; /** * Uploads files based on the provided options. * @param options - The upload options. * @returns A promise that resolves to the uploaded file URI or URIs (when passing multiple files). * @throws An error if the upload fails. * @example * * ### Uploading JSON objects * * ```ts * import { upload } from "thirdweb/storage"; * const uri = await upload({ * client, * files: [ * { * name: "something", * data: { * hello: "world", * }, * }, * ], * }); * ``` * * ### Uploading files * * ```ts * import { upload } from "thirdweb/storage"; * const uri = await upload({ * client, * files: [ * new File(["hello world"], "hello.txt"), * ], * }); * ``` * @storage */ export declare function upload(options: UploadOptions): Promise>; export {}; //# sourceMappingURL=upload.d.ts.map