/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { SecureSession } from "#session/SecureSession.js";
import { AsyncObservable, Observable } from "@matter/general";
import { BdxMessenger } from "./BdxMessenger.js";
import { BdxSessionConfiguration } from "./BdxSessionConfiguration.js";
/**
 * Class to manage one BDX session.
 *
 * Matter BDX protocol is used to transfer files between devices.
 *
 * Notes:
 * * Even though Matter allows 64bit values for size and offset, we do not use them, as they make no sense for now.
 *   We support up to MAX_SAFE_INTEGER for size and offset (which basically is 2^53 - 1 and so far enough for us).
 * * We support partial transfers (startOffset or shorter dataLength) only when we act as the sender. As a receiver,
 *   only full transfers are supported.
 * * We do not use BlockQueryWithSkip when requesting data ourselves
 */
export declare class BdxSession {
    #private;
    /** Initializes a BdxSession as a sender, means that we upload data to the peer. */
    static asSender(messenger: BdxMessenger, options: BdxSessionConfiguration.SenderInitiatorOptions): BdxSession;
    /** Initializes a BdxSession as a receiver, means that we download data from the peer. */
    static asReceiver(messenger: BdxMessenger, options: BdxSessionConfiguration.InitiatorOptions): BdxSession;
    /**
     * Initializes a BdxSession from an incoming *Init message. The message determines the direction of the transfer.
     * The provided storages allow to map the file designator to a storage context depending on the path prefix in the
     * file designator.
     */
    static fromMessage(messenger: BdxMessenger, options: BdxSessionConfiguration.ReceiverOptions): BdxSession;
    private constructor();
    get progressInfo(): Observable<[bytesTransferred: number, totalBytesLength: number | undefined], void>;
    get progressFinished(): Observable<[totalBytesTransferred: number], void>;
    get progressCancelled(): Observable<any[], void>;
    /** Method called to start the session. It will end with a successful Transfer or with an error */
    processTransfer(): Promise<void>;
    get closed(): AsyncObservable<any[], void>;
    get peerAddress(): import("../index.js").PeerAddress;
    get session(): SecureSession;
    close(error?: unknown): Promise<void>;
}
export declare namespace BdxSession { }
//# sourceMappingURL=BdxSession.d.ts.map