/** * Bound version of `inner[prop]` if it is a function, cached so repeated * reads return the same reference. Identity matters for `{#each}` keying * and consumer memoization. * * @param {object | Function} inner * @param {string | symbol} prop * @param {unknown} source the freshly-read value of `inner[prop]` */ export function bindForwarded(inner: object | Function, prop: string | symbol, source: unknown): any; /** * Build a Proxy wrapping `self` so reads forward to its inner value and * writes follow the chosen policy. Shared between `Box` (mutable) and * `ConstBox` (read-only). The caller's constructor should * `return buildBoxProxy(this, opts);` after `super(initial)`. * * @param {{ value: unknown } & Record} self the * underlying box instance. Reads of own keys route to it; the proxy * itself is returned from the constructor. * @param {object} [opts] * @param {boolean} [opts.readOnly=false] when true, every write trap * throws `TypeError(opts.writeMessage)`. When false, writes route to * `self` (own keys) or `self.value` (inner keys). * @param {Set} [opts.forwardFirst] property names where * the inner method should win over the box's own (e.g. `get`/`set` * for `boxedMap` ergonomics). * @param {string} [opts.writeMessage] thrown by every write trap when * `readOnly` is true. * @param {string} [opts.deleteOwnMessage] thrown when deleting an own * helper key on a mutable box. Ignored under `readOnly`. * @param {string} [opts.preventExtensionsMessage] thrown by * `preventExtensions` on both variants. * @param {string} [opts.setPrototypeOfMessage] thrown by * `setPrototypeOf` on both variants. * @param {string} [opts.applyNonFunctionMessage] thrown by `apply` when * the inner value is not a function. * @param {string} [opts.constructNonFunctionMessage] thrown by * `construct` when the inner value is not a function. */ export function buildBoxProxy(self: { value: unknown; } & Record, opts?: { readOnly?: boolean | undefined; forwardFirst?: Set | undefined; writeMessage?: string | undefined; deleteOwnMessage?: string | undefined; preventExtensionsMessage?: string | undefined; setPrototypeOfMessage?: string | undefined; applyNonFunctionMessage?: string | undefined; constructNonFunctionMessage?: string | undefined; }): () => void;