/**
 * @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;
    primaryKey: "id" | "name";
    parent: ValReference<Val.Collection>;
    subrefs?: Record<number | string, ValReference>;
    owner?: Val;
    supervisionConfig?: Supervision.Config;
    /**
     * @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
     */
    constructor(parent: ValReference<Val.Collection>, primaryKey: "name" | "id", 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