/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { AccessControl, Val } from "@matter/protocol"; import type { Supervision } from "../../supervision/Supervision.js"; import type { ValReference } from "./ValReference.js"; /** * ManagedReference manages a reference to a container property of another reference. * * The ManagedReference detects when the value changes and clones the container if it is the original copy. * * This serves the following purposes: * * - We can change properties in a container (an array or object) without modifying the original container * * - When nested, this effect bubbles so we make copies at all levels in the hierarchy as necessary * * - Preserves metadata regarding the state of the value * * Change detection happens automatically if the value is replaced. If a subvalue is replaced, the logic replacing the * subvalue must update "changed" manually before replacing the subvalue. For managed structures this is handled by a * separate ManagedReference. */ export declare class ManagedReference implements ValReference { #private; readonly primaryKey = "name"; parent: ValReference; subrefs?: Record; owner?: Val; supervisionConfig?: Supervision.Config; /** * @param parent a reference to the container we reference * @param name the name (in the case of structs) or index (in case of lists) * @param id the lookup ID, used when {@link parent} keys its members by ID * @param assertWriteOk enforces ACLs and read-only * @param clone clones the container prior to write; undefined if not transactional * @param session the access control session */ constructor(parent: ValReference, name: string | number, id: number | undefined, assertWriteOk: (value: Val) => void, clone: (container: Val) => Val, session: AccessControl.Session); get rootOwner(): any; get value(): Val; set value(newValue: Val); get expired(): boolean; get location(): AccessControl.Location; set location(loc: AccessControl.Location); get original(): unknown; change(mutator: () => void): void; refresh(): void; } //# sourceMappingURL=ManagedReference.d.ts.map