/** * Copyright (c) 2026 Sergio Turolla * * This file is part of @r-machine/react, licensed under the * GNU Affero General Public License v3.0 (AGPL-3.0-only). * * You may use, modify, and distribute this file under the terms * of the AGPL-3.0. See LICENSE in this package for details. * * If you need to use this software in a proprietary project, * contact: licensing@codecarvings.com */ /** * Everything the wrapper needs to know about a plug's resolved result. A * reactive (outer / vertex) surface can reach the consumer through THREE paths, * and all are covered here: * 1. a direct dep — list position (`nsDepList` + `reactiveDepsSet`) or map key * (`reactiveMapKeys`); * 2. `$.kit.{name}` — a `gear:outer` placed in the consumer kit (`reactiveKitKeys`); * 3. map-mode top-level kit spread — `buildMapPlugin` does `{ ...kit, ...deps, $ }`, * so a reactive kit entry is also reachable as `result.{name}` (folded into * `reactiveMapKeys`). */ export interface ReactiveWrapInfo { readonly isList: boolean; /** List mode: index → namespace, to test positions against `reactiveDepsSet`. */ readonly nsDepList: readonly string[]; /** Reactive dep namespaces (list-position test). */ readonly reactiveDepsSet: ReadonlySet; /** Map mode: top-level keys to wrap (reactive dep keys ∪ reactive kit keys). */ readonly reactiveMapKeys: ReadonlySet; /** Reactive kit keys, wrapped under `$.kit` in both modes. */ readonly reactiveKitKeys: ReadonlySet; } /** * Give every reactive surface in `result` a fresh passthrough-Proxy identity, * routing all three reachability paths through ONE shared surface→proxy map so * the same underlying surface yields the same proxy wherever it appears (e.g. * `result.cart` and `$.kit.cart`). The `$` and `$.kit` wrappers are memoized * (those objects are invariant for a given result), so identities are stable * across repeated accesses within one (plugin, version). */ export declare function wrapReactiveResult(result: unknown, info: ReactiveWrapInfo): unknown;