/** * MT-side per-slot event registration state machine. * * Lynx native's `__AddEvent(el, eventType, eventName, value)` only stores ONE * value per `(el, eventType, eventName)` slot — the second call wins. When * sigx user code declares both a `main-thread-bind*` worklet AND a regular * `bind*` BG handler on the same element, two ops arrive in the same patch * batch (SET_WORKLET_EVENT + SET_EVENT). Calling `__AddEvent` eagerly per op * means the second one silently overwrites the first. * * This module defers the `__AddEvent` call. Each op updates per-slot state * (`worklet?`, `bgSign?`) and marks the slot dirty. After the entire op * batch is processed (`flushDirtySlots` is called at the tail of `applyOps`), * we issue ONE `__AddEvent` per dirty slot using whichever shape combines * the present handlers — string sign, worklet ctx, or hybrid ctx. * * State persists across batches because re-renders may update only one of * the two handlers (the BG event-registry already deduplicates SET_EVENT * after the first registration, and `sentWorklets` deduplicates * SET_WORKLET_EVENT by `_wkltId`). */ import type { WorkletPlaceholder } from './worklet-events.js'; export declare function setSlotWorklet(elId: number, type: string, name: string, ctx: WorkletPlaceholder | undefined): void; export declare function setSlotBgSign(elId: number, type: string, name: string, sign: string | undefined): void; /** * Commit __AddEvent for every slot that changed since the last flush. * Called from `applyOps` after the op loop, before `__FlushElementTree()`. */ export declare function flushDirtySlots(): void; /** * Drop all slot state for one element (snapshot-instance teardown — the * synthetic id is about to leave the `elements` map, so pending dirty * entries would no-op but the per-element map would leak). */ export declare function clearElementSlots(elId: number): void; /** Hot-reload / test reset hook — clears all slot state. */ export declare function resetSlotStates(): void;