/** * @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): { 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; subscriptionOptions: ServerSubscriptionConfig; useAsMaxInterval?: Duration; useAsSendInterval?: Duration; }); get subscriptionId(): number; get idStr(): string; get session(): NodeSession; get isTerminated(): boolean; get request(): Omit; minIntervalFloorSeconds: import("@matter/types").FieldType; maxIntervalCeilingSeconds: import("@matter/types").FieldType; attributeRequests: import("@matter/types").OptionalFieldType; nodeId: import("@matter/types").OptionalFieldType; endpointId: import("@matter/types").OptionalFieldType; clusterId: import("@matter/types").OptionalFieldType; attributeId: import("@matter/types").OptionalFieldType; listIndex: import("@matter/types").OptionalFieldType; wildcardPathFlags: import("@matter/types").OptionalFieldType>; wildcardFilterConfigurationVersion: import("@matter/types").OptionalFieldType; }>[]>; eventRequests: import("@matter/types").OptionalFieldType; endpointId: import("@matter/types").OptionalFieldType; clusterId: import("@matter/types").OptionalFieldType; eventId: import("@matter/types").OptionalFieldType; isUrgent: import("@matter/types").OptionalFieldType; }>[]>; eventFilters: import("@matter/types").OptionalFieldType; eventMin: import("@matter/types").FieldType; }>[]>; isFabricFiltered: import("@matter/types").FieldType; dataVersionFilters: import("@matter/types").OptionalFieldType; endpointId: import("@matter/types").FieldType; clusterId: import("@matter/types").FieldType; }>>; dataVersion: import("@matter/types").FieldType; }>[]>; interactionModelRevision: import("@matter/types").OptionalFieldType; }>, "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; /** @returns true if the subscription became active, false if it was dropped because its session is closing. */ activate(): boolean; sendInitialReport(messenger: InteractionServerMessenger, readContext: RemoteActorContext.Options, suppressStatusReports?: boolean): Promise; /** * Closes the subscription and flushes all outstanding data updates if requested. */ close(flushViaSession?: Session, currentExchange?: MessageExchange): Promise; } //# sourceMappingURL=ServerSubscription.d.ts.map