/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { ClientBdxRequest, ClientBdxResponse } from "#action/client/ClientBdx.js";
import { ClientRead } from "#action/client/ClientRead.js";
import { Interactable, InteractionSession } from "#action/Interactable.js";
import { ClientInvoke } from "#action/request/Invoke.js";
import { DecodedInvokeResult } from "#action/response/InvokeResult.js";
import { ReadResult } from "#action/response/ReadResult.js";
import { WriteResult } from "#action/response/WriteResult.js";
import { BdxMessenger } from "#bdx/BdxMessenger.js";
import { InteractionClientMessenger } from "#interaction/InteractionMessenger.js";
import { PeerAddress } from "#peer/PeerAddress.js";
import { ExchangeProvider } from "#protocol/ExchangeProvider.js";
import { Abort, Duration, Environment, RetrySchedule, ServerAddressUdp } from "@matter/general";
import { ClientWrite } from "./ClientWrite.js";
import { ClientSubscribe } from "./subscription/ClientSubscribe.js";
import { ClientSubscriptions } from "./subscription/ClientSubscriptions.js";
import { PeerSubscription } from "./subscription/PeerSubscription.js";
import { SustainedSubscription } from "./subscription/SustainedSubscription.js";
export type SubscriptionResult<T extends ClientSubscribe = ClientSubscribe> = Promise<T extends {
    sustain: true;
} ? SustainedSubscription : PeerSubscription>;
export interface ClientInteractionContext {
    environment: Environment;
    abort?: Abort.Signal;
    sustainRetries?: RetrySchedule.Configuration;
    exchangeProvider?: ExchangeProvider;
    address?: PeerAddress;
    network?: string;
}
export declare const DEFAULT_MIN_INTERVAL_FLOOR: Duration;
/**
 * Defines the upper limit for the publisher-selected maximum interval for any subscription.
 * ◦ If the publisher is an ICD, this SHALL be set to the Idle Mode Duration or 60 minutes, whichever is greater.
 * ◦ Otherwise, this SHALL be set to 60 minutes.
 * So for a absolute maximum if nothing was provided we use the 60 minutes
 */
export declare const SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT: Duration;
/**
 * Client-side implementation of the Matter protocol.
 */
export declare class ClientInteraction<SessionT extends InteractionSession = InteractionSession> implements Interactable<SessionT> {
    #private;
    protected readonly environment: Environment;
    constructor({ environment, abort, sustainRetries, exchangeProvider, address, network }: ClientInteractionContext);
    close(reason?: Error): Promise<void>;
    [Symbol.asyncDispose](): Promise<void>;
    get subscriptions(): ClientSubscriptions;
    /**
     * Read attributes and events.
     */
    read(request: ClientRead, session?: SessionT, extraAbort?: AbortSignal): ReadResult;
    /**
     * Probe the peer with an empty read to verify session liveness.
     *
     * Optionally sends to a different address than the session's current one via {@link addressOverride},
     * without affecting other exchanges on the session.
     *
     * @returns true if the probe succeeded, false otherwise
     */
    probe(options?: ClientProbeOptions): Promise<boolean>;
    /**
     * Write to node attributes.
     */
    write<T extends ClientWrite>(request: T, session?: SessionT): WriteResult<T>;
    /**
     * Invoke one or more commands.
     *
     * When the number of commands exceeds the peer's MaxPathsPerInvoke limit (or 1 for older nodes),
     * commands are split across multiple parallel exchanges automatically.
     *
     * Single commands are automatically batched with other commands invoked in the same timer tick
     * when the device supports multiple invokes per exchange and the target is not endpoint 0.
     */
    invoke(request: ClientInvoke, session?: SessionT): DecodedInvokeResult;
    /**
     * Subscribe to attribute values and events.
     */
    subscribe<T extends ClientSubscribe>(request: T, session?: SessionT): SubscriptionResult<T>;
    initBdx(request: ClientBdxRequest, session?: SessionT): Promise<ClientBdxResponse>;
    get channelType(): import("@matter/general").ChannelType;
    /** Calculates the current maximum response time for a message use in additional logic like timers. */
    maximumPeerResponseTime(expectedProcessingTime?: Duration, includeMaximumSendingTime?: boolean): Duration;
    get address(): PeerAddress;
}
export interface RequestContext<M extends InteractionClientMessenger | BdxMessenger = InteractionClientMessenger> {
    abort: Abort;
    messenger: M;
    [Symbol.asyncDispose](): Promise<void>;
}
/**
 * Options for {@link ClientInteraction.probe}.
 */
export interface ClientProbeOptions {
    /** Network profile to use for the probe exchange. */
    network?: string;
    /** Override the destination address for the probe without changing the session's channel. */
    addressOverride?: ServerAddressUdp;
    /** Abort signal for the probe. */
    abort?: AbortSignal;
}
//# sourceMappingURL=ClientInteraction.d.ts.map