import { FileUploadPassThrough, FileBeforeUploadEvent, FileSendEvent, FileUploadEvent, FileUploadErrorEvent, FileRemoveEvent, FileSelectEvent, FileProgressEvent, FileUploadHandlerEvent, RemoveUploadedFileEvent, FileUploadHeaderTemplateContext, FileUploadContentTemplateContext, FileUploadFileLabelTemplateContext } from 'primeng/types/fileupload'; export * from 'primeng/types/fileupload'; import * as i0 from '@angular/core'; import { EventEmitter, TemplateRef, ElementRef, NgZone, QueryList } from '@angular/core'; import { HttpHeaders, HttpClient } from '@angular/common/http'; import { DomSanitizer } from '@angular/platform-browser'; import * as i2 from 'primeng/api'; import { BlockableUI, PrimeTemplate } from 'primeng/api'; import { BaseComponent } from 'primeng/basecomponent'; import * as i1 from 'primeng/bind'; import { Bind } from 'primeng/bind'; import { ButtonProps } from 'primeng/button'; import { VoidListener } from 'primeng/ts-helpers'; import { Subscription } from 'rxjs'; import * as _primeuix_styled from '@primeuix/styled'; import { BaseStyle } from 'primeng/base'; /** * * FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations. * * [Live Demo](https://www.primeng.org/fileupload/) * * @module fileuploadstyle * */ declare enum FileUploadClasses { /** * Class name of the root element */ root = "p-fileupload", /** * Class name of the header element */ header = "p-fileupload-header", /** * Class name of the choose button element */ pcChooseButton = "p-fileupload-choose-button", /** * Class name of the upload button element */ pcUploadButton = "p-fileupload-upload-button", /** * Class name of the cancel button element */ pcCancelButton = "p-fileupload-cancel-button", /** * Class name of the content element */ content = "p-fileupload-content", /** * Class name of the file list element */ fileList = "p-fileupload-file-list", /** * Class name of the file element */ file = "p-fileupload-file", /** * Class name of the file thumbnail element */ fileThumbnail = "p-fileupload-file-thumbnail", /** * Class name of the file info element */ fileInfo = "p-fileupload-file-info", /** * Class name of the file name element */ fileName = "p-fileupload-file-name", /** * Class name of the file size element */ fileSize = "p-fileupload-file-size", /** * Class name of the file badge element */ pcFileBadge = "p-fileupload-file-badge", /** * Class name of the file actions element */ fileActions = "p-fileupload-file-actions", /** * Class name of the file remove button element */ pcFileRemoveButton = "p-fileupload-file-remove-button", /** * Class name of the content in basic mode */ basicContent = "p-fileupload-basic-content" } declare class FileUploadStyle extends BaseStyle { name: string; style: _primeuix_styled.StyleType; classes: { root: ({ instance }: { instance: any; }) => string; header: string; pcChooseButton: string; pcUploadButton: string; pcCancelButton: string; content: string; fileList: string; file: string; fileThumbnail: string; fileInfo: string; fileName: string; fileSize: string; pcFileBadge: string; fileActions: string; pcFileRemoveButton: string; basicContent: string; }; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } interface FileUploadStyle extends BaseStyle { } declare class FileContent extends BaseComponent { _componentStyle: FileUploadStyle; $pcFileUpload: FileUpload; onRemove: i0.OutputEmitterRef; files: i0.InputSignal; badgeSeverity: i0.InputSignal<"secondary" | "info" | "success" | "warn" | "danger" | "contrast">; badgeValue: i0.InputSignal; previewWidth: i0.InputSignal; fileRemoveIconTemplate: i0.InputSignal; onRemoveClick(event: any, index: number): void; formatSize(bytes: number): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations. * @group Components */ declare class FileUpload extends BaseComponent implements BlockableUI { bindDirectiveInstance: Bind; onAfterViewChecked(): void; /** * 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; /** * Used to pass all properties of the ButtonProps to the choose button inside the component. * @group Props */ chooseButtonProps: ButtonProps; /** * Used to pass all properties of the ButtonProps to the upload button inside the component. * @group Props */ uploadButtonProps: ButtonProps; /** * Used to pass all properties of the ButtonProps to the cancel button inside the component. * @group Props */ cancelButtonProps: ButtonProps; /** * 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; /** * Custom file template. * @group Templates */ fileTemplate: TemplateRef | undefined; /** * Custom header template. * @param {FileUploadHeaderTemplateContext} context - header template context. * @group Templates */ headerTemplate: TemplateRef | undefined; /** * Custom content template. * @param {FileUploadContentTemplateContext} context - content template context. * @group Templates */ contentTemplate: TemplateRef | undefined; /** * Custom toolbar template. * @group Templates */ toolbarTemplate: TemplateRef | undefined; /** * Custom choose icon template. * @group Templates */ chooseIconTemplate: TemplateRef | undefined; /** * Custom file label template. * @param {FileUploadFileLabelTemplateContext} context - file label template context. * @group Templates */ fileLabelTemplate: TemplateRef | undefined; /** * Custom upload icon template. * @group Templates */ uploadIconTemplate: TemplateRef | undefined; /** * Custom cancel icon template. * @group Templates */ cancelIconTemplate: TemplateRef | undefined; /** * Custom empty state template. * @group Templates */ emptyTemplate: TemplateRef | 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: any[] | undefined; uploadedFileCount: number; focus: boolean | undefined; uploading: boolean | undefined; duplicateIEEvent: boolean | undefined; translationSubscription: Subscription | undefined; dragOverListener: VoidListener; uploadedFiles: File[]; sanitizer: DomSanitizer; zone: NgZone; http: HttpClient; _componentStyle: FileUploadStyle; onInit(): void; onAfterViewInit(): void; _headerTemplate: TemplateRef | undefined; _contentTemplate: TemplateRef | undefined; _toolbarTemplate: TemplateRef | undefined; _chooseIconTemplate: TemplateRef | undefined; _uploadIconTemplate: TemplateRef | undefined; _cancelIconTemplate: TemplateRef | undefined; _emptyTemplate: TemplateRef | undefined; _fileTemplate: TemplateRef | undefined; _fileLabelTemplate: TemplateRef | undefined; templates: QueryList | undefined; onAfterContentInit(): void; basicFileChosenLabel(): any; completedLabel(): any; getTranslation(option: string): any; choose(): void; onFileSelect(event: any): void; isFileSelected(file: File): boolean; isIE11(): boolean | undefined; 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 */ uploader(): void; onRemoveClick(e: any): void; onRemoveUploadedFileClick(e: any): 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: number): void; isFileLimitExceeded(): boolean | 0 | undefined; isChooseDisabled(): boolean | 0 | undefined; checkFileLimit(files: File[]): void; clearInputElement(): void; clearIEInput(): void; hasFiles(): boolean; hasUploadedFiles(): 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; upload(): void; onBasicUploaderClick(): void; onBasicKeydown(event: KeyboardEvent): void; imageError(event: Event): void; getBlockableElement(): HTMLElement; get chooseButtonLabel(): string; get uploadButtonLabel(): string; get cancelButtonLabel(): string; get browseFilesLabel(): string; get pendingLabel(): any; onDestroy(): 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; } declare class FileUploadModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { FileContent, FileUpload, FileUploadClasses, FileUploadModule, FileUploadStyle };