import { Methods } from "./methods.js"; //#region src/files.d.ts /** A class having API methods related to Files */ declare class FilesMethods extends Methods { /** * Start a multipart upload. Returns presigned URLs for each part. * * @param filename The filename (e.g. `course.pdf`) * @param file_size The file size in bytes; max 20 GB * * @returns On success, An Object * * @see https://app.gumroad.com/api#post-/files/presign * * **Only available with the `edit_products` scope.** */ presign(filename: string, file_size: number, { signal }?: { signal?: AbortSignal; }): Promise<{ /** S3 multipart upload ID; pass to `/files/complete` */ upload_id: string; /** S3 object key for the uploaded file; pass to `/files/complete` */ key: string; /** * Canonical S3 URL (`{S3_BASE_URL}attachments/{seller_external_id}/{guid}/original/{filename}`); * the S3 object isn't accessible until `/files/complete` finalizes the multipart upload */ file_url: string; /** One entry per 100 MB part; PUT the bytes for each part to its `presigned_url` */ parts: { /** Sequential part number, starting at 1 */ part_number: number; /** S3 presigned URL; expires after 900 seconds (15 minutes) */ presigned_url: string; }[]; }>; /** * Finalize the multipart upload started by `/v2/files/presign`. * * Returns the final `file_url`. * * @param upload_id returned by `/files/presign` * @param key returned by `/files/presign` * @param parts An Array of `{ part_number, etag }` * * @returns On success, An Object * * @see https://app.gumroad.com/api#post-/files/complete * * **Only available with the edit_products scope.** */ complete(upload_id: string, key: string, parts: { part_number: number; etag: string; }[], { signal }?: { signal?: AbortSignal; }): Promise<{ /** Pass this as `files[][url]` when attaching to a product */ file_url: string; }>; /** * Cancel a multipart upload started by `/v2/files/presign`. * * @param upload_id returned by `/files/presign` * @param key returned by `/files/presign` * * @returns On success, An Object * * @see https://app.gumroad.com/api#post-/files/abort * * **Only available with the edit_products scope.** */ abort(upload_id: string, key: string, { signal }?: { signal?: AbortSignal; }): Promise<{ /** * `accepted` if S3 took the cancellation on this call (parts still in flight may finish seconds later); * `already_gone` if S3 has no multipart session for this `upload_id` */ status: 'accepted' | 'already_gone'; }>; } //#endregion export { FilesMethods }; //# sourceMappingURL=files.d.ts.map