cocori-ng
Version:
Cocori-ng is an Angular full of great components & utilites based on Material
33 lines (32 loc) • 1.38 kB
TypeScript
import { AssembleFilePartsCommand, ConfigAPIsFile, FilePartCommand, HttpService, NewFileCommand } from 'cocori-ng/src/feature-core';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import * as i0 from "@angular/core";
export declare class UploaderService {
private httpService;
progressSource: BehaviorSubject<number>;
fileUploaded$: Subject<any>;
fileOnError$: Subject<any>;
apisFile: ConfigAPIsFile;
chunkSize: number;
file: File;
constructor(httpService: HttpService);
uploadFile(file: File): void;
private handleFullFile;
private handlePartsFile;
private loopParts;
private sendFull;
private sendPart;
private sendFile;
private endCommand;
private getNumberPart;
convertFileToArrayBuffer(file: File): Observable<ArrayBuffer>;
convertToBase64(buffer: ArrayBuffer): string;
getPart(data: ArrayBuffer, partIndex: number): ArrayBuffer;
getChecksum(data: ArrayBuffer): string;
private getEventMessage;
/** APIs */
UploadFileAPI(datas: NewFileCommand | FilePartCommand, partIndex: number, numberParts: number): Observable<any>;
EndUploadPartsFileAPI(datas: AssembleFilePartsCommand): Observable<any>;
static ɵfac: i0.ɵɵFactoryDeclaration<UploaderService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<UploaderService>;
}