import React from 'react';
import { FormControlProps } from './Item';
import { Payload } from '../../types';
export interface FileProps extends FormControlProps {
    btnClassName: string;
    btnUploadClassName: string;
    maxSize: number;
    maxLength: number;
    placeholder?: string;
    btnLabel?: string;
    reciever?: string;
    fileField?: string;
    joinValues?: boolean;
    extractValue?: boolean;
    delimiter?: string;
    downloadUrl?: string;
    useChunk?: 'auto' | boolean;
    chunkSize?: number;
    startChunkApi?: string;
    chunkApi?: string;
    finishChunkApi?: string;
    accept?: string;
    multiple?: boolean;
    autoUpload?: boolean;
    hideUploadButton?: boolean;
    stateTextMap?: {
        init: string;
        pending: string;
        uploading: string;
        error: string;
        uploaded: string;
        [propName: string]: string;
    };
    asBase64?: boolean;
    resetValue?: string;
}
export interface FileX extends File {
    state?: 'init' | 'error' | 'pending' | 'uploading' | 'uploaded' | 'invalid';
}
export interface FileValue {
    filename?: string;
    value?: string;
    name?: string;
    url?: string;
    state: 'init' | 'error' | 'pending' | 'uploading' | 'uploaded' | 'invalid';
    [propName: string]: any;
}
export interface FileState {
    uploading: boolean;
    files: Array<FileX | FileValue>;
    error?: string | null;
}
export default class FileControl extends React.Component<FileProps, FileState> {
    static defaultProps: Partial<FileProps>;
    state: FileState;
    current: FileValue | FileX | null;
    resolve?: (value?: any) => void;
    static valueToFile(value: string | FileValue, props: FileProps, files?: Array<FileX | FileValue>): FileValue | undefined;
    constructor(props: FileProps);
    componentWillReceiveProps(nextProps: FileProps): void;
    handleDrop(e: React.ChangeEvent<any>): void;
    startUpload(): void;
    toggleUpload(e: React.MouseEvent<HTMLButtonElement>): void;
    stopUpload(): void;
    tick(): void;
    sendFile(file: FileX, cb: (error: null | string, file?: FileX, obj?: FileValue) => void): void;
    removeFile(file: FileX | FileValue, index: number): void;
    clearError(): void;
    onChange(): void;
    uploadFile(file: FileX, reciever: string, params: object, config?: Partial<FileProps>): Promise<Payload>;
    uploadBigFile(file: FileX, reciever: string, params: object, config?: Partial<FileProps>): Promise<Payload>;
    _send(reciever: string, data: any, options?: object): Promise<Payload>;
    validate(): any;
    render(): JSX.Element;
}
export declare class FileControlRenderer extends FileControl {
}
