import { PathTestFunction, ObserverCallbackFunction, TosiTouchableType } from './xin-types'; /** * Return this from an observer callback to retire that observer. * * The only teardown form usable from INSIDE the callback, which makes it the * natural one for "stop when the thing I was updating is gone": * * observe('app.thing', () => { * if (!el.isConnected) return OBSERVER_SHOULD_BE_REMOVED * ... * }) * * ⚠️ It was `observerShouldBeRemoved` and exported from THIS MODULE ONLY, so * it reached no entry point and no consumer could import it — the mechanism * was implemented, documented and unusable, and returning `undefined` instead * silently retired nothing (tosijs#45). Renamed to match the convention every * other exported constant here follows (TOSI_ACCESSOR, BOUND_CLASS, * TARGET_SIZE_DEFAULT) and wired into the entries. The rename is safe because * the `exports` map has no wildcard, so a deep import could never have * resolved it. */ export declare const OBSERVER_SHOULD_BE_REMOVED: unique symbol; export declare const listeners: Listener[]; /** * Synthesize id-path touches for a given array path, item index, and property suffix. * Called when we know we're touching something inside an array item. */ export declare function synthesizeIdPathTouches(arrayPath: string, index: number, item: any, suffix: string): string[]; export declare const extendsPath: (prefix: string, path: string) => boolean; /** * Does a write at `path` land on, under, or above `action`? Either way it * can replace the function (SEC-9). The agent surface's write gate and * enableDeclarativeBinding's two-way bindings both ask this. */ export declare const overlapsPath: (a: string, b: string) => boolean; export declare class Listener { description: string; test: PathTestFunction; callback: ObserverCallbackFunction; constructor(test: string | RegExp | PathTestFunction, callback: string | ObserverCallbackFunction); } /** * Whether a notification drain is queued right now: a touch has been made and * its observers (bind()'s DOM updates included) have not run yet. Synchronous, * unlike `updates()`, so a caller can ask "is anything pending" without * waiting — the agent surface's `settled()` is the one that needs to. */ export declare const pendingUpdates: () => boolean; export declare const updates: () => Promise; export declare const touch: (touchable: TosiTouchableType) => void; export declare const observe: (test: string | RegExp | PathTestFunction, callback: ObserverCallbackFunction) => Listener; export declare const stopFunction: (listener: Listener) => (() => void); export declare const unobserve: (listener: Listener | (() => void)) => void;