@sentclose/sentc-nodejs
Version:
End-to-end encryption sdk
28 lines (27 loc) • 1.39 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { User } from "../User";
import { FileHandle } from "node:fs/promises";
/**
* @author Jörn Heinemann <joernheinemann@gmx.de>
* @since 2022/08/27
*/
export declare class Uploader {
private base_url;
private app_token;
private user;
private group_id?;
private other_user_id?;
private upload_callback?;
private readonly group_as_member?;
private chunk_size;
private readonly belongs_to_id?;
private readonly belongs_to?;
static cancel_upload: boolean;
constructor(base_url: string, app_token: string, user: User, group_id?: string, other_user_id?: string, upload_callback?: (progress?: number) => void, group_as_member?: string, chunk_size?: number);
prepareFileRegister(file: File, content_key: string, encrypted_content_key: string, master_key_id: string): string[];
doneFileRegister(server_output: string): string[];
checkFileUpload(fileHandle: FileHandle, fileSize: number, content_key: string, session_id: string, sign?: boolean): Promise<void>;
uploadFileWithPath(path: string, content_key: string, encrypted_content_key: string, master_key_id: string, sign?: boolean): Promise<any>;
uploadFile(file: FileHandle, file_name: string, content_key: string, encrypted_content_key: string, master_key_id: string, sign?: boolean): Promise<string[]>;
}