import { FileWithPath } from '@mantine/dropzone';
import { UploadProgress } from '../ui/Upload';
export interface ChunkUploadApi {
    init(file: File, parentId: string, parentType: string): Promise<{
        id: string;
        startOffset?: number;
    }>;
    uploadChunk(id: string, file: File, offset: number, end: number, total: number, signal: AbortSignal, onProgress: (loaded: number) => void, onXhr: (xhr: XMLHttpRequest) => void): Promise<{
        nextOffset?: number;
        expectedOffset?: number;
    }>;
    fetchOffset(id: string): Promise<{
        nextOffset?: number;
    }>;
}
interface UseChunkedUploadOptions {
    api: ChunkUploadApi;
    parentId?: string;
    parentType?: string;
    onComplete?: (id: string, file: FileWithPath) => void;
    onError?: (error: unknown) => void;
}
export declare function useChunkedUpload({ api, parentId, parentType, onComplete, onError, }: UseChunkedUploadOptions): {
    uploadProgress: UploadProgress;
    isUploading: boolean;
    isPaused: boolean;
    uploadId: string | null;
    handleUpload: (file: FileWithPath) => Promise<void>;
    handlePause: () => void;
    handleResume: () => Promise<void>;
    handleCancel: () => void;
};
export {};
//# sourceMappingURL=useChunkedUpload.d.ts.map