/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { SupportedBehaviors } from "../properties/SupportedBehaviors.js"; import { SupportedClientClusters } from "../properties/SupportedClientClusters.js"; import { EndpointType } from "./EndpointType.js"; /** * A MutableEndpoint is an EndpointType with factory functions that make it convenient to reconfigure the endpoint. * * Note: mandatory client clusters from `requirements.client.mandatory` are auto-registered into the * `clientClusters` slot at runtime but do not surface in the static type — the slot type reflects only * explicitly-supplied `clientClusters` or `.withClientClusters(...)` additions. */ export interface MutableEndpoint extends EndpointType { /** * Access default state values. */ defaults: {}; /** * Define an endpoint like this one with different defaults. Only updates values present in the input object. */ set(defaults: {}): MutableEndpoint; /** * Define an endpoint like this one with additional and/or replacement server behaviors. */ withBehaviors(...behaviors: SupportedBehaviors.List): MutableEndpoint; /** * Define an endpoint like this one with additional and/or replacement client cluster declarations. */ withClientClusters(...clientClusters: SupportedClientClusters.List): MutableEndpoint; /** * Route server behaviors to the behaviors slot and ClientBehavior arguments to the clientClusters slot. */ with(...behaviors: SupportedBehaviors.List): MutableEndpoint; } /** * Define a new type of endpoint with factory functions. */ export declare function MutableEndpoint(options: T): MutableEndpoint.With, T["behaviors"] extends SupportedBehaviors ? T["behaviors"] : {}, T["clientClusters"] extends SupportedClientClusters ? T["clientClusters"] : {}>; export declare namespace MutableEndpoint { type With = Omit & { behaviors: B["behaviors"] & SB; clientClusters: SC; /** * Access default state values. */ defaults: SupportedBehaviors.StateOf; /** * Define an endpoint like this one with different defaults. Only updates values present in the input object. */ set(defaults: SupportedBehaviors.InputStateOf): With; /** * Define an endpoint like this one with additional and/or replacement server behaviors. */ withBehaviors(...behaviors: BL): With, SC>; /** * Define an endpoint like this one with additional and/or replacement client cluster declarations. */ withClientClusters(...clientClusters: CL): With>; /** * Define an endpoint like this one with additional behaviors. ClientBehavior arguments are routed to the * clientClusters slot at runtime; the static type widens them like ordinary server behaviors. For typed access * to the resulting clientClusters slot, use {@link withClientClusters} instead. */ with(...behaviors: BL): With, SC>; }; } //# sourceMappingURL=MutableEndpoint.d.ts.map