import * as _angular_core from '@angular/core'; import { DestroyRef, ElementRef } from '@angular/core'; declare const FILE_TYPES: { readonly PDF: ".pdf,application/pdf"; readonly TXT: ".txt,text/plain"; readonly RTF: ".rtf,application/rtf"; readonly DOC: ".doc,application/msword"; readonly DOCX: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document"; readonly EML: ".eml,message/rfc822"; readonly MSG: ".msg,application/vnd.ms-outlook"; readonly CSV: ".csv,text/csv"; readonly XLS: ".xls,application/vnd.ms-excel"; readonly XLSX: ".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; readonly PPT: ".ppt,application/vnd.ms-powerpoint"; readonly PPTX: ".pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation"; readonly PNG: ".png,image/png"; readonly JPG: ".jpg,.jpeg,image/jpeg"; readonly SVG: ".svg,image/svg+xml"; readonly WEBP: ".webp,image/webp"; readonly GIF: ".gif,image/gif"; readonly ANY_IMAGE: "image/*"; readonly ZIP: ".zip,application/zip"; readonly RAR: ".rar,application/vnd.rar"; readonly SEVEN_ZIP: ".7z,application/x-7z-compressed"; readonly TAR: ".tar,application/x-tar"; readonly GZ: ".gz,application/gzip"; readonly MP3: ".mp3,audio/mpeg"; readonly MP4: ".mp4,video/mp4"; readonly ANY_AUDIO: "audio/*"; readonly ANY_VIDEO: "video/*"; readonly JSON: ".json,application/json"; readonly XML: ".xml,application/xml"; readonly HTML: ".html,.htm,text/html"; }; type FileType = (typeof FILE_TYPES)[keyof typeof FILE_TYPES]; interface DroppedFile { file: File; relativePath: string; } interface FileDropEvent { files: DroppedFile[]; } interface FilePickerOptions { /** * Allows dropped folders/directories to be traversed. * * This should NOT force the hidden file input into directory-picker mode. */ directory?: boolean; } declare class AngularFileDrop { #private; destroyRef: DestroyRef; /** * Whether multiple files can be selected. */ multiple: _angular_core.InputSignalWithTransform; /** * Allows dropped folders/directories to be traversed. * * This should NOT force the hidden file input into directory-picker mode. */ directory: _angular_core.InputSignalWithTransform; directoryPicker: _angular_core.InputSignalWithTransform; /** * The accepted file types. */ acceptedFiles: _angular_core.InputSignal; ignoreHiddenFiles: _angular_core.InputSignalWithTransform; clickable: _angular_core.InputSignalWithTransform; disabled: _angular_core.InputSignalWithTransform; isManualActivation: _angular_core.InputSignalWithTransform; hostActivationEnabled: _angular_core.Signal; hostCanOpenPicker: _angular_core.Signal; fileDrop: _angular_core.OutputEmitterRef; dragEnter: _angular_core.OutputEmitterRef; dragLeave: _angular_core.OutputEmitterRef; dragOver: _angular_core.OutputEmitterRef; isDragOver: _angular_core.WritableSignal; el: ElementRef; hiddenInput?: HTMLInputElement; openPicker(event?: Event, options?: FilePickerOptions): void; openDirectoryPicker(event?: Event): void; openFilePicker(event?: Event): void; shouldIgnoreActivationTarget(event: Event): boolean; onActivate(event: Event): void; onDragEnter(event: DragEvent): void; onDragOver(event: DragEvent): void; onDragLeave(event: DragEvent): void; onDocumentDragLeave(event: DragEvent): void; resetDragState(): void; onDrop(event: DragEvent): Promise; syncInput(input: HTMLInputElement, options?: FilePickerOptions): void; getOrCreateFileInput(): HTMLInputElement | undefined; prepareFiles(files: DroppedFile[]): DroppedFile[]; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } /** * Interactive child elements that should not trigger the file picker when clicked. */ declare const FILE_DND_IGNORE_SELECTOR = "button,a,input,textarea,select,[contenteditable=\"true\"],[data-file-dnd-ignore]"; declare function containsFiles(event: DragEvent): boolean; declare function setDropEffect(event: DragEvent, dropEffect: DataTransfer['dropEffect']): void; /** * A path is considered hidden if any of its segments starts with a dot * (e.g. `.git/config` or `folder/.DS_Store`). */ declare function isHiddenPath(relativePath: string): boolean; declare function filterHiddenFiles(files: DroppedFile[]): DroppedFile[]; /** * Matches a file against an `accept`-style string (e.g. `.png,image/*,application/pdf`). */ declare function isFileAccepted(file: File, acceptStr: string | null): boolean; declare function filterAcceptedFiles(files: DroppedFile[], acceptStr: string | null): DroppedFile[]; declare function enforceMultiple(files: DroppedFile[], multiple: boolean): DroppedFile[]; declare function toDroppedFiles(files: ArrayLike): DroppedFile[]; /** * Extracts all files from a drop's DataTransfer, traversing folders when * `traverseDirectories` is true. Picks the best available API: * File System Access handles → webkit entries → plain FileList. */ declare function readDroppedFiles(dt: DataTransfer, traverseDirectories: boolean): Promise; declare function walkHandles(handles: FileSystemHandle[], basePath: string, traverseDirectories: boolean): Promise; declare function walkEntries(entries: FileSystemEntry[], basePath: string, traverseDirectories: boolean): Promise; declare function walkEntry(entry: FileSystemEntry, basePath: string, traverseDirectories: boolean): Promise; declare function resolveFileEntry(entry: FileSystemFileEntry, basePath: string): Promise; declare function resolveDirectoryEntry(entry: FileSystemDirectoryEntry, basePath: string, traverseDirectories: boolean): Promise; /** * Creates an invisible `` attached to `document.body`. * The caller is responsible for removing it again. */ declare function createHiddenFileInput(): HTMLInputElement; export { AngularFileDrop, FILE_DND_IGNORE_SELECTOR, FILE_TYPES, containsFiles, createHiddenFileInput, enforceMultiple, filterAcceptedFiles, filterHiddenFiles, isFileAccepted, isHiddenPath, readDroppedFiles, resolveDirectoryEntry, resolveFileEntry, setDropEffect, toDroppedFiles, walkEntries, walkEntry, walkHandles }; export type { DroppedFile, FileDropEvent, FilePickerOptions, FileType };