/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { RemoteActorContext } from "#behavior/context/server/RemoteActorContext.js";
import { Duration } from "#general";
import type { ServerNode } from "#node/ServerNode.js";
import type { MessageExchange, NodeSession } from "#protocol";
import { InteractionServerMessenger, PeerAddress, Subscription, SubscriptionCriteria } from "#protocol";
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(address: PeerAddress, protocolId: number): MessageExchange;
}
/**
 * Implements the server side of a single subscription.
 */
export declare class ServerSubscription extends Subscription {
    #private;
    constructor(options: {
        id: number;
        context: ServerSubscriptionContext;
        criteria: SubscriptionCriteria;
        minIntervalFloor: Duration;
        maxIntervalCeiling: Duration;
        subscriptionOptions: ServerSubscriptionConfig;
        useAsMaxInterval?: Duration;
        useAsSendInterval?: Duration;
    });
    get sendInterval(): Duration;
    get minIntervalFloor(): Duration;
    get maxIntervalCeiling(): Duration;
    activate(): void;
    sendInitialReport(messenger: InteractionServerMessenger, readContext: RemoteActorContext.Options, suppressStatusReports?: boolean): Promise<void>;
    protected destroy(): Promise<void>;
    /**
     * Closes the subscription and flushes all outstanding data updates if requested.
     */
    close(flush?: boolean, cancelledByPeer?: boolean): Promise<void>;
}
//# sourceMappingURL=ServerSubscription.d.ts.map