/// <reference types="node" />
/// <reference types="mocha" />
/// <reference types="node" />
import { AbortMultipartUploadCommandOutput, CompleteMultipartUploadCommandOutput } from '@aws-sdk/client-s3';
import { VirtruS3Config } from './builders.js';
import Metadata from '../tdf.js';
import { Manifest, UpsertResponse } from '../models/index.js';
export declare function streamToBuffer(stream: ReadableStream<Uint8Array>): Promise<Buffer>;
export declare abstract class DecoratedReadableStream {
    KEK: null | string;
    algorithm: string;
    tdfSize: number;
    stream: ReadableStream<Uint8Array>;
    on: NodeJS.EventEmitter['on'];
    emit: NodeJS.EventEmitter['emit'];
    metadata?: Metadata;
    contentLength?: number;
    manifest: Manifest;
    upsertResponse?: UpsertResponse;
    constructor(byteLimit: number, underlyingSource: UnderlyingSource);
    /**
     *
     * Dump the stream content to remote storage. This will consume the stream.
     * @param {string} fileName - the name of the remote file to write TDF ciphertext to.
     * @param {S3ClientConfig} [config] - the object containing remote storage configuration.
     * <br>A detailed spec for the interface can be found [here]{@link https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/s3clientconfig.html}
     * @param {string} [credentialURL] - the url to request remote storage credentials from.
     * @return {RemoteUploadResponse} - an object containing metadata for the uploaded file.
     */
    toRemoteStore(fileName: string, config: VirtruS3Config, credentialURL: string): Promise<CompleteMultipartUploadCommandOutput | AbortMultipartUploadCommandOutput>;
    getMetadata(): Promise<unknown>;
    /**
     * Dump the stream content to a buffer. This will consume the stream.
     * @return the plaintext in Buffer form.
     */
    toBuffer(): Promise<Buffer>;
    /**
     * Dump the stream content to a string. This will consume the stream.
     * @return the plaintext in string form.
     */
    toString(): Promise<string>;
    /**
     * Dump the stream content to a local file. This will consume the stream.
     *
     * @param filepath The path of the local file to write plaintext to.
     * @param encoding The charset encoding to use. Defaults to utf-8.
     */
    abstract toFile(filepath: string, encoding: BufferEncoding): Promise<void>;
}
//# sourceMappingURL=DecoratedReadableStream.d.ts.map