import { HttpClient, HttpEventType, HttpRequest, HttpResponse } from '@angular/common/http'; import { Observable, Subscription } from 'rxjs'; import { SnFileModal } from '../../models/snFile.modal'; import { SN_FILE_ERROR_TYPE } from '../../models/sn-file-error.modal'; import * as i0 from "@angular/core"; export declare class UploadFileService { private http; constructor(http: HttpClient); initFileUploadInstance(): FileUploadRef; httpRequestObs(req: HttpRequest): Observable; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export declare class FileUploadRef { private uploadFileSvc; private httpMethod; private formData; private httpRequest; private errorMap; private beforeHttpRequestFire; private httpRequestObs; constructor(uploadFileSvc: UploadFileService); /** * Initialize the Request object * @param httpMethod http method such as post, get, put, options... * @param url url * @param repProgress boolean if set to true, first requestResponse would be of * HttpEventType(information about uploading file. From this we can deduce the upload progress) and * last response would be of type HttpResponse */ initRequest(httpMethod: any, url: string, repProgress?: boolean): FileUploadRef; /** * Set the file * @param filePropKey * @param file */ setFile(filePropKey: string | undefined, file: SnFileModal | SnFileModal[]): FileUploadRef; setData(key: string, value: any): FileUploadRef; setHeaders(key: string, value: string | string[]): FileUploadRef; beforeRequestFetch(cb: (fur: FileUploadRef, reqObs: Observable) => Observable): FileUploadRef; getFormData(): FormData; getHTTPMethod(): string | 'POST' | 'GET' | 'OPTION'; getHTTPRequest(): HttpRequest; getHTTPRequestObs(): Observable | null; buildRequestObs(): FileUploadRef; buildAndFire(onSuccess: (value: U | HttpEventType | HttpResponse) => void, onError?: (err: Map | any) => void, onComplete?: () => void): void; fire(onSuccess: (value: U | HttpEventType | HttpResponse) => void, onError?: (err: any | Map) => void, onComplete?: () => void): Subscription | null; private addError; private getFormDataLength; }