import * as _angular_core from '@angular/core'; import { ElementRef } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE */ /** Why a dropped / picked file was rejected. */ type WrFileUploadRejectionReason = 'type' | 'size' | 'count'; /** A single rejected file + the reason. Emitted via `(rejected)`. */ interface WrFileUploadRejection { readonly file: File; readonly reason: WrFileUploadRejectionReason; } /** Human-readable byte size (e.g. `1.2 MB`). */ declare function formatBytes(bytes: number): string; /** * Drag-and-drop file upload zone. Click to browse, drag-and-drop to add, * with an optional file list + remove buttons. * * Implements `ControlValueAccessor` — value is `File | File[] | null` * (single or array, governed by `multiple`). * * @example * ```html * * * ``` * * @see https://ngwr.dev/components/file-upload */ declare class WrFileUpload implements ControlValueAccessor { /** Allow multiple files. Single mode replaces on each add. @default false */ readonly multiple: _angular_core.InputSignalWithTransform; /** `accept` attribute — comma-separated MIME types or extensions. @default '' */ readonly accept: _angular_core.InputSignal; /** Max bytes per file. `0` disables the check. @default 0 */ readonly maxSize: _angular_core.InputSignalWithTransform; /** Max files (multi mode only). `0` disables the check. @default 0 */ readonly maxFiles: _angular_core.InputSignalWithTransform; /** Render the picked-files list below the zone. @default true */ readonly showList: _angular_core.InputSignalWithTransform; /** Disable interaction. @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** Primary call-to-action label. Falls back to `fileUpload.browse`. */ readonly pickLabel: _angular_core.InputSignal; /** Secondary instruction below the CTA. Falls back to `fileUpload.dropZone`. */ readonly dropLabel: _angular_core.InputSignal; /** Drop-zone host aria-label. Falls back to `fileUpload.dropZoneLabel`. */ readonly dropZoneLabel: _angular_core.InputSignal; /** Remove-file button aria-label. Falls back to `fileUpload.removeFile`. */ readonly removeFileLabel: _angular_core.InputSignal; protected readonly resolvedPick: _angular_core.Signal; protected readonly resolvedDrop: _angular_core.Signal; protected readonly resolvedDropZone: _angular_core.Signal; protected readonly resolvedRemove: _angular_core.Signal; /** Optional helper text shown below the labels (e.g. accepted formats). */ readonly helperText: _angular_core.InputSignal; /** Emitted when files are rejected for type / size / count reasons. */ readonly rejected: _angular_core.OutputEmitterRef; protected readonly picker: _angular_core.Signal>; protected readonly files: _angular_core.WritableSignal; protected readonly dragging: _angular_core.WritableSignal; private readonly disabledFromCva; protected readonly effectiveDisabled: _angular_core.Signal; protected readonly classes: _angular_core.Signal; protected readonly formatBytes: typeof formatBytes; private onChange; private onTouched; writeValue(value: File | readonly File[] | null): void; registerOnChange(fn: (value: File | readonly File[] | null) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; protected openPicker(): void; protected onZoneKey(event: KeyboardEvent): void; protected onPickerChange(event: Event): void; protected onDragEnter(event: DragEvent): void; protected onDragOver(event: DragEvent): void; protected onDragLeave(event: DragEvent): void; protected onDrop(event: DragEvent): void; protected removeAt(index: number): void; private acceptFiles; private reject; private emit; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { WrFileUpload }; export type { WrFileUploadRejection, WrFileUploadRejectionReason };