/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Message } from "#codec/MessageCodec.js";
import type { ExchangeLogContext, MessageExchange } from "#protocol/MessageExchange.js";
import type { Session } from "#session/Session.js";
import type { SessionParameters } from "#session/SessionParameters.js";
import { Bytes, Channel, Duration, MaybePromise, Observable, ServerAddressUdp } from "@matter/general";
export declare class MessageChannel implements Channel<Message> {
    #private;
    readonly session: Session;
    closed: boolean;
    constructor(channel: Channel<Bytes>, session: Session, onClose?: () => MaybePromise<void>);
    set onClose(callback: () => MaybePromise<void>);
    /** Is the underlying transport reliable? */
    get isReliable(): boolean;
    /**
     * Does the underlying transport support large messages?
     * This is only true for TCP channels currently.
     */
    get supportsLargeMessages(): boolean;
    get type(): import("@matter/general").ChannelType;
    /**
     * Max Payload size of the exchange which bases on the maximum payload size of the channel. The full encoded matter
     * message payload sent here can be as huge as allowed by the channel.
     */
    get maxPayloadSize(): number;
    send(message: Message, options?: MessageChannelSendOptions): Promise<void>;
    get name(): string;
    get networkAddress(): ServerAddressUdp | undefined;
    set networkAddress(networkAddress: ServerAddressUdp);
    get networkAddressChanged(): Observable<[ServerAddressUdp], void>;
    get channel(): Channel<AllowSharedBufferSource>;
    /**
     * Sync the addresses for IP network channels and replace channel if the IPs change
     * If the channel is on a non ip network then the call is basically ignored
     * We already use a new naming here which will be more used in future, so yes inconsistency in naming is ok for now
     * TODO refactor this out again and remove the address from the channel
     */
    set socket(channel: Channel<Bytes>);
    close(): Promise<void>;
    calculateMaximumPeerResponseTime(peerSessionParameters: SessionParameters, localSessionParameters: SessionParameters, expectedProcessingTime?: Duration, includeMaximumSendingTime?: boolean): Duration;
    /**
     * Calculates the backoff time for a resubmission based on the current retransmission count.
     * If no session parameters are provided, the parameters of the current session are used.
     * If session parameters are provided, the method can be used to calculate the maximum backoff time for the other
     * side of the exchange.
     *
     * When `calculateMaximum` is set to true, we calculate the maximum time without any randomness.
     *
     * @see {@link MatterSpecification.v10.Core}, section 4.11.2.1
     */
    getMrpResubmissionBackOffTime(retransmissionCount: number, sessionParameters?: SessionParameters, calculateMaximum?: boolean): Duration;
}
export interface MessageChannelSendOptions {
    /** The exchange initiating the send, used for diagnostics. */
    exchange?: MessageExchange;
    /** Additional context for logging. */
    logContext?: ExchangeLogContext;
    /** Override the destination address for this send without changing the channel's default address. */
    addressOverride?: ServerAddressUdp;
}
//# sourceMappingURL=MessageChannel.d.ts.map