/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Behavior } from "#behavior/Behavior.js"; import { DescriptorBehavior } from "../../behaviors/descriptor/DescriptorBehavior.js"; /** * A set of behaviors an endpoint supports. */ export type SupportedBehaviors = Record; /** * Create SupportedBehaviors from a list of behavior types. */ export declare function SupportedBehaviors(...types: T): SupportedBehaviors.MapOf; /** * Utility functions and definitions for modifying lists of clusters. */ export declare namespace SupportedBehaviors { type List = readonly Behavior.Type[]; /** * Create a new list with additional behaviors, replacing any previous * behavior for the same cluster. Replacement updates the set of supported * cluster features. * * Note: Functional equivalent of With<> but you can't have a method named * "with" in a namespace. */ function extend(currentTypes: BehaviorsT, newTypes: NewBehaviorsT): With; /** * Add or replace behaviors. */ type With = Omit & MapOf; /** * Convert a List to BehaviorTypes. */ type MapOf = T extends readonly [infer F extends Behavior.Type] ? { readonly [K in F["id"]]: F; } : T extends readonly [infer F extends Behavior.Type, ...infer R extends List] ? { readonly [K in F["id"]]: F; } & MapOf : {}; /** * Properties of an endpoint contributed by listed behaviors. */ type EndpointProperties = { readonly [K in keyof SB]: InstanceType; }; /** * Compound state for all behaviors. */ type StateOf = { [K in keyof SB]: Behavior.StateOf; } & { descriptor: Behavior.StateOf; }; /** * Compound events for all behaviors. */ type EventsOf = { [K in keyof SB]: Behavior.EventsOf; }; /** * Input version of {@link StateOf}. */ type InputStateOf = { [K in keyof SB]?: Behavior.InputStateOf; } & { descriptor?: Behavior.InputStateOf; }; /** * Patch input version of {@link StateOf}. */ type StatePatchOf = { readonly [K in keyof SB]?: Behavior.PatchStateOf; } & { descriptor?: Behavior.PatchStateOf; }; } //# sourceMappingURL=SupportedBehaviors.d.ts.map