import * as i0 from '@angular/core';
import { EventEmitter, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
import { Nullable } from '@fundamental-ngx/cdk/utils';
import { ControlValueAccessor } from '@angular/forms';
import { ContentDensityObserver } from '@fundamental-ngx/core/content-density';
import { FormItemControl } from '@fundamental-ngx/core/form';
import { stateType } from '@fundamental-ngx/core/radio';

interface FileUploadOutput {
    validFiles?: File[];
    invalidFiles?: File[];
}
declare class FileUploaderService {
    /**
     * Method that validates files passed. It is based on
     * @param files File[]
     * @param minFileSize string
     * @param maxFileSize string
     * @param acceptedExtensions string
     */
    validateFiles(files: File[], minFileSize: string, maxFileSize: string, acceptedExtensions: Nullable<string>): FileUploadOutput;
    /** @hidden */
    private _checkExtension;
    /** @hidden */
    private _checkSize;
    static ɵfac: i0.ɵɵFactoryDeclaration<FileUploaderService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<FileUploaderService>;
}

/**
 * Directive that handles the drag and drop feature of the file input.
 */
declare class FileUploaderDragndropDirective {
    private _fileUploadService;
    /** Whether multiple files can be dropped at once. */
    multiple: boolean;
    /** Accepted file extensions. Format: `'.png,.jpg'`. */
    accept: string;
    /** Max file size in bytes that the input will accept. */
    maxFileSize: string;
    /** Min file size in bytes that the input will accept. */
    minFileSize: string;
    /** Whether selecting of new files is disabled. */
    disabled: boolean;
    /** Whether drag and drop is enabled. Disables this directive. */
    dragndrop: boolean;
    /** Event emitted when files are dropped. Passes back an array of files. */
    readonly fileChanged: EventEmitter<FileUploadOutput>;
    /** Event emitted when the dragged file enters the dropzone. */
    readonly dragEntered: EventEmitter<void>;
    /** Event emitted when the dragged file exits the dropzone. */
    readonly dragLeave: EventEmitter<void>;
    /** @hidden */
    private elementStateCounter;
    /** @hidden */
    constructor(_fileUploadService: FileUploaderService);
    /** @hidden */
    onDragover(event: Event): void;
    /** @hidden */
    onDragenter(): void;
    /** @hidden */
    onDragleave(event: Event): void;
    /** @hidden */
    onDrop(event: any): void;
    /** @hidden */
    private _muteEvent;
    static ɵfac: i0.ɵɵFactoryDeclaration<FileUploaderDragndropDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<FileUploaderDragndropDirective, "[fdFileDragnDrop], [fd-file-drag-n-drop]", never, { "multiple": { "alias": "multiple"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; "minFileSize": { "alias": "minFileSize"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "dragndrop": { "alias": "dragndrop"; "required": false; }; }, { "fileChanged": "fileChanged"; "dragEntered": "dragEntered"; "dragLeave": "dragLeave"; }, never, never, true, never>;
}

/**
 * Directive tool to facilitate interacting with a native file input element.
 */
declare class FileUploaderSelectDirective {
    /** Whether the input should accept multiple file selections. */
    multiple: boolean;
    /** Event emitted when files are selected. */
    readonly fileSelected: EventEmitter<File[]>;
    /** @hidden */
    get multipleBinding(): boolean | undefined;
    /** @hidden */
    onChange(event: Event): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FileUploaderSelectDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<FileUploaderSelectDirective, "[fdFileSelect]", never, { "multiple": { "alias": "multiple"; "required": false; }; }, { "fileSelected": "fileSelected"; }, never, never, true, never>;
}

/**
 * Tool to facilitate the input of files from the user.
 * It supports drag and drop, multiple input, max file size and more.
 * The drag events make it very easy to create and style elements like a dropzone.
 */
declare class FileUploaderComponent implements ControlValueAccessor, OnDestroy, FormItemControl {
    private _fileUploadService;
    private _changeDetRef;
    readonly _contentDensityObserver: ContentDensityObserver;
    /** @hidden */
    inputRef: ElementRef<HTMLInputElement>;
    /** @hidden */
    inputRefText: ElementRef;
    /** Whether the file input is disabled. */
    disabled: boolean;
    /** If it is mandatory field */
    required: boolean;
    /** Whether the file input should accept multiple files. */
    multiple: boolean;
    /** Accepted file extensions. Format: `'.png,.jpg'`. */
    accept: string;
    /** Whether the file input accepts drag and dropped files. */
    dragndrop: boolean;
    /** Max file size in bytes that the input will accept. */
    maxFileSize: string;
    /** Min file size in bytes that the input will accept. */
    minFileSize: string;
    /** Id for the input element. */
    id: string;
    /** aria-label value for input element. */
    ariaLabel: Nullable<string>;
    /** aria-label-by value for input element.*/
    ariaLabelledBy: Nullable<string>;
    /** placeholder for input element. */
    placeholder: string;
    /** button value */
    buttonLabel: string;
    /** value for input element. */
    buttonAriaLabel: Nullable<string>;
    /** The field to set state of radio button using:
     * 'success' | 'error' | 'warning' | 'default' | 'information'
     * by default value is set to 'default'
     */
    state: stateType;
    /** specifies number of files to allow to select */
    fileLimit: number;
    /** Whether or not to hide the input, leaving only the upload/browse button. */
    inputHidden: boolean;
    /** Width of the file uploader */
    width: string;
    /** Event fired when files are selected. Passed object is the array of files selected. */
    readonly selectedFilesChanged: EventEmitter<File[]>;
    /** Event fired when some invalid files are selected. Passed object is the array of invalid files. */
    readonly selectedInvalidFiles: EventEmitter<File[]>;
    /** Event fired when the dragged file enters the component boundaries. */
    readonly onDragEnter: EventEmitter<void>;
    /** Event fired when the dragged file exits the component boundaries. */
    readonly onDragLeave: EventEmitter<void>;
    /** * It stores the valid files  */
    validFiles: File[];
    /** * It stores the invalid files  */
    invalidFiles: File[];
    /** @hidden */
    private _previousValidFiles;
    /** @hidden */
    private _previousInvalidFiles;
    /** @hidden */
    private _subscriptions;
    /** @hidden */
    constructor(_fileUploadService: FileUploaderService, _changeDetRef: ChangeDetectorRef, _contentDensityObserver: ContentDensityObserver);
    /** @hidden */
    ngOnDestroy(): void;
    /** @hidden */
    onChange: (values: File[]) => void;
    /** @hidden */
    onTouched: () => void;
    /** @hidden */
    registerOnChange(fn: any): void;
    /** @hidden */
    registerOnTouched(fn: any): void;
    /** @hidden */
    setDisabledState(isDisabled: boolean): void;
    /** @hidden */
    writeValue(files: File[]): void;
    /** @hidden */
    handleDrop(files: FileUploadOutput): void;
    /** @hidden */
    selectHandler(event: File[]): void;
    /** @hidden */
    validateFiles(event: File[]): void;
    /** @hidden */
    setInputValue(selectedFiles: File[], fromClear?: boolean): void;
    /** @hidden */
    keyDownHandle(event: KeyboardEvent): void;
    /**
     * Opens the file selector.
     */
    open(): void;
    /**
     * Clears the files from the input.
     */
    clear(): void;
    /** @hidden */
    private _propagateFiles;
    static ɵfac: i0.ɵɵFactoryDeclaration<FileUploaderComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FileUploaderComponent, "fd-file-uploader", never, { "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "accept": { "alias": "accept"; "required": false; }; "dragndrop": { "alias": "dragndrop"; "required": false; }; "maxFileSize": { "alias": "maxFileSize"; "required": false; }; "minFileSize": { "alias": "minFileSize"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; }; "buttonAriaLabel": { "alias": "buttonAriaLabel"; "required": false; }; "state": { "alias": "state"; "required": false; }; "fileLimit": { "alias": "fileLimit"; "required": false; }; "inputHidden": { "alias": "inputHidden"; "required": false; }; "width": { "alias": "width"; "required": false; }; }, { "selectedFilesChanged": "selectedFilesChanged"; "selectedInvalidFiles": "selectedInvalidFiles"; "onDragEnter": "onDragEnter"; "onDragLeave": "onDragLeave"; }, never, ["[fd-form-control]"], true, never>;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class FileUploaderModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FileUploaderModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FileUploaderModule, never, [typeof FileUploaderComponent, typeof FileUploaderSelectDirective, typeof FileUploaderDragndropDirective], [typeof FileUploaderComponent, typeof FileUploaderSelectDirective, typeof FileUploaderDragndropDirective]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FileUploaderModule>;
}

export { FileUploaderComponent, FileUploaderDragndropDirective, FileUploaderModule, FileUploaderSelectDirective, FileUploaderService };
export type { FileUploadOutput };
