import { QueryDirectoryResponseBody, UploadFileResponseBody, DeleteFileResponseBody } from './ApiTypes'; import PathArrayable from './Path'; /** * Represents the data for a remote resource. */ export type RemoteResourceData = { localFilePath: string; } & ({ isSuccessful: true; url: string; } | { isSuccessful: false; }); /** * Handles file operations such as listing directory contents, uploading files, and deleting files. */ export default class FileHandler { /** * Lists the contents of a directory. * @param remoteDirectoryPath - The path of the directory to list. * @param teamNumber - The team number. * @param sessionToken - The session token. * @returns A Promise that resolves to the response body containing the directory contents. */ static listDirectory(remoteDirectoryPath: PathArrayable, teamNumber: number, sessionToken: string, emitLogs?: boolean): Promise; /** * Uploads a file to the server. * @param remoteDirectoryPath - The path to the directory where the file should be uploaded. * @param localDirectoryPath - The local path to the file. * @param fileName - The name of the file. * @param teamNumber - The team number. * @param sessionToken - The session token. * @returns A promise that resolves to the response body containing the uploaded file URL. * @throws An error if the file is not found or if the file type is not supported. */ static uploadFile(remoteDirectoryPath: PathArrayable, localDirectoryPath: PathArrayable, fileName: string, teamNumber: number, sessionToken: string): Promise; /** * Deletes a file from the specified directory path for a given team. * @param remoteDirectoryPath - The path to the directory where the file is located. * @param fileName - The name of the file to be deleted. * @param teamNumber - The team number associated with the file. * @param sessionToken - The session token for authentication. * @returns A promise that resolves to the response body containing information about the deleted file. */ static deleteFile(remoteDirectoryPath: PathArrayable, fileName: string, teamNumber: number, sessionToken: string): Promise; /** * Asserts whether the given file type is supported. * @param filename - The name of the file. * @throws {Error} If the file type is not supported. */ private static assertSupportedFileType; /** * Recursively deletes all files and folders within a directory. * @param remoteDirectoryPath - The path of the directory to purge. * @param teamNumber - The team number associated with the directory. * @param sessionToken - The session token for authentication. * @param recursive - Indicates whether to delete files and folders recursively. * @returns A Promise that resolves when the directory is purged. */ static purgeDirectory(remoteDirectoryPath: PathArrayable, teamNumber: number, sessionToken: string, recursive: boolean): Promise; /** * Uploads a directory and its contents recursively to a remote server. * * @param remoteDirectoryPath - The path of the remote directory to upload to. * @param localDirectoryPath - The path of the local directory to upload from. * @param teamNumber - The team number associated with the upload. * @param sessionToken - The session token for authentication. * @returns A Promise that resolves when the upload is complete. */ static uploadDirectory(remoteDirectoryPath: PathArrayable, localDirectoryPath: PathArrayable, teamNumber: number, sessionToken: string): Promise; } //# sourceMappingURL=FileHandler.d.ts.map