import * as _angular_core from '@angular/core';
import { Signal, OnInit, ElementRef } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { ZEvent } from '@shival99/z-ui/utils';
import { ClassValue } from 'clsx';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';

type ZUploadSize = 'sm' | 'default' | 'lg';
type ZUploadStatus = 'pending' | 'uploading' | 'success' | 'error';
interface ZUploadFile {
    id: string;
    name: string;
    size: number;
    type: string;
    file?: File;
    url?: string;
    progress: number;
    status: ZUploadStatus;
}
interface ZUploadError {
    file: File;
    error: string;
}
interface ZUploadValidator {
    error: string;
    message: string;
    validate?: (files: ZUploadFile[]) => boolean;
}
interface ZUploadControl {
    /** Trigger validation and return true if valid */
    valid: () => boolean;
    /**
     * Trigger validation and return true if has error.
     * @deprecated Use `valid()` for boolean form-submit checks.
     */
    validate: () => boolean;
    reset: () => void;
    clearFiles: () => void;
    openFileDialog: () => void;
    markAsTouched: () => void;
    markAsUntouched: () => void;
    markAsDirty: () => void;
    markAsPristine: () => void;
    hasError: Signal<boolean>;
    files: Signal<ZUploadFile[]>;
    errorMessage: Signal<string>;
}
declare const formatFileSize: (bytes: number) => string;

