import { AxiosResponse } from 'axios';
import { PluginObject } from 'vue';
import { RequestConfig } from '../http/rest';
declare module 'vue/types/vue' {
    interface Vue {
        $file: FileService;
    }
}
export declare const DEFAULT_STORE_NAME: string;
export interface MFile {
    uid: string;
    name: string;
    extension: string;
    file: File;
    status: MFileStatus;
    progress: number;
    rejection?: MFileRejectionCause;
    url?: string;
}
export declare enum MFileRejectionCause {
    FILE_SIZE = "file-size",
    FILE_TYPE = "file-type",
    MAX_FILES = "max-files",
    CUSTOM_VALIDATION = "custom-validation"
}
export declare enum MFileStatus {
    READY = "ready",
    UPLOADING = "uploading",
    COMPLETED = "completed",
    FAILED = "failed",
    REJECTED = "rejected",
    CANCELED = "canceled"
}
export interface MFileUploadOptions {
    url: string;
    config?: RequestConfig;
    onUploadProgress?: (progressEvent: ProgressEvent) => void;
}
export interface MFileValidationOptions {
    maxFiles?: number;
    maxSizeKb?: number;
    allowedExtensions?: string[];
    rejectedExtensions?: string[];
    /**
     * Function that validates custom criteria on a MFile.
     * @returns true if the file respects the criterias, false otherwise (therefore the file is in error)
     */
    customValidationFunction?: (file: MFile) => Promise<boolean>;
}
export declare class FileService {
    private stores;
    files(storeName?: string): MFile[];
    setValidationOptions(options: MFileValidationOptions, storeName?: string): void;
    add(files: FileList, storeName?: string): Promise<void>;
    addSingleFile(file: File, storeName?: string): Promise<void>;
    remove(fileuid: string, storeName?: string): void;
    clear(storeName?: string): void;
    destroy(storeName?: string): void;
    upload<T>(fileuid: string, options: MFileUploadOptions, storeName?: string): Promise<AxiosResponse<T>>;
    uploadTemp(files: MFile[], storeName?: string): void;
    cancelUpload(fileuid: string, storeName?: string): void;
    private getStoreName;
    private getStore;
}
export declare function extractExtension(filename: string): string;
declare const FilePlugin: PluginObject<any>;
export default FilePlugin;
//# sourceMappingURL=file.d.ts.map