/// <reference types="pouchdb-core" />
/// <reference types="node" />
import { ARCHistoryRequest, ARCSavedRequest, MultipartBody, Response as ArcResponse, TransformedPayload } from "@api-client/core/build/legacy.js";
/**
 * This was copied from the legacy ARC "lib" repo to restore the payload state using the legacy system.
 *
 * @deprecated This is only to upgrade the legacy data to the new data structure. Do not use it to store any data.
 *
 * Please, do not make changes to this class. It was extensively tested in the previous system but the tests for this is not
 * included in with this library.
 */
export declare class LegacyBodyProcessor {
    /**
     * Transforms the request payload to string if needed and the response payload when set.
     * Note, this returns copy of the object if any transformation is applied.
     *
     * @param request ArcRequest object
     * @returns A copy of the request object with transformed payload
     */
    static stringifyRequest(request: ARCHistoryRequest | ARCSavedRequest): Promise<ARCHistoryRequest | ARCSavedRequest>;
    /**
     * Restores the payload into its original format from both the request and response objects.
     *
     * @param request ArcRequest object
     * @returns Processed request
     */
    static restoreRequest(request: ARCHistoryRequest | ARCSavedRequest): ARCHistoryRequest | ARCSavedRequest;
    /**
     * Transforms request payload to string if needed.
     * Note, this returns copy of the object if any transformation is applied.
     *
     * @param request ArcRequest object
     * @returns A copy of the request object with transformed payload
     */
    static payloadToString(request: ARCHistoryRequest | ARCSavedRequest | ArcResponse): Promise<ARCHistoryRequest | ARCSavedRequest | ArcResponse>;
    /**
     * When the passed argument is a NodeJS buffer it creates an object describing the buffer
     * in a safe to store object.
     *
     * @returns The buffer metadata or undefined if the passed argument is not a Buffer.
     */
    static bufferToTransformed(payload: unknown): TransformedPayload | undefined;
    /**
     * When the passed argument is an ArrayBuffer it creates an object describing the object in a safe to store object.
     *
     * @returns The buffer metadata or undefined if the passed argument is not an ArrayBuffer.
     */
    static arrayBufferToTransformed(payload: unknown): TransformedPayload | undefined;
    /**
     * Computes `multipart` list value to replace FormData with array that can
     * be stored in the datastore.
     *
     * @param payload FormData object
     * @returns A promise resolved to a datastore safe entries.
     */
    static createMultipartEntry(payload: FormData): Promise<MultipartBody[]>;
    /**
     * Transforms a FormData entry into a safe-to-store text entry
     *
     * @param name The part name
     * @param file The part value
     * @returns Transformed FormData part to a datastore safe entry.
     */
    static computeFormDataEntry(name: string, file: string | File): Promise<MultipartBody>;
    /**
     * Converts blob data to base64 string.
     *
     * @param blob File or blob object to be translated to string
     * @returns Promise resolved to a base64 string data from the file.
     */
    static blobToString(blob: Blob): Promise<string>;
    /**
     * Restores the payload into its original format.
     *
     * @param request ArcRequest object
     * @returns Processed request
     */
    static restorePayload(request: ARCHistoryRequest | ARCSavedRequest | ArcResponse): ARCHistoryRequest | ARCSavedRequest | ArcResponse;
    /**
     * Handles potential `TransformedPayload` and returns the original data
     *
     * @returns The original data format or undefined otherwise.
     */
    static transformedToPayload(payload: unknown): Buffer | ArrayBuffer | undefined;
    /**
     * Restores FormData from ARC data model.
     *
     * @param model ARC model for multipart.
     * @returns Restored form data
     */
    static restoreMultipart(model: MultipartBody[]): FormData;
    /**
     * Converts data-url string to blob
     *
     * @param dataUrl Data url from blob value.
     * @returns Restored blob value
     */
    static dataURLtoBlob(dataUrl: string): Blob;
    /**
     * Converts blob data to a string.
     *
     * @param blob File or blob object to be translated to string
     * @returns Promise resolved to a text value of the file
     */
    static fileToString(blob: File): Promise<string>;
}
//# sourceMappingURL=LegacyBodyProcessor.d.ts.map