import { HttpClient } from '@angular/common/http'; import { Observable } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; import { EnvironmentService } from '../../services/environment.service'; import { ErrorService } from './error.service'; import { HeaderService } from './header.service'; export declare class BlobService { private readonly http; private readonly errorService; private readonly headerService; constructor(environmentService: EnvironmentService, http: HttpClient, errorService: ErrorService, headerService: HeaderService); /** * Stored apiUrl, that comes from the parent module. */ private readonly apiUrl; /** * GET request, that expects blob response. It will download it, if the response has 'content-disposition' header. * Otherwise it will throw an error notification. * @param path The relative path to the backend endpoint. For example * @param params The query params, that goes with the request. * @example getBlob('/api/some/route', { id: 5 }); */ getBlob(path: string, params?: object): Observable; /** * POST request, that expects blob response. It will download it, if the response has 'content-disposition' header. * Otherwise it will throw an error notification. * @param path The relative path to the backend endpoint. For example * @param params The query params, that goes with the request. * @example getBlob('/api/some/route', { id: 5 }); */ postForBlob(path: string, params?: object): Observable; /** * This function handles the response, if the request was successfully. * @param resp Response, that came from the api request. */ private handleBlobResponse; /** * This function downloads the getBlob and postForBlob functions' files. * @param blob The Blob instance. * @param filename Optional parameter. It overrides the 'content-disposition' header filename. */ private downloadBlob; }