@evan.network/ui-angular-core
Version:
The angular-core operates as an global and central library for the evan.network Angular 5 frontend development. Using this project you will be able to to the following things:
45 lines (44 loc) • 1.97 kB
TypeScript
import { DomSanitizer, File, FileOpener, OnDestroy } from 'angular-libs';
import { EvanUtilService } from '../utils';
import { EvanBCCService } from '../bcc/bcc';
import { EvanToastService } from '../ui/toast';
import { EvanTranslationService } from '../ui/translate';
/**************************************************************************************************/
/**
* Service to handle files and its encryption / decryption.
*
* @class Injectable EvanFileService
*/
export declare class EvanFileService implements OnDestroy {
private utils;
private bcc;
private file;
private toast;
private translateService;
private fileOpener;
private _DomSanitizer;
constructor(utils: EvanUtilService, bcc: EvanBCCService, file: File, toast: EvanToastService, translateService: EvanTranslationService, fileOpener: FileOpener, _DomSanitizer: DomSanitizer);
/**
* Uploads an array of fils that were selected with an HTML 5 <input type="file"> selector or using
* the evan-file-select component and transforms them into an encryption object
*
* @param {Array<any>} files array of files
* @return {Promise<any>} uploaded files transformed into an encryption object
*/
readFilesAsArrayBuffer(files: Array<any>): Promise<any[]>;
/**
* Transform an array of files to be valid for display (including file, blob and blobURI)
*
* @param {Array<any>} files array of files that should be checked
* @return {Array<any>} array of valid files
*/
equalizeFileStructure(files: Array<any>): Promise<any[]>;
/**
* Link element using blob uris and download flag does not work on mobile decives. Use this
* funciton to download files on mobile devices
*
* @param {string} name name of the file
* @param {Blob} blob Blob of the file
*/
downloadMobile(name: string, blob: any): Promise<void>;
}