nextcloud-node-client
Version:
Nextcloud client API for node.js TypeScript applications
32 lines (31 loc) • 1 kB
TypeScript
import Client, { File } from "./client";
import Command from "./command";
export interface SourceTargetFileNames {
sourceFileName: string;
targetFileName: string;
}
export interface UploadFilesCommandOptions {
files: SourceTargetFileNames[];
processFileAfterUpload?: (file: File) => Promise<void>;
}
/**
* Command to upload a set or files from local file system to nextcloud
*/
export default class UploadFilesCommand extends Command {
private files;
private processFileAfterUpload?;
private bytesUploaded;
/**
* @param {Client} client the client
* @param {SourceTargetFileNames[]} files the files to be uploaded
* @param {(file: File) => void} processAfterUpload callback function to process the uploaded file
*/
constructor(client: Client, options: UploadFilesCommandOptions);
/**
* execute the command
* @async
* @returns {Promise<void>}
*/
protected onExecute(): Promise<void>;
getBytesUploaded(): number;
}