import type { Run } from "../runtime/asyncContext.js"; import { AgencyFunction } from "../runtime/agencyFunction.js"; /** * Register a scoped callback for the dynamic extent of the caller's function * or node. Implementation backing for `callback(name, fn)` in std::index. * * Frame targeting: * - At top level (inside `__initializeGlobals`, before any node frame is * pushed) — route to `ctx.topLevelCallbacks`, which lives on the * execution context for the whole run. * - Otherwise — push onto the caller's stack frame, which auto-cleans up * when the caller's frame pops. * * NOTE on the AgencyFunction wrapping: this function needs the run, to * walk the state stack and find the caller's frame. It is wrapped as an * AgencyFunction because `invoke()` passes every body the run as its first * argument. */ export declare function _callbackImpl(run: Run, name: string, fn: unknown): void; export declare const _callback: AgencyFunction;