/** Test-only registry reset, used to clear module-level state between cases; never shipped to the browser. */ export { __resetContributions } from './plugin/registry'; /** Test-only plugin host-state reset, cleared between cases beside the registry reset. */ export { __resetPluginHostState } from './plugin/host-state'; /** Test-only injector: serves a fixed tool display-name map without a live fetch. */ export { StaticToolDisplayNamesProvider } from './hooks/useToolDisplayNames'; /** * Fires every live `ResizeObserver` stub's callback for the elements it is * observing. Pair it with `setElementOverflow` to drive a component that * measures itself (`ScrollRegion` and `useProseScrollRegions` re-read * `scrollWidth`/`clientWidth` from their observer callbacks): * * setElementOverflow(region, true); * flushResizeObservers(); * * Only meaningful once `installJsdomStubs` has installed the stub; with a real * `ResizeObserver` present (a browser environment) there is nothing to flush. */ export declare function flushResizeObservers(): void; /** * Delivers a resize for ONE element, to every stub observing it — the narrow * form of {@link flushResizeObservers}. Use it to prove which element a * component is watching: a measurement driven by a resize of a CHILD only * arrives if that child is observed, so the assertion fails the moment a * component narrows its observation to its own box. * * @param target - the element whose resize to deliver. */ export declare function flushResizeObserversFor(target: Element): void; /** * Makes `element` report itself as overflowing (or not) on `axis`. jsdom runs no * layout, so `scroll*` and `client*` are both 0 and every overflow test reads as * "fits"; this shadows the prototype getters with own, configurable values so a * test can drive either state. Call it again with the opposite flag to flip the * element back. * * @param element - the element whose scroll metrics to fake. * @param overflowing - true to report content larger than the box on `axis`. * @param axis - the dimension to fake: `horizontal` (width, the default) or * `vertical` (height). */ export declare function setElementOverflow(element: HTMLElement, overflowing: boolean, axis?: 'horizontal' | 'vertical'): void; /** * jsdom omits a handful of browser APIs the Studio components reach for while a * test drives them. Installing every stub in one place keeps each feature's * `test-setup.ts` identical and lets interaction tests exercise the real * components instead of mocking them out: * * - Radix primitives observe element size (`ResizeObserver`), scroll the active * item into view, and capture the pointer while opening. * - Export/download paths create and revoke object URLs. * - File-import flows read the picked file via `Blob.text()`. * - Router scroll restoration calls `scrollTo` on navigation. * * The `ResizeObserver` stub is a WORKING observer, not an inert one: it keeps a * registry of the observers still in use, delivers an entry to the callback as * each element is observed (as a real observer does for its initial * observation), and lets a test re-deliver on demand via * `flushResizeObservers`. Components that size themselves — `ScrollRegion` and * `useProseScrollRegions` — are therefore exercised for real, with * `setElementOverflow` supplying the scroll metrics jsdom cannot compute. * * Each stub only fills a MISSING API, so installing the whole set everywhere is * harmless — the one exception is `window.scrollTo`, which jsdom ships as a "Not * implemented" stub that logs loudly on every navigation, so it is replaced * unconditionally. Call once from a package's Vitest `setupFiles` entry. */ export declare function installJsdomStubs(): void; /** * A promise whose settlement the test controls, returned alongside its own * `resolve`/`reject`. It pins a component's loading state for assertion: hand the * unsettled `promise` to the code under test (e.g. as a mocked api call's return * value), assert the in-flight UI while it hangs, then call `resolve`/`reject` to * drive the success or failure branch and assert the settled UI. Each call * returns a fresh, independent deferred. * * @typeParam T - the value the promise resolves to. */ export declare function deferred(): { promise: Promise; resolve: (value: T) => void; reject: (reason: unknown) => void; }; //# sourceMappingURL=testing.d.ts.map