import { Readable } from 'stream';
export declare function isExpired(file: File): boolean;
export declare function extractOriginalName(meta: Metadata): string | undefined;
export declare function extractMimeType(meta: Metadata): string | undefined;
export declare const generateFileId: (file: File) => string;
export interface FileInit {
    contentType?: string;
    originalName?: string;
    metadata: Metadata;
    size?: number | string;
    userId?: string;
}
export type UploadxEventType = 'created' | 'completed' | 'deleted' | 'part' | 'updated';
export declare class File implements FileInit {
    bytesWritten: number;
    contentType: string;
    originalName: string;
    id: string;
    metadata: Metadata;
    name: string;
    size: number;
    status?: UploadxEventType;
    userId?: string | undefined;
    expiredAt?: string | Date | number;
    createdAt?: string | Date | number;
    constructor({ metadata, originalName, contentType, size, userId }: FileInit);
}
export type UploadxFile = Readonly<File>;
export interface FileQuery {
    id: string;
    name?: string;
    size?: number;
    userId?: string;
}
export interface FilePart extends Checksum, FileQuery {
    body: Readable;
    contentLength?: number;
    start: number;
}
export declare function hasContent(part: Partial<FilePart>): part is FilePart;
export declare function partMatch(part: Partial<FilePart>, file: File): boolean;
export declare function updateSize(file: File, size: number): File;
/** User-provided metadata */
export declare class Metadata {
    [key: string]: any;
    size?: string | number;
    name?: string;
    filetype?: string;
    type?: string;
    mimeType?: string;
    contentType?: string;
    title?: string;
    filename?: string;
    originalName?: string;
    lastModified?: string | number;
}
export declare function isMetadata(raw: unknown): raw is Metadata;
export declare function updateMetadata<T extends File>(file: T, metadata: Partial<T>): void;
export declare function getFileStatus(file: File): UploadxEventType;
export declare class FileName {
    static INVALID_CHARS: string[];
    static INVALID_PREFIXES: string[];
    static INVALID_SUFFIXES: string[];
    static MAX_LENGTH: number;
    static MIN_LENGTH: number;
    static isValid(name: string): boolean;
}
export type Checksum = {
    checksum?: string;
    checksumAlgorithm?: string;
};
