/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Duration, MatterError } from "#general";
import { GeneralStatusCode, SecureChannelStatusCode, TlvSchema } from "#types";
import { Message } from "../codec/MessageCodec.js";
import { ExchangeSendOptions, MessageExchange } from "../protocol/MessageExchange.js";
/** Error base Class for all errors related to the status response messages. */
export declare class ChannelStatusResponseError extends MatterError {
    readonly generalStatusCode: GeneralStatusCode;
    readonly protocolStatusCode: SecureChannelStatusCode;
    constructor(message: string, generalStatusCode: GeneralStatusCode, protocolStatusCode: SecureChannelStatusCode);
}
/** This value is used by chip SDK when performance wise heavy crypto operations are expected. */
export declare const EXPECTED_CRYPTO_PROCESSING_TIME: Duration;
/** This value is used by chip SDK when normal processing time is expected. */
export declare const DEFAULT_NORMAL_PROCESSING_TIME: Duration;
export declare class SecureChannelMessenger {
    #private;
    readonly exchange: MessageExchange;
    constructor(exchange: MessageExchange, defaultExpectedProcessingTime?: Duration);
    get channel(): import("../index.js").MessageChannel;
    nextMessage(expectedMessageType: number, expectedProcessingTimeMs?: Duration, expectedMessageInfo?: string): Promise<Message>;
    anyNextMessage(expectedMessageInfo: string, expectedProcessingTime?: Duration): Promise<Message>;
    /**
     * Waits for the next message and decodes it.
     *
     * When no expectedProcessingTimeMs is provided, the default value of EXPECTED_CRYPTO_PROCESSING_TIME_MS is used.
     */
    nextMessageDecoded<T>(expectedMessageType: number, schema: TlvSchema<T>, expectedProcessingTime?: Duration): Promise<T>;
    /**
     * Waits for the next message and returns it.
     *
     * When no expectedProcessingTimeMs is provided, the default value of EXPECTED_CRYPTO_PROCESSING_TIME_MS is used.
     */
    waitForSuccess(expectedMessageInfo: string, expectedProcessingTime?: Duration): Promise<void>;
    /**
     * Sends a message of the given type with the given payload.
     *
     * If no ExchangeSendOptions are provided, the expectedProcessingTimeMs will be set to
     * EXPECTED_CRYPTO_PROCESSING_TIME_MS.
     */
    send<T>(message: T, type: number, schema: TlvSchema<T>, options?: ExchangeSendOptions): Promise<AllowSharedBufferSource>;
    sendError(code: SecureChannelStatusCode): Promise<void>;
    sendSuccess(): Promise<void>;
    sendCloseSession(): Promise<void>;
    get channelName(): string;
    [Symbol.asyncDispose](): Promise<void>;
    close(): Promise<void>;
    protected throwIfErrorStatusReport(message: Message, logHint?: string): void;
}
//# sourceMappingURL=SecureChannelMessenger.d.ts.map