import { type WritableBox } from "../box/box.svelte.js"; type RefSetter = (v: T) => void; /** * Creates a Svelte Attachment that attaches a DOM element to a ref. * The ref can be either a WritableBox or a callback function. * * @param ref - Either a WritableBox to store the element in, or a callback function that receives the element * @param onChange - Optional callback that fires when the ref changes * @returns An object with a spreadable attachment key that should be spread onto the element * * @example * // Using with WritableBox * const ref = box(null); *
Content
* * @example * // Using with callback *
myNode = node)}>Content
* * @example * // Using with onChange *
console.log(node))}>Content
*/ export declare function attachRef(ref: WritableBox | RefSetter, onChange?: (v: T | null) => void): { [x: symbol]: (node: T) => () => void; }; export {};