/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { AccessControl, Val } from "#protocol";
/**
 * 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.
 *
 * @param parent a reference to the container we reference
 * @param primaryKey the preferred key for lookup
 * @param name the name (in the case of structs) or index (in case of lists)
 * @param id the lookup ID in the case of structs
 * @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
 *
 * @returns a reference to the property
 */
export declare function ManagedReference(parent: Val.Reference<Val.Collection>, primaryKey: "name" | "id", name: string | number, id: number | undefined, assertWriteOk: (value: Val) => void, clone: (container: Val) => Val, session: AccessControl.Session): Val.Reference<unknown>;
//# sourceMappingURL=ManagedReference.d.ts.map