declare class ZUploadComponent implements OnInit, ControlValueAccessor {
    private readonly _injector;
    private readonly _destroyRef;
    private readonly _zTranslate;
    protected readonly fileInputRef: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
    readonly zOnUpload: _angular_core.OutputEmitterRef<ZUploadFile[]>;
    readonly zOnRemove: _angular_core.OutputEmitterRef<ZUploadFile>;
    readonly zOnDownload: _angular_core.OutputEmitterRef<ZUploadFile>;
    readonly zOnError: _angular_core.OutputEmitterRef<ZUploadError>;
    readonly zOnFileChange: _angular_core.OutputEmitterRef<File[]>;
    readonly zOnDragover: _angular_core.OutputEmitterRef<DragEvent>;
    readonly zOnDragleave: _angular_core.OutputEmitterRef<DragEvent>;
    readonly zOnDrop: _angular_core.OutputEmitterRef<DragEvent>;
    readonly zControl: _angular_core.OutputEmitterRef<ZUploadControl>;
    readonly zEvent: _angular_core.OutputEmitterRef<ZEvent>;
    readonly class: _angular_core.InputSignal<ClassValue>;
    readonly zLabel: _angular_core.InputSignal<string>;
    readonly zLabelClass: _angular_core.InputSignal<string>;
    readonly zNote: _angular_core.InputSignal<string>;
    readonly zSize: _angular_core.InputSignal<ZUploadSize>;
    readonly zAcceptFile: _angular_core.InputSignal<string>;
    readonly zMultipleFile: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zMaxSize: _angular_core.InputSignal<number>;
    readonly zMaxFiles: _angular_core.InputSignal<number>;
    readonly zRequired: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zDisabled: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zReadonly: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zLoading: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zShowProgress: _angular_core.InputSignalWithTransform<boolean, string | boolean>;
    readonly zValidators: _angular_core.InputSignal<ZUploadValidator[]>;
    readonly files: _angular_core.WritableSignal<ZUploadFile[]>;
    protected readonly inputId: string;
    protected readonly labelId: string;
    protected readonly isDragOver: _angular_core.WritableSignal<boolean>;
    protected readonly uiState: _angular_core.WritableSignal<{
        touched: boolean;
        dirty: boolean;
    }>;
    private readonly _fileError;
    private readonly _disabled;
    private readonly _formControl;
    private readonly _formStateVersion;
    private readonly _isNgModel;
    private _onChange;
    private _onTouched;
    private _ngControl;
    protected readonly isDisabled: _angular_core.Signal<boolean>;
    protected readonly isBlocked: _angular_core.Signal<boolean>;
    private readonly _shouldShowValidation;
    protected readonly hasError: _angular_core.Signal<boolean>;
    protected readonly showError: _angular_core.Signal<boolean>;
    protected readonly errorMessage: _angular_core.Signal<string>;
    protected readonly currentStatus: _angular_core.Signal<"default" | "error" | "disabled" | "readonly" | "active">;
    protected readonly dropzoneClasses: _angular_core.Signal<string>;
    protected readonly acceptTypes: _angular_core.Signal<string>;
    protected readonly formatFileSize: (bytes: number) => string;
    protected readonly getFileItemClasses: (file: ZUploadFile) => string;
    ngOnInit(): void;
    writeValue(value: ZUploadFile[] | null): void;
    registerOnChange(fn: (value: ZUploadFile[]) => void): void;
    registerOnTouched(fn: () => void): void;
    setDisabledState(isDisabled: boolean): void;
    updateProgress(fileId: string, progress: number): void;
    setFileStatus(fileId: string, status: ZUploadFile['status']): void;
    clearFiles(): void;
    /** @deprecated Use `valid()` for boolean form-submit checks. */
    validate(): boolean;
    valid(): boolean;
    reset(): void;
    markAsTouched(): void;
    markAsUntouched(): void;
    markAsDirty(): void;
    markAsPristine(): void;
    private _emitControl;
    getFiles(): File[];
    protected openFileDialog(): void;
    protected onFileSelected(event: Event): void;
    protected onDragOver(event: DragEvent): void;
    protected onDragLeave(event: DragEvent): void;
    protected onDrop(event: DragEvent): void;
    protected removeFile(file: ZUploadFile): void;
    protected downloadFile(file: ZUploadFile): void;
    private _getValidationErrors;
    private _processFiles;
    private _emitFileChange;
    private _isValidFileType;
    private _notifyChange;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<ZUploadComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<ZUploadComponent, "z-upload", ["zUpload"], { "class": { "alias": "class"; "required": false; "isSignal": true; }; "zLabel": { "alias": "zLabel"; "required": false; "isSignal": true; }; "zLabelClass": { "alias": "zLabelClass"; "required": false; "isSignal": true; }; "zNote": { "alias": "zNote"; "required": false; "isSignal": true; }; "zSize": { "alias": "zSize"; "required": false; "isSignal": true; }; "zAcceptFile": { "alias": "zAcceptFile"; "required": false; "isSignal": true; }; "zMultipleFile": { "alias": "zMultipleFile"; "required": false; "isSignal": true; }; "zMaxSize": { "alias": "zMaxSize"; "required": false; "isSignal": true; }; "zMaxFiles": { "alias": "zMaxFiles"; "required": false; "isSignal": true; }; "zRequired": { "alias": "zRequired"; "required": false; "isSignal": true; }; "zDisabled": { "alias": "zDisabled"; "required": false; "isSignal": true; }; "zReadonly": { "alias": "zReadonly"; "required": false; "isSignal": true; }; "zLoading": { "alias": "zLoading"; "required": false; "isSignal": true; }; "zShowProgress": { "alias": "zShowProgress"; "required": false; "isSignal": true; }; "zValidators": { "alias": "zValidators"; "required": false; "isSignal": true; }; }, { "zOnUpload": "zOnUpload"; "zOnRemove": "zOnRemove"; "zOnDownload": "zOnDownload"; "zOnError": "zOnError"; "zOnFileChange": "zOnFileChange"; "zOnDragover": "zOnDragover"; "zOnDragleave": "zOnDragleave"; "zOnDrop": "zOnDrop"; "zControl": "zControl"; "zEvent": "zEvent"; }, never, never, true, never>;
}

declare const zUploadDropzoneVariants: (props?: ({
    zSize?: "sm" | "default" | "lg" | null | undefined;
    zStatus?: "default" | "error" | "active" | "disabled" | "readonly" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type ZUploadDropzoneVariants = VariantProps<typeof zUploadDropzoneVariants>;
declare const zUploadFileItemVariants: (props?: ({
    zStatus?: "pending" | "uploading" | "success" | "error" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type ZUploadFileItemVariants = VariantProps<typeof zUploadFileItemVariants>;

export { ZUploadComponent, formatFileSize, zUploadDropzoneVariants, zUploadFileItemVariants };
export type { ZUploadControl, ZUploadDropzoneVariants, ZUploadError, ZUploadFile, ZUploadFileItemVariants, ZUploadSize, ZUploadStatus, ZUploadValidator };
