import { FileBeforeUploadEvent, FileContentRemoveEvent, FileProgressEvent, FileRemoveEvent, FileSelectEvent, FileSendEvent, FileUploadContentTemplateContext, FileUploadErrorEvent, FileUploadEvent, FileUploadFileLabelTemplateContext, FileUploadFileTemplateContext, FileUploadHandlerEvent, FileUploadHeaderTemplateContext, FileUploadMessage, FileUploadPassThrough, RemoveUploadedFileEvent } from "primeng/types/fileupload"; import { HttpClient, HttpHeaders } from "@angular/common/http"; import * as i0 from "@angular/core"; import { ElementRef, TemplateRef } from "@angular/core"; import { DomSanitizer } from "@angular/platform-browser"; import * as i2 from "primeng/api"; import { BlockableUI } from "primeng/api"; import { BaseComponent } from "primeng/basecomponent"; import * as i1 from "primeng/bind"; import { Bind } from "primeng/bind"; import { ButtonDirectiveOptions } from "primeng/types/button"; import { CSSProperties } from "primeng/types/shared"; import { VoidListener } from "primeng/ts-helpers"; import { Subscription } from "rxjs"; import { BaseStyle } from "primeng/base"; export * from "primeng/types/fileupload"; export declare class FileUploadStyle extends BaseStyle { name: string; style: string; 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; } /** * * 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 * */ export 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" } /** * FileUpload is an advanced uploader with dragdrop support, multi file uploads, auto uploading, progress tracking and validations. * @group Components */ export declare class FileUpload extends BaseComponent implements BlockableUI { componentName: string; bindDirectiveInstance: Bind; /** * Name of the request parameter to identify the files at backend. * @group Props */ name: import("@angular/core").InputSignal; /** * Remote url to upload the files. * @group Props */ url: import("@angular/core").InputSignal; /** * HTTP method to send the files to the url such as "post" and "put". * @group Props */ method: import("@angular/core").InputSignal<"post" | "put">; /** * Used to select multiple files at once from file dialog. * @group Props */ multiple: import("@angular/core").InputSignalWithTransform; /** * 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: import("@angular/core").InputSignal; /** * Disables the upload functionality. * @group Props */ disabled: import("@angular/core").InputSignalWithTransform; /** * When enabled, upload begins automatically after selection is completed. * @group Props */ auto: import("@angular/core").InputSignalWithTransform; /** * Cross-site Access-Control requests should be made using credentials such as cookies, authorization headers or TLS client certificates. * @group Props */ withCredentials: import("@angular/core").InputSignalWithTransform; /** * Maximum file size allowed in bytes. * @group Props */ maxFileSize: import("@angular/core").InputSignalWithTransform; /** * Summary message of the invalid file size. * @group Props */ invalidFileSizeMessageSummary: import("@angular/core").InputSignal; /** * Detail message of the invalid file size. * @group Props */ invalidFileSizeMessageDetail: import("@angular/core").InputSignal; /** * Summary message of the invalid file type. * @group Props */ invalidFileTypeMessageSummary: import("@angular/core").InputSignal; /** * Detail message of the invalid file type. * @group Props */ invalidFileTypeMessageDetail: import("@angular/core").InputSignal; /** * Detail message of the invalid file type. * @group Props */ invalidFileLimitMessageDetail: import("@angular/core").InputSignal; /** * Summary message of the invalid file type. * @group Props */ invalidFileLimitMessageSummary: import("@angular/core").InputSignal; /** * Inline style of the element. * @group Props */ style: import("@angular/core").InputSignal; /** * Class of the element. * @group Props */ styleClass: import("@angular/core").InputSignal; /** * Width of the image thumbnail in pixels. * @group Props */ previewWidth: import("@angular/core").InputSignalWithTransform; /** * Label of the choose button. Defaults to PrimeNG Locale configuration. * @group Props */ chooseLabel: import("@angular/core").InputSignal; /** * Label of the upload button. Defaults to PrimeNG Locale configuration. * @group Props */ uploadLabel: import("@angular/core").InputSignal; /** * Label of the cancel button. Defaults to PrimeNG Locale configuration. * @group Props */ cancelLabel: import("@angular/core").InputSignal; /** * Icon of the choose button. * @group Props */ chooseIcon: import("@angular/core").InputSignal; /** * Icon of the upload button. * @group Props */ uploadIcon: import("@angular/core").InputSignal; /** * Icon of the cancel button. * @group Props */ cancelIcon: import("@angular/core").InputSignal; /** * Whether to show the upload button. * @group Props */ showUploadButton: import("@angular/core").InputSignalWithTransform; /** * Whether to show the cancel button. * @group Props */ showCancelButton: import("@angular/core").InputSignalWithTransform; /** * Defines the UI of the component. * @group Props */ mode: import("@angular/core").InputSignal<"advanced" | "basic">; /** * HttpHeaders class represents the header configuration options for an HTTP request. * @group Props */ headers: import("@angular/core").InputSignal; /** * Whether to use the default upload or a manual implementation defined in uploadHandler callback. Defaults to PrimeNG Locale configuration. * @group Props */ customUpload: import("@angular/core").InputSignalWithTransform; /** * Maximum number of files that can be uploaded. * @group Props */ fileLimit: import("@angular/core").InputSignalWithTransform; /** * Style class of the upload button. * @group Props */ uploadStyleClass: import("@angular/core").InputSignal; /** * Style class of the cancel button. * @group Props */ cancelStyleClass: import("@angular/core").InputSignal; /** * Style class of the remove button. * @group Props */ removeStyleClass: import("@angular/core").InputSignal; /** * Style class of the choose button. * @group Props */ chooseStyleClass: import("@angular/core").InputSignal; /** * Configuration object forwarded to the choose button. * @group Props */ chooseButtonProps: import("@angular/core").InputSignal; /** * Configuration object forwarded to the upload button. * @group Props */ uploadButtonProps: import("@angular/core").InputSignal; /** * Configuration object forwarded to the cancel button. * @group Props */ cancelButtonProps: import("@angular/core").InputSignal; /** * Callback to invoke before file upload is initialized. * @param {FileBeforeUploadEvent} event - Custom upload event. * @group Emits */ onBeforeUpload: import("@angular/core").OutputEmitterRef; /** * 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: import("@angular/core").OutputEmitterRef; /** * Callback to invoke when file upload is complete. * @param {FileUploadEvent} event - Custom upload event. * @group Emits */ onUpload: import("@angular/core").OutputEmitterRef; /** * Callback to invoke if file upload fails. * @param {FileUploadErrorEvent} event - Custom error event. * @group Emits */ onError: import("@angular/core").OutputEmitterRef; /** * Callback to invoke when files in queue are removed without uploading using clear all button. * @param {Event} event - Browser event. * @group Emits */ onClear: import("@angular/core").OutputEmitterRef; /** * Callback to invoke when a file is removed without uploading using clear button of a file. * @param {FileRemoveEvent} event - Remove event. * @group Emits */ onRemove: import("@angular/core").OutputEmitterRef; /** * Callback to invoke when files are selected. * @param {FileSelectEvent} event - Select event. * @group Emits */ onSelect: import("@angular/core").OutputEmitterRef; /** * Callback to invoke when files are being uploaded. * @param {FileProgressEvent} event - Progress event. * @group Emits */ onProgress: import("@angular/core").OutputEmitterRef; /** * Callback to invoke in custom upload mode to upload the files manually. * @param {FileUploadHandlerEvent} event - Upload handler event. * @group Emits */ uploadHandler: import("@angular/core").OutputEmitterRef; /** * This event is triggered if an error occurs while loading an image file. * @param {Event} event - Browser event. * @group Emits */ onImageError: import("@angular/core").OutputEmitterRef; /** * This event is triggered if an error occurs while loading an image file. * @param {RemoveUploadedFileEvent} event - Remove event. * @group Emits */ onRemoveUploadedFile: import("@angular/core").OutputEmitterRef; /** * Custom file template. * @group Templates */ fileTemplate: import("@angular/core").Signal | undefined>; /** * Custom header template. * @param {FileUploadHeaderTemplateContext} context - header template context. * @group Templates */ headerTemplate: import("@angular/core").Signal | undefined>; /** * Custom content template. * @param {FileUploadContentTemplateContext} context - content template context. * @group Templates */ contentTemplate: import("@angular/core").Signal | undefined>; /** * Custom toolbar template. * @group Templates */ toolbarTemplate: import("@angular/core").Signal | undefined>; /** * Custom choose icon template. * @group Templates */ chooseIconTemplate: import("@angular/core").Signal | undefined>; /** * Custom file label template. * @param {FileUploadFileLabelTemplateContext} context - file label template context. * @group Templates */ fileLabelTemplate: import("@angular/core").Signal | undefined>; /** * Custom upload icon template. * @group Templates */ uploadIconTemplate: import("@angular/core").Signal | undefined>; /** * Custom cancel icon template. * @group Templates */ cancelIconTemplate: import("@angular/core").Signal | undefined>; /** * Custom empty state template. * @group Templates */ emptyTemplate: import("@angular/core").Signal | undefined>; isAdvancedMode: import("@angular/core").Signal; isBasicMode: import("@angular/core").Signal; showUploadBtn: import("@angular/core").Signal; showCancelBtn: import("@angular/core").Signal; chooseButtonDisabled: import("@angular/core").Signal; uploadButtonDisabled: import("@angular/core").Signal; cancelButtonDisabled: import("@angular/core").Signal; showEmpty: import("@angular/core").Signal; get headerTemplateContext(): FileUploadHeaderTemplateContext; get contentTemplateContext(): FileUploadContentTemplateContext; get fileLabelTemplateContext(): FileUploadFileLabelTemplateContext; advancedFileInput: import("@angular/core").Signal | undefined>; basicFileInput: import("@angular/core").Signal | undefined>; contentEl: import("@angular/core").Signal | undefined>; /** * Files input. * @group Props */ filesInput: import("@angular/core").InputSignal; get files(): File[]; set files(value: File[]); get basicButtonLabel(): string; _files: import("@angular/core").WritableSignal; progress: import("@angular/core").WritableSignal; dragHighlight: import("@angular/core").WritableSignal; msgs: import("@angular/core").WritableSignal; uploadedFileCount: number; focus: import("@angular/core").WritableSignal; uploading: import("@angular/core").WritableSignal; duplicateIEEvent: boolean | undefined; translationSubscription: Subscription | undefined; dragOverListener: VoidListener; uploadedFiles: import("@angular/core").WritableSignal; sanitizer: DomSanitizer; http: HttpClient; _componentStyle: FileUploadStyle; constructor(); onAfterViewChecked(): void; onInit(): void; onAfterViewInit(): void; basicFileChosenLabel(): any; completedLabel(): any; choose(): void; onFileSelect(event: Event): 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: HTMLImageElement): void; /** * Uploads the selected files. * @group Method */ uploader(): void; onRemoveClick(e: FileContentRemoveEvent): void; onRemoveUploadedFileClick(e: Pick): 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: FileList | File[]): void; clearInputElement(): void; clearIEInput(): void; hasFiles(): boolean; hasUploadedFiles(): boolean; getFileTemplateContext(file: File): FileUploadFileTemplateContext; onDragEnter(e: DragEvent): void; onDragOver(e: DragEvent): void; onDragLeave(_event: DragEvent): void; onDrop(event: DragEvent): 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; } export declare class FileUploadModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; }