/** * Let promise continuations and queued microtasks settle without advancing time * or yielding a full event-loop turn. Awaits `Promise.resolve()` `turns` times, * which is enough to drain chained `.then()` continuations. Use it when a test * needs queued microtasks to run but does not need a macrotask boundary. * * @example * ```ts * import { flushPortableMicrotasks } from '@lostgradient/weft/testing'; * * let ran = false; * void Promise.resolve().then(() => { * ran = true; * }); * await flushPortableMicrotasks(); * console.log(ran); // true * ``` */ export declare function flushPortableMicrotasks(turns?: number): Promise; /** * Yield one full event-loop turn without importing test-runner-only timer APIs, * then drain microtasks. Prefers a `MessageChannel` postMessage (a macrotask) * and falls back to `setTimeout(0)` where `MessageChannel` is unavailable. * * Use it in an `afterEach` to drain a prior test's deferred inline workflow * launch: under a shared-process runner (Bun, Jest, Vitest), an engine disposed * mid-workflow can leave a queued inline start that would otherwise starve the * next test's timers. * * @example * ```ts * import { afterEach } from 'bun:test'; * import { yieldToPortableEventLoop } from '@lostgradient/weft/testing'; * * afterEach(yieldToPortableEventLoop); * ``` */ export declare function yieldToPortableEventLoop(): Promise;