/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Duration, MatterError, Semaphore, ServerAddressUdp } from "@matter/general";
import type { ServerNode } from "@matter/node";
import { DecodedAttributeReportStatus, DecodedAttributeReportValue, DecodedDataReport, DecodedEventData, DecodedEventReportStatus, DecodedEventReportValue, DiscoveryData, ExchangeProvider, Interactable, PeerAddress, PeerSet, SecureSession } from "@matter/protocol";
import { AttributeId, CaseAuthenticatedTag, ClusterId, ClusterType, EndpointNumber, EventId, EventNumber, NodeId, StatusCode, TlvEventFilter, TypeFromSchema } from "@matter/types";
/**
 * Types of discovery that may be performed when connecting operationally.
 *
 * @deprecated node discovery is now continuous with MDNS queries sent as needed
 */
export declare enum NodeDiscoveryType {
    /** No discovery is done, in calls means that only known addresses are tried. */
    None = 0,
    /** Retransmission discovery means that we ignore known addresses and start a query for 5s. */
    RetransmissionDiscovery = 1,
    /** Timed discovery means that the device is discovered for a defined timeframe, including known addresses. */
    TimedDiscovery = 2,
    /** Full discovery means that the device is discovered until it is found, excluding known addresses. */
    FullDiscovery = 3
}
/**
 * Error when an unknown node is tried to be connected or any other action done with it.
 */
export declare class UnknownNodeError extends MatterError {
}
/**
 * Configuration for discovering when establishing a peer connection.
 *
 * @deprecated discovery occurs automatically based on node state
 */
export interface DiscoveryOptions {
    discoveryType?: NodeDiscoveryType;
    timeout?: Duration;
    discoveryData?: DiscoveryData;
}
/**
 * Extended discovery options that include case authenticated tags for peer connections.
 *
 * @deprecated these options are ignored
 */
