import { Observable } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; /** * Service de gestion de fichier */ export declare class AsiFileService { private http; private sanitizer; constructor(http: HttpClient, sanitizer: DomSanitizer); fileToBase64(file: File, sanitize?: boolean): Observable; fileToBase64Url(file: File, sanitize?: boolean): Observable; fileToBase64Data(file: File): Observable; blobToBase64(blob: Blob, sanitize?: boolean): Observable; blobToBase64Url(blob: Blob, sanitize?: boolean): Observable; blobToBase64Data(blob: Blob): Observable; private toBase64(data, sanitize?); private toBase64Url(data, sanitize?); private toBase64Data(data); /** * Download the blob file with the specified name * @param fileAsBlob the file to download as a Blob * @param fileName the name to give to the downloaded file */ private saveToFile(fileAsBlob, fileName); /** * Transform a Blob into a File adding a file name and a last modified date * @param response The blob response */ private getFileFromBlobResponse(response); getFileUrl(file: File): SafeResourceUrl; getFileAsText(fileUrl: string): Observable; getFileAsBlob(fileUrl: string): Observable; getFileAsBlobFromPostRequest(fileUrl: string, body: any): Observable; /** * Download the file at the given url * @param fileUrl The url of the downloadable file * @param fileName [Optional] The new name of the downloaded file */ downloadFile(fileUrl: string, fileName?: string): Observable; /** * Download the file at the given url from a POST request * @param fileUrl The url of the downloadable file * @param body the POST request body * @param fileName [Optional] The new name of the downloaded file */ downloadFileFromPostRequest(fileUrl: string, body: any, fileName?: string): Observable; getBlobImage(fileUrl: string): Observable; uploadFile(url: string, file: File, reportProgress?: boolean): Observable; }