import { OnInit } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { CreateFileValue, UpdateFileValue } from '@dasch-swiss/dsp-js'; import { NotificationService } from '../../../action/services/notification.service'; import { UploadFileService } from '../../services/upload-file.service'; export declare class UploadFileComponent implements OnInit { private readonly _fb; private readonly _ns; private readonly _ufs; parentForm?: FormGroup; representation: string; readonly fromLabels: { upload: string; drag_drop: string; }; file: File; form: FormGroup; fileControl: FormControl; isLoading: boolean; thumbnailUrl: string; constructor(_fb: FormBuilder, _ns: NotificationService, _ufs: UploadFileService); ngOnInit(): void; /** * Adds file and uploads to SIPI, checking before if conditions met * @param event DragDrop event containing upload files */ addFile(event: any): void; /** * Converts file size to display in KB or MB * @param val file size to be converted */ convertBytes(val: number): string; /** * Converts date to a readable format. * @param date date to be converted */ convertDate(date: number): string; /** * Removes the attachment */ deleteAttachment(): void; /** * Initializes form group */ initializeForm(): void; /** * Resets form group */ resetForm(): void; /** * Create a new file value. */ getNewValue(): CreateFileValue | false; /** * Create an updated file value. * * @param id the current file value's id. */ getUpdatedValue(id: string): UpdateFileValue | false; /** * Checks if added file type is supported for certain resource type * @param fileType file type to be checked */ private _isFileTypeSupported; /** * Returns supported file types list for certain resource type */ private _supportedFileTypes; /** * Checks if more than one file dropped * @param files files array to be checked */ private _isMoreThanOneFile; }