export interface PeerConnectionOptions {
    discoveryOptions?: DiscoveryOptions;
    /**
     * @deprecated set CATs on CommissioningBehavior#state
     */
    caseAuthenticatedTags?: CaseAuthenticatedTag[];
    /**
     * @deprected configure queuing using the NetworkProfiles environmental service
     */
    queue?: Semaphore;
}
export type ResponseDataReport = Omit<DecodedDataReport, "isNormalized" | "subscriptionId" | "interactionModelRevision">;
export interface AttributeStatus {
    path: {
        nodeId?: NodeId;
        endpointId?: EndpointNumber;
        clusterId?: ClusterId;
        attributeId?: AttributeId;
    };
    status: StatusCode;
}
type CommandRequest<C extends ClusterType.Command> = C extends ClusterType.Command<infer F> ? F extends (req: infer R, ...args: unknown[]) => unknown ? R : undefined : unknown;
type CommandResponse<C extends ClusterType.Command> = C extends ClusterType.Command<infer F> ? Awaited<ReturnType<F>> : unknown;
export type InvokeOptions<C extends ClusterType.Command = ClusterType.Command> = {
    endpointId?: EndpointNumber;
    clusterId: ClusterId;
    request: CommandRequest<C>;
    command: C;
    /** Send as timed request. If no timedRequestTimeoutMs is provided the default of 10s will be used. */
    asTimedRequest?: boolean;
    /** Use this timeout and send the request as Timed Request. If this is specified the above parameter is implied. */
    timedRequestTimeout?: Duration;
    /**
     * Expected processing time on the device side for this command.
     * useExtendedFailSafeMessageResponseTimeout is ignored if this value is set.
     */
    expectedProcessingTime?: Duration;
    /** Use an extended Message Response Timeout as defined for FailSafe cases which is 30s. */
    useExtendedFailSafeMessageResponseTimeout?: boolean;
    /** Skip request data validation. Use this only when you know that your data is correct and validation would return an error. */
    skipValidation?: boolean;
};
export declare class InteractionClientProvider {
    #private;
    constructor(owner: ServerNode);
    get peers(): PeerSet;
    connect(address: PeerAddress, _options: PeerConnectionOptions & {
        allowUnknownPeer?: boolean;
        operationalAddress?: ServerAddressUdp;
    }): Promise<InteractionClient>;
    /**
     * Returns an InteractionClient for a session or PeerAddress which is not bound to a ClientNode Interactable
     * This should only be used for special cases.
     */
    interactionClientFor(sessionOrAddress: SecureSession | PeerAddress): Promise<InteractionClient>;
    /**
     * Returns an InteractionClient for a specific peer address and ensures that also a peer node exists.
     */
    getNodeInteractionClient(address: PeerAddress, _options?: PeerConnectionOptions): Promise<InteractionClient>;
}
export declare class InteractionClient {
    #private;
    readonly isGroupAddress: boolean;
    constructor(interaction: Interactable, exchanges: ExchangeProvider, address?: PeerAddress);
    get interaction(): Interactable<import("@matter/protocol").InteractionSession>;
    get address(): PeerAddress;
    get maybeAddress(): PeerAddress | undefined;
    get isReconnectable(): boolean;
    get channelUpdated(): never;
    getAllAttributes(options?: {
        dataVersionFilters?: {
            endpointId: EndpointNumber;
            clusterId: ClusterId;
            dataVersion: number;
        }[];
        isFabricFiltered?: boolean;
        attributeChangeListener?: (data: DecodedAttributeReportValue<any>, valueChanged?: boolean, oldValue?: any) => void;
    }): Promise<DecodedAttributeReportValue<any>[]>;
    getAllEvents(options?: {
        eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];
        isFabricFiltered?: boolean;
    }): Promise<DecodedEventReportValue<any>[]>;
    getAllAttributesAndEvents(options?: {
        dataVersionFilters?: {
            endpointId: EndpointNumber;
            clusterId: ClusterId;
            dataVersion: number;
        }[];
        eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];
        isFabricFiltered?: boolean;
        attributeChangeListener?: (data: DecodedAttributeReportValue<any>, valueChanged?: boolean, oldValue?: any) => void;
    }): Promise<{
        attributeReports: DecodedAttributeReportValue<any>[];
        eventReports: DecodedEventReportValue<any>[];
    }>;
    getMultipleAttributes(options?: {
        attributes?: {
            endpointId?: EndpointNumber;
            clusterId?: ClusterId;
            attributeId?: AttributeId;
        }[];
        dataVersionFilters?: {
            endpointId: EndpointNumber;
            clusterId: ClusterId;
            dataVersion: number;
        }[];
        isFabricFiltered?: boolean;
        attributeChangeListener?: (data: DecodedAttributeReportValue<any>, valueChanged?: boolean, oldValue?: any) => void;
    }): Promise<DecodedAttributeReportValue<any>[]>;
    getMultipleAttributesAndStatus(options?: {
        attributes?: {
            endpointId?: EndpointNumber;
            clusterId?: ClusterId;
            attributeId?: AttributeId;
        }[];
        dataVersionFilters?: {
            endpointId: EndpointNumber;
            clusterId: ClusterId;
            dataVersion: number;
        }[];
        isFabricFiltered?: boolean;
        attributeChangeListener?: (data: DecodedAttributeReportValue<any>, valueChanged?: boolean, oldValue?: any) => void;
    }): Promise<{
        attributeData: DecodedAttributeReportValue<any>[];
        attributeStatus?: DecodedAttributeReportStatus[];
    }>;
    getMultipleEvents(options?: {
        events?: {
            endpointId?: EndpointNumber;
            clusterId?: ClusterId;
            eventId?: EventId;
        }[];
        eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];
        isFabricFiltered?: boolean;
    }): Promise<DecodedEventReportValue<any>[]>;
    getMultipleEventsAndStatus(options?: {
        events?: {
            endpointId?: EndpointNumber;
            clusterId?: ClusterId;
            eventId?: EventId;
        }[];
        eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];
        isFabricFiltered?: boolean;
    }): Promise<{
        eventData: DecodedEventReportValue<any>[];
        eventStatus?: DecodedEventReportStatus[];
    }>;
    getMultipleAttributesAndEvents(options?: {
        attributes?: {
            endpointId?: EndpointNumber;
            clusterId?: ClusterId;
            attributeId?: AttributeId;
        }[];
        dataVersionFilters?: {
            endpointId: EndpointNumber;
            clusterId: ClusterId;
            dataVersion: number;
        }[];
        events?: {
            endpointId?: EndpointNumber;
            clusterId?: ClusterId;
            eventId?: EventId;
        }[];
        eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];
        isFabricFiltered?: boolean;
        attributeChangeListener?: (data: DecodedAttributeReportValue<any>) => void;
    }): Promise<ResponseDataReport>;
    getStoredAttribute<T>(options: {
        endpointId: EndpointNumber;
        clusterId: ClusterId;
        attribute: ClusterType.Attribute<T>;
    }): T | undefined;
    getAttribute<T>(options: {
        endpointId: EndpointNumber;
        clusterId: ClusterId;
        attribute: ClusterType.Attribute<T>;
        isFabricFiltered?: boolean;
        requestFromRemote?: boolean;
        attributeChangeListener?: (data: DecodedAttributeReportValue<any>) => void;
    }): Promise<T | undefined>;
    getEvent<T>(options: {
        endpointId: EndpointNumber;
        clusterId: ClusterId;
        event: ClusterType.Event<T>;
        minimumEventNumber?: EventNumber;
        isFabricFiltered?: boolean;
    }): Promise<DecodedEventData<T>[] | undefined>;
    setAttribute<T>(options: {
        attributeData: {
            endpointId?: EndpointNumber;
            clusterId: ClusterId;
            attribute: ClusterType.Attribute<T>;
            value: T;
            dataVersion?: number;
        };
        asTimedRequest?: boolean;
        timedRequestTimeout?: Duration;
        suppressResponse?: boolean;
        chunkLists?: boolean;
    }): Promise<void>;
    setMultipleAttributes(options: {
        attributes: {
            endpointId?: EndpointNumber;
            clusterId: ClusterId;
            attribute: ClusterType.Attribute;
            value: any;
            dataVersion?: number;
        }[];
        asTimedRequest?: boolean;
        timedRequestTimeout?: Duration;
        suppressResponse?: boolean;
        chunkLists?: boolean;
    }): Promise<AttributeStatus[]>;
    subscribeAttribute<T>(options: {
        endpointId: EndpointNumber;
        clusterId: ClusterId;
        attribute: ClusterType.Attribute<T>;
        minIntervalFloorSeconds: number;
        maxIntervalCeilingSeconds: number;
        isFabricFiltered?: boolean;
        knownDataVersion?: number;
        keepSubscriptions?: boolean;
        listener?: (value: T, version: number) => void;
        updateTimeoutHandler?: () => void;
        updateReceived?: () => void;
    }): Promise<{
        maxInterval: number;
    }>;
    subscribeEvent<T>(options: {
        endpointId: EndpointNumber;
        clusterId: ClusterId;
        event: ClusterType.Event<T>;
        minIntervalFloorSeconds: number;
        maxIntervalCeilingSeconds: number;
        keepSubscriptions?: boolean;
        isUrgent?: boolean;
        minimumEventNumber?: EventNumber;
        isFabricFiltered?: boolean;
        listener?: (value: DecodedEventData<T>) => void;
        updateTimeoutHandler?: () => void;
        updateReceived?: () => void;
    }): Promise<{
        maxInterval: number;
    }>;
    subscribeAllAttributesAndEvents(options: {
        minIntervalFloorSeconds: number;
        maxIntervalCeilingSeconds: number;
        attributeListener?: (data: DecodedAttributeReportValue<any>) => void;
        eventListener?: (data: DecodedEventReportValue<any>) => void;
        isUrgent?: boolean;
        keepSubscriptions?: boolean;
        isFabricFiltered?: boolean;
        eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];
        dataVersionFilters?: {
            endpointId: EndpointNumber;
            clusterId: ClusterId;
            dataVersion: number;
        }[];
        updateTimeoutHandler?: () => void;
        updateReceived?: () => void;
    }): Promise<{
        attributeReports?: DecodedAttributeReportValue<any>[];
        eventReports?: DecodedEventReportValue<any>[];
        maxInterval: number;
    }>;
    subscribeMultipleAttributesAndEvents(options: {
        attributes?: {
            endpointId?: EndpointNumber;
            clusterId?: ClusterId;
            attributeId?: AttributeId;
        }[];
        events?: {
            endpointId?: EndpointNumber;
            clusterId?: ClusterId;
            eventId?: EventId;
            isUrgent?: boolean;
        }[];
        minIntervalFloorSeconds: number;
        maxIntervalCeilingSeconds: number;
        keepSubscriptions?: boolean;
        isFabricFiltered?: boolean;
        attributeListener?: (data: DecodedAttributeReportValue<any>) => void;
        eventListener?: (data: DecodedEventReportValue<any>) => void;
        eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];
        dataVersionFilters?: {
            endpointId: EndpointNumber;
            clusterId: ClusterId;
            dataVersion: number;
        }[];
        updateTimeoutHandler?: () => void;
        updateReceived?: () => void;
    }): Promise<{
        attributeReports?: DecodedAttributeReportValue<any>[];
        eventReports?: DecodedEventReportValue<any>[];
        maxInterval: number;
    }>;
    invoke<C extends ClusterType.Command>(options: InvokeOptions<C>): Promise<CommandResponse<C>>;
    invokeWithSuppressedResponse<C extends ClusterType.Command>(options: {
        endpointId?: EndpointNumber;
        clusterId: ClusterId;
        request: CommandRequest<C>;
        command: C;
        asTimedRequest?: boolean;
        timedRequestTimeout?: Duration;
        skipValidation?: boolean;
    }): Promise<void>;
    get channelType(): import("@matter/general").ChannelType;
}
export {};
//# sourceMappingURL=InteractionClient.d.ts.map