///
import { DisksList, WriteOptions, DriveManagerContract } from '@ioc:Adonis/Core/Drive';
import { FileUploadError, FileValidationOptions, MultipartFileContract } from '@ioc:Adonis/Core/BodyParser';
/**
* The file holds the meta/data for an uploaded file, along with
* an errors occurred during the upload process.
*/
export declare class File implements MultipartFileContract {
private data;
private drive;
private sizeValidator;
private extensionValidator;
/**
* A boolean to know if file is an instance of this class
* or not
*/
isMultipartFile: true;
/**
* Field name is the name of the field
*/
fieldName: string;
/**
* Client name is the file name on the user client
*/
clientName: string;
/**
* The headers sent as part of the multipart request
*/
headers: any;
/**
* File size in bytes
*/
size: number;
/**
* The extname for the file.
*/
extname?: string;
/**
* Upload errors
*/
errors: FileUploadError[];
/**
* Type and subtype are extracted from the `content-type`
* header or from the file magic number
*/
type?: string;
subtype?: string;
/**
* File path is only set after the move operation
*/
filePath?: string;
/**
* File name is only set after the move operation. It is the relative
* path of the moved file
*/
fileName?: string;
/**
* Tmp path, only exists when file is uploaded using the
* classic mode.
*/
tmpPath?: string;
/**
* The file meta data
*/
meta: any;
/**
* The state of the file
*/
state: 'idle' | 'streaming' | 'consumed' | 'moved';
/**
* Whether or not the validations have been executed
*/
get validated(): boolean;
/**
* A boolean to know if file has one or more errors
*/
get isValid(): boolean;
/**
* Opposite of [[this.isValid]]
*/
get hasErrors(): boolean;
/**
* The maximum file size limit
*/
get sizeLimit(): number | string | undefined;
set sizeLimit(limit: number | string | undefined);
/**
* Extensions allowed
*/
get allowedExtensions(): string[] | undefined;
set allowedExtensions(extensions: string[] | undefined);
constructor(data: {
fieldName: string;
clientName: string;
headers: any;
}, validationOptions: Partial, drive: DriveManagerContract);
/**
* Validate the file
*/
validate(): void;
/**
* Mark file as moved
*/
markAsMoved(fileName: string, filePath: string): void;
/**
* Moves the file to a given location. Multiple calls to the `move` method are allowed,
* incase you want to move a file to multiple locations.
*/
move(location: string, options?: {
name?: string;
overwrite?: boolean;
}): Promise;
/**
* Move file to a drive disk
*/
moveToDisk(location: string, options?: WriteOptions & {
name?: string;
}, diskName?: keyof DisksList): Promise;
/**
* Returns file JSON representation
*/
toJSON(): {
fieldName: string;
clientName: string;
size: number;
filePath: string | undefined;
fileName: string | undefined;
type: string | undefined;
extname: string | undefined;
subtype: string | undefined;
state: "idle" | "streaming" | "consumed" | "moved";
isValid: boolean;
validated: boolean;
errors: FileUploadError[];
meta: any;
};
}