import { ComponentInterface, EventEmitter } from '../../stencil-public-runtime'; import type { ValidFileStatus, FilesObject } from 'q2-tecton-common/lib/types/elements'; type DisplayedFile = { file: File; message?: string; status: ValidFileStatusType | InvalidFileStatusType; toBeRemoved?: boolean; }; type ValidFileStatusType = 'in-progress' | 'failed' | 'uploaded'; type InvalidFileStatusType = 'invalid-type' | 'over-size-limit' | 'over-max-files-limit'; /** * @name File Picker * @category Forms * @summary Use for uploading files via browse dialog or drag-and-drop. * @slot label - An optional slot to display a custom label. * @slot description - An optional slot to display a custom description. */ export declare class Q2FilePicker implements ComponentInterface { private _value; browseButtonInput: HTMLElement; dropZone: HTMLElement; fileItemsToBeDeleted: any; fileList: HTMLElement; fileListContainer: HTMLElement; fileListResizeObserver: ResizeObserver; queuedFiles: File[]; el: HTMLElement; areFilesUploading: boolean; displayedFiles: DisplayedFile[]; isDropZoneHighlighted: boolean; refreshCounter: number; /** * The size of the browse button. */ buttonSize: 'none' | 'small' | 'medium' | 'large'; /** * A description of the field. This is announced by screen readers when the field is focused. * @localizable */ description: string; /** * Disables the file picker, preventing user interaction. */ disabled: boolean; /** * When `false`, the file name renders as-is and may wrap. Otherwise, long * file names are middle-ellipsized so the beginning and end of the name * remain visible. */ ellipsizeFileName: boolean; /** * Allowed file types based on extensions (e.g., ['jpg', 'png', 'pdf'] or * 'jpg, png, pdf'). When using the attribute, provide a comma-separated * string (e.g., 'jpg, png, pdf'). Arrays can only be set programmatically * via JavaScript. */ fileTypes: string[] | string; /** * The label for the field. This is announced by screen readers when the field is focused. * @localizable */ label: string; /** * The maximum number of files that can be selected. */ maxFiles: number; /** * The maximum size (in bytes) of any file that can be selected. */ maxFileSize: number; /** * Shows a gradient at the bottom of the file list when more files are available below the visible area. */ showGradient: boolean; /** * An array of `ValidFileStatus` objects representing the upload status of * files. Each `ValidFileStatus` object contains the following properties: * - `name`: The file name. * - `status`: The upload status, either `"failed"` or `"uploaded"`. * - `message`: (Optional) A custom status message, used only when `status` * is `"failed"`. This allows developers to provide more detail about * upload failures while ensuring all other file status messages remain * consistent with approved design/UX standards. Custom failure messages * are limited to a single line. * @localizable */ status: ValidFileStatus[]; /** * Returns an object representing the selected files with two properties: * - `invalidFiles`: An array of `InvalidFileStatus` objects representing * files that failed validation. * - `validFiles`: An array of `File` objects representing files that passed * validation. * * Each `InvalidFileStatus` object includes the following properties: * - `file`: The `File` object. * - `status`: The validation status, which can be `"invalid-type"` (invalid file * type), `"over-size-limit"` (file exceeds the size limit), or * `"over-max-files-limit"` (total exceeds the max files limit). * @readonly */ get value(): FilesObject; set value(_: FilesObject); /** * Determines if the file picker is a browse button or a drop zone with a * browse link. */ variant: 'browse' | 'browse-drop'; /** * Custom event dispatched when the user selects files. The event detail * contains an object representing the selected files with two * properties: * - `invalidFiles`: An array of `InvalidFileStatus` objects representing * files that failed validation. * - `validFiles`: An array of `File` objects representing files that passed * validation. * * Each `InvalidFileStatus` object includes the following properties: * - `file`: The `File` object. * - `status`: The validation status, which can be `"invalid-type"` (invalid file * type), `"over-size-limit"` (file exceeds the size limit), or * `"over-max-files-limit"` (total exceeds the max files limit). */ tctChange: EventEmitter; disconnectedCallback(): void; componentDidLoad(): void; componentDidRender(): void; updateGradientVisibility(): void; updateFileList(newValue: ValidFileStatus[]): void; get actualButtonSize(): "small" | "medium" | "large"; get dropZoneClasses(): string; get fileTypesArray(): string[]; get hasDescription(): boolean; get hasDescriptionSlotContent(): boolean; get hasLabel(): boolean; get hasLabelSlotContent(): boolean; get isMobileViewport(): boolean; buildFilesObject(filesToUpload: File[]): FilesObject; dimDropZone: (e: DragEvent) => void; disableEvent(event: Event): void; disableLoaderIfAllFilesUploaded(): void; emitChange(filesObject: FilesObject): void; extractFilesOfInvalidTypes(files: File[]): any[]; extractFilesOverMaxFilesLimit(files: File[]): any[]; extractFilesOverSizeLimit(files: File[]): any[]; forceRerender(): void; getAnimationendHandlerToRemoveFileItem(fileName: string): (e: AnimationEvent) => void; getClickHandlerToRemoveFileItem(fileName: string): () => void; getFileItemButtonLabel(displayedFile: DisplayedFile): string; getFileItemClasses(fileName: string): string; getFileItemStatusMessage(displayedFile: DisplayedFile): string; grabDroppedFiles: (e: DragEvent) => void; grabSelectedFiles: (e: Event) => void; highlightDropZone: (e: DragEvent) => void; launchFileBrowser(): void; observeFileListContent(): void; updateFileListGradient: () => void; render: () => any; } export {};