import { HttpClient, HttpHeaders } from '@angular/common/http'; import { AfterContentInit, AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy, OnInit, QueryList, Renderer2, TemplateRef } from '@angular/core'; import { DomSanitizer } from '@angular/platform-browser'; import { BlockableUI, Message, PrimeNGConfig, PrimeTemplate } from 'primeng/api'; import { VoidListener } from 'primeng/ts-helpers'; import { Subscription } from 'rxjs'; import { FileBeforeUploadEvent, FileProgressEvent, FileRemoveEvent, FileSelectEvent, FileSendEvent, FileUploadErrorEvent, FileUploadEvent, FileUploadHandlerEvent, RemoveUploadedFileEvent } from './fileupload.interface'; import * as i0 from "@angular/core"; import * as i1 from "@angular/common"; import * as i2 from "primeng/api"; import * as i3 from "primeng/button"; import * as i4 from "primeng/progressbar"; import * as i5 from "primeng/messages"; import * as i6 from "primeng/ripple"; import * as i7 from "primeng/icons/plus"; import * as i8 from "primeng/icons/upload"; import * as i9 from "primeng/icons/times"; /** * FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations. * @group Components */ export declare class FileUpload implements AfterViewInit, AfterContentInit, OnInit, OnDestroy, BlockableUI { private document; private platformId; private renderer; private el; sanitizer: DomSanitizer; zone: NgZone; private http; cd: ChangeDetectorRef; config: PrimeNGConfig; /** * Name of the request parameter to identify the files at backend. * @group Props */ name: string | undefined; /** * Remote url to upload the files. * @group Props */ url: string | undefined; /** * HTTP method to send the files to the url such as "post" and "put". * @group Props */ method: 'post' | 'put' | undefined; /** * Used to select multiple files at once from file dialog. * @group Props */ multiple: boolean | undefined; /** * Comma-separated list of pattern to restrict the allowed file types. Can be any combination of either the MIME types (such as "image/*") or the file extensions (such as ".jpg"). * @group Props */ accept: string | undefined; /** * Disables the upload functionality. * @group Props */ disabled: boolean | undefined; /** * When enabled, upload begins automatically after selection is completed. * @group Props */ auto: boolean | undefined; /** * Cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. * @group Props */ withCredentials: boolean | undefined; /** * Maximum file size allowed in bytes. * @group Props */ maxFileSize: number | undefined; /** * Summary message of the invalid file size. * @group Props */ invalidFileSizeMessageSummary: string; /** * Detail message of the invalid file size. * @group Props */ invalidFileSizeMessageDetail: string; /** * Summary message of the invalid file type. * @group Props */ invalidFileTypeMessageSummary: string; /** * Detail message of the invalid file type. * @group Props */ invalidFileTypeMessageDetail: string; /** * Detail message of the invalid file type. * @group Props */ invalidFileLimitMessageDetail: string; /** * Summary message of the invalid file type. * @group Props */ invalidFileLimitMessageSummary: string; /** * Inline style of the element. * @group Props */ style: { [klass: string]: any; } | null | undefined; /** * Class of the element. * @group Props */ styleClass: string | undefined; /** * Width of the image thumbnail in pixels. * @group Props */ previewWidth: number; /** * Label of the choose button. Defaults to PrimeNG Locale configuration. * @group Props */ chooseLabel: string | undefined; /** * Label of the upload button. Defaults to PrimeNG Locale configuration. * @group Props */ uploadLabel: string | undefined; /** * Label of the cancel button. Defaults to PrimeNG Locale configuration. * @group Props */ cancelLabel: string | undefined; /** * Icon of the choose button. * @group Props */ chooseIcon: string | undefined; /** * Icon of the upload button. * @group Props */ uploadIcon: string | undefined; /** * Icon of the cancel button. * @group Props */ cancelIcon: string | undefined; /** * Whether to show the upload button. * @group Props */ showUploadButton: boolean; /** * Whether to show the cancel button. * @group Props */ showCancelButton: boolean; /** * Defines the UI of the component. * @group Props */ mode: 'advanced' | 'basic' | undefined; /** * HttpHeaders class represents the header configuration options for an HTTP request. * @group Props */ headers: HttpHeaders | undefined; /** * Whether to use the default upload or a manual implementation defined in uploadHandler callback. Defaults to PrimeNG Locale configuration. * @group Props */ customUpload: boolean | undefined; /** * Maximum number of files that can be uploaded. * @group Props */ fileLimit: number | undefined; /** * Style class of the upload button. * @group Props */ uploadStyleClass: string | undefined; /** * Style class of the cancel button. * @group Props */ cancelStyleClass: string | undefined; /** * Style class of the remove button. * @group Props */ removeStyleClass: string | undefined; /** * Style class of the choose button. * @group Props */ chooseStyleClass: string | undefined; /** * Callback to invoke before file upload is initialized. * @param {FileBeforeUploadEvent} event - Custom upload event. * @group Emits */ onBeforeUpload: EventEmitter; /** * An event indicating that the request was sent to the server. Useful when a request may be retried multiple times, to distinguish between retries on the final event stream. * @param {FileSendEvent} event - Custom send event. * @group Emits */ onSend: EventEmitter; /** * Callback to invoke when file upload is complete. * @param {FileUploadEvent} event - Custom upload event. * @group Emits */ onUpload: EventEmitter; /** * Callback to invoke if file upload fails. * @param {FileUploadErrorEvent} event - Custom error event. * @group Emits */ onError: EventEmitter; /** * Callback to invoke when files in queue are removed without uploading using clear all button. * @param {Event} event - Browser event. * @group Emits */ onClear: EventEmitter; /** * Callback to invoke when a file is removed without uploading using clear button of a file. * @param {FileRemoveEvent} event - Remove event. * @group Emits */ onRemove: EventEmitter; /** * Callback to invoke when files are selected. * @param {FileSelectEvent} event - Select event. * @group Emits */ onSelect: EventEmitter; /** * Callback to invoke when files are being uploaded. * @param {FileProgressEvent} event - Progress event. * @group Emits */ onProgress: EventEmitter; /** * Callback to invoke in custom upload mode to upload the files manually. * @param {FileUploadHandlerEvent} event - Upload handler event. * @group Emits */ uploadHandler: EventEmitter; /** * This event is triggered if an error occurs while loading an image file. * @param {Event} event - Browser event. * @group Emits */ onImageError: EventEmitter; /** * This event is triggered if an error occurs while loading an image file. * @param {RemoveUploadedFileEvent} event - Remove event. * @group Emits */ onRemoveUploadedFile: EventEmitter; templates: QueryList | undefined; advancedFileInput: ElementRef | undefined | any; basicFileInput: ElementRef | undefined; content: ElementRef | undefined; set files(files: File[]); get files(): File[]; get basicButtonLabel(): string; _files: File[]; progress: number; dragHighlight: boolean | undefined; msgs: Message[] | undefined; fileTemplate: TemplateRef | undefined; headerTemplate: TemplateRef | undefined; contentTemplate: TemplateRef | undefined; toolbarTemplate: TemplateRef | undefined; chooseIconTemplate: TemplateRef | undefined; uploadIconTemplate: TemplateRef | undefined; cancelIconTemplate: TemplateRef | undefined; emptyTemplate: TemplateRef | undefined; uploadedFileCount: number; focus: boolean | undefined; uploading: boolean | undefined; duplicateIEEvent: boolean | undefined; translationSubscription: Subscription | undefined; dragOverListener: VoidListener; uploadedFiles: any[]; constructor(document: Document, platformId: any, renderer: Renderer2, el: ElementRef, sanitizer: DomSanitizer, zone: NgZone, http: HttpClient, cd: ChangeDetectorRef, config: PrimeNGConfig); ngAfterContentInit(): void; ngOnInit(): void; ngAfterViewInit(): void; getTranslation(option: string): any; choose(): void; onFileSelect(event: any): void; isFileSelected(file: File): boolean; isIE11(): boolean; validate(file: File): boolean; private isFileTypeValid; getTypeClass(fileType: string): string; isWildcard(fileType: string): boolean; getFileExtension(file: File): string; isImage(file: File): boolean; onImageLoad(img: any): void; /** * Uploads the selected files. * @group Method */ upload(): void; /** * Clears the files list. * @group Method */ clear(): void; /** * Removes a single file. * @param {Event} event - Browser event. * @param {Number} index - Index of the file. * @group Method */ remove(event: Event, index: number): void; /** * Removes uploaded file. * @param {Number} index - Index of the file to be removed. * @group Method */ removeUploadedFile(index: any): void; isFileLimitExceeded(): boolean; isChooseDisabled(): boolean; checkFileLimit(files: File[]): void; clearInputElement(): void; clearIEInput(): void; hasFiles(): boolean; onDragEnter(e: DragEvent): void; onDragOver(e: DragEvent): void; onDragLeave(event: DragEvent): void; onDrop(event: any): void; onFocus(): void; onBlur(): void; formatSize(bytes: number): string; onBasicUploaderClick(): void; onBasicKeydown(event: KeyboardEvent): void; imageError(event: Event): void; getBlockableElement(): HTMLElement; get chooseButtonLabel(): string; get uploadButtonLabel(): string; get cancelButtonLabel(): string; get browseFilesLabel(): string; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_multiple: unknown; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_auto: unknown; static ngAcceptInputType_withCredentials: unknown; static ngAcceptInputType_maxFileSize: unknown; static ngAcceptInputType_previewWidth: unknown; static ngAcceptInputType_showUploadButton: unknown; static ngAcceptInputType_showCancelButton: unknown; static ngAcceptInputType_customUpload: unknown; static ngAcceptInputType_fileLimit: unknown; } export declare class FileUploadModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; }