import { BaseApi } from "../base-api"; import type { ConfirmDatasetUpload, UploadsResponse } from "./types"; /** * API class for handling file uploads. * @extends BaseApi */ declare class UploadsApi extends BaseApi { /** * Retrieves an upload URL for a given upload path. * * @async * @param {string} upload_path - The path of the upload resource. * @returns {Promise} - A Promise resolving to the response data. */ getUploadUrl(uploadPath: string): Promise; /** * Confirms the completion of an upload process by ingesting the uploaded file into a dataset. * This method should be called after a file has been uploaded to the provided URL to finalize the upload. * * Note: this calls `POST /datasets/{dataset_id}/upload` — there is no `uploads/{id}` confirmation * endpoint; `/uploads/{upload_path}` (see {@link getUploadUrl}) only supports issuing upload URLs. * * @async * @param {number} datasetId - The unique identifier of the dataset being uploaded. * @param {string} uploadPath - The path where the file was uploaded. * @returns {Promise} A promise resolving when the upload confirmation is complete. */ confirmUpload(datasetId: number, uploadInfo: UploadsResponse): Promise; /** * Uploads a file to a given presigned S3 URL. * The user selects a file from a form in the browser, and this function handles the upload to S3. * * @param {File} file - The file to be uploaded, typically obtained from a file input in the browser. * @param {string} presignedUrl - The presigned URL to which the file should be uploaded. * @returns {Promise} A promise that resolves to true if the file is successfully uploaded. */ uploadFileToS3(file: File, uploadInfo: UploadsResponse): Promise; } export { type ConfirmDatasetUpload, UploadsApi, type UploadsResponse };