/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { RemoteActorContext } from "#behavior/context/server/RemoteActorContext.js";
import type { ServerNode } from "#node/ServerNode.js";
import { AsyncObservable, Duration } from "@matter/general";
import type { MessageExchange, NodeSession, Session } from "@matter/protocol";
import { InteractionServerMessenger, PeerAddress, Subscription } from "@matter/protocol";
import { AttributeId, ClusterId, EndpointNumber, SubscribeRequest } from "@matter/types";
export declare const MAX_INTERVAL_PUBLISHER_LIMIT: Duration;
export declare const INTERNAL_INTERVAL_PUBLISHER_LIMIT: Duration;
export declare const MIN_INTERVAL: Duration;
export declare const DEFAULT_RANDOMIZATION_WINDOW: Duration;
/**
 * Server options that control subscription handling.
 */
export interface ServerSubscriptionConfig {
    /**
     * Optional maximum subscription interval to use for sending subscription reports. It will be used if not too
     * low and inside the range requested by the connected controller.
     */
    maxInterval: Duration;
    /**
     * Optional minimum subscription interval to use for sending subscription reports. It will be used when other
     * calculated values are smaller than it. Use this to make sure your device hardware can handle the load and to
     * set limits.
     */
    minInterval: Duration;
    /**
     * Optional subscription randomization window to use for sending subscription reports. This specifies a window
     * in seconds from which a random part is added to the calculated maximum interval to make sure that devices
     * that get powered on in parallel not all send at the same timepoint.
     */
    randomizationWindow: Duration;
}
export declare namespace ServerSubscriptionConfig {
    /**
     * Validate options and set defaults.
     *
     * @returns the resulting options
     */
    function of(options?: Partial<ServerSubscriptionConfig>): {
        maxInterval: Duration;
        minInterval: Duration;
        randomizationWindow: Duration;
    };
}
/**
 * Interface between {@link ServerSubscription} and the local Matter environment.
 */
export interface ServerSubscriptionContext {
    session: NodeSession;
    node: ServerNode;
    initiateExchange(addressOrSession: PeerAddress | Session, protocolId: number): MessageExchange;
}
/**
 * Implements the server side of a single subscription.
 */
export declare class ServerSubscription implements Subscription {
    #private;
    constructor(options: {
        id: number;
        context: ServerSubscriptionContext;
        request: Omit<SubscribeRequest, "interactionModelRevision" | "keepSubscriptions">;
        subscriptionOptions: ServerSubscriptionConfig;
        useAsMaxInterval?: Duration;
        useAsSendInterval?: Duration;
    });
    get subscriptionId(): number;
    get idStr(): string;
    get session(): NodeSession;
    get isCanceledByPeer(): boolean;
    get request(): Omit<import("@matter/types").TypeFromFields<{
        keepSubscriptions: import("@matter/types").FieldType<boolean>;
        minIntervalFloorSeconds: import("@matter/types").FieldType<number>;
        maxIntervalCeilingSeconds: import("@matter/types").FieldType<number>;
        attributeRequests: import("@matter/types").OptionalFieldType<import("@matter/types").TypeFromFields<{
            enableTagCompression: import("@matter/types").OptionalFieldType<boolean>;
            nodeId: import("@matter/types").OptionalFieldType<import("@matter/types").NodeId>;
            endpointId: import("@matter/types").OptionalFieldType<import("@matter/types").EndpointNumber>;
            clusterId: import("@matter/types").OptionalFieldType<import("@matter/types").ClusterId>;
            attributeId: import("@matter/types").OptionalFieldType<import("@matter/types").AttributeId>;
            listIndex: import("@matter/types").OptionalFieldType<number | null>;
            wildcardPathFlags: import("@matter/types").OptionalFieldType<import("@matter/types").TypeFromPartialBitSchema<{
                skipRootNode: import("@matter/types").BitFlag;
                skipGlobalAttributes: import("@matter/types").BitFlag;
                skipAttributeList: import("@matter/types").BitFlag;
                reserved1: import("@matter/types").BitFlag;
                skipCommandLists: import("@matter/types").BitFlag;
                skipCustomElements: import("@matter/types").BitFlag;
                skipFixedAttributes: import("@matter/types").BitFlag;
                skipChangesOmittedAttributes: import("@matter/types").BitFlag;
                skipDiagnosticsClusters: import("@matter/types").BitFlag;
            }>>;
        }>[]>;
        eventRequests: import("@matter/types").OptionalFieldType<import("@matter/types").TypeFromFields<{
            nodeId: import("@matter/types").OptionalFieldType<import("@matter/types").NodeId>;
            endpointId: import("@matter/types").OptionalFieldType<import("@matter/types").EndpointNumber>;
            clusterId: import("@matter/types").OptionalFieldType<import("@matter/types").ClusterId>;
            eventId: import("@matter/types").OptionalFieldType<import("@matter/types").EventId>;
            isUrgent: import("@matter/types").OptionalFieldType<boolean>;
        }>[]>;
        eventFilters: import("@matter/types").OptionalFieldType<import("@matter/types").TypeFromFields<{
            nodeId: import("@matter/types").OptionalFieldType<import("@matter/types").NodeId>;
            eventMin: import("@matter/types").FieldType<number | bigint>;
        }>[]>;
        isFabricFiltered: import("@matter/types").FieldType<boolean>;
        dataVersionFilters: import("@matter/types").OptionalFieldType<import("@matter/types").TypeFromFields<{
            path: import("@matter/types").FieldType<import("@matter/types").TypeFromFields<{
                nodeId: import("@matter/types").OptionalFieldType<import("@matter/types").NodeId>;
                endpointId: import("@matter/types").FieldType<import("@matter/types").EndpointNumber>;
                clusterId: import("@matter/types").FieldType<import("@matter/types").ClusterId>;
            }>>;
            dataVersion: import("@matter/types").FieldType<number>;
        }>[]>;
        interactionModelRevision: import("@matter/types").OptionalFieldType<number>;
    }>, "interactionModelRevision" | "keepSubscriptions">;
    get cancelled(): AsyncObservable<[subscription: Subscription], void>;
    get maxInterval(): Duration;
    get sendInterval(): Duration;
    get minIntervalFloor(): Duration;
    get maxIntervalCeiling(): Duration;
    set maxInterval(value: Duration);
    handlePeerCancel(): Promise<void>;
    activate(): void;
    sendInitialReport(messenger: InteractionServerMessenger, readContext: RemoteActorContext.Options, suppressStatusReports?: boolean): Promise<void>;
    /**
     * Closes the subscription and flushes all outstanding data updates if requested.
     */
    close(flushViaSession?: Session): Promise<void>;
}
//# sourceMappingURL=ServerSubscription.d.ts